@dagger.io/dagger 0.1.1 → 0.2.1
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 +97 -64
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +178 -59
- package/dist/api/utils.d.ts +26 -2
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/api/utils.js +102 -30
- package/dist/provisioning/default.js +1 -1
- package/package.json +6 -6
package/dist/api/client.gen.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by `cloak clientgen`.
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
|
+
import { GraphQLClient } from "graphql-request";
|
|
5
6
|
/**
|
|
6
7
|
* @hidden
|
|
7
8
|
*/
|
|
@@ -15,7 +16,7 @@ interface ClientConfig {
|
|
|
15
16
|
}
|
|
16
17
|
declare class BaseClient {
|
|
17
18
|
protected _queryTree: QueryTree[];
|
|
18
|
-
|
|
19
|
+
protected client: GraphQLClient;
|
|
19
20
|
/**
|
|
20
21
|
* @defaultValue `127.0.0.1:8080`
|
|
21
22
|
*/
|
|
@@ -28,48 +29,42 @@ declare class BaseClient {
|
|
|
28
29
|
* @hidden
|
|
29
30
|
*/
|
|
30
31
|
get queryTree(): QueryTree[];
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
protected _compute<T>(): Promise<Record<string, T>>;
|
|
35
32
|
}
|
|
36
33
|
/**
|
|
37
34
|
* A global cache volume identifier
|
|
38
|
-
* @hidden
|
|
39
35
|
*/
|
|
40
36
|
export type CacheID = string;
|
|
41
37
|
/**
|
|
42
38
|
* A unique container identifier. Null designates an empty container (scratch).
|
|
43
|
-
* @hidden
|
|
44
39
|
*/
|
|
45
40
|
export type ContainerID = string;
|
|
46
41
|
/**
|
|
47
42
|
* The `DateTime` scalar type represents a DateTime. The DateTime is serialized as an RFC 3339 quoted string
|
|
48
|
-
* @hidden
|
|
49
43
|
*/
|
|
50
44
|
export type DateTime = string;
|
|
51
45
|
/**
|
|
52
46
|
* A content-addressed directory identifier
|
|
53
|
-
* @hidden
|
|
54
47
|
*/
|
|
55
48
|
export type DirectoryID = string;
|
|
56
49
|
export type FileID = string;
|
|
57
50
|
/**
|
|
58
51
|
* The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.
|
|
59
|
-
* @hidden
|
|
60
52
|
*/
|
|
61
53
|
export type ID = string;
|
|
62
54
|
export type Platform = string;
|
|
63
55
|
/**
|
|
64
56
|
* A unique identifier for a secret
|
|
65
|
-
* @hidden
|
|
66
57
|
*/
|
|
67
58
|
export type SecretID = string;
|
|
59
|
+
/**
|
|
60
|
+
* A content-addressed socket identifier
|
|
61
|
+
*/
|
|
62
|
+
export type SocketID = string;
|
|
68
63
|
/**
|
|
69
64
|
* A directory whose contents persist across runs
|
|
70
65
|
*/
|
|
71
66
|
export declare class CacheVolume extends BaseClient {
|
|
72
|
-
id(): Promise<
|
|
67
|
+
id(): Promise<CacheID>;
|
|
73
68
|
}
|
|
74
69
|
/**
|
|
75
70
|
* An OCI-compatible container, also known as a docker container
|
|
@@ -78,11 +73,11 @@ export declare class Container extends BaseClient {
|
|
|
78
73
|
/**
|
|
79
74
|
* Initialize this container from a Dockerfile build
|
|
80
75
|
*/
|
|
81
|
-
build(context: DirectoryID, dockerfile?: string): Container;
|
|
76
|
+
build(context: DirectoryID | Directory, dockerfile?: string): Container;
|
|
82
77
|
/**
|
|
83
78
|
* Default arguments for future commands
|
|
84
79
|
*/
|
|
85
|
-
defaultArgs(): Promise<
|
|
80
|
+
defaultArgs(): Promise<string[]>;
|
|
86
81
|
/**
|
|
87
82
|
* Retrieve a directory at the given path. Mounts are included.
|
|
88
83
|
*/
|
|
@@ -90,15 +85,15 @@ export declare class Container extends BaseClient {
|
|
|
90
85
|
/**
|
|
91
86
|
* Entrypoint to be prepended to the arguments of all commands
|
|
92
87
|
*/
|
|
93
|
-
entrypoint(): Promise<
|
|
88
|
+
entrypoint(): Promise<string[]>;
|
|
94
89
|
/**
|
|
95
90
|
* The value of the specified environment variable
|
|
96
91
|
*/
|
|
97
|
-
envVariable(name: string): Promise<
|
|
92
|
+
envVariable(name: string): Promise<string>;
|
|
98
93
|
/**
|
|
99
94
|
* A list of environment variables passed to commands
|
|
100
95
|
*/
|
|
101
|
-
envVariables(): Promise<
|
|
96
|
+
envVariables(): Promise<EnvVariable[]>;
|
|
102
97
|
/**
|
|
103
98
|
* This container after executing the specified command inside it
|
|
104
99
|
*
|
|
@@ -109,11 +104,11 @@ export declare class Container extends BaseClient {
|
|
|
109
104
|
* Exit code of the last executed command. Zero means success.
|
|
110
105
|
* Null if no command has been executed.
|
|
111
106
|
*/
|
|
112
|
-
exitCode(): Promise<
|
|
107
|
+
exitCode(): Promise<number>;
|
|
113
108
|
/**
|
|
114
109
|
* Write the container as an OCI tarball to the destination file path on the host
|
|
115
110
|
*/
|
|
116
|
-
export(path: string, platformVariants?: ContainerID[]): Promise<
|
|
111
|
+
export(path: string, platformVariants?: ContainerID[] | Container[]): Promise<boolean>;
|
|
117
112
|
/**
|
|
118
113
|
* Retrieve a file at the given path. Mounts are included.
|
|
119
114
|
*/
|
|
@@ -131,19 +126,19 @@ export declare class Container extends BaseClient {
|
|
|
131
126
|
/**
|
|
132
127
|
* A unique identifier for this container
|
|
133
128
|
*/
|
|
134
|
-
id(): Promise<
|
|
129
|
+
id(): Promise<ContainerID>;
|
|
135
130
|
/**
|
|
136
131
|
* List of paths where a directory is mounted
|
|
137
132
|
*/
|
|
138
|
-
mounts(): Promise<
|
|
133
|
+
mounts(): Promise<string[]>;
|
|
139
134
|
/**
|
|
140
135
|
* The platform this container executes and publishes as
|
|
141
136
|
*/
|
|
142
|
-
platform(): Promise<
|
|
137
|
+
platform(): Promise<Platform>;
|
|
143
138
|
/**
|
|
144
139
|
* Publish this container as a new image, returning a fully qualified ref
|
|
145
140
|
*/
|
|
146
|
-
publish(address: string, platformVariants?: ContainerID[]): Promise<
|
|
141
|
+
publish(address: string, platformVariants?: ContainerID[] | Container[]): Promise<string>;
|
|
147
142
|
/**
|
|
148
143
|
* This container's root filesystem. Mounts are not included.
|
|
149
144
|
*/
|
|
@@ -152,20 +147,24 @@ export declare class Container extends BaseClient {
|
|
|
152
147
|
* The error stream of the last executed command.
|
|
153
148
|
* Null if no command has been executed.
|
|
154
149
|
*/
|
|
155
|
-
stderr(): Promise<
|
|
150
|
+
stderr(): Promise<string>;
|
|
156
151
|
/**
|
|
157
152
|
* The output stream of the last executed command.
|
|
158
153
|
* Null if no command has been executed.
|
|
159
154
|
*/
|
|
160
|
-
stdout(): Promise<
|
|
155
|
+
stdout(): Promise<string>;
|
|
161
156
|
/**
|
|
162
157
|
* The user to be set for all commands
|
|
163
158
|
*/
|
|
164
|
-
user(): Promise<
|
|
159
|
+
user(): Promise<string>;
|
|
165
160
|
/**
|
|
166
161
|
* Configures default arguments for future commands
|
|
167
162
|
*/
|
|
168
163
|
withDefaultArgs(args?: string[]): Container;
|
|
164
|
+
/**
|
|
165
|
+
* This container plus a directory written at the given path
|
|
166
|
+
*/
|
|
167
|
+
withDirectory(path: string, directory: DirectoryID | Directory, exclude?: string[], include?: string[]): Container;
|
|
169
168
|
/**
|
|
170
169
|
* This container but with a different command entrypoint
|
|
171
170
|
*/
|
|
@@ -183,35 +182,47 @@ export declare class Container extends BaseClient {
|
|
|
183
182
|
*
|
|
184
183
|
* @deprecated Replaced by withRootfs.
|
|
185
184
|
*/
|
|
186
|
-
withFS(id: DirectoryID): Container;
|
|
185
|
+
withFS(id: DirectoryID | Directory): Container;
|
|
186
|
+
/**
|
|
187
|
+
* This container plus the contents of the given file copied to the given path
|
|
188
|
+
*/
|
|
189
|
+
withFile(path: string, source: FileID | File): Container;
|
|
187
190
|
/**
|
|
188
191
|
* This container plus a cache volume mounted at the given path
|
|
189
192
|
*/
|
|
190
|
-
withMountedCache(path: string, cache: CacheID, source?: DirectoryID): Container;
|
|
193
|
+
withMountedCache(path: string, cache: CacheID | CacheVolume, source?: DirectoryID | Directory): Container;
|
|
191
194
|
/**
|
|
192
195
|
* This container plus a directory mounted at the given path
|
|
193
196
|
*/
|
|
194
|
-
withMountedDirectory(path: string, source: DirectoryID): Container;
|
|
197
|
+
withMountedDirectory(path: string, source: DirectoryID | Directory): Container;
|
|
195
198
|
/**
|
|
196
199
|
* This container plus a file mounted at the given path
|
|
197
200
|
*/
|
|
198
|
-
withMountedFile(path: string, source: FileID): Container;
|
|
201
|
+
withMountedFile(path: string, source: FileID | File): Container;
|
|
199
202
|
/**
|
|
200
203
|
* This container plus a secret mounted into a file at the given path
|
|
201
204
|
*/
|
|
202
|
-
withMountedSecret(path: string, source: SecretID): Container;
|
|
205
|
+
withMountedSecret(path: string, source: SecretID | Secret): Container;
|
|
203
206
|
/**
|
|
204
207
|
* This container plus a temporary directory mounted at the given path
|
|
205
208
|
*/
|
|
206
209
|
withMountedTemp(path: string): Container;
|
|
210
|
+
/**
|
|
211
|
+
* This container plus a new file written at the given path
|
|
212
|
+
*/
|
|
213
|
+
withNewFile(path: string, contents?: string): Container;
|
|
207
214
|
/**
|
|
208
215
|
* Initialize this container from this DirectoryID
|
|
209
216
|
*/
|
|
210
|
-
withRootfs(id: DirectoryID): Container;
|
|
217
|
+
withRootfs(id: DirectoryID | Directory): Container;
|
|
211
218
|
/**
|
|
212
219
|
* This container plus an env variable containing the given secret
|
|
213
220
|
*/
|
|
214
|
-
withSecretVariable(name: string, secret: SecretID): Container;
|
|
221
|
+
withSecretVariable(name: string, secret: SecretID | Secret): Container;
|
|
222
|
+
/**
|
|
223
|
+
* This container plus a socket forwarded to the given Unix socket path
|
|
224
|
+
*/
|
|
225
|
+
withUnixSocket(path: string, source: SocketID): Container;
|
|
215
226
|
/**
|
|
216
227
|
* This container but with a different command user
|
|
217
228
|
*/
|
|
@@ -228,10 +239,14 @@ export declare class Container extends BaseClient {
|
|
|
228
239
|
* This container after unmounting everything at the given path.
|
|
229
240
|
*/
|
|
230
241
|
withoutMount(path: string): Container;
|
|
242
|
+
/**
|
|
243
|
+
* This container with a previously added Unix socket removed
|
|
244
|
+
*/
|
|
245
|
+
withoutUnixSocket(path: string): Container;
|
|
231
246
|
/**
|
|
232
247
|
* The working directory for all commands
|
|
233
248
|
*/
|
|
234
|
-
workdir(): Promise<
|
|
249
|
+
workdir(): Promise<string>;
|
|
235
250
|
}
|
|
236
251
|
/**
|
|
237
252
|
* A directory
|
|
@@ -240,19 +255,23 @@ export declare class Directory extends BaseClient {
|
|
|
240
255
|
/**
|
|
241
256
|
* The difference between this directory and an another directory
|
|
242
257
|
*/
|
|
243
|
-
diff(other: DirectoryID): Directory;
|
|
258
|
+
diff(other: DirectoryID | Directory): Directory;
|
|
244
259
|
/**
|
|
245
260
|
* Retrieve a directory at the given path
|
|
246
261
|
*/
|
|
247
262
|
directory(path: string): Directory;
|
|
263
|
+
/**
|
|
264
|
+
* Build a new Docker container from this directory
|
|
265
|
+
*/
|
|
266
|
+
dockerBuild(dockerfile?: string, platform?: Platform): Container;
|
|
248
267
|
/**
|
|
249
268
|
* Return a list of files and directories at the given path
|
|
250
269
|
*/
|
|
251
|
-
entries(path?: string): Promise<
|
|
270
|
+
entries(path?: string): Promise<string[]>;
|
|
252
271
|
/**
|
|
253
272
|
* Write the contents of the directory to a path on the host
|
|
254
273
|
*/
|
|
255
|
-
export(path: string): Promise<
|
|
274
|
+
export(path: string): Promise<boolean>;
|
|
256
275
|
/**
|
|
257
276
|
* Retrieve a file at the given path
|
|
258
277
|
*/
|
|
@@ -260,7 +279,7 @@ export declare class Directory extends BaseClient {
|
|
|
260
279
|
/**
|
|
261
280
|
* The content-addressed identifier of the directory
|
|
262
281
|
*/
|
|
263
|
-
id(): Promise<
|
|
282
|
+
id(): Promise<DirectoryID>;
|
|
264
283
|
/**
|
|
265
284
|
* load a project's metadata
|
|
266
285
|
*/
|
|
@@ -268,11 +287,11 @@ export declare class Directory extends BaseClient {
|
|
|
268
287
|
/**
|
|
269
288
|
* This directory plus a directory written at the given path
|
|
270
289
|
*/
|
|
271
|
-
withDirectory(path: string, directory: DirectoryID, exclude?: string[], include?: string[]): Directory;
|
|
290
|
+
withDirectory(path: string, directory: DirectoryID | Directory, exclude?: string[], include?: string[]): Directory;
|
|
272
291
|
/**
|
|
273
292
|
* This directory plus the contents of the given file copied to the given path
|
|
274
293
|
*/
|
|
275
|
-
withFile(path: string, source: FileID): Directory;
|
|
294
|
+
withFile(path: string, source: FileID | File): Directory;
|
|
276
295
|
/**
|
|
277
296
|
* This directory plus a new directory created at the given path
|
|
278
297
|
*/
|
|
@@ -297,11 +316,11 @@ export declare class EnvVariable extends BaseClient {
|
|
|
297
316
|
/**
|
|
298
317
|
* name is the environment variable name.
|
|
299
318
|
*/
|
|
300
|
-
name(): Promise<
|
|
319
|
+
name(): Promise<string>;
|
|
301
320
|
/**
|
|
302
321
|
* value is the environment variable value
|
|
303
322
|
*/
|
|
304
|
-
value(): Promise<
|
|
323
|
+
value(): Promise<string>;
|
|
305
324
|
}
|
|
306
325
|
/**
|
|
307
326
|
* A file
|
|
@@ -310,20 +329,20 @@ export declare class File extends BaseClient {
|
|
|
310
329
|
/**
|
|
311
330
|
* The contents of the file
|
|
312
331
|
*/
|
|
313
|
-
contents(): Promise<
|
|
332
|
+
contents(): Promise<string>;
|
|
314
333
|
/**
|
|
315
334
|
* Write the file to a file path on the host
|
|
316
335
|
*/
|
|
317
|
-
export(path: string): Promise<
|
|
336
|
+
export(path: string): Promise<boolean>;
|
|
318
337
|
/**
|
|
319
338
|
* The content-addressed identifier of the file
|
|
320
339
|
*/
|
|
321
|
-
id(): Promise<
|
|
340
|
+
id(): Promise<FileID>;
|
|
322
341
|
secret(): Secret;
|
|
323
342
|
/**
|
|
324
343
|
* The size of the file, in bytes
|
|
325
344
|
*/
|
|
326
|
-
size(): Promise<
|
|
345
|
+
size(): Promise<number>;
|
|
327
346
|
}
|
|
328
347
|
/**
|
|
329
348
|
* A git ref (tag or branch)
|
|
@@ -332,11 +351,11 @@ export declare class GitRef extends BaseClient {
|
|
|
332
351
|
/**
|
|
333
352
|
* The digest of the current value of this ref
|
|
334
353
|
*/
|
|
335
|
-
digest(): Promise<
|
|
354
|
+
digest(): Promise<string>;
|
|
336
355
|
/**
|
|
337
356
|
* The filesystem tree at this ref
|
|
338
357
|
*/
|
|
339
|
-
tree(): Directory;
|
|
358
|
+
tree(sshKnownHosts?: string, sshAuthSocket?: SocketID): Directory;
|
|
340
359
|
}
|
|
341
360
|
/**
|
|
342
361
|
* A git repository
|
|
@@ -349,7 +368,7 @@ export declare class GitRepository extends BaseClient {
|
|
|
349
368
|
/**
|
|
350
369
|
* List of branches on the repository
|
|
351
370
|
*/
|
|
352
|
-
branches(): Promise<
|
|
371
|
+
branches(): Promise<string[]>;
|
|
353
372
|
/**
|
|
354
373
|
* Details on one commit
|
|
355
374
|
*/
|
|
@@ -361,7 +380,7 @@ export declare class GitRepository extends BaseClient {
|
|
|
361
380
|
/**
|
|
362
381
|
* List of tags on the repository
|
|
363
382
|
*/
|
|
364
|
-
tags(): Promise<
|
|
383
|
+
tags(): Promise<string[]>;
|
|
365
384
|
}
|
|
366
385
|
/**
|
|
367
386
|
* Information about the host execution environment
|
|
@@ -372,9 +391,13 @@ export declare class Host extends BaseClient {
|
|
|
372
391
|
*/
|
|
373
392
|
directory(path: string, exclude?: string[], include?: string[]): Directory;
|
|
374
393
|
/**
|
|
375
|
-
*
|
|
394
|
+
* Access an environment variable on the host
|
|
376
395
|
*/
|
|
377
396
|
envVariable(name: string): HostVariable;
|
|
397
|
+
/**
|
|
398
|
+
* Access a Unix socket on the host
|
|
399
|
+
*/
|
|
400
|
+
unixSocket(path: string): Socket;
|
|
378
401
|
/**
|
|
379
402
|
* The current working directory on the host
|
|
380
403
|
*
|
|
@@ -393,7 +416,7 @@ export declare class HostVariable extends BaseClient {
|
|
|
393
416
|
/**
|
|
394
417
|
* The value of this variable
|
|
395
418
|
*/
|
|
396
|
-
value(): Promise<
|
|
419
|
+
value(): Promise<string>;
|
|
397
420
|
}
|
|
398
421
|
/**
|
|
399
422
|
* A set of scripts and/or extensions
|
|
@@ -402,7 +425,7 @@ export declare class Project extends BaseClient {
|
|
|
402
425
|
/**
|
|
403
426
|
* extensions in this project
|
|
404
427
|
*/
|
|
405
|
-
extensions(): Promise<
|
|
428
|
+
extensions(): Promise<Project[]>;
|
|
406
429
|
/**
|
|
407
430
|
* Code files generated by the SDKs in the project
|
|
408
431
|
*/
|
|
@@ -410,19 +433,19 @@ export declare class Project extends BaseClient {
|
|
|
410
433
|
/**
|
|
411
434
|
* install the project's schema
|
|
412
435
|
*/
|
|
413
|
-
install(): Promise<
|
|
436
|
+
install(): Promise<boolean>;
|
|
414
437
|
/**
|
|
415
438
|
* name of the project
|
|
416
439
|
*/
|
|
417
|
-
name(): Promise<
|
|
440
|
+
name(): Promise<string>;
|
|
418
441
|
/**
|
|
419
442
|
* schema provided by the project
|
|
420
443
|
*/
|
|
421
|
-
schema(): Promise<
|
|
444
|
+
schema(): Promise<string>;
|
|
422
445
|
/**
|
|
423
446
|
* sdk used to generate code for and/or execute this project
|
|
424
447
|
*/
|
|
425
|
-
sdk(): Promise<
|
|
448
|
+
sdk(): Promise<string>;
|
|
426
449
|
}
|
|
427
450
|
export default class Client extends BaseClient {
|
|
428
451
|
/**
|
|
@@ -434,19 +457,19 @@ export default class Client extends BaseClient {
|
|
|
434
457
|
* Null ID returns an empty container (scratch).
|
|
435
458
|
* Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
|
|
436
459
|
*/
|
|
437
|
-
container(id?: ContainerID, platform?: Platform): Container;
|
|
460
|
+
container(id?: ContainerID | Container, platform?: Platform): Container;
|
|
438
461
|
/**
|
|
439
462
|
* The default platform of the builder.
|
|
440
463
|
*/
|
|
441
|
-
defaultPlatform(): Promise<
|
|
464
|
+
defaultPlatform(): Promise<Platform>;
|
|
442
465
|
/**
|
|
443
466
|
* Load a directory by ID. No argument produces an empty directory.
|
|
444
467
|
*/
|
|
445
|
-
directory(id?: DirectoryID): Directory;
|
|
468
|
+
directory(id?: DirectoryID | Directory): Directory;
|
|
446
469
|
/**
|
|
447
470
|
* Load a file by ID
|
|
448
471
|
*/
|
|
449
|
-
file(id: FileID): File;
|
|
472
|
+
file(id: FileID | File): File;
|
|
450
473
|
/**
|
|
451
474
|
* Query a git repository
|
|
452
475
|
*/
|
|
@@ -466,7 +489,11 @@ export default class Client extends BaseClient {
|
|
|
466
489
|
/**
|
|
467
490
|
* Load a secret from its ID
|
|
468
491
|
*/
|
|
469
|
-
secret(id: SecretID): Secret;
|
|
492
|
+
secret(id: SecretID | Secret): Secret;
|
|
493
|
+
/**
|
|
494
|
+
* Load a socket by ID
|
|
495
|
+
*/
|
|
496
|
+
socket(id?: SocketID): Socket;
|
|
470
497
|
}
|
|
471
498
|
/**
|
|
472
499
|
* A reference to a secret value, which can be handled more safely than the value itself
|
|
@@ -475,11 +502,17 @@ export declare class Secret extends BaseClient {
|
|
|
475
502
|
/**
|
|
476
503
|
* The identifier for this secret
|
|
477
504
|
*/
|
|
478
|
-
id(): Promise<
|
|
505
|
+
id(): Promise<SecretID>;
|
|
479
506
|
/**
|
|
480
507
|
* The value of this secret
|
|
481
508
|
*/
|
|
482
|
-
plaintext(): Promise<
|
|
509
|
+
plaintext(): Promise<string>;
|
|
510
|
+
}
|
|
511
|
+
export declare class Socket extends BaseClient {
|
|
512
|
+
/**
|
|
513
|
+
* The content-addressed identifier of the socket
|
|
514
|
+
*/
|
|
515
|
+
id(): Promise<SocketID>;
|
|
483
516
|
}
|
|
484
517
|
export {};
|
|
485
518
|
//# sourceMappingURL=client.gen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../api/client.gen.ts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;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM;IAarC;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM;CAY9B;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC;;OAEG;IACG,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC;IAgB7B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;CAenC;AAED,qBAAa,MAAO,SAAQ,UAAU;IACpC;;OAEG;IACG,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC;CAe9B"}
|
package/dist/api/client.gen.js
CHANGED
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
-
import { GraphQLClient
|
|
15
|
-
import { queryBuilder
|
|
14
|
+
import { GraphQLClient } from "graphql-request";
|
|
15
|
+
import { queryBuilder } from "./utils.js";
|
|
16
16
|
class BaseClient {
|
|
17
17
|
/**
|
|
18
18
|
* @hidden
|
|
@@ -28,25 +28,6 @@ class BaseClient {
|
|
|
28
28
|
get queryTree() {
|
|
29
29
|
return this._queryTree;
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
_compute() {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
try {
|
|
37
|
-
// run the query and return the result.
|
|
38
|
-
const query = queryBuilder(this._queryTree);
|
|
39
|
-
const computeQuery = yield this.client.request(gql `
|
|
40
|
-
${query}
|
|
41
|
-
`);
|
|
42
|
-
return queryFlatten(computeQuery);
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.error(JSON.stringify(error, undefined, 2));
|
|
46
|
-
return {};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
31
|
}
|
|
51
32
|
/**
|
|
52
33
|
* A directory whose contents persist across runs
|
|
@@ -60,7 +41,7 @@ export class CacheVolume extends BaseClient {
|
|
|
60
41
|
operation: "id",
|
|
61
42
|
},
|
|
62
43
|
];
|
|
63
|
-
const response = yield this.
|
|
44
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
64
45
|
return response;
|
|
65
46
|
});
|
|
66
47
|
}
|
|
@@ -95,7 +76,7 @@ export class Container extends BaseClient {
|
|
|
95
76
|
operation: "defaultArgs",
|
|
96
77
|
},
|
|
97
78
|
];
|
|
98
|
-
const response = yield this.
|
|
79
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
99
80
|
return response;
|
|
100
81
|
});
|
|
101
82
|
}
|
|
@@ -125,7 +106,7 @@ export class Container extends BaseClient {
|
|
|
125
106
|
operation: "entrypoint",
|
|
126
107
|
},
|
|
127
108
|
];
|
|
128
|
-
const response = yield this.
|
|
109
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
129
110
|
return response;
|
|
130
111
|
});
|
|
131
112
|
}
|
|
@@ -141,7 +122,7 @@ export class Container extends BaseClient {
|
|
|
141
122
|
args: { name },
|
|
142
123
|
},
|
|
143
124
|
];
|
|
144
|
-
const response = yield this.
|
|
125
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
145
126
|
return response;
|
|
146
127
|
});
|
|
147
128
|
}
|
|
@@ -156,7 +137,7 @@ export class Container extends BaseClient {
|
|
|
156
137
|
operation: "envVariables",
|
|
157
138
|
},
|
|
158
139
|
];
|
|
159
|
-
const response = yield this.
|
|
140
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
160
141
|
return response;
|
|
161
142
|
});
|
|
162
143
|
}
|
|
@@ -195,7 +176,7 @@ export class Container extends BaseClient {
|
|
|
195
176
|
operation: "exitCode",
|
|
196
177
|
},
|
|
197
178
|
];
|
|
198
|
-
const response = yield this.
|
|
179
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
199
180
|
return response;
|
|
200
181
|
});
|
|
201
182
|
}
|
|
@@ -211,7 +192,7 @@ export class Container extends BaseClient {
|
|
|
211
192
|
args: { path, platformVariants },
|
|
212
193
|
},
|
|
213
194
|
];
|
|
214
|
-
const response = yield this.
|
|
195
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
215
196
|
return response;
|
|
216
197
|
});
|
|
217
198
|
}
|
|
@@ -272,7 +253,7 @@ export class Container extends BaseClient {
|
|
|
272
253
|
operation: "id",
|
|
273
254
|
},
|
|
274
255
|
];
|
|
275
|
-
const response = yield this.
|
|
256
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
276
257
|
return response;
|
|
277
258
|
});
|
|
278
259
|
}
|
|
@@ -287,7 +268,7 @@ export class Container extends BaseClient {
|
|
|
287
268
|
operation: "mounts",
|
|
288
269
|
},
|
|
289
270
|
];
|
|
290
|
-
const response = yield this.
|
|
271
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
291
272
|
return response;
|
|
292
273
|
});
|
|
293
274
|
}
|
|
@@ -302,7 +283,7 @@ export class Container extends BaseClient {
|
|
|
302
283
|
operation: "platform",
|
|
303
284
|
},
|
|
304
285
|
];
|
|
305
|
-
const response = yield this.
|
|
286
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
306
287
|
return response;
|
|
307
288
|
});
|
|
308
289
|
}
|
|
@@ -318,7 +299,7 @@ export class Container extends BaseClient {
|
|
|
318
299
|
args: { address, platformVariants },
|
|
319
300
|
},
|
|
320
301
|
];
|
|
321
|
-
const response = yield this.
|
|
302
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
322
303
|
return response;
|
|
323
304
|
});
|
|
324
305
|
}
|
|
@@ -348,7 +329,7 @@ export class Container extends BaseClient {
|
|
|
348
329
|
operation: "stderr",
|
|
349
330
|
},
|
|
350
331
|
];
|
|
351
|
-
const response = yield this.
|
|
332
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
352
333
|
return response;
|
|
353
334
|
});
|
|
354
335
|
}
|
|
@@ -364,7 +345,7 @@ export class Container extends BaseClient {
|
|
|
364
345
|
operation: "stdout",
|
|
365
346
|
},
|
|
366
347
|
];
|
|
367
|
-
const response = yield this.
|
|
348
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
368
349
|
return response;
|
|
369
350
|
});
|
|
370
351
|
}
|
|
@@ -379,7 +360,7 @@ export class Container extends BaseClient {
|
|
|
379
360
|
operation: "user",
|
|
380
361
|
},
|
|
381
362
|
];
|
|
382
|
-
const response = yield this.
|
|
363
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
383
364
|
return response;
|
|
384
365
|
});
|
|
385
366
|
}
|
|
@@ -398,6 +379,21 @@ export class Container extends BaseClient {
|
|
|
398
379
|
host: this.clientHost,
|
|
399
380
|
});
|
|
400
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* This container plus a directory written at the given path
|
|
384
|
+
*/
|
|
385
|
+
withDirectory(path, directory, exclude, include) {
|
|
386
|
+
return new Container({
|
|
387
|
+
queryTree: [
|
|
388
|
+
...this._queryTree,
|
|
389
|
+
{
|
|
390
|
+
operation: "withDirectory",
|
|
391
|
+
args: { path, directory, exclude, include },
|
|
392
|
+
},
|
|
393
|
+
],
|
|
394
|
+
host: this.clientHost,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
401
397
|
/**
|
|
402
398
|
* This container but with a different command entrypoint
|
|
403
399
|
*/
|
|
@@ -466,6 +462,21 @@ export class Container extends BaseClient {
|
|
|
466
462
|
host: this.clientHost,
|
|
467
463
|
});
|
|
468
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* This container plus the contents of the given file copied to the given path
|
|
467
|
+
*/
|
|
468
|
+
withFile(path, source) {
|
|
469
|
+
return new Container({
|
|
470
|
+
queryTree: [
|
|
471
|
+
...this._queryTree,
|
|
472
|
+
{
|
|
473
|
+
operation: "withFile",
|
|
474
|
+
args: { path, source },
|
|
475
|
+
},
|
|
476
|
+
],
|
|
477
|
+
host: this.clientHost,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
469
480
|
/**
|
|
470
481
|
* This container plus a cache volume mounted at the given path
|
|
471
482
|
*/
|
|
@@ -541,6 +552,21 @@ export class Container extends BaseClient {
|
|
|
541
552
|
host: this.clientHost,
|
|
542
553
|
});
|
|
543
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* This container plus a new file written at the given path
|
|
557
|
+
*/
|
|
558
|
+
withNewFile(path, contents) {
|
|
559
|
+
return new Container({
|
|
560
|
+
queryTree: [
|
|
561
|
+
...this._queryTree,
|
|
562
|
+
{
|
|
563
|
+
operation: "withNewFile",
|
|
564
|
+
args: { path, contents },
|
|
565
|
+
},
|
|
566
|
+
],
|
|
567
|
+
host: this.clientHost,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
544
570
|
/**
|
|
545
571
|
* Initialize this container from this DirectoryID
|
|
546
572
|
*/
|
|
@@ -571,6 +597,21 @@ export class Container extends BaseClient {
|
|
|
571
597
|
host: this.clientHost,
|
|
572
598
|
});
|
|
573
599
|
}
|
|
600
|
+
/**
|
|
601
|
+
* This container plus a socket forwarded to the given Unix socket path
|
|
602
|
+
*/
|
|
603
|
+
withUnixSocket(path, source) {
|
|
604
|
+
return new Container({
|
|
605
|
+
queryTree: [
|
|
606
|
+
...this._queryTree,
|
|
607
|
+
{
|
|
608
|
+
operation: "withUnixSocket",
|
|
609
|
+
args: { path, source },
|
|
610
|
+
},
|
|
611
|
+
],
|
|
612
|
+
host: this.clientHost,
|
|
613
|
+
});
|
|
614
|
+
}
|
|
574
615
|
/**
|
|
575
616
|
* This container but with a different command user
|
|
576
617
|
*/
|
|
@@ -631,6 +672,21 @@ export class Container extends BaseClient {
|
|
|
631
672
|
host: this.clientHost,
|
|
632
673
|
});
|
|
633
674
|
}
|
|
675
|
+
/**
|
|
676
|
+
* This container with a previously added Unix socket removed
|
|
677
|
+
*/
|
|
678
|
+
withoutUnixSocket(path) {
|
|
679
|
+
return new Container({
|
|
680
|
+
queryTree: [
|
|
681
|
+
...this._queryTree,
|
|
682
|
+
{
|
|
683
|
+
operation: "withoutUnixSocket",
|
|
684
|
+
args: { path },
|
|
685
|
+
},
|
|
686
|
+
],
|
|
687
|
+
host: this.clientHost,
|
|
688
|
+
});
|
|
689
|
+
}
|
|
634
690
|
/**
|
|
635
691
|
* The working directory for all commands
|
|
636
692
|
*/
|
|
@@ -642,7 +698,7 @@ export class Container extends BaseClient {
|
|
|
642
698
|
operation: "workdir",
|
|
643
699
|
},
|
|
644
700
|
];
|
|
645
|
-
const response = yield this.
|
|
701
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
646
702
|
return response;
|
|
647
703
|
});
|
|
648
704
|
}
|
|
@@ -681,6 +737,21 @@ export class Directory extends BaseClient {
|
|
|
681
737
|
host: this.clientHost,
|
|
682
738
|
});
|
|
683
739
|
}
|
|
740
|
+
/**
|
|
741
|
+
* Build a new Docker container from this directory
|
|
742
|
+
*/
|
|
743
|
+
dockerBuild(dockerfile, platform) {
|
|
744
|
+
return new Container({
|
|
745
|
+
queryTree: [
|
|
746
|
+
...this._queryTree,
|
|
747
|
+
{
|
|
748
|
+
operation: "dockerBuild",
|
|
749
|
+
args: { dockerfile, platform },
|
|
750
|
+
},
|
|
751
|
+
],
|
|
752
|
+
host: this.clientHost,
|
|
753
|
+
});
|
|
754
|
+
}
|
|
684
755
|
/**
|
|
685
756
|
* Return a list of files and directories at the given path
|
|
686
757
|
*/
|
|
@@ -693,7 +764,7 @@ export class Directory extends BaseClient {
|
|
|
693
764
|
args: { path },
|
|
694
765
|
},
|
|
695
766
|
];
|
|
696
|
-
const response = yield this.
|
|
767
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
697
768
|
return response;
|
|
698
769
|
});
|
|
699
770
|
}
|
|
@@ -709,7 +780,7 @@ export class Directory extends BaseClient {
|
|
|
709
780
|
args: { path },
|
|
710
781
|
},
|
|
711
782
|
];
|
|
712
|
-
const response = yield this.
|
|
783
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
713
784
|
return response;
|
|
714
785
|
});
|
|
715
786
|
}
|
|
@@ -739,7 +810,7 @@ export class Directory extends BaseClient {
|
|
|
739
810
|
operation: "id",
|
|
740
811
|
},
|
|
741
812
|
];
|
|
742
|
-
const response = yield this.
|
|
813
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
743
814
|
return response;
|
|
744
815
|
});
|
|
745
816
|
}
|
|
@@ -864,7 +935,7 @@ export class EnvVariable extends BaseClient {
|
|
|
864
935
|
operation: "name",
|
|
865
936
|
},
|
|
866
937
|
];
|
|
867
|
-
const response = yield this.
|
|
938
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
868
939
|
return response;
|
|
869
940
|
});
|
|
870
941
|
}
|
|
@@ -879,7 +950,7 @@ export class EnvVariable extends BaseClient {
|
|
|
879
950
|
operation: "value",
|
|
880
951
|
},
|
|
881
952
|
];
|
|
882
|
-
const response = yield this.
|
|
953
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
883
954
|
return response;
|
|
884
955
|
});
|
|
885
956
|
}
|
|
@@ -899,7 +970,7 @@ export class File extends BaseClient {
|
|
|
899
970
|
operation: "contents",
|
|
900
971
|
},
|
|
901
972
|
];
|
|
902
|
-
const response = yield this.
|
|
973
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
903
974
|
return response;
|
|
904
975
|
});
|
|
905
976
|
}
|
|
@@ -915,7 +986,7 @@ export class File extends BaseClient {
|
|
|
915
986
|
args: { path },
|
|
916
987
|
},
|
|
917
988
|
];
|
|
918
|
-
const response = yield this.
|
|
989
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
919
990
|
return response;
|
|
920
991
|
});
|
|
921
992
|
}
|
|
@@ -930,7 +1001,7 @@ export class File extends BaseClient {
|
|
|
930
1001
|
operation: "id",
|
|
931
1002
|
},
|
|
932
1003
|
];
|
|
933
|
-
const response = yield this.
|
|
1004
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
934
1005
|
return response;
|
|
935
1006
|
});
|
|
936
1007
|
}
|
|
@@ -956,7 +1027,7 @@ export class File extends BaseClient {
|
|
|
956
1027
|
operation: "size",
|
|
957
1028
|
},
|
|
958
1029
|
];
|
|
959
|
-
const response = yield this.
|
|
1030
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
960
1031
|
return response;
|
|
961
1032
|
});
|
|
962
1033
|
}
|
|
@@ -976,19 +1047,20 @@ export class GitRef extends BaseClient {
|
|
|
976
1047
|
operation: "digest",
|
|
977
1048
|
},
|
|
978
1049
|
];
|
|
979
|
-
const response = yield this.
|
|
1050
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
980
1051
|
return response;
|
|
981
1052
|
});
|
|
982
1053
|
}
|
|
983
1054
|
/**
|
|
984
1055
|
* The filesystem tree at this ref
|
|
985
1056
|
*/
|
|
986
|
-
tree() {
|
|
1057
|
+
tree(sshKnownHosts, sshAuthSocket) {
|
|
987
1058
|
return new Directory({
|
|
988
1059
|
queryTree: [
|
|
989
1060
|
...this._queryTree,
|
|
990
1061
|
{
|
|
991
1062
|
operation: "tree",
|
|
1063
|
+
args: { sshKnownHosts, sshAuthSocket },
|
|
992
1064
|
},
|
|
993
1065
|
],
|
|
994
1066
|
host: this.clientHost,
|
|
@@ -1025,7 +1097,7 @@ export class GitRepository extends BaseClient {
|
|
|
1025
1097
|
operation: "branches",
|
|
1026
1098
|
},
|
|
1027
1099
|
];
|
|
1028
|
-
const response = yield this.
|
|
1100
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1029
1101
|
return response;
|
|
1030
1102
|
});
|
|
1031
1103
|
}
|
|
@@ -1070,7 +1142,7 @@ export class GitRepository extends BaseClient {
|
|
|
1070
1142
|
operation: "tags",
|
|
1071
1143
|
},
|
|
1072
1144
|
];
|
|
1073
|
-
const response = yield this.
|
|
1145
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1074
1146
|
return response;
|
|
1075
1147
|
});
|
|
1076
1148
|
}
|
|
@@ -1095,7 +1167,7 @@ export class Host extends BaseClient {
|
|
|
1095
1167
|
});
|
|
1096
1168
|
}
|
|
1097
1169
|
/**
|
|
1098
|
-
*
|
|
1170
|
+
* Access an environment variable on the host
|
|
1099
1171
|
*/
|
|
1100
1172
|
envVariable(name) {
|
|
1101
1173
|
return new HostVariable({
|
|
@@ -1109,6 +1181,21 @@ export class Host extends BaseClient {
|
|
|
1109
1181
|
host: this.clientHost,
|
|
1110
1182
|
});
|
|
1111
1183
|
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Access a Unix socket on the host
|
|
1186
|
+
*/
|
|
1187
|
+
unixSocket(path) {
|
|
1188
|
+
return new Socket({
|
|
1189
|
+
queryTree: [
|
|
1190
|
+
...this._queryTree,
|
|
1191
|
+
{
|
|
1192
|
+
operation: "unixSocket",
|
|
1193
|
+
args: { path },
|
|
1194
|
+
},
|
|
1195
|
+
],
|
|
1196
|
+
host: this.clientHost,
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1112
1199
|
/**
|
|
1113
1200
|
* The current working directory on the host
|
|
1114
1201
|
*
|
|
@@ -1156,7 +1243,7 @@ export class HostVariable extends BaseClient {
|
|
|
1156
1243
|
operation: "value",
|
|
1157
1244
|
},
|
|
1158
1245
|
];
|
|
1159
|
-
const response = yield this.
|
|
1246
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1160
1247
|
return response;
|
|
1161
1248
|
});
|
|
1162
1249
|
}
|
|
@@ -1176,7 +1263,7 @@ export class Project extends BaseClient {
|
|
|
1176
1263
|
operation: "extensions",
|
|
1177
1264
|
},
|
|
1178
1265
|
];
|
|
1179
|
-
const response = yield this.
|
|
1266
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1180
1267
|
return response;
|
|
1181
1268
|
});
|
|
1182
1269
|
}
|
|
@@ -1205,7 +1292,7 @@ export class Project extends BaseClient {
|
|
|
1205
1292
|
operation: "install",
|
|
1206
1293
|
},
|
|
1207
1294
|
];
|
|
1208
|
-
const response = yield this.
|
|
1295
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1209
1296
|
return response;
|
|
1210
1297
|
});
|
|
1211
1298
|
}
|
|
@@ -1220,7 +1307,7 @@ export class Project extends BaseClient {
|
|
|
1220
1307
|
operation: "name",
|
|
1221
1308
|
},
|
|
1222
1309
|
];
|
|
1223
|
-
const response = yield this.
|
|
1310
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1224
1311
|
return response;
|
|
1225
1312
|
});
|
|
1226
1313
|
}
|
|
@@ -1235,7 +1322,7 @@ export class Project extends BaseClient {
|
|
|
1235
1322
|
operation: "schema",
|
|
1236
1323
|
},
|
|
1237
1324
|
];
|
|
1238
|
-
const response = yield this.
|
|
1325
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1239
1326
|
return response;
|
|
1240
1327
|
});
|
|
1241
1328
|
}
|
|
@@ -1250,7 +1337,7 @@ export class Project extends BaseClient {
|
|
|
1250
1337
|
operation: "sdk",
|
|
1251
1338
|
},
|
|
1252
1339
|
];
|
|
1253
|
-
const response = yield this.
|
|
1340
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1254
1341
|
return response;
|
|
1255
1342
|
});
|
|
1256
1343
|
}
|
|
@@ -1299,7 +1386,7 @@ export default class Client extends BaseClient {
|
|
|
1299
1386
|
operation: "defaultPlatform",
|
|
1300
1387
|
},
|
|
1301
1388
|
];
|
|
1302
|
-
const response = yield this.
|
|
1389
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1303
1390
|
return response;
|
|
1304
1391
|
});
|
|
1305
1392
|
}
|
|
@@ -1407,6 +1494,21 @@ export default class Client extends BaseClient {
|
|
|
1407
1494
|
host: this.clientHost,
|
|
1408
1495
|
});
|
|
1409
1496
|
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Load a socket by ID
|
|
1499
|
+
*/
|
|
1500
|
+
socket(id) {
|
|
1501
|
+
return new Socket({
|
|
1502
|
+
queryTree: [
|
|
1503
|
+
...this._queryTree,
|
|
1504
|
+
{
|
|
1505
|
+
operation: "socket",
|
|
1506
|
+
args: { id },
|
|
1507
|
+
},
|
|
1508
|
+
],
|
|
1509
|
+
host: this.clientHost,
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1410
1512
|
}
|
|
1411
1513
|
/**
|
|
1412
1514
|
* A reference to a secret value, which can be handled more safely than the value itself
|
|
@@ -1423,7 +1525,7 @@ export class Secret extends BaseClient {
|
|
|
1423
1525
|
operation: "id",
|
|
1424
1526
|
},
|
|
1425
1527
|
];
|
|
1426
|
-
const response = yield this.
|
|
1528
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1427
1529
|
return response;
|
|
1428
1530
|
});
|
|
1429
1531
|
}
|
|
@@ -1438,7 +1540,24 @@ export class Secret extends BaseClient {
|
|
|
1438
1540
|
operation: "plaintext",
|
|
1439
1541
|
},
|
|
1440
1542
|
];
|
|
1441
|
-
const response = yield this.
|
|
1543
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1544
|
+
return response;
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
export class Socket extends BaseClient {
|
|
1549
|
+
/**
|
|
1550
|
+
* The content-addressed identifier of the socket
|
|
1551
|
+
*/
|
|
1552
|
+
id() {
|
|
1553
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1554
|
+
this._queryTree = [
|
|
1555
|
+
...this._queryTree,
|
|
1556
|
+
{
|
|
1557
|
+
operation: "id",
|
|
1558
|
+
},
|
|
1559
|
+
];
|
|
1560
|
+
const response = yield queryBuilder(this._queryTree, this.client);
|
|
1442
1561
|
return response;
|
|
1443
1562
|
});
|
|
1444
1563
|
}
|
package/dist/api/utils.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
import { GraphQLClient } from "graphql-request";
|
|
1
2
|
import { QueryTree } from "./client.gen.js";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Convert the queryTree into a GraphQL query
|
|
5
|
+
* @param q
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildQuery(q: QueryTree[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Convert querytree into a Graphql query then compute it
|
|
11
|
+
* @param q | QueryTree[]
|
|
12
|
+
* @param client | GraphQLClient
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function queryBuilder<T>(q: QueryTree[], client: GraphQLClient): Promise<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Return a Graphql query result flattened
|
|
18
|
+
* @param response any
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function queryFlatten<T>(response: any): T;
|
|
22
|
+
/**
|
|
23
|
+
* Send a GraphQL document to the server
|
|
24
|
+
* return a flatten result
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
export declare function compute<T>(query: string, client: GraphQLClient): Promise<T>;
|
|
4
28
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/api/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../api/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../api/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAkD3C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,MAAM,CAYjD;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,CAAC,EAAE,SAAS,EAAE,EACd,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC,CAQZ;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,CAmBhD;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC,CAQZ"}
|
package/dist/api/utils.js
CHANGED
|
@@ -1,40 +1,112 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
|
+
import { gql } from "graphql-request";
|
|
12
|
+
function buildArgs(item) {
|
|
13
|
+
const entries = Object.entries(item.args)
|
|
14
|
+
.filter((value) => value[1] !== undefined)
|
|
15
|
+
.map((value) => {
|
|
16
|
+
return `${value[0]}: ${JSON.stringify(value[1]).replace(/\{"[a-zA-Z]+"/gi, (str) => str.replace(/"/g, ""))}`;
|
|
17
|
+
});
|
|
18
|
+
if (entries.length === 0) {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
return "(" + entries + ")";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Find querytree, convert them into GraphQl query
|
|
25
|
+
* then compute and return the result to the appropriate field
|
|
26
|
+
*/
|
|
27
|
+
function computeNestedQuery(query, client) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
/**
|
|
30
|
+
* Check if there is a nested queryTree to be executed
|
|
31
|
+
*/
|
|
32
|
+
const isQueryTree = (value) => Object.keys(value).find((val) => val === "_queryTree");
|
|
33
|
+
for (const q of query) {
|
|
34
|
+
if (q.args !== undefined) {
|
|
35
|
+
yield Promise.all(Object.entries(q.args).map((val) => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
if (val[1] instanceof Object && isQueryTree(val[1])) {
|
|
37
|
+
// push an id that will be used by the container
|
|
38
|
+
val[1]["_queryTree"].push({ operation: "id" });
|
|
39
|
+
const getQueryTree = buildQuery(val[1]["_queryTree"]);
|
|
40
|
+
const result = yield compute(getQueryTree, client);
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
42
|
+
//@ts-ignore
|
|
43
|
+
q.args[val[0]] = result;
|
|
44
|
+
}
|
|
45
|
+
})));
|
|
12
46
|
}
|
|
13
|
-
return `${value[0]}: "${value[1]}"`;
|
|
14
|
-
});
|
|
15
|
-
if (entries.length === 0) {
|
|
16
|
-
return "";
|
|
17
47
|
}
|
|
18
|
-
|
|
19
|
-
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Convert the queryTree into a GraphQL query
|
|
52
|
+
* @param q
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
export function buildQuery(q) {
|
|
20
56
|
let query = "{";
|
|
21
57
|
q.forEach((item, index) => {
|
|
22
58
|
query += `
|
|
23
|
-
${item.operation} ${item.args ? `${
|
|
59
|
+
${item.operation} ${item.args ? `${buildArgs(item)}` : ""} ${q.length - 1 !== index ? "{" : "}".repeat(q.length - 1)}
|
|
24
60
|
`;
|
|
25
61
|
});
|
|
26
62
|
query += "}";
|
|
27
|
-
return query
|
|
63
|
+
return query;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Convert querytree into a Graphql query then compute it
|
|
67
|
+
* @param q | QueryTree[]
|
|
68
|
+
* @param client | GraphQLClient
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
export function queryBuilder(q, client) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
yield computeNestedQuery(q, client);
|
|
74
|
+
const query = buildQuery(q);
|
|
75
|
+
const result = yield compute(query, client);
|
|
76
|
+
return result;
|
|
77
|
+
});
|
|
28
78
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
79
|
+
/**
|
|
80
|
+
* Return a Graphql query result flattened
|
|
81
|
+
* @param response any
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
export function queryFlatten(response) {
|
|
85
|
+
// Recursion break condition
|
|
86
|
+
// If our response is not an object or an array we assume we reached the value
|
|
87
|
+
if (!(response instanceof Object) || Array.isArray(response)) {
|
|
88
|
+
return response;
|
|
89
|
+
}
|
|
90
|
+
const keys = Object.keys(response);
|
|
91
|
+
if (keys.length != 1) {
|
|
92
|
+
// Dagger is currently expecting to only return one value
|
|
93
|
+
// If the response is nested in a way were more than one object is nested inside throw an error
|
|
94
|
+
// TODO Throw sensible Error
|
|
95
|
+
throw new Error("Too many Graphql nested objects");
|
|
96
|
+
}
|
|
97
|
+
const nestedKey = keys[0];
|
|
98
|
+
return queryFlatten(response[nestedKey]);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Send a GraphQL document to the server
|
|
102
|
+
* return a flatten result
|
|
103
|
+
* @hidden
|
|
104
|
+
*/
|
|
105
|
+
export function compute(query, client) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const computeQuery = yield client.request(gql `
|
|
108
|
+
${query}
|
|
109
|
+
`);
|
|
110
|
+
return queryFlatten(computeQuery);
|
|
111
|
+
});
|
|
40
112
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Code generated by dagger. DO NOT EDIT.
|
|
2
|
-
const DEFAULT_IMAGE_REF = "ghcr.io/dagger/engine:v0.3.
|
|
2
|
+
const DEFAULT_IMAGE_REF = "ghcr.io/dagger/engine:v0.3.7@sha256:9ad18aca71b1b1bae137d3ac5b8d1c62bd548d4f3b01c42b48120fdbc1490f22";
|
|
3
3
|
export const DEFAULT_HOST = `docker-image://${DEFAULT_IMAGE_REF}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dagger.io/dagger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"author": "hello@dagger.io",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@lifeomic/axios-fetch": "^3.0.1",
|
|
20
|
-
"axios": "^1.
|
|
20
|
+
"axios": "^1.2.0",
|
|
21
21
|
"execa": "^6.1.0",
|
|
22
22
|
"graphql": "^16.5.0",
|
|
23
23
|
"graphql-request": "^5.0.0",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/mocha": "latest",
|
|
36
36
|
"@types/node": "~16",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
38
|
-
"@typescript-eslint/parser": "^5.
|
|
39
|
-
"eslint": "^8.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
39
|
+
"eslint": "^8.28.0",
|
|
40
40
|
"eslint-config-prettier": "^8.5.0",
|
|
41
41
|
"eslint-plugin-prettier": "^4.2.1",
|
|
42
42
|
"mocha": "^10.1.0",
|
|
43
|
-
"prettier": "^2.
|
|
43
|
+
"prettier": "^2.8.0",
|
|
44
44
|
"ts-node": "^10.9.1",
|
|
45
45
|
"typedoc": "^0.23.21",
|
|
46
46
|
"typedoc-plugin-markdown": "^3.13.6",
|