@dagger.io/dagger 0.1.0-alpha.4 → 0.1.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/README.md +1 -1
- package/dist/api/client.gen.d.ts +44 -23
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +506 -336
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/api/utils.js +14 -15
- package/dist/connect.d.ts +7 -6
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/provisioning/default.d.ts.map +1 -1
- package/dist/provisioning/default.js +1 -1
- package/dist/provisioning/docker-provision/image.d.ts +1 -0
- package/dist/provisioning/docker-provision/image.d.ts.map +1 -1
- package/dist/provisioning/docker-provision/image.js +31 -14
- package/dist/provisioning/docker-provision/index.d.ts +1 -1
- package/dist/provisioning/docker-provision/index.d.ts.map +1 -1
- package/dist/provisioning/docker-provision/index.js +1 -1
- package/dist/provisioning/engineconn.d.ts +3 -2
- package/dist/provisioning/engineconn.d.ts.map +1 -1
- package/dist/provisioning/http/http.d.ts.map +1 -1
- package/dist/provisioning/http/http.js +1 -0
- package/dist/provisioning/http/index.d.ts.map +1 -1
- package/dist/provisioning/index.d.ts +4 -4
- package/dist/provisioning/index.d.ts.map +1 -1
- package/dist/provisioning/index.js +4 -4
- package/dist/provisioning/provisioner.d.ts.map +1 -1
- package/package.json +8 -4
- package/dist/api/types.d.ts +0 -302
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -1
package/dist/api/client.gen.js
CHANGED
|
@@ -14,20 +14,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
import { GraphQLClient, gql } from "graphql-request";
|
|
15
15
|
import { queryBuilder, queryFlatten } from "./utils.js";
|
|
16
16
|
class BaseClient {
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
17
20
|
constructor({ queryTree, host } = {}) {
|
|
18
21
|
this._queryTree = queryTree || [];
|
|
19
|
-
this.
|
|
22
|
+
this.clientHost = host || "127.0.0.1:8080";
|
|
20
23
|
this.client = new GraphQLClient(`http://${host}/query`);
|
|
21
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
22
28
|
get queryTree() {
|
|
23
29
|
return this._queryTree;
|
|
24
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
25
34
|
_compute() {
|
|
26
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
36
|
try {
|
|
28
37
|
// run the query and return the result.
|
|
29
38
|
const query = queryBuilder(this._queryTree);
|
|
30
|
-
const computeQuery = yield this.client.request(gql
|
|
39
|
+
const computeQuery = yield this.client.request(gql `
|
|
40
|
+
${query}
|
|
41
|
+
`);
|
|
31
42
|
return queryFlatten(computeQuery);
|
|
32
43
|
}
|
|
33
44
|
catch (error) {
|
|
@@ -40,14 +51,14 @@ class BaseClient {
|
|
|
40
51
|
/**
|
|
41
52
|
* A directory whose contents persist across runs
|
|
42
53
|
*/
|
|
43
|
-
class CacheVolume extends BaseClient {
|
|
54
|
+
export class CacheVolume extends BaseClient {
|
|
44
55
|
id() {
|
|
45
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
57
|
this._queryTree = [
|
|
47
58
|
...this._queryTree,
|
|
48
59
|
{
|
|
49
|
-
operation:
|
|
50
|
-
}
|
|
60
|
+
operation: "id",
|
|
61
|
+
},
|
|
51
62
|
];
|
|
52
63
|
const response = yield this._compute();
|
|
53
64
|
return response;
|
|
@@ -57,18 +68,21 @@ class CacheVolume extends BaseClient {
|
|
|
57
68
|
/**
|
|
58
69
|
* An OCI-compatible container, also known as a docker container
|
|
59
70
|
*/
|
|
60
|
-
class Container extends BaseClient {
|
|
71
|
+
export class Container extends BaseClient {
|
|
61
72
|
/**
|
|
62
73
|
* Initialize this container from a Dockerfile build
|
|
63
74
|
*/
|
|
64
75
|
build(context, dockerfile) {
|
|
65
|
-
return new Container({
|
|
76
|
+
return new Container({
|
|
77
|
+
queryTree: [
|
|
66
78
|
...this._queryTree,
|
|
67
79
|
{
|
|
68
|
-
operation:
|
|
69
|
-
args: { context, dockerfile }
|
|
70
|
-
}
|
|
71
|
-
],
|
|
80
|
+
operation: "build",
|
|
81
|
+
args: { context, dockerfile },
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
host: this.clientHost,
|
|
85
|
+
});
|
|
72
86
|
}
|
|
73
87
|
/**
|
|
74
88
|
* Default arguments for future commands
|
|
@@ -78,8 +92,8 @@ class Container extends BaseClient {
|
|
|
78
92
|
this._queryTree = [
|
|
79
93
|
...this._queryTree,
|
|
80
94
|
{
|
|
81
|
-
operation:
|
|
82
|
-
}
|
|
95
|
+
operation: "defaultArgs",
|
|
96
|
+
},
|
|
83
97
|
];
|
|
84
98
|
const response = yield this._compute();
|
|
85
99
|
return response;
|
|
@@ -89,13 +103,16 @@ class Container extends BaseClient {
|
|
|
89
103
|
* Retrieve a directory at the given path. Mounts are included.
|
|
90
104
|
*/
|
|
91
105
|
directory(path) {
|
|
92
|
-
return new Directory({
|
|
106
|
+
return new Directory({
|
|
107
|
+
queryTree: [
|
|
93
108
|
...this._queryTree,
|
|
94
109
|
{
|
|
95
|
-
operation:
|
|
96
|
-
args: { path }
|
|
97
|
-
}
|
|
98
|
-
],
|
|
110
|
+
operation: "directory",
|
|
111
|
+
args: { path },
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
host: this.clientHost,
|
|
115
|
+
});
|
|
99
116
|
}
|
|
100
117
|
/**
|
|
101
118
|
* Entrypoint to be prepended to the arguments of all commands
|
|
@@ -105,8 +122,8 @@ class Container extends BaseClient {
|
|
|
105
122
|
this._queryTree = [
|
|
106
123
|
...this._queryTree,
|
|
107
124
|
{
|
|
108
|
-
operation:
|
|
109
|
-
}
|
|
125
|
+
operation: "entrypoint",
|
|
126
|
+
},
|
|
110
127
|
];
|
|
111
128
|
const response = yield this._compute();
|
|
112
129
|
return response;
|
|
@@ -120,9 +137,9 @@ class Container extends BaseClient {
|
|
|
120
137
|
this._queryTree = [
|
|
121
138
|
...this._queryTree,
|
|
122
139
|
{
|
|
123
|
-
operation:
|
|
124
|
-
args: { name }
|
|
125
|
-
}
|
|
140
|
+
operation: "envVariable",
|
|
141
|
+
args: { name },
|
|
142
|
+
},
|
|
126
143
|
];
|
|
127
144
|
const response = yield this._compute();
|
|
128
145
|
return response;
|
|
@@ -136,8 +153,8 @@ class Container extends BaseClient {
|
|
|
136
153
|
this._queryTree = [
|
|
137
154
|
...this._queryTree,
|
|
138
155
|
{
|
|
139
|
-
operation:
|
|
140
|
-
}
|
|
156
|
+
operation: "envVariables",
|
|
157
|
+
},
|
|
141
158
|
];
|
|
142
159
|
const response = yield this._compute();
|
|
143
160
|
return response;
|
|
@@ -147,13 +164,22 @@ class Container extends BaseClient {
|
|
|
147
164
|
* This container after executing the specified command inside it
|
|
148
165
|
*/
|
|
149
166
|
exec(args, stdin, redirectStdout, redirectStderr, experimentalPrivilegedNesting) {
|
|
150
|
-
return new Container({
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
167
|
+
return new Container({
|
|
168
|
+
queryTree: [
|
|
169
|
+
...this._queryTree,
|
|
170
|
+
{
|
|
171
|
+
operation: "exec",
|
|
172
|
+
args: {
|
|
173
|
+
args,
|
|
174
|
+
stdin,
|
|
175
|
+
redirectStdout,
|
|
176
|
+
redirectStderr,
|
|
177
|
+
experimentalPrivilegedNesting,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
host: this.clientHost,
|
|
182
|
+
});
|
|
157
183
|
}
|
|
158
184
|
/**
|
|
159
185
|
* Exit code of the last executed command. Zero means success.
|
|
@@ -164,8 +190,8 @@ class Container extends BaseClient {
|
|
|
164
190
|
this._queryTree = [
|
|
165
191
|
...this._queryTree,
|
|
166
192
|
{
|
|
167
|
-
operation:
|
|
168
|
-
}
|
|
193
|
+
operation: "exitCode",
|
|
194
|
+
},
|
|
169
195
|
];
|
|
170
196
|
const response = yield this._compute();
|
|
171
197
|
return response;
|
|
@@ -179,9 +205,9 @@ class Container extends BaseClient {
|
|
|
179
205
|
this._queryTree = [
|
|
180
206
|
...this._queryTree,
|
|
181
207
|
{
|
|
182
|
-
operation:
|
|
183
|
-
args: { path, platformVariants }
|
|
184
|
-
}
|
|
208
|
+
operation: "export",
|
|
209
|
+
args: { path, platformVariants },
|
|
210
|
+
},
|
|
185
211
|
];
|
|
186
212
|
const response = yield this._compute();
|
|
187
213
|
return response;
|
|
@@ -191,36 +217,45 @@ class Container extends BaseClient {
|
|
|
191
217
|
* Retrieve a file at the given path. Mounts are included.
|
|
192
218
|
*/
|
|
193
219
|
file(path) {
|
|
194
|
-
return new File({
|
|
220
|
+
return new File({
|
|
221
|
+
queryTree: [
|
|
195
222
|
...this._queryTree,
|
|
196
223
|
{
|
|
197
|
-
operation:
|
|
198
|
-
args: { path }
|
|
199
|
-
}
|
|
200
|
-
],
|
|
224
|
+
operation: "file",
|
|
225
|
+
args: { path },
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
host: this.clientHost,
|
|
229
|
+
});
|
|
201
230
|
}
|
|
202
231
|
/**
|
|
203
232
|
* Initialize this container from the base image published at the given address
|
|
204
233
|
*/
|
|
205
234
|
from(address) {
|
|
206
|
-
return new Container({
|
|
235
|
+
return new Container({
|
|
236
|
+
queryTree: [
|
|
207
237
|
...this._queryTree,
|
|
208
238
|
{
|
|
209
|
-
operation:
|
|
210
|
-
args: { address }
|
|
211
|
-
}
|
|
212
|
-
],
|
|
239
|
+
operation: "from",
|
|
240
|
+
args: { address },
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
host: this.clientHost,
|
|
244
|
+
});
|
|
213
245
|
}
|
|
214
246
|
/**
|
|
215
247
|
* This container's root filesystem. Mounts are not included.
|
|
216
248
|
*/
|
|
217
249
|
fs() {
|
|
218
|
-
return new Directory({
|
|
250
|
+
return new Directory({
|
|
251
|
+
queryTree: [
|
|
219
252
|
...this._queryTree,
|
|
220
253
|
{
|
|
221
|
-
operation:
|
|
222
|
-
}
|
|
223
|
-
],
|
|
254
|
+
operation: "fs",
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
host: this.clientHost,
|
|
258
|
+
});
|
|
224
259
|
}
|
|
225
260
|
/**
|
|
226
261
|
* A unique identifier for this container
|
|
@@ -230,8 +265,8 @@ class Container extends BaseClient {
|
|
|
230
265
|
this._queryTree = [
|
|
231
266
|
...this._queryTree,
|
|
232
267
|
{
|
|
233
|
-
operation:
|
|
234
|
-
}
|
|
268
|
+
operation: "id",
|
|
269
|
+
},
|
|
235
270
|
];
|
|
236
271
|
const response = yield this._compute();
|
|
237
272
|
return response;
|
|
@@ -245,8 +280,8 @@ class Container extends BaseClient {
|
|
|
245
280
|
this._queryTree = [
|
|
246
281
|
...this._queryTree,
|
|
247
282
|
{
|
|
248
|
-
operation:
|
|
249
|
-
}
|
|
283
|
+
operation: "mounts",
|
|
284
|
+
},
|
|
250
285
|
];
|
|
251
286
|
const response = yield this._compute();
|
|
252
287
|
return response;
|
|
@@ -260,8 +295,8 @@ class Container extends BaseClient {
|
|
|
260
295
|
this._queryTree = [
|
|
261
296
|
...this._queryTree,
|
|
262
297
|
{
|
|
263
|
-
operation:
|
|
264
|
-
}
|
|
298
|
+
operation: "platform",
|
|
299
|
+
},
|
|
265
300
|
];
|
|
266
301
|
const response = yield this._compute();
|
|
267
302
|
return response;
|
|
@@ -275,9 +310,9 @@ class Container extends BaseClient {
|
|
|
275
310
|
this._queryTree = [
|
|
276
311
|
...this._queryTree,
|
|
277
312
|
{
|
|
278
|
-
operation:
|
|
279
|
-
args: { address, platformVariants }
|
|
280
|
-
}
|
|
313
|
+
operation: "publish",
|
|
314
|
+
args: { address, platformVariants },
|
|
315
|
+
},
|
|
281
316
|
];
|
|
282
317
|
const response = yield this._compute();
|
|
283
318
|
return response;
|
|
@@ -288,24 +323,30 @@ class Container extends BaseClient {
|
|
|
288
323
|
* Null if no command has been executed.
|
|
289
324
|
*/
|
|
290
325
|
stderr() {
|
|
291
|
-
return new File({
|
|
326
|
+
return new File({
|
|
327
|
+
queryTree: [
|
|
292
328
|
...this._queryTree,
|
|
293
329
|
{
|
|
294
|
-
operation:
|
|
295
|
-
}
|
|
296
|
-
],
|
|
330
|
+
operation: "stderr",
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
host: this.clientHost,
|
|
334
|
+
});
|
|
297
335
|
}
|
|
298
336
|
/**
|
|
299
337
|
* The output stream of the last executed command.
|
|
300
338
|
* Null if no command has been executed.
|
|
301
339
|
*/
|
|
302
340
|
stdout() {
|
|
303
|
-
return new File({
|
|
341
|
+
return new File({
|
|
342
|
+
queryTree: [
|
|
304
343
|
...this._queryTree,
|
|
305
344
|
{
|
|
306
|
-
operation:
|
|
307
|
-
}
|
|
308
|
-
],
|
|
345
|
+
operation: "stdout",
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
host: this.clientHost,
|
|
349
|
+
});
|
|
309
350
|
}
|
|
310
351
|
/**
|
|
311
352
|
* The user to be set for all commands
|
|
@@ -315,8 +356,8 @@ class Container extends BaseClient {
|
|
|
315
356
|
this._queryTree = [
|
|
316
357
|
...this._queryTree,
|
|
317
358
|
{
|
|
318
|
-
operation:
|
|
319
|
-
}
|
|
359
|
+
operation: "user",
|
|
360
|
+
},
|
|
320
361
|
];
|
|
321
362
|
const response = yield this._compute();
|
|
322
363
|
return response;
|
|
@@ -326,169 +367,211 @@ class Container extends BaseClient {
|
|
|
326
367
|
* Configures default arguments for future commands
|
|
327
368
|
*/
|
|
328
369
|
withDefaultArgs(args) {
|
|
329
|
-
return new Container({
|
|
370
|
+
return new Container({
|
|
371
|
+
queryTree: [
|
|
330
372
|
...this._queryTree,
|
|
331
373
|
{
|
|
332
|
-
operation:
|
|
333
|
-
args: { args }
|
|
334
|
-
}
|
|
335
|
-
],
|
|
374
|
+
operation: "withDefaultArgs",
|
|
375
|
+
args: { args },
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
host: this.clientHost,
|
|
379
|
+
});
|
|
336
380
|
}
|
|
337
381
|
/**
|
|
338
382
|
* This container but with a different command entrypoint
|
|
339
383
|
*/
|
|
340
384
|
withEntrypoint(args) {
|
|
341
|
-
return new Container({
|
|
385
|
+
return new Container({
|
|
386
|
+
queryTree: [
|
|
342
387
|
...this._queryTree,
|
|
343
388
|
{
|
|
344
|
-
operation:
|
|
345
|
-
args: { args }
|
|
346
|
-
}
|
|
347
|
-
],
|
|
389
|
+
operation: "withEntrypoint",
|
|
390
|
+
args: { args },
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
host: this.clientHost,
|
|
394
|
+
});
|
|
348
395
|
}
|
|
349
396
|
/**
|
|
350
397
|
* This container plus the given environment variable
|
|
351
398
|
*/
|
|
352
399
|
withEnvVariable(name, value) {
|
|
353
|
-
return new Container({
|
|
400
|
+
return new Container({
|
|
401
|
+
queryTree: [
|
|
354
402
|
...this._queryTree,
|
|
355
403
|
{
|
|
356
|
-
operation:
|
|
357
|
-
args: { name, value }
|
|
358
|
-
}
|
|
359
|
-
],
|
|
404
|
+
operation: "withEnvVariable",
|
|
405
|
+
args: { name, value },
|
|
406
|
+
},
|
|
407
|
+
],
|
|
408
|
+
host: this.clientHost,
|
|
409
|
+
});
|
|
360
410
|
}
|
|
361
411
|
/**
|
|
362
412
|
* Initialize this container from this DirectoryID
|
|
363
413
|
*/
|
|
364
414
|
withFS(id) {
|
|
365
|
-
return new Container({
|
|
415
|
+
return new Container({
|
|
416
|
+
queryTree: [
|
|
366
417
|
...this._queryTree,
|
|
367
418
|
{
|
|
368
|
-
operation:
|
|
369
|
-
args: { id }
|
|
370
|
-
}
|
|
371
|
-
],
|
|
419
|
+
operation: "withFS",
|
|
420
|
+
args: { id },
|
|
421
|
+
},
|
|
422
|
+
],
|
|
423
|
+
host: this.clientHost,
|
|
424
|
+
});
|
|
372
425
|
}
|
|
373
426
|
/**
|
|
374
427
|
* This container plus a cache volume mounted at the given path
|
|
375
428
|
*/
|
|
376
429
|
withMountedCache(path, cache, source) {
|
|
377
|
-
return new Container({
|
|
430
|
+
return new Container({
|
|
431
|
+
queryTree: [
|
|
378
432
|
...this._queryTree,
|
|
379
433
|
{
|
|
380
|
-
operation:
|
|
381
|
-
args: { path, cache, source }
|
|
382
|
-
}
|
|
383
|
-
],
|
|
434
|
+
operation: "withMountedCache",
|
|
435
|
+
args: { path, cache, source },
|
|
436
|
+
},
|
|
437
|
+
],
|
|
438
|
+
host: this.clientHost,
|
|
439
|
+
});
|
|
384
440
|
}
|
|
385
441
|
/**
|
|
386
442
|
* This container plus a directory mounted at the given path
|
|
387
443
|
*/
|
|
388
444
|
withMountedDirectory(path, source) {
|
|
389
|
-
return new Container({
|
|
445
|
+
return new Container({
|
|
446
|
+
queryTree: [
|
|
390
447
|
...this._queryTree,
|
|
391
448
|
{
|
|
392
|
-
operation:
|
|
393
|
-
args: { path, source }
|
|
394
|
-
}
|
|
395
|
-
],
|
|
449
|
+
operation: "withMountedDirectory",
|
|
450
|
+
args: { path, source },
|
|
451
|
+
},
|
|
452
|
+
],
|
|
453
|
+
host: this.clientHost,
|
|
454
|
+
});
|
|
396
455
|
}
|
|
397
456
|
/**
|
|
398
457
|
* This container plus a file mounted at the given path
|
|
399
458
|
*/
|
|
400
459
|
withMountedFile(path, source) {
|
|
401
|
-
return new Container({
|
|
460
|
+
return new Container({
|
|
461
|
+
queryTree: [
|
|
402
462
|
...this._queryTree,
|
|
403
463
|
{
|
|
404
|
-
operation:
|
|
405
|
-
args: { path, source }
|
|
406
|
-
}
|
|
407
|
-
],
|
|
464
|
+
operation: "withMountedFile",
|
|
465
|
+
args: { path, source },
|
|
466
|
+
},
|
|
467
|
+
],
|
|
468
|
+
host: this.clientHost,
|
|
469
|
+
});
|
|
408
470
|
}
|
|
409
471
|
/**
|
|
410
472
|
* This container plus a secret mounted into a file at the given path
|
|
411
473
|
*/
|
|
412
474
|
withMountedSecret(path, source) {
|
|
413
|
-
return new Container({
|
|
475
|
+
return new Container({
|
|
476
|
+
queryTree: [
|
|
414
477
|
...this._queryTree,
|
|
415
478
|
{
|
|
416
|
-
operation:
|
|
417
|
-
args: { path, source }
|
|
418
|
-
}
|
|
419
|
-
],
|
|
479
|
+
operation: "withMountedSecret",
|
|
480
|
+
args: { path, source },
|
|
481
|
+
},
|
|
482
|
+
],
|
|
483
|
+
host: this.clientHost,
|
|
484
|
+
});
|
|
420
485
|
}
|
|
421
486
|
/**
|
|
422
487
|
* This container plus a temporary directory mounted at the given path
|
|
423
488
|
*/
|
|
424
489
|
withMountedTemp(path) {
|
|
425
|
-
return new Container({
|
|
490
|
+
return new Container({
|
|
491
|
+
queryTree: [
|
|
426
492
|
...this._queryTree,
|
|
427
493
|
{
|
|
428
|
-
operation:
|
|
429
|
-
args: { path }
|
|
430
|
-
}
|
|
431
|
-
],
|
|
494
|
+
operation: "withMountedTemp",
|
|
495
|
+
args: { path },
|
|
496
|
+
},
|
|
497
|
+
],
|
|
498
|
+
host: this.clientHost,
|
|
499
|
+
});
|
|
432
500
|
}
|
|
433
501
|
/**
|
|
434
502
|
* This container plus an env variable containing the given secret
|
|
435
503
|
*/
|
|
436
504
|
withSecretVariable(name, secret) {
|
|
437
|
-
return new Container({
|
|
505
|
+
return new Container({
|
|
506
|
+
queryTree: [
|
|
438
507
|
...this._queryTree,
|
|
439
508
|
{
|
|
440
|
-
operation:
|
|
441
|
-
args: { name, secret }
|
|
442
|
-
}
|
|
443
|
-
],
|
|
509
|
+
operation: "withSecretVariable",
|
|
510
|
+
args: { name, secret },
|
|
511
|
+
},
|
|
512
|
+
],
|
|
513
|
+
host: this.clientHost,
|
|
514
|
+
});
|
|
444
515
|
}
|
|
445
516
|
/**
|
|
446
517
|
* This container but with a different command user
|
|
447
518
|
*/
|
|
448
519
|
withUser(name) {
|
|
449
|
-
return new Container({
|
|
520
|
+
return new Container({
|
|
521
|
+
queryTree: [
|
|
450
522
|
...this._queryTree,
|
|
451
523
|
{
|
|
452
|
-
operation:
|
|
453
|
-
args: { name }
|
|
454
|
-
}
|
|
455
|
-
],
|
|
524
|
+
operation: "withUser",
|
|
525
|
+
args: { name },
|
|
526
|
+
},
|
|
527
|
+
],
|
|
528
|
+
host: this.clientHost,
|
|
529
|
+
});
|
|
456
530
|
}
|
|
457
531
|
/**
|
|
458
532
|
* This container but with a different working directory
|
|
459
533
|
*/
|
|
460
534
|
withWorkdir(path) {
|
|
461
|
-
return new Container({
|
|
535
|
+
return new Container({
|
|
536
|
+
queryTree: [
|
|
462
537
|
...this._queryTree,
|
|
463
538
|
{
|
|
464
|
-
operation:
|
|
465
|
-
args: { path }
|
|
466
|
-
}
|
|
467
|
-
],
|
|
539
|
+
operation: "withWorkdir",
|
|
540
|
+
args: { path },
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
host: this.clientHost,
|
|
544
|
+
});
|
|
468
545
|
}
|
|
469
546
|
/**
|
|
470
547
|
* This container minus the given environment variable
|
|
471
548
|
*/
|
|
472
549
|
withoutEnvVariable(name) {
|
|
473
|
-
return new Container({
|
|
550
|
+
return new Container({
|
|
551
|
+
queryTree: [
|
|
474
552
|
...this._queryTree,
|
|
475
553
|
{
|
|
476
|
-
operation:
|
|
477
|
-
args: { name }
|
|
478
|
-
}
|
|
479
|
-
],
|
|
554
|
+
operation: "withoutEnvVariable",
|
|
555
|
+
args: { name },
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
host: this.clientHost,
|
|
559
|
+
});
|
|
480
560
|
}
|
|
481
561
|
/**
|
|
482
562
|
* This container after unmounting everything at the given path.
|
|
483
563
|
*/
|
|
484
564
|
withoutMount(path) {
|
|
485
|
-
return new Container({
|
|
565
|
+
return new Container({
|
|
566
|
+
queryTree: [
|
|
486
567
|
...this._queryTree,
|
|
487
568
|
{
|
|
488
|
-
operation:
|
|
489
|
-
args: { path }
|
|
490
|
-
}
|
|
491
|
-
],
|
|
569
|
+
operation: "withoutMount",
|
|
570
|
+
args: { path },
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
host: this.clientHost,
|
|
574
|
+
});
|
|
492
575
|
}
|
|
493
576
|
/**
|
|
494
577
|
* The working directory for all commands
|
|
@@ -498,8 +581,8 @@ class Container extends BaseClient {
|
|
|
498
581
|
this._queryTree = [
|
|
499
582
|
...this._queryTree,
|
|
500
583
|
{
|
|
501
|
-
operation:
|
|
502
|
-
}
|
|
584
|
+
operation: "workdir",
|
|
585
|
+
},
|
|
503
586
|
];
|
|
504
587
|
const response = yield this._compute();
|
|
505
588
|
return response;
|
|
@@ -509,30 +592,36 @@ class Container extends BaseClient {
|
|
|
509
592
|
/**
|
|
510
593
|
* A directory
|
|
511
594
|
*/
|
|
512
|
-
class Directory extends BaseClient {
|
|
595
|
+
export class Directory extends BaseClient {
|
|
513
596
|
/**
|
|
514
597
|
* The difference between this directory and an another directory
|
|
515
598
|
*/
|
|
516
599
|
diff(other) {
|
|
517
|
-
return new Directory({
|
|
600
|
+
return new Directory({
|
|
601
|
+
queryTree: [
|
|
518
602
|
...this._queryTree,
|
|
519
603
|
{
|
|
520
|
-
operation:
|
|
521
|
-
args: { other }
|
|
522
|
-
}
|
|
523
|
-
],
|
|
604
|
+
operation: "diff",
|
|
605
|
+
args: { other },
|
|
606
|
+
},
|
|
607
|
+
],
|
|
608
|
+
host: this.clientHost,
|
|
609
|
+
});
|
|
524
610
|
}
|
|
525
611
|
/**
|
|
526
612
|
* Retrieve a directory at the given path
|
|
527
613
|
*/
|
|
528
614
|
directory(path) {
|
|
529
|
-
return new Directory({
|
|
615
|
+
return new Directory({
|
|
616
|
+
queryTree: [
|
|
530
617
|
...this._queryTree,
|
|
531
618
|
{
|
|
532
|
-
operation:
|
|
533
|
-
args: { path }
|
|
534
|
-
}
|
|
535
|
-
],
|
|
619
|
+
operation: "directory",
|
|
620
|
+
args: { path },
|
|
621
|
+
},
|
|
622
|
+
],
|
|
623
|
+
host: this.clientHost,
|
|
624
|
+
});
|
|
536
625
|
}
|
|
537
626
|
/**
|
|
538
627
|
* Return a list of files and directories at the given path
|
|
@@ -542,9 +631,9 @@ class Directory extends BaseClient {
|
|
|
542
631
|
this._queryTree = [
|
|
543
632
|
...this._queryTree,
|
|
544
633
|
{
|
|
545
|
-
operation:
|
|
546
|
-
args: { path }
|
|
547
|
-
}
|
|
634
|
+
operation: "entries",
|
|
635
|
+
args: { path },
|
|
636
|
+
},
|
|
548
637
|
];
|
|
549
638
|
const response = yield this._compute();
|
|
550
639
|
return response;
|
|
@@ -558,9 +647,9 @@ class Directory extends BaseClient {
|
|
|
558
647
|
this._queryTree = [
|
|
559
648
|
...this._queryTree,
|
|
560
649
|
{
|
|
561
|
-
operation:
|
|
562
|
-
args: { path }
|
|
563
|
-
}
|
|
650
|
+
operation: "export",
|
|
651
|
+
args: { path },
|
|
652
|
+
},
|
|
564
653
|
];
|
|
565
654
|
const response = yield this._compute();
|
|
566
655
|
return response;
|
|
@@ -570,13 +659,16 @@ class Directory extends BaseClient {
|
|
|
570
659
|
* Retrieve a file at the given path
|
|
571
660
|
*/
|
|
572
661
|
file(path) {
|
|
573
|
-
return new File({
|
|
662
|
+
return new File({
|
|
663
|
+
queryTree: [
|
|
574
664
|
...this._queryTree,
|
|
575
665
|
{
|
|
576
|
-
operation:
|
|
577
|
-
args: { path }
|
|
578
|
-
}
|
|
579
|
-
],
|
|
666
|
+
operation: "file",
|
|
667
|
+
args: { path },
|
|
668
|
+
},
|
|
669
|
+
],
|
|
670
|
+
host: this.clientHost,
|
|
671
|
+
});
|
|
580
672
|
}
|
|
581
673
|
/**
|
|
582
674
|
* The content-addressed identifier of the directory
|
|
@@ -586,8 +678,8 @@ class Directory extends BaseClient {
|
|
|
586
678
|
this._queryTree = [
|
|
587
679
|
...this._queryTree,
|
|
588
680
|
{
|
|
589
|
-
operation:
|
|
590
|
-
}
|
|
681
|
+
operation: "id",
|
|
682
|
+
},
|
|
591
683
|
];
|
|
592
684
|
const response = yield this._compute();
|
|
593
685
|
return response;
|
|
@@ -597,91 +689,112 @@ class Directory extends BaseClient {
|
|
|
597
689
|
* load a project's metadata
|
|
598
690
|
*/
|
|
599
691
|
loadProject(configPath) {
|
|
600
|
-
return new Project({
|
|
692
|
+
return new Project({
|
|
693
|
+
queryTree: [
|
|
601
694
|
...this._queryTree,
|
|
602
695
|
{
|
|
603
|
-
operation:
|
|
604
|
-
args: { configPath }
|
|
605
|
-
}
|
|
606
|
-
],
|
|
696
|
+
operation: "loadProject",
|
|
697
|
+
args: { configPath },
|
|
698
|
+
},
|
|
699
|
+
],
|
|
700
|
+
host: this.clientHost,
|
|
701
|
+
});
|
|
607
702
|
}
|
|
608
703
|
/**
|
|
609
704
|
* This directory plus a directory written at the given path
|
|
610
705
|
*/
|
|
611
706
|
withDirectory(path, directory, exclude, include) {
|
|
612
|
-
return new Directory({
|
|
707
|
+
return new Directory({
|
|
708
|
+
queryTree: [
|
|
613
709
|
...this._queryTree,
|
|
614
710
|
{
|
|
615
|
-
operation:
|
|
616
|
-
args: { path, directory, exclude, include }
|
|
617
|
-
}
|
|
618
|
-
],
|
|
711
|
+
operation: "withDirectory",
|
|
712
|
+
args: { path, directory, exclude, include },
|
|
713
|
+
},
|
|
714
|
+
],
|
|
715
|
+
host: this.clientHost,
|
|
716
|
+
});
|
|
619
717
|
}
|
|
620
718
|
/**
|
|
621
719
|
* This directory plus the contents of the given file copied to the given path
|
|
622
720
|
*/
|
|
623
721
|
withFile(path, source) {
|
|
624
|
-
return new Directory({
|
|
722
|
+
return new Directory({
|
|
723
|
+
queryTree: [
|
|
625
724
|
...this._queryTree,
|
|
626
725
|
{
|
|
627
|
-
operation:
|
|
628
|
-
args: { path, source }
|
|
629
|
-
}
|
|
630
|
-
],
|
|
726
|
+
operation: "withFile",
|
|
727
|
+
args: { path, source },
|
|
728
|
+
},
|
|
729
|
+
],
|
|
730
|
+
host: this.clientHost,
|
|
731
|
+
});
|
|
631
732
|
}
|
|
632
733
|
/**
|
|
633
734
|
* This directory plus a new directory created at the given path
|
|
634
735
|
*/
|
|
635
736
|
withNewDirectory(path) {
|
|
636
|
-
return new Directory({
|
|
737
|
+
return new Directory({
|
|
738
|
+
queryTree: [
|
|
637
739
|
...this._queryTree,
|
|
638
740
|
{
|
|
639
|
-
operation:
|
|
640
|
-
args: { path }
|
|
641
|
-
}
|
|
642
|
-
],
|
|
741
|
+
operation: "withNewDirectory",
|
|
742
|
+
args: { path },
|
|
743
|
+
},
|
|
744
|
+
],
|
|
745
|
+
host: this.clientHost,
|
|
746
|
+
});
|
|
643
747
|
}
|
|
644
748
|
/**
|
|
645
749
|
* This directory plus a new file written at the given path
|
|
646
750
|
*/
|
|
647
751
|
withNewFile(path, contents) {
|
|
648
|
-
return new Directory({
|
|
752
|
+
return new Directory({
|
|
753
|
+
queryTree: [
|
|
649
754
|
...this._queryTree,
|
|
650
755
|
{
|
|
651
|
-
operation:
|
|
652
|
-
args: { path, contents }
|
|
653
|
-
}
|
|
654
|
-
],
|
|
756
|
+
operation: "withNewFile",
|
|
757
|
+
args: { path, contents },
|
|
758
|
+
},
|
|
759
|
+
],
|
|
760
|
+
host: this.clientHost,
|
|
761
|
+
});
|
|
655
762
|
}
|
|
656
763
|
/**
|
|
657
764
|
* This directory with the directory at the given path removed
|
|
658
765
|
*/
|
|
659
766
|
withoutDirectory(path) {
|
|
660
|
-
return new Directory({
|
|
767
|
+
return new Directory({
|
|
768
|
+
queryTree: [
|
|
661
769
|
...this._queryTree,
|
|
662
770
|
{
|
|
663
|
-
operation:
|
|
664
|
-
args: { path }
|
|
665
|
-
}
|
|
666
|
-
],
|
|
771
|
+
operation: "withoutDirectory",
|
|
772
|
+
args: { path },
|
|
773
|
+
},
|
|
774
|
+
],
|
|
775
|
+
host: this.clientHost,
|
|
776
|
+
});
|
|
667
777
|
}
|
|
668
778
|
/**
|
|
669
779
|
* This directory with the file at the given path removed
|
|
670
780
|
*/
|
|
671
781
|
withoutFile(path) {
|
|
672
|
-
return new Directory({
|
|
782
|
+
return new Directory({
|
|
783
|
+
queryTree: [
|
|
673
784
|
...this._queryTree,
|
|
674
785
|
{
|
|
675
|
-
operation:
|
|
676
|
-
args: { path }
|
|
677
|
-
}
|
|
678
|
-
],
|
|
786
|
+
operation: "withoutFile",
|
|
787
|
+
args: { path },
|
|
788
|
+
},
|
|
789
|
+
],
|
|
790
|
+
host: this.clientHost,
|
|
791
|
+
});
|
|
679
792
|
}
|
|
680
793
|
}
|
|
681
794
|
/**
|
|
682
795
|
* EnvVariable is a simple key value object that represents an environment variable.
|
|
683
796
|
*/
|
|
684
|
-
class EnvVariable extends BaseClient {
|
|
797
|
+
export class EnvVariable extends BaseClient {
|
|
685
798
|
/**
|
|
686
799
|
* name is the environment variable name.
|
|
687
800
|
*/
|
|
@@ -690,8 +803,8 @@ class EnvVariable extends BaseClient {
|
|
|
690
803
|
this._queryTree = [
|
|
691
804
|
...this._queryTree,
|
|
692
805
|
{
|
|
693
|
-
operation:
|
|
694
|
-
}
|
|
806
|
+
operation: "name",
|
|
807
|
+
},
|
|
695
808
|
];
|
|
696
809
|
const response = yield this._compute();
|
|
697
810
|
return response;
|
|
@@ -705,8 +818,8 @@ class EnvVariable extends BaseClient {
|
|
|
705
818
|
this._queryTree = [
|
|
706
819
|
...this._queryTree,
|
|
707
820
|
{
|
|
708
|
-
operation:
|
|
709
|
-
}
|
|
821
|
+
operation: "value",
|
|
822
|
+
},
|
|
710
823
|
];
|
|
711
824
|
const response = yield this._compute();
|
|
712
825
|
return response;
|
|
@@ -716,7 +829,7 @@ class EnvVariable extends BaseClient {
|
|
|
716
829
|
/**
|
|
717
830
|
* A file
|
|
718
831
|
*/
|
|
719
|
-
class File extends BaseClient {
|
|
832
|
+
export class File extends BaseClient {
|
|
720
833
|
/**
|
|
721
834
|
* The contents of the file
|
|
722
835
|
*/
|
|
@@ -725,8 +838,8 @@ class File extends BaseClient {
|
|
|
725
838
|
this._queryTree = [
|
|
726
839
|
...this._queryTree,
|
|
727
840
|
{
|
|
728
|
-
operation:
|
|
729
|
-
}
|
|
841
|
+
operation: "contents",
|
|
842
|
+
},
|
|
730
843
|
];
|
|
731
844
|
const response = yield this._compute();
|
|
732
845
|
return response;
|
|
@@ -740,9 +853,9 @@ class File extends BaseClient {
|
|
|
740
853
|
this._queryTree = [
|
|
741
854
|
...this._queryTree,
|
|
742
855
|
{
|
|
743
|
-
operation:
|
|
744
|
-
args: { path }
|
|
745
|
-
}
|
|
856
|
+
operation: "export",
|
|
857
|
+
args: { path },
|
|
858
|
+
},
|
|
746
859
|
];
|
|
747
860
|
const response = yield this._compute();
|
|
748
861
|
return response;
|
|
@@ -756,20 +869,23 @@ class File extends BaseClient {
|
|
|
756
869
|
this._queryTree = [
|
|
757
870
|
...this._queryTree,
|
|
758
871
|
{
|
|
759
|
-
operation:
|
|
760
|
-
}
|
|
872
|
+
operation: "id",
|
|
873
|
+
},
|
|
761
874
|
];
|
|
762
875
|
const response = yield this._compute();
|
|
763
876
|
return response;
|
|
764
877
|
});
|
|
765
878
|
}
|
|
766
879
|
secret() {
|
|
767
|
-
return new Secret({
|
|
880
|
+
return new Secret({
|
|
881
|
+
queryTree: [
|
|
768
882
|
...this._queryTree,
|
|
769
883
|
{
|
|
770
|
-
operation:
|
|
771
|
-
}
|
|
772
|
-
],
|
|
884
|
+
operation: "secret",
|
|
885
|
+
},
|
|
886
|
+
],
|
|
887
|
+
host: this.clientHost,
|
|
888
|
+
});
|
|
773
889
|
}
|
|
774
890
|
/**
|
|
775
891
|
* The size of the file, in bytes
|
|
@@ -779,8 +895,8 @@ class File extends BaseClient {
|
|
|
779
895
|
this._queryTree = [
|
|
780
896
|
...this._queryTree,
|
|
781
897
|
{
|
|
782
|
-
operation:
|
|
783
|
-
}
|
|
898
|
+
operation: "size",
|
|
899
|
+
},
|
|
784
900
|
];
|
|
785
901
|
const response = yield this._compute();
|
|
786
902
|
return response;
|
|
@@ -790,7 +906,7 @@ class File extends BaseClient {
|
|
|
790
906
|
/**
|
|
791
907
|
* A git ref (tag or branch)
|
|
792
908
|
*/
|
|
793
|
-
class GitRef extends BaseClient {
|
|
909
|
+
export class GitRef extends BaseClient {
|
|
794
910
|
/**
|
|
795
911
|
* The digest of the current value of this ref
|
|
796
912
|
*/
|
|
@@ -799,8 +915,8 @@ class GitRef extends BaseClient {
|
|
|
799
915
|
this._queryTree = [
|
|
800
916
|
...this._queryTree,
|
|
801
917
|
{
|
|
802
|
-
operation:
|
|
803
|
-
}
|
|
918
|
+
operation: "digest",
|
|
919
|
+
},
|
|
804
920
|
];
|
|
805
921
|
const response = yield this._compute();
|
|
806
922
|
return response;
|
|
@@ -810,29 +926,35 @@ class GitRef extends BaseClient {
|
|
|
810
926
|
* The filesystem tree at this ref
|
|
811
927
|
*/
|
|
812
928
|
tree() {
|
|
813
|
-
return new Directory({
|
|
929
|
+
return new Directory({
|
|
930
|
+
queryTree: [
|
|
814
931
|
...this._queryTree,
|
|
815
932
|
{
|
|
816
|
-
operation:
|
|
817
|
-
}
|
|
818
|
-
],
|
|
933
|
+
operation: "tree",
|
|
934
|
+
},
|
|
935
|
+
],
|
|
936
|
+
host: this.clientHost,
|
|
937
|
+
});
|
|
819
938
|
}
|
|
820
939
|
}
|
|
821
940
|
/**
|
|
822
941
|
* A git repository
|
|
823
942
|
*/
|
|
824
|
-
class GitRepository extends BaseClient {
|
|
943
|
+
export class GitRepository extends BaseClient {
|
|
825
944
|
/**
|
|
826
945
|
* Details on one branch
|
|
827
946
|
*/
|
|
828
947
|
branch(name) {
|
|
829
|
-
return new GitRef({
|
|
948
|
+
return new GitRef({
|
|
949
|
+
queryTree: [
|
|
830
950
|
...this._queryTree,
|
|
831
951
|
{
|
|
832
|
-
operation:
|
|
833
|
-
args: { name }
|
|
834
|
-
}
|
|
835
|
-
],
|
|
952
|
+
operation: "branch",
|
|
953
|
+
args: { name },
|
|
954
|
+
},
|
|
955
|
+
],
|
|
956
|
+
host: this.clientHost,
|
|
957
|
+
});
|
|
836
958
|
}
|
|
837
959
|
/**
|
|
838
960
|
* List of branches on the repository
|
|
@@ -842,8 +964,8 @@ class GitRepository extends BaseClient {
|
|
|
842
964
|
this._queryTree = [
|
|
843
965
|
...this._queryTree,
|
|
844
966
|
{
|
|
845
|
-
operation:
|
|
846
|
-
}
|
|
967
|
+
operation: "branches",
|
|
968
|
+
},
|
|
847
969
|
];
|
|
848
970
|
const response = yield this._compute();
|
|
849
971
|
return response;
|
|
@@ -853,25 +975,31 @@ class GitRepository extends BaseClient {
|
|
|
853
975
|
* Details on one commit
|
|
854
976
|
*/
|
|
855
977
|
commit(id) {
|
|
856
|
-
return new GitRef({
|
|
978
|
+
return new GitRef({
|
|
979
|
+
queryTree: [
|
|
857
980
|
...this._queryTree,
|
|
858
981
|
{
|
|
859
|
-
operation:
|
|
860
|
-
args: { id }
|
|
861
|
-
}
|
|
862
|
-
],
|
|
982
|
+
operation: "commit",
|
|
983
|
+
args: { id },
|
|
984
|
+
},
|
|
985
|
+
],
|
|
986
|
+
host: this.clientHost,
|
|
987
|
+
});
|
|
863
988
|
}
|
|
864
989
|
/**
|
|
865
990
|
* Details on one tag
|
|
866
991
|
*/
|
|
867
992
|
tag(name) {
|
|
868
|
-
return new GitRef({
|
|
993
|
+
return new GitRef({
|
|
994
|
+
queryTree: [
|
|
869
995
|
...this._queryTree,
|
|
870
996
|
{
|
|
871
|
-
operation:
|
|
872
|
-
args: { name }
|
|
873
|
-
}
|
|
874
|
-
],
|
|
997
|
+
operation: "tag",
|
|
998
|
+
args: { name },
|
|
999
|
+
},
|
|
1000
|
+
],
|
|
1001
|
+
host: this.clientHost,
|
|
1002
|
+
});
|
|
875
1003
|
}
|
|
876
1004
|
/**
|
|
877
1005
|
* List of tags on the repository
|
|
@@ -881,8 +1009,8 @@ class GitRepository extends BaseClient {
|
|
|
881
1009
|
this._queryTree = [
|
|
882
1010
|
...this._queryTree,
|
|
883
1011
|
{
|
|
884
|
-
operation:
|
|
885
|
-
}
|
|
1012
|
+
operation: "tags",
|
|
1013
|
+
},
|
|
886
1014
|
];
|
|
887
1015
|
const response = yield this._compute();
|
|
888
1016
|
return response;
|
|
@@ -892,58 +1020,70 @@ class GitRepository extends BaseClient {
|
|
|
892
1020
|
/**
|
|
893
1021
|
* Information about the host execution environment
|
|
894
1022
|
*/
|
|
895
|
-
class Host extends BaseClient {
|
|
1023
|
+
export class Host extends BaseClient {
|
|
896
1024
|
/**
|
|
897
1025
|
* Access a directory on the host
|
|
898
1026
|
*/
|
|
899
1027
|
directory(path, exclude, include) {
|
|
900
|
-
return new Directory({
|
|
1028
|
+
return new Directory({
|
|
1029
|
+
queryTree: [
|
|
901
1030
|
...this._queryTree,
|
|
902
1031
|
{
|
|
903
|
-
operation:
|
|
904
|
-
args: { path, exclude, include }
|
|
905
|
-
}
|
|
906
|
-
],
|
|
1032
|
+
operation: "directory",
|
|
1033
|
+
args: { path, exclude, include },
|
|
1034
|
+
},
|
|
1035
|
+
],
|
|
1036
|
+
host: this.clientHost,
|
|
1037
|
+
});
|
|
907
1038
|
}
|
|
908
1039
|
/**
|
|
909
1040
|
* Lookup the value of an environment variable. Null if the variable is not available.
|
|
910
1041
|
*/
|
|
911
1042
|
envVariable(name) {
|
|
912
|
-
return new HostVariable({
|
|
1043
|
+
return new HostVariable({
|
|
1044
|
+
queryTree: [
|
|
913
1045
|
...this._queryTree,
|
|
914
1046
|
{
|
|
915
|
-
operation:
|
|
916
|
-
args: { name }
|
|
917
|
-
}
|
|
918
|
-
],
|
|
1047
|
+
operation: "envVariable",
|
|
1048
|
+
args: { name },
|
|
1049
|
+
},
|
|
1050
|
+
],
|
|
1051
|
+
host: this.clientHost,
|
|
1052
|
+
});
|
|
919
1053
|
}
|
|
920
1054
|
/**
|
|
921
1055
|
* The current working directory on the host
|
|
922
1056
|
*/
|
|
923
1057
|
workdir(exclude, include) {
|
|
924
|
-
return new Directory({
|
|
1058
|
+
return new Directory({
|
|
1059
|
+
queryTree: [
|
|
925
1060
|
...this._queryTree,
|
|
926
1061
|
{
|
|
927
|
-
operation:
|
|
928
|
-
args: { exclude, include }
|
|
929
|
-
}
|
|
930
|
-
],
|
|
1062
|
+
operation: "workdir",
|
|
1063
|
+
args: { exclude, include },
|
|
1064
|
+
},
|
|
1065
|
+
],
|
|
1066
|
+
host: this.clientHost,
|
|
1067
|
+
});
|
|
931
1068
|
}
|
|
932
1069
|
}
|
|
933
1070
|
/**
|
|
934
1071
|
* An environment variable on the host environment
|
|
935
1072
|
*/
|
|
936
|
-
class HostVariable extends BaseClient {
|
|
1073
|
+
export class HostVariable extends BaseClient {
|
|
937
1074
|
/**
|
|
938
1075
|
* A secret referencing the value of this variable
|
|
939
1076
|
*/
|
|
940
1077
|
secret() {
|
|
941
|
-
return new Secret({
|
|
1078
|
+
return new Secret({
|
|
1079
|
+
queryTree: [
|
|
942
1080
|
...this._queryTree,
|
|
943
1081
|
{
|
|
944
|
-
operation:
|
|
945
|
-
}
|
|
946
|
-
],
|
|
1082
|
+
operation: "secret",
|
|
1083
|
+
},
|
|
1084
|
+
],
|
|
1085
|
+
host: this.clientHost,
|
|
1086
|
+
});
|
|
947
1087
|
}
|
|
948
1088
|
/**
|
|
949
1089
|
* The value of this variable
|
|
@@ -953,8 +1093,8 @@ class HostVariable extends BaseClient {
|
|
|
953
1093
|
this._queryTree = [
|
|
954
1094
|
...this._queryTree,
|
|
955
1095
|
{
|
|
956
|
-
operation:
|
|
957
|
-
}
|
|
1096
|
+
operation: "value",
|
|
1097
|
+
},
|
|
958
1098
|
];
|
|
959
1099
|
const response = yield this._compute();
|
|
960
1100
|
return response;
|
|
@@ -964,7 +1104,7 @@ class HostVariable extends BaseClient {
|
|
|
964
1104
|
/**
|
|
965
1105
|
* A set of scripts and/or extensions
|
|
966
1106
|
*/
|
|
967
|
-
class Project extends BaseClient {
|
|
1107
|
+
export class Project extends BaseClient {
|
|
968
1108
|
/**
|
|
969
1109
|
* extensions in this project
|
|
970
1110
|
*/
|
|
@@ -973,8 +1113,8 @@ class Project extends BaseClient {
|
|
|
973
1113
|
this._queryTree = [
|
|
974
1114
|
...this._queryTree,
|
|
975
1115
|
{
|
|
976
|
-
operation:
|
|
977
|
-
}
|
|
1116
|
+
operation: "extensions",
|
|
1117
|
+
},
|
|
978
1118
|
];
|
|
979
1119
|
const response = yield this._compute();
|
|
980
1120
|
return response;
|
|
@@ -984,12 +1124,15 @@ class Project extends BaseClient {
|
|
|
984
1124
|
* Code files generated by the SDKs in the project
|
|
985
1125
|
*/
|
|
986
1126
|
generatedCode() {
|
|
987
|
-
return new Directory({
|
|
1127
|
+
return new Directory({
|
|
1128
|
+
queryTree: [
|
|
988
1129
|
...this._queryTree,
|
|
989
1130
|
{
|
|
990
|
-
operation:
|
|
991
|
-
}
|
|
992
|
-
],
|
|
1131
|
+
operation: "generatedCode",
|
|
1132
|
+
},
|
|
1133
|
+
],
|
|
1134
|
+
host: this.clientHost,
|
|
1135
|
+
});
|
|
993
1136
|
}
|
|
994
1137
|
/**
|
|
995
1138
|
* install the project's schema
|
|
@@ -999,8 +1142,8 @@ class Project extends BaseClient {
|
|
|
999
1142
|
this._queryTree = [
|
|
1000
1143
|
...this._queryTree,
|
|
1001
1144
|
{
|
|
1002
|
-
operation:
|
|
1003
|
-
}
|
|
1145
|
+
operation: "install",
|
|
1146
|
+
},
|
|
1004
1147
|
];
|
|
1005
1148
|
const response = yield this._compute();
|
|
1006
1149
|
return response;
|
|
@@ -1014,8 +1157,8 @@ class Project extends BaseClient {
|
|
|
1014
1157
|
this._queryTree = [
|
|
1015
1158
|
...this._queryTree,
|
|
1016
1159
|
{
|
|
1017
|
-
operation:
|
|
1018
|
-
}
|
|
1160
|
+
operation: "name",
|
|
1161
|
+
},
|
|
1019
1162
|
];
|
|
1020
1163
|
const response = yield this._compute();
|
|
1021
1164
|
return response;
|
|
@@ -1029,8 +1172,8 @@ class Project extends BaseClient {
|
|
|
1029
1172
|
this._queryTree = [
|
|
1030
1173
|
...this._queryTree,
|
|
1031
1174
|
{
|
|
1032
|
-
operation:
|
|
1033
|
-
}
|
|
1175
|
+
operation: "schema",
|
|
1176
|
+
},
|
|
1034
1177
|
];
|
|
1035
1178
|
const response = yield this._compute();
|
|
1036
1179
|
return response;
|
|
@@ -1044,8 +1187,8 @@ class Project extends BaseClient {
|
|
|
1044
1187
|
this._queryTree = [
|
|
1045
1188
|
...this._queryTree,
|
|
1046
1189
|
{
|
|
1047
|
-
operation:
|
|
1048
|
-
}
|
|
1190
|
+
operation: "sdk",
|
|
1191
|
+
},
|
|
1049
1192
|
];
|
|
1050
1193
|
const response = yield this._compute();
|
|
1051
1194
|
return response;
|
|
@@ -1057,13 +1200,16 @@ export default class Client extends BaseClient {
|
|
|
1057
1200
|
* Construct a cache volume for a given cache key
|
|
1058
1201
|
*/
|
|
1059
1202
|
cacheVolume(key) {
|
|
1060
|
-
return new CacheVolume({
|
|
1203
|
+
return new CacheVolume({
|
|
1204
|
+
queryTree: [
|
|
1061
1205
|
...this._queryTree,
|
|
1062
1206
|
{
|
|
1063
|
-
operation:
|
|
1064
|
-
args: { key }
|
|
1065
|
-
}
|
|
1066
|
-
],
|
|
1207
|
+
operation: "cacheVolume",
|
|
1208
|
+
args: { key },
|
|
1209
|
+
},
|
|
1210
|
+
],
|
|
1211
|
+
host: this.clientHost,
|
|
1212
|
+
});
|
|
1067
1213
|
}
|
|
1068
1214
|
/**
|
|
1069
1215
|
* Load a container from ID.
|
|
@@ -1071,13 +1217,16 @@ export default class Client extends BaseClient {
|
|
|
1071
1217
|
* Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
|
|
1072
1218
|
*/
|
|
1073
1219
|
container(id, platform) {
|
|
1074
|
-
return new Container({
|
|
1220
|
+
return new Container({
|
|
1221
|
+
queryTree: [
|
|
1075
1222
|
...this._queryTree,
|
|
1076
1223
|
{
|
|
1077
|
-
operation:
|
|
1078
|
-
args: { id, platform }
|
|
1079
|
-
}
|
|
1080
|
-
],
|
|
1224
|
+
operation: "container",
|
|
1225
|
+
args: { id, platform },
|
|
1226
|
+
},
|
|
1227
|
+
],
|
|
1228
|
+
host: this.clientHost,
|
|
1229
|
+
});
|
|
1081
1230
|
}
|
|
1082
1231
|
/**
|
|
1083
1232
|
* The default platform of the builder.
|
|
@@ -1087,8 +1236,8 @@ export default class Client extends BaseClient {
|
|
|
1087
1236
|
this._queryTree = [
|
|
1088
1237
|
...this._queryTree,
|
|
1089
1238
|
{
|
|
1090
|
-
operation:
|
|
1091
|
-
}
|
|
1239
|
+
operation: "defaultPlatform",
|
|
1240
|
+
},
|
|
1092
1241
|
];
|
|
1093
1242
|
const response = yield this._compute();
|
|
1094
1243
|
return response;
|
|
@@ -1098,90 +1247,111 @@ export default class Client extends BaseClient {
|
|
|
1098
1247
|
* Load a directory by ID. No argument produces an empty directory.
|
|
1099
1248
|
*/
|
|
1100
1249
|
directory(id) {
|
|
1101
|
-
return new Directory({
|
|
1250
|
+
return new Directory({
|
|
1251
|
+
queryTree: [
|
|
1102
1252
|
...this._queryTree,
|
|
1103
1253
|
{
|
|
1104
|
-
operation:
|
|
1105
|
-
args: { id }
|
|
1106
|
-
}
|
|
1107
|
-
],
|
|
1254
|
+
operation: "directory",
|
|
1255
|
+
args: { id },
|
|
1256
|
+
},
|
|
1257
|
+
],
|
|
1258
|
+
host: this.clientHost,
|
|
1259
|
+
});
|
|
1108
1260
|
}
|
|
1109
1261
|
/**
|
|
1110
1262
|
* Load a file by ID
|
|
1111
1263
|
*/
|
|
1112
1264
|
file(id) {
|
|
1113
|
-
return new File({
|
|
1265
|
+
return new File({
|
|
1266
|
+
queryTree: [
|
|
1114
1267
|
...this._queryTree,
|
|
1115
1268
|
{
|
|
1116
|
-
operation:
|
|
1117
|
-
args: { id }
|
|
1118
|
-
}
|
|
1119
|
-
],
|
|
1269
|
+
operation: "file",
|
|
1270
|
+
args: { id },
|
|
1271
|
+
},
|
|
1272
|
+
],
|
|
1273
|
+
host: this.clientHost,
|
|
1274
|
+
});
|
|
1120
1275
|
}
|
|
1121
1276
|
/**
|
|
1122
1277
|
* Query a git repository
|
|
1123
1278
|
*/
|
|
1124
1279
|
git(url, keepGitDir) {
|
|
1125
|
-
return new GitRepository({
|
|
1280
|
+
return new GitRepository({
|
|
1281
|
+
queryTree: [
|
|
1126
1282
|
...this._queryTree,
|
|
1127
1283
|
{
|
|
1128
|
-
operation:
|
|
1129
|
-
args: { url, keepGitDir }
|
|
1130
|
-
}
|
|
1131
|
-
],
|
|
1284
|
+
operation: "git",
|
|
1285
|
+
args: { url, keepGitDir },
|
|
1286
|
+
},
|
|
1287
|
+
],
|
|
1288
|
+
host: this.clientHost,
|
|
1289
|
+
});
|
|
1132
1290
|
}
|
|
1133
1291
|
/**
|
|
1134
1292
|
* Query the host environment
|
|
1135
1293
|
*/
|
|
1136
1294
|
host() {
|
|
1137
|
-
return new Host({
|
|
1295
|
+
return new Host({
|
|
1296
|
+
queryTree: [
|
|
1138
1297
|
...this._queryTree,
|
|
1139
1298
|
{
|
|
1140
|
-
operation:
|
|
1141
|
-
}
|
|
1142
|
-
],
|
|
1299
|
+
operation: "host",
|
|
1300
|
+
},
|
|
1301
|
+
],
|
|
1302
|
+
host: this.clientHost,
|
|
1303
|
+
});
|
|
1143
1304
|
}
|
|
1144
1305
|
/**
|
|
1145
1306
|
* An http remote
|
|
1146
1307
|
*/
|
|
1147
1308
|
http(url) {
|
|
1148
|
-
return new File({
|
|
1309
|
+
return new File({
|
|
1310
|
+
queryTree: [
|
|
1149
1311
|
...this._queryTree,
|
|
1150
1312
|
{
|
|
1151
|
-
operation:
|
|
1152
|
-
args: { url }
|
|
1153
|
-
}
|
|
1154
|
-
],
|
|
1313
|
+
operation: "http",
|
|
1314
|
+
args: { url },
|
|
1315
|
+
},
|
|
1316
|
+
],
|
|
1317
|
+
host: this.clientHost,
|
|
1318
|
+
});
|
|
1155
1319
|
}
|
|
1156
1320
|
/**
|
|
1157
1321
|
* Look up a project by name
|
|
1158
1322
|
*/
|
|
1159
1323
|
project(name) {
|
|
1160
|
-
return new Project({
|
|
1324
|
+
return new Project({
|
|
1325
|
+
queryTree: [
|
|
1161
1326
|
...this._queryTree,
|
|
1162
1327
|
{
|
|
1163
|
-
operation:
|
|
1164
|
-
args: { name }
|
|
1165
|
-
}
|
|
1166
|
-
],
|
|
1328
|
+
operation: "project",
|
|
1329
|
+
args: { name },
|
|
1330
|
+
},
|
|
1331
|
+
],
|
|
1332
|
+
host: this.clientHost,
|
|
1333
|
+
});
|
|
1167
1334
|
}
|
|
1168
1335
|
/**
|
|
1169
1336
|
* Load a secret from its ID
|
|
1170
1337
|
*/
|
|
1171
1338
|
secret(id) {
|
|
1172
|
-
return new Secret({
|
|
1339
|
+
return new Secret({
|
|
1340
|
+
queryTree: [
|
|
1173
1341
|
...this._queryTree,
|
|
1174
1342
|
{
|
|
1175
|
-
operation:
|
|
1176
|
-
args: { id }
|
|
1177
|
-
}
|
|
1178
|
-
],
|
|
1343
|
+
operation: "secret",
|
|
1344
|
+
args: { id },
|
|
1345
|
+
},
|
|
1346
|
+
],
|
|
1347
|
+
host: this.clientHost,
|
|
1348
|
+
});
|
|
1179
1349
|
}
|
|
1180
1350
|
}
|
|
1181
1351
|
/**
|
|
1182
1352
|
* A reference to a secret value, which can be handled more safely than the value itself
|
|
1183
1353
|
*/
|
|
1184
|
-
class Secret extends BaseClient {
|
|
1354
|
+
export class Secret extends BaseClient {
|
|
1185
1355
|
/**
|
|
1186
1356
|
* The identifier for this secret
|
|
1187
1357
|
*/
|
|
@@ -1190,8 +1360,8 @@ class Secret extends BaseClient {
|
|
|
1190
1360
|
this._queryTree = [
|
|
1191
1361
|
...this._queryTree,
|
|
1192
1362
|
{
|
|
1193
|
-
operation:
|
|
1194
|
-
}
|
|
1363
|
+
operation: "id",
|
|
1364
|
+
},
|
|
1195
1365
|
];
|
|
1196
1366
|
const response = yield this._compute();
|
|
1197
1367
|
return response;
|
|
@@ -1205,8 +1375,8 @@ class Secret extends BaseClient {
|
|
|
1205
1375
|
this._queryTree = [
|
|
1206
1376
|
...this._queryTree,
|
|
1207
1377
|
{
|
|
1208
|
-
operation:
|
|
1209
|
-
}
|
|
1378
|
+
operation: "plaintext",
|
|
1379
|
+
},
|
|
1210
1380
|
];
|
|
1211
1381
|
const response = yield this._compute();
|
|
1212
1382
|
return response;
|