@dagger.io/dagger 0.6.4 → 0.8.0
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 +185 -96
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +374 -162
- package/dist/connect.d.ts +1 -1
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +8 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/provisioning/bin.d.ts +1 -1
- package/dist/provisioning/bin.d.ts.map +1 -1
- package/dist/provisioning/bin.js +17 -2
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/dist/provisioning/engineconn.d.ts +1 -1
- package/dist/provisioning/engineconn.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/api/client.gen.js
CHANGED
|
@@ -89,8 +89,19 @@ export var NetworkProtocol;
|
|
|
89
89
|
* A directory whose contents persist across runs.
|
|
90
90
|
*/
|
|
91
91
|
export class CacheVolume extends BaseClient {
|
|
92
|
+
/**
|
|
93
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
94
|
+
*/
|
|
95
|
+
constructor(parent, _id) {
|
|
96
|
+
super(parent);
|
|
97
|
+
this._id = undefined;
|
|
98
|
+
this._id = _id;
|
|
99
|
+
}
|
|
92
100
|
id() {
|
|
93
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
if (this._id) {
|
|
103
|
+
return this._id;
|
|
104
|
+
}
|
|
94
105
|
const response = yield computeQuery([
|
|
95
106
|
...this._queryTree,
|
|
96
107
|
{
|
|
@@ -105,6 +116,40 @@ export class CacheVolume extends BaseClient {
|
|
|
105
116
|
* An OCI-compatible container, also known as a docker container.
|
|
106
117
|
*/
|
|
107
118
|
export class Container extends BaseClient {
|
|
119
|
+
/**
|
|
120
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
121
|
+
*/
|
|
122
|
+
constructor(parent, _endpoint, _envVariable, _export, _hostname, _id, _imageRef, _label, _platform, _publish, _stderr, _stdout, _sync, _user, _workdir) {
|
|
123
|
+
super(parent);
|
|
124
|
+
this._endpoint = undefined;
|
|
125
|
+
this._envVariable = undefined;
|
|
126
|
+
this._export = undefined;
|
|
127
|
+
this._hostname = undefined;
|
|
128
|
+
this._id = undefined;
|
|
129
|
+
this._imageRef = undefined;
|
|
130
|
+
this._label = undefined;
|
|
131
|
+
this._platform = undefined;
|
|
132
|
+
this._publish = undefined;
|
|
133
|
+
this._stderr = undefined;
|
|
134
|
+
this._stdout = undefined;
|
|
135
|
+
this._sync = undefined;
|
|
136
|
+
this._user = undefined;
|
|
137
|
+
this._workdir = undefined;
|
|
138
|
+
this._endpoint = _endpoint;
|
|
139
|
+
this._envVariable = _envVariable;
|
|
140
|
+
this._export = _export;
|
|
141
|
+
this._hostname = _hostname;
|
|
142
|
+
this._id = _id;
|
|
143
|
+
this._imageRef = _imageRef;
|
|
144
|
+
this._label = _label;
|
|
145
|
+
this._platform = _platform;
|
|
146
|
+
this._publish = _publish;
|
|
147
|
+
this._stderr = _stderr;
|
|
148
|
+
this._stdout = _stdout;
|
|
149
|
+
this._sync = _sync;
|
|
150
|
+
this._user = _user;
|
|
151
|
+
this._workdir = _workdir;
|
|
152
|
+
}
|
|
108
153
|
/**
|
|
109
154
|
* Initializes this container from a Dockerfile build.
|
|
110
155
|
* @param context Directory context used by the Dockerfile.
|
|
@@ -176,6 +221,9 @@ export class Container extends BaseClient {
|
|
|
176
221
|
*/
|
|
177
222
|
endpoint(opts) {
|
|
178
223
|
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
if (this._endpoint) {
|
|
225
|
+
return this._endpoint;
|
|
226
|
+
}
|
|
179
227
|
const response = yield computeQuery([
|
|
180
228
|
...this._queryTree,
|
|
181
229
|
{
|
|
@@ -206,6 +254,9 @@ export class Container extends BaseClient {
|
|
|
206
254
|
*/
|
|
207
255
|
envVariable(name) {
|
|
208
256
|
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
+
if (this._envVariable) {
|
|
258
|
+
return this._envVariable;
|
|
259
|
+
}
|
|
209
260
|
const response = yield computeQuery([
|
|
210
261
|
...this._queryTree,
|
|
211
262
|
{
|
|
@@ -226,49 +277,15 @@ export class Container extends BaseClient {
|
|
|
226
277
|
{
|
|
227
278
|
operation: "envVariables",
|
|
228
279
|
},
|
|
229
|
-
], this.client);
|
|
230
|
-
return response;
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Retrieves this container after executing the specified command inside it.
|
|
235
|
-
* @param opts.args Command to run instead of the container's default command (e.g., ["run", "main.go"]).
|
|
236
|
-
* @param opts.stdin Content to write to the command's standard input before closing (e.g., "Hello world").
|
|
237
|
-
* @param opts.redirectStdout Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
|
|
238
|
-
* @param opts.redirectStderr Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
|
|
239
|
-
* @param opts.experimentalPrivilegedNesting Provide dagger access to the executed command.
|
|
240
|
-
* Do not use this option unless you trust the command being executed.
|
|
241
|
-
* The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
|
|
242
|
-
* @deprecated Replaced by withExec.
|
|
243
|
-
*/
|
|
244
|
-
exec(opts) {
|
|
245
|
-
return new Container({
|
|
246
|
-
queryTree: [
|
|
247
|
-
...this._queryTree,
|
|
248
280
|
{
|
|
249
|
-
operation: "
|
|
250
|
-
args: Object.assign({}, opts),
|
|
251
|
-
},
|
|
252
|
-
],
|
|
253
|
-
host: this.clientHost,
|
|
254
|
-
sessionToken: this.sessionToken,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Exit code of the last executed command. Zero means success.
|
|
259
|
-
*
|
|
260
|
-
* Will execute default command if none is set, or error if there's no default.
|
|
261
|
-
* @deprecated Use sync instead.
|
|
262
|
-
*/
|
|
263
|
-
exitCode() {
|
|
264
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
-
const response = yield computeQuery([
|
|
266
|
-
...this._queryTree,
|
|
267
|
-
{
|
|
268
|
-
operation: "exitCode",
|
|
281
|
+
operation: "name value",
|
|
269
282
|
},
|
|
270
283
|
], this.client);
|
|
271
|
-
return response
|
|
284
|
+
return response.map((r) => new EnvVariable({
|
|
285
|
+
queryTree: this.queryTree,
|
|
286
|
+
host: this.clientHost,
|
|
287
|
+
sessionToken: this.sessionToken,
|
|
288
|
+
}, r.name, r.value));
|
|
272
289
|
});
|
|
273
290
|
}
|
|
274
291
|
/**
|
|
@@ -291,6 +308,9 @@ export class Container extends BaseClient {
|
|
|
291
308
|
*/
|
|
292
309
|
export(path, opts) {
|
|
293
310
|
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
+
if (this._export) {
|
|
312
|
+
return this._export;
|
|
313
|
+
}
|
|
294
314
|
const response = yield computeQuery([
|
|
295
315
|
...this._queryTree,
|
|
296
316
|
{
|
|
@@ -316,8 +336,15 @@ export class Container extends BaseClient {
|
|
|
316
336
|
{
|
|
317
337
|
operation: "exposedPorts",
|
|
318
338
|
},
|
|
339
|
+
{
|
|
340
|
+
operation: "description port protocol",
|
|
341
|
+
},
|
|
319
342
|
], this.client);
|
|
320
|
-
return response
|
|
343
|
+
return response.map((r) => new Port({
|
|
344
|
+
queryTree: this.queryTree,
|
|
345
|
+
host: this.clientHost,
|
|
346
|
+
sessionToken: this.sessionToken,
|
|
347
|
+
}, r.description, r.port, r.protocol));
|
|
321
348
|
});
|
|
322
349
|
}
|
|
323
350
|
/**
|
|
@@ -358,22 +385,6 @@ export class Container extends BaseClient {
|
|
|
358
385
|
sessionToken: this.sessionToken,
|
|
359
386
|
});
|
|
360
387
|
}
|
|
361
|
-
/**
|
|
362
|
-
* Retrieves this container's root filesystem. Mounts are not included.
|
|
363
|
-
* @deprecated Replaced by rootfs.
|
|
364
|
-
*/
|
|
365
|
-
fs() {
|
|
366
|
-
return new Directory({
|
|
367
|
-
queryTree: [
|
|
368
|
-
...this._queryTree,
|
|
369
|
-
{
|
|
370
|
-
operation: "fs",
|
|
371
|
-
},
|
|
372
|
-
],
|
|
373
|
-
host: this.clientHost,
|
|
374
|
-
sessionToken: this.sessionToken,
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
388
|
/**
|
|
378
389
|
* Retrieves a hostname which can be used by clients to reach this container.
|
|
379
390
|
*
|
|
@@ -381,6 +392,9 @@ export class Container extends BaseClient {
|
|
|
381
392
|
*/
|
|
382
393
|
hostname() {
|
|
383
394
|
return __awaiter(this, void 0, void 0, function* () {
|
|
395
|
+
if (this._hostname) {
|
|
396
|
+
return this._hostname;
|
|
397
|
+
}
|
|
384
398
|
const response = yield computeQuery([
|
|
385
399
|
...this._queryTree,
|
|
386
400
|
{
|
|
@@ -395,6 +409,9 @@ export class Container extends BaseClient {
|
|
|
395
409
|
*/
|
|
396
410
|
id() {
|
|
397
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
412
|
+
if (this._id) {
|
|
413
|
+
return this._id;
|
|
414
|
+
}
|
|
398
415
|
const response = yield computeQuery([
|
|
399
416
|
...this._queryTree,
|
|
400
417
|
{
|
|
@@ -409,6 +426,9 @@ export class Container extends BaseClient {
|
|
|
409
426
|
*/
|
|
410
427
|
imageRef() {
|
|
411
428
|
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
+
if (this._imageRef) {
|
|
430
|
+
return this._imageRef;
|
|
431
|
+
}
|
|
412
432
|
const response = yield computeQuery([
|
|
413
433
|
...this._queryTree,
|
|
414
434
|
{
|
|
@@ -445,6 +465,9 @@ export class Container extends BaseClient {
|
|
|
445
465
|
*/
|
|
446
466
|
label(name) {
|
|
447
467
|
return __awaiter(this, void 0, void 0, function* () {
|
|
468
|
+
if (this._label) {
|
|
469
|
+
return this._label;
|
|
470
|
+
}
|
|
448
471
|
const response = yield computeQuery([
|
|
449
472
|
...this._queryTree,
|
|
450
473
|
{
|
|
@@ -465,8 +488,15 @@ export class Container extends BaseClient {
|
|
|
465
488
|
{
|
|
466
489
|
operation: "labels",
|
|
467
490
|
},
|
|
491
|
+
{
|
|
492
|
+
operation: "name value",
|
|
493
|
+
},
|
|
468
494
|
], this.client);
|
|
469
|
-
return response
|
|
495
|
+
return response.map((r) => new Label({
|
|
496
|
+
queryTree: this.queryTree,
|
|
497
|
+
host: this.clientHost,
|
|
498
|
+
sessionToken: this.sessionToken,
|
|
499
|
+
}, r.name, r.value));
|
|
470
500
|
});
|
|
471
501
|
}
|
|
472
502
|
/**
|
|
@@ -507,6 +537,9 @@ export class Container extends BaseClient {
|
|
|
507
537
|
*/
|
|
508
538
|
platform() {
|
|
509
539
|
return __awaiter(this, void 0, void 0, function* () {
|
|
540
|
+
if (this._platform) {
|
|
541
|
+
return this._platform;
|
|
542
|
+
}
|
|
510
543
|
const response = yield computeQuery([
|
|
511
544
|
...this._queryTree,
|
|
512
545
|
{
|
|
@@ -537,6 +570,9 @@ export class Container extends BaseClient {
|
|
|
537
570
|
*/
|
|
538
571
|
publish(address, opts) {
|
|
539
572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
573
|
+
if (this._publish) {
|
|
574
|
+
return this._publish;
|
|
575
|
+
}
|
|
540
576
|
const response = yield computeQuery([
|
|
541
577
|
...this._queryTree,
|
|
542
578
|
{
|
|
@@ -569,6 +605,9 @@ export class Container extends BaseClient {
|
|
|
569
605
|
*/
|
|
570
606
|
stderr() {
|
|
571
607
|
return __awaiter(this, void 0, void 0, function* () {
|
|
608
|
+
if (this._stderr) {
|
|
609
|
+
return this._stderr;
|
|
610
|
+
}
|
|
572
611
|
const response = yield computeQuery([
|
|
573
612
|
...this._queryTree,
|
|
574
613
|
{
|
|
@@ -585,6 +624,9 @@ export class Container extends BaseClient {
|
|
|
585
624
|
*/
|
|
586
625
|
stdout() {
|
|
587
626
|
return __awaiter(this, void 0, void 0, function* () {
|
|
627
|
+
if (this._stdout) {
|
|
628
|
+
return this._stdout;
|
|
629
|
+
}
|
|
588
630
|
const response = yield computeQuery([
|
|
589
631
|
...this._queryTree,
|
|
590
632
|
{
|
|
@@ -615,6 +657,9 @@ export class Container extends BaseClient {
|
|
|
615
657
|
*/
|
|
616
658
|
user() {
|
|
617
659
|
return __awaiter(this, void 0, void 0, function* () {
|
|
660
|
+
if (this._user) {
|
|
661
|
+
return this._user;
|
|
662
|
+
}
|
|
618
663
|
const response = yield computeQuery([
|
|
619
664
|
...this._queryTree,
|
|
620
665
|
{
|
|
@@ -759,23 +804,6 @@ export class Container extends BaseClient {
|
|
|
759
804
|
sessionToken: this.sessionToken,
|
|
760
805
|
});
|
|
761
806
|
}
|
|
762
|
-
/**
|
|
763
|
-
* Initializes this container from this DirectoryID.
|
|
764
|
-
* @deprecated Replaced by withRootfs.
|
|
765
|
-
*/
|
|
766
|
-
withFS(id) {
|
|
767
|
-
return new Container({
|
|
768
|
-
queryTree: [
|
|
769
|
-
...this._queryTree,
|
|
770
|
-
{
|
|
771
|
-
operation: "withFS",
|
|
772
|
-
args: { id },
|
|
773
|
-
},
|
|
774
|
-
],
|
|
775
|
-
host: this.clientHost,
|
|
776
|
-
sessionToken: this.sessionToken,
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
807
|
/**
|
|
780
808
|
* Retrieves this container plus the contents of the given file copied to the given path.
|
|
781
809
|
* @param path Location of the copied file (e.g., "/tmp/file.txt").
|
|
@@ -1000,13 +1028,13 @@ export class Container extends BaseClient {
|
|
|
1000
1028
|
/**
|
|
1001
1029
|
* Initializes this container from this DirectoryID.
|
|
1002
1030
|
*/
|
|
1003
|
-
withRootfs(
|
|
1031
|
+
withRootfs(directory) {
|
|
1004
1032
|
return new Container({
|
|
1005
1033
|
queryTree: [
|
|
1006
1034
|
...this._queryTree,
|
|
1007
1035
|
{
|
|
1008
1036
|
operation: "withRootfs",
|
|
1009
|
-
args: {
|
|
1037
|
+
args: { directory },
|
|
1010
1038
|
},
|
|
1011
1039
|
],
|
|
1012
1040
|
host: this.clientHost,
|
|
@@ -1244,6 +1272,9 @@ export class Container extends BaseClient {
|
|
|
1244
1272
|
*/
|
|
1245
1273
|
workdir() {
|
|
1246
1274
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1275
|
+
if (this._workdir) {
|
|
1276
|
+
return this._workdir;
|
|
1277
|
+
}
|
|
1247
1278
|
const response = yield computeQuery([
|
|
1248
1279
|
...this._queryTree,
|
|
1249
1280
|
{
|
|
@@ -1266,6 +1297,18 @@ export class Container extends BaseClient {
|
|
|
1266
1297
|
* A directory.
|
|
1267
1298
|
*/
|
|
1268
1299
|
export class Directory extends BaseClient {
|
|
1300
|
+
/**
|
|
1301
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1302
|
+
*/
|
|
1303
|
+
constructor(parent, _export, _id, _sync) {
|
|
1304
|
+
super(parent);
|
|
1305
|
+
this._export = undefined;
|
|
1306
|
+
this._id = undefined;
|
|
1307
|
+
this._sync = undefined;
|
|
1308
|
+
this._export = _export;
|
|
1309
|
+
this._id = _id;
|
|
1310
|
+
this._sync = _sync;
|
|
1311
|
+
}
|
|
1269
1312
|
/**
|
|
1270
1313
|
* Gets the difference between this directory and an another directory.
|
|
1271
1314
|
* @param other Identifier of the directory to compare.
|
|
@@ -1347,6 +1390,9 @@ export class Directory extends BaseClient {
|
|
|
1347
1390
|
*/
|
|
1348
1391
|
export(path) {
|
|
1349
1392
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1393
|
+
if (this._export) {
|
|
1394
|
+
return this._export;
|
|
1395
|
+
}
|
|
1350
1396
|
const response = yield computeQuery([
|
|
1351
1397
|
...this._queryTree,
|
|
1352
1398
|
{
|
|
@@ -1379,6 +1425,9 @@ export class Directory extends BaseClient {
|
|
|
1379
1425
|
*/
|
|
1380
1426
|
id() {
|
|
1381
1427
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1428
|
+
if (this._id) {
|
|
1429
|
+
return this._id;
|
|
1430
|
+
}
|
|
1382
1431
|
const response = yield computeQuery([
|
|
1383
1432
|
...this._queryTree,
|
|
1384
1433
|
{
|
|
@@ -1569,11 +1618,24 @@ export class Directory extends BaseClient {
|
|
|
1569
1618
|
* A simple key value object that represents an environment variable.
|
|
1570
1619
|
*/
|
|
1571
1620
|
export class EnvVariable extends BaseClient {
|
|
1621
|
+
/**
|
|
1622
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1623
|
+
*/
|
|
1624
|
+
constructor(parent, _name, _value) {
|
|
1625
|
+
super(parent);
|
|
1626
|
+
this._name = undefined;
|
|
1627
|
+
this._value = undefined;
|
|
1628
|
+
this._name = _name;
|
|
1629
|
+
this._value = _value;
|
|
1630
|
+
}
|
|
1572
1631
|
/**
|
|
1573
1632
|
* The environment variable name.
|
|
1574
1633
|
*/
|
|
1575
1634
|
name() {
|
|
1576
1635
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1636
|
+
if (this._name) {
|
|
1637
|
+
return this._name;
|
|
1638
|
+
}
|
|
1577
1639
|
const response = yield computeQuery([
|
|
1578
1640
|
...this._queryTree,
|
|
1579
1641
|
{
|
|
@@ -1588,6 +1650,9 @@ export class EnvVariable extends BaseClient {
|
|
|
1588
1650
|
*/
|
|
1589
1651
|
value() {
|
|
1590
1652
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1653
|
+
if (this._value) {
|
|
1654
|
+
return this._value;
|
|
1655
|
+
}
|
|
1591
1656
|
const response = yield computeQuery([
|
|
1592
1657
|
...this._queryTree,
|
|
1593
1658
|
{
|
|
@@ -1602,11 +1667,30 @@ export class EnvVariable extends BaseClient {
|
|
|
1602
1667
|
* A file.
|
|
1603
1668
|
*/
|
|
1604
1669
|
export class File extends BaseClient {
|
|
1670
|
+
/**
|
|
1671
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1672
|
+
*/
|
|
1673
|
+
constructor(parent, _contents, _export, _id, _size, _sync) {
|
|
1674
|
+
super(parent);
|
|
1675
|
+
this._contents = undefined;
|
|
1676
|
+
this._export = undefined;
|
|
1677
|
+
this._id = undefined;
|
|
1678
|
+
this._size = undefined;
|
|
1679
|
+
this._sync = undefined;
|
|
1680
|
+
this._contents = _contents;
|
|
1681
|
+
this._export = _export;
|
|
1682
|
+
this._id = _id;
|
|
1683
|
+
this._size = _size;
|
|
1684
|
+
this._sync = _sync;
|
|
1685
|
+
}
|
|
1605
1686
|
/**
|
|
1606
1687
|
* Retrieves the contents of the file.
|
|
1607
1688
|
*/
|
|
1608
1689
|
contents() {
|
|
1609
1690
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1691
|
+
if (this._contents) {
|
|
1692
|
+
return this._contents;
|
|
1693
|
+
}
|
|
1610
1694
|
const response = yield computeQuery([
|
|
1611
1695
|
...this._queryTree,
|
|
1612
1696
|
{
|
|
@@ -1624,6 +1708,9 @@ export class File extends BaseClient {
|
|
|
1624
1708
|
*/
|
|
1625
1709
|
export(path, opts) {
|
|
1626
1710
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1711
|
+
if (this._export) {
|
|
1712
|
+
return this._export;
|
|
1713
|
+
}
|
|
1627
1714
|
const response = yield computeQuery([
|
|
1628
1715
|
...this._queryTree,
|
|
1629
1716
|
{
|
|
@@ -1639,6 +1726,9 @@ export class File extends BaseClient {
|
|
|
1639
1726
|
*/
|
|
1640
1727
|
id() {
|
|
1641
1728
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1729
|
+
if (this._id) {
|
|
1730
|
+
return this._id;
|
|
1731
|
+
}
|
|
1642
1732
|
const response = yield computeQuery([
|
|
1643
1733
|
...this._queryTree,
|
|
1644
1734
|
{
|
|
@@ -1648,27 +1738,14 @@ export class File extends BaseClient {
|
|
|
1648
1738
|
return response;
|
|
1649
1739
|
});
|
|
1650
1740
|
}
|
|
1651
|
-
/**
|
|
1652
|
-
* Retrieves a secret referencing the contents of this file.
|
|
1653
|
-
* @deprecated insecure, leaves secret in cache. Superseded by setSecret
|
|
1654
|
-
*/
|
|
1655
|
-
secret() {
|
|
1656
|
-
return new Secret({
|
|
1657
|
-
queryTree: [
|
|
1658
|
-
...this._queryTree,
|
|
1659
|
-
{
|
|
1660
|
-
operation: "secret",
|
|
1661
|
-
},
|
|
1662
|
-
],
|
|
1663
|
-
host: this.clientHost,
|
|
1664
|
-
sessionToken: this.sessionToken,
|
|
1665
|
-
});
|
|
1666
|
-
}
|
|
1667
1741
|
/**
|
|
1668
1742
|
* Gets the size of the file, in bytes.
|
|
1669
1743
|
*/
|
|
1670
1744
|
size() {
|
|
1671
1745
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1746
|
+
if (this._size) {
|
|
1747
|
+
return this._size;
|
|
1748
|
+
}
|
|
1672
1749
|
const response = yield computeQuery([
|
|
1673
1750
|
...this._queryTree,
|
|
1674
1751
|
{
|
|
@@ -1724,6 +1801,12 @@ export class File extends BaseClient {
|
|
|
1724
1801
|
* A git ref (tag, branch or commit).
|
|
1725
1802
|
*/
|
|
1726
1803
|
export class GitRef extends BaseClient {
|
|
1804
|
+
/**
|
|
1805
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1806
|
+
*/
|
|
1807
|
+
constructor(parent) {
|
|
1808
|
+
super(parent);
|
|
1809
|
+
}
|
|
1727
1810
|
/**
|
|
1728
1811
|
* The filesystem tree at this ref.
|
|
1729
1812
|
*/
|
|
@@ -1745,6 +1828,12 @@ export class GitRef extends BaseClient {
|
|
|
1745
1828
|
* A git repository.
|
|
1746
1829
|
*/
|
|
1747
1830
|
export class GitRepository extends BaseClient {
|
|
1831
|
+
/**
|
|
1832
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1833
|
+
*/
|
|
1834
|
+
constructor(parent) {
|
|
1835
|
+
super(parent);
|
|
1836
|
+
}
|
|
1748
1837
|
/**
|
|
1749
1838
|
* Returns details on one branch.
|
|
1750
1839
|
* @param name Branch's name (e.g., "main").
|
|
@@ -1801,6 +1890,12 @@ export class GitRepository extends BaseClient {
|
|
|
1801
1890
|
* Information about the host execution environment.
|
|
1802
1891
|
*/
|
|
1803
1892
|
export class Host extends BaseClient {
|
|
1893
|
+
/**
|
|
1894
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1895
|
+
*/
|
|
1896
|
+
constructor(parent) {
|
|
1897
|
+
super(parent);
|
|
1898
|
+
}
|
|
1804
1899
|
/**
|
|
1805
1900
|
* Accesses a directory on the host.
|
|
1806
1901
|
* @param path Location of the directory to access (e.g., ".").
|
|
@@ -1820,23 +1915,6 @@ export class Host extends BaseClient {
|
|
|
1820
1915
|
sessionToken: this.sessionToken,
|
|
1821
1916
|
});
|
|
1822
1917
|
}
|
|
1823
|
-
/**
|
|
1824
|
-
* Accesses an environment variable on the host.
|
|
1825
|
-
* @param name Name of the environment variable (e.g., "PATH").
|
|
1826
|
-
*/
|
|
1827
|
-
envVariable(name) {
|
|
1828
|
-
return new HostVariable({
|
|
1829
|
-
queryTree: [
|
|
1830
|
-
...this._queryTree,
|
|
1831
|
-
{
|
|
1832
|
-
operation: "envVariable",
|
|
1833
|
-
args: { name },
|
|
1834
|
-
},
|
|
1835
|
-
],
|
|
1836
|
-
host: this.clientHost,
|
|
1837
|
-
sessionToken: this.sessionToken,
|
|
1838
|
-
});
|
|
1839
|
-
}
|
|
1840
1918
|
/**
|
|
1841
1919
|
* Accesses a file on the host.
|
|
1842
1920
|
* @param path Location of the file to retrieve (e.g., "README.md").
|
|
@@ -1855,16 +1933,18 @@ export class Host extends BaseClient {
|
|
|
1855
1933
|
});
|
|
1856
1934
|
}
|
|
1857
1935
|
/**
|
|
1858
|
-
*
|
|
1859
|
-
*
|
|
1936
|
+
* Sets a secret given a user-defined name and the file path on the host, and returns the secret.
|
|
1937
|
+
* The file is limited to a size of 512000 bytes.
|
|
1938
|
+
* @param name The user defined name for this secret.
|
|
1939
|
+
* @param path Location of the file to set as a secret.
|
|
1860
1940
|
*/
|
|
1861
|
-
|
|
1862
|
-
return new
|
|
1941
|
+
setSecretFile(name, path) {
|
|
1942
|
+
return new Secret({
|
|
1863
1943
|
queryTree: [
|
|
1864
1944
|
...this._queryTree,
|
|
1865
1945
|
{
|
|
1866
|
-
operation: "
|
|
1867
|
-
args: { path },
|
|
1946
|
+
operation: "setSecretFile",
|
|
1947
|
+
args: { name, path },
|
|
1868
1948
|
},
|
|
1869
1949
|
],
|
|
1870
1950
|
host: this.clientHost,
|
|
@@ -1872,18 +1952,16 @@ export class Host extends BaseClient {
|
|
|
1872
1952
|
});
|
|
1873
1953
|
}
|
|
1874
1954
|
/**
|
|
1875
|
-
*
|
|
1876
|
-
* @param
|
|
1877
|
-
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
1878
|
-
* @deprecated Use directory with path set to '.' instead.
|
|
1955
|
+
* Accesses a Unix socket on the host.
|
|
1956
|
+
* @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
|
|
1879
1957
|
*/
|
|
1880
|
-
|
|
1881
|
-
return new
|
|
1958
|
+
unixSocket(path) {
|
|
1959
|
+
return new Socket({
|
|
1882
1960
|
queryTree: [
|
|
1883
1961
|
...this._queryTree,
|
|
1884
1962
|
{
|
|
1885
|
-
operation: "
|
|
1886
|
-
args:
|
|
1963
|
+
operation: "unixSocket",
|
|
1964
|
+
args: { path },
|
|
1887
1965
|
},
|
|
1888
1966
|
],
|
|
1889
1967
|
host: this.clientHost,
|
|
@@ -1892,49 +1970,27 @@ export class Host extends BaseClient {
|
|
|
1892
1970
|
}
|
|
1893
1971
|
}
|
|
1894
1972
|
/**
|
|
1895
|
-
*
|
|
1973
|
+
* A simple key value object that represents a label.
|
|
1896
1974
|
*/
|
|
1897
|
-
export class
|
|
1898
|
-
/**
|
|
1899
|
-
* A secret referencing the value of this variable.
|
|
1900
|
-
* @deprecated been superseded by setSecret
|
|
1901
|
-
*/
|
|
1902
|
-
secret() {
|
|
1903
|
-
return new Secret({
|
|
1904
|
-
queryTree: [
|
|
1905
|
-
...this._queryTree,
|
|
1906
|
-
{
|
|
1907
|
-
operation: "secret",
|
|
1908
|
-
},
|
|
1909
|
-
],
|
|
1910
|
-
host: this.clientHost,
|
|
1911
|
-
sessionToken: this.sessionToken,
|
|
1912
|
-
});
|
|
1913
|
-
}
|
|
1975
|
+
export class Label extends BaseClient {
|
|
1914
1976
|
/**
|
|
1915
|
-
*
|
|
1977
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1916
1978
|
*/
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
},
|
|
1924
|
-
], this.client);
|
|
1925
|
-
return response;
|
|
1926
|
-
});
|
|
1979
|
+
constructor(parent, _name, _value) {
|
|
1980
|
+
super(parent);
|
|
1981
|
+
this._name = undefined;
|
|
1982
|
+
this._value = undefined;
|
|
1983
|
+
this._name = _name;
|
|
1984
|
+
this._value = _value;
|
|
1927
1985
|
}
|
|
1928
|
-
}
|
|
1929
|
-
/**
|
|
1930
|
-
* A simple key value object that represents a label.
|
|
1931
|
-
*/
|
|
1932
|
-
export class Label extends BaseClient {
|
|
1933
1986
|
/**
|
|
1934
1987
|
* The label name.
|
|
1935
1988
|
*/
|
|
1936
1989
|
name() {
|
|
1937
1990
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1991
|
+
if (this._name) {
|
|
1992
|
+
return this._name;
|
|
1993
|
+
}
|
|
1938
1994
|
const response = yield computeQuery([
|
|
1939
1995
|
...this._queryTree,
|
|
1940
1996
|
{
|
|
@@ -1949,6 +2005,9 @@ export class Label extends BaseClient {
|
|
|
1949
2005
|
*/
|
|
1950
2006
|
value() {
|
|
1951
2007
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2008
|
+
if (this._value) {
|
|
2009
|
+
return this._value;
|
|
2010
|
+
}
|
|
1952
2011
|
const response = yield computeQuery([
|
|
1953
2012
|
...this._queryTree,
|
|
1954
2013
|
{
|
|
@@ -1963,11 +2022,26 @@ export class Label extends BaseClient {
|
|
|
1963
2022
|
* A port exposed by a container.
|
|
1964
2023
|
*/
|
|
1965
2024
|
export class Port extends BaseClient {
|
|
2025
|
+
/**
|
|
2026
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2027
|
+
*/
|
|
2028
|
+
constructor(parent, _description, _port, _protocol) {
|
|
2029
|
+
super(parent);
|
|
2030
|
+
this._description = undefined;
|
|
2031
|
+
this._port = undefined;
|
|
2032
|
+
this._protocol = undefined;
|
|
2033
|
+
this._description = _description;
|
|
2034
|
+
this._port = _port;
|
|
2035
|
+
this._protocol = _protocol;
|
|
2036
|
+
}
|
|
1966
2037
|
/**
|
|
1967
2038
|
* The port description.
|
|
1968
2039
|
*/
|
|
1969
2040
|
description() {
|
|
1970
2041
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2042
|
+
if (this._description) {
|
|
2043
|
+
return this._description;
|
|
2044
|
+
}
|
|
1971
2045
|
const response = yield computeQuery([
|
|
1972
2046
|
...this._queryTree,
|
|
1973
2047
|
{
|
|
@@ -1982,6 +2056,9 @@ export class Port extends BaseClient {
|
|
|
1982
2056
|
*/
|
|
1983
2057
|
port() {
|
|
1984
2058
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2059
|
+
if (this._port) {
|
|
2060
|
+
return this._port;
|
|
2061
|
+
}
|
|
1985
2062
|
const response = yield computeQuery([
|
|
1986
2063
|
...this._queryTree,
|
|
1987
2064
|
{
|
|
@@ -1996,6 +2073,9 @@ export class Port extends BaseClient {
|
|
|
1996
2073
|
*/
|
|
1997
2074
|
protocol() {
|
|
1998
2075
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2076
|
+
if (this._protocol) {
|
|
2077
|
+
return this._protocol;
|
|
2078
|
+
}
|
|
1999
2079
|
const response = yield computeQuery([
|
|
2000
2080
|
...this._queryTree,
|
|
2001
2081
|
{
|
|
@@ -2010,6 +2090,16 @@ export class Port extends BaseClient {
|
|
|
2010
2090
|
* A collection of Dagger resources that can be queried and invoked.
|
|
2011
2091
|
*/
|
|
2012
2092
|
export class Project extends BaseClient {
|
|
2093
|
+
/**
|
|
2094
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2095
|
+
*/
|
|
2096
|
+
constructor(parent, _id, _name) {
|
|
2097
|
+
super(parent);
|
|
2098
|
+
this._id = undefined;
|
|
2099
|
+
this._name = undefined;
|
|
2100
|
+
this._id = _id;
|
|
2101
|
+
this._name = _name;
|
|
2102
|
+
}
|
|
2013
2103
|
/**
|
|
2014
2104
|
* Commands provided by this project
|
|
2015
2105
|
*/
|
|
@@ -2020,8 +2110,15 @@ export class Project extends BaseClient {
|
|
|
2020
2110
|
{
|
|
2021
2111
|
operation: "commands",
|
|
2022
2112
|
},
|
|
2113
|
+
{
|
|
2114
|
+
operation: "description id name resultType",
|
|
2115
|
+
},
|
|
2023
2116
|
], this.client);
|
|
2024
|
-
return response
|
|
2117
|
+
return response.map((r) => new ProjectCommand({
|
|
2118
|
+
queryTree: this.queryTree,
|
|
2119
|
+
host: this.clientHost,
|
|
2120
|
+
sessionToken: this.sessionToken,
|
|
2121
|
+
}, r.description, r.id, r.name, r.resultType));
|
|
2025
2122
|
});
|
|
2026
2123
|
}
|
|
2027
2124
|
/**
|
|
@@ -2029,6 +2126,9 @@ export class Project extends BaseClient {
|
|
|
2029
2126
|
*/
|
|
2030
2127
|
id() {
|
|
2031
2128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2129
|
+
if (this._id) {
|
|
2130
|
+
return this._id;
|
|
2131
|
+
}
|
|
2032
2132
|
const response = yield computeQuery([
|
|
2033
2133
|
...this._queryTree,
|
|
2034
2134
|
{
|
|
@@ -2059,6 +2159,9 @@ export class Project extends BaseClient {
|
|
|
2059
2159
|
*/
|
|
2060
2160
|
name() {
|
|
2061
2161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2162
|
+
if (this._name) {
|
|
2163
|
+
return this._name;
|
|
2164
|
+
}
|
|
2062
2165
|
const response = yield computeQuery([
|
|
2063
2166
|
...this._queryTree,
|
|
2064
2167
|
{
|
|
@@ -2081,11 +2184,28 @@ export class Project extends BaseClient {
|
|
|
2081
2184
|
* A command defined in a project that can be invoked from the CLI.
|
|
2082
2185
|
*/
|
|
2083
2186
|
export class ProjectCommand extends BaseClient {
|
|
2187
|
+
/**
|
|
2188
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2189
|
+
*/
|
|
2190
|
+
constructor(parent, _description, _id, _name, _resultType) {
|
|
2191
|
+
super(parent);
|
|
2192
|
+
this._description = undefined;
|
|
2193
|
+
this._id = undefined;
|
|
2194
|
+
this._name = undefined;
|
|
2195
|
+
this._resultType = undefined;
|
|
2196
|
+
this._description = _description;
|
|
2197
|
+
this._id = _id;
|
|
2198
|
+
this._name = _name;
|
|
2199
|
+
this._resultType = _resultType;
|
|
2200
|
+
}
|
|
2084
2201
|
/**
|
|
2085
2202
|
* Documentation for what this command does.
|
|
2086
2203
|
*/
|
|
2087
2204
|
description() {
|
|
2088
2205
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2206
|
+
if (this._description) {
|
|
2207
|
+
return this._description;
|
|
2208
|
+
}
|
|
2089
2209
|
const response = yield computeQuery([
|
|
2090
2210
|
...this._queryTree,
|
|
2091
2211
|
{
|
|
@@ -2105,8 +2225,15 @@ export class ProjectCommand extends BaseClient {
|
|
|
2105
2225
|
{
|
|
2106
2226
|
operation: "flags",
|
|
2107
2227
|
},
|
|
2228
|
+
{
|
|
2229
|
+
operation: "description name",
|
|
2230
|
+
},
|
|
2108
2231
|
], this.client);
|
|
2109
|
-
return response
|
|
2232
|
+
return response.map((r) => new ProjectCommandFlag({
|
|
2233
|
+
queryTree: this.queryTree,
|
|
2234
|
+
host: this.clientHost,
|
|
2235
|
+
sessionToken: this.sessionToken,
|
|
2236
|
+
}, r.description, r.name));
|
|
2110
2237
|
});
|
|
2111
2238
|
}
|
|
2112
2239
|
/**
|
|
@@ -2114,6 +2241,9 @@ export class ProjectCommand extends BaseClient {
|
|
|
2114
2241
|
*/
|
|
2115
2242
|
id() {
|
|
2116
2243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2244
|
+
if (this._id) {
|
|
2245
|
+
return this._id;
|
|
2246
|
+
}
|
|
2117
2247
|
const response = yield computeQuery([
|
|
2118
2248
|
...this._queryTree,
|
|
2119
2249
|
{
|
|
@@ -2128,6 +2258,9 @@ export class ProjectCommand extends BaseClient {
|
|
|
2128
2258
|
*/
|
|
2129
2259
|
name() {
|
|
2130
2260
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2261
|
+
if (this._name) {
|
|
2262
|
+
return this._name;
|
|
2263
|
+
}
|
|
2131
2264
|
const response = yield computeQuery([
|
|
2132
2265
|
...this._queryTree,
|
|
2133
2266
|
{
|
|
@@ -2142,6 +2275,9 @@ export class ProjectCommand extends BaseClient {
|
|
|
2142
2275
|
*/
|
|
2143
2276
|
resultType() {
|
|
2144
2277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2278
|
+
if (this._resultType) {
|
|
2279
|
+
return this._resultType;
|
|
2280
|
+
}
|
|
2145
2281
|
const response = yield computeQuery([
|
|
2146
2282
|
...this._queryTree,
|
|
2147
2283
|
{
|
|
@@ -2161,8 +2297,15 @@ export class ProjectCommand extends BaseClient {
|
|
|
2161
2297
|
{
|
|
2162
2298
|
operation: "subcommands",
|
|
2163
2299
|
},
|
|
2300
|
+
{
|
|
2301
|
+
operation: "description id name resultType",
|
|
2302
|
+
},
|
|
2164
2303
|
], this.client);
|
|
2165
|
-
return response
|
|
2304
|
+
return response.map((r) => new ProjectCommand({
|
|
2305
|
+
queryTree: this.queryTree,
|
|
2306
|
+
host: this.clientHost,
|
|
2307
|
+
sessionToken: this.sessionToken,
|
|
2308
|
+
}, r.description, r.id, r.name, r.resultType));
|
|
2166
2309
|
});
|
|
2167
2310
|
}
|
|
2168
2311
|
}
|
|
@@ -2170,11 +2313,24 @@ export class ProjectCommand extends BaseClient {
|
|
|
2170
2313
|
* A flag accepted by a project command.
|
|
2171
2314
|
*/
|
|
2172
2315
|
export class ProjectCommandFlag extends BaseClient {
|
|
2316
|
+
/**
|
|
2317
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2318
|
+
*/
|
|
2319
|
+
constructor(parent, _description, _name) {
|
|
2320
|
+
super(parent);
|
|
2321
|
+
this._description = undefined;
|
|
2322
|
+
this._name = undefined;
|
|
2323
|
+
this._description = _description;
|
|
2324
|
+
this._name = _name;
|
|
2325
|
+
}
|
|
2173
2326
|
/**
|
|
2174
2327
|
* Documentation for what this flag sets.
|
|
2175
2328
|
*/
|
|
2176
2329
|
description() {
|
|
2177
2330
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2331
|
+
if (this._description) {
|
|
2332
|
+
return this._description;
|
|
2333
|
+
}
|
|
2178
2334
|
const response = yield computeQuery([
|
|
2179
2335
|
...this._queryTree,
|
|
2180
2336
|
{
|
|
@@ -2189,6 +2345,9 @@ export class ProjectCommandFlag extends BaseClient {
|
|
|
2189
2345
|
*/
|
|
2190
2346
|
name() {
|
|
2191
2347
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2348
|
+
if (this._name) {
|
|
2349
|
+
return this._name;
|
|
2350
|
+
}
|
|
2192
2351
|
const response = yield computeQuery([
|
|
2193
2352
|
...this._queryTree,
|
|
2194
2353
|
{
|
|
@@ -2199,7 +2358,17 @@ export class ProjectCommandFlag extends BaseClient {
|
|
|
2199
2358
|
});
|
|
2200
2359
|
}
|
|
2201
2360
|
}
|
|
2202
|
-
export
|
|
2361
|
+
export class Client extends BaseClient {
|
|
2362
|
+
/**
|
|
2363
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2364
|
+
*/
|
|
2365
|
+
constructor(parent, _checkVersionCompatibility, _defaultPlatform) {
|
|
2366
|
+
super(parent);
|
|
2367
|
+
this._checkVersionCompatibility = undefined;
|
|
2368
|
+
this._defaultPlatform = undefined;
|
|
2369
|
+
this._checkVersionCompatibility = _checkVersionCompatibility;
|
|
2370
|
+
this._defaultPlatform = _defaultPlatform;
|
|
2371
|
+
}
|
|
2203
2372
|
/**
|
|
2204
2373
|
* Constructs a cache volume for a given cache key.
|
|
2205
2374
|
* @param key A string identifier to target this cache volume (e.g., "modules-cache").
|
|
@@ -2217,6 +2386,22 @@ export default class Client extends BaseClient {
|
|
|
2217
2386
|
sessionToken: this.sessionToken,
|
|
2218
2387
|
});
|
|
2219
2388
|
}
|
|
2389
|
+
/**
|
|
2390
|
+
* Checks if the current Dagger Engine is compatible with an SDK's required version.
|
|
2391
|
+
* @param version The SDK's required version.
|
|
2392
|
+
*/
|
|
2393
|
+
checkVersionCompatibility(version) {
|
|
2394
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2395
|
+
const response = yield computeQuery([
|
|
2396
|
+
...this._queryTree,
|
|
2397
|
+
{
|
|
2398
|
+
operation: "checkVersionCompatibility",
|
|
2399
|
+
args: { version },
|
|
2400
|
+
},
|
|
2401
|
+
], this.client);
|
|
2402
|
+
return response;
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2220
2405
|
/**
|
|
2221
2406
|
* Loads a container from ID.
|
|
2222
2407
|
*
|
|
@@ -2452,11 +2637,24 @@ export default class Client extends BaseClient {
|
|
|
2452
2637
|
* A reference to a secret value, which can be handled more safely than the value itself.
|
|
2453
2638
|
*/
|
|
2454
2639
|
export class Secret extends BaseClient {
|
|
2640
|
+
/**
|
|
2641
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2642
|
+
*/
|
|
2643
|
+
constructor(parent, _id, _plaintext) {
|
|
2644
|
+
super(parent);
|
|
2645
|
+
this._id = undefined;
|
|
2646
|
+
this._plaintext = undefined;
|
|
2647
|
+
this._id = _id;
|
|
2648
|
+
this._plaintext = _plaintext;
|
|
2649
|
+
}
|
|
2455
2650
|
/**
|
|
2456
2651
|
* The identifier for this secret.
|
|
2457
2652
|
*/
|
|
2458
2653
|
id() {
|
|
2459
2654
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2655
|
+
if (this._id) {
|
|
2656
|
+
return this._id;
|
|
2657
|
+
}
|
|
2460
2658
|
const response = yield computeQuery([
|
|
2461
2659
|
...this._queryTree,
|
|
2462
2660
|
{
|
|
@@ -2471,6 +2669,9 @@ export class Secret extends BaseClient {
|
|
|
2471
2669
|
*/
|
|
2472
2670
|
plaintext() {
|
|
2473
2671
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2672
|
+
if (this._plaintext) {
|
|
2673
|
+
return this._plaintext;
|
|
2674
|
+
}
|
|
2474
2675
|
const response = yield computeQuery([
|
|
2475
2676
|
...this._queryTree,
|
|
2476
2677
|
{
|
|
@@ -2482,11 +2683,22 @@ export class Secret extends BaseClient {
|
|
|
2482
2683
|
}
|
|
2483
2684
|
}
|
|
2484
2685
|
export class Socket extends BaseClient {
|
|
2686
|
+
/**
|
|
2687
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2688
|
+
*/
|
|
2689
|
+
constructor(parent, _id) {
|
|
2690
|
+
super(parent);
|
|
2691
|
+
this._id = undefined;
|
|
2692
|
+
this._id = _id;
|
|
2693
|
+
}
|
|
2485
2694
|
/**
|
|
2486
2695
|
* The content-addressed identifier of the socket.
|
|
2487
2696
|
*/
|
|
2488
2697
|
id() {
|
|
2489
2698
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2699
|
+
if (this._id) {
|
|
2700
|
+
return this._id;
|
|
2701
|
+
}
|
|
2490
2702
|
const response = yield computeQuery([
|
|
2491
2703
|
...this._queryTree,
|
|
2492
2704
|
{
|