@dagger.io/dagger 0.1.1 → 0.2.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.
@@ -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
- private client;
19
+ protected client: GraphQLClient;
19
20
  /**
20
21
  * @defaultValue `127.0.0.1:8080`
21
22
  */
@@ -28,10 +29,6 @@ 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
@@ -65,11 +62,16 @@ export type Platform = string;
65
62
  * @hidden
66
63
  */
67
64
  export type SecretID = string;
65
+ /**
66
+ * A content-addressed socket identifier
67
+ * @hidden
68
+ */
69
+ export type SocketID = string;
68
70
  /**
69
71
  * A directory whose contents persist across runs
70
72
  */
71
73
  export declare class CacheVolume extends BaseClient {
72
- id(): Promise<Record<string, CacheID>>;
74
+ id(): Promise<CacheID>;
73
75
  }
74
76
  /**
75
77
  * An OCI-compatible container, also known as a docker container
@@ -78,11 +80,11 @@ export declare class Container extends BaseClient {
78
80
  /**
79
81
  * Initialize this container from a Dockerfile build
80
82
  */
81
- build(context: DirectoryID, dockerfile?: string): Container;
83
+ build(context: DirectoryID | Directory, dockerfile?: string): Container;
82
84
  /**
83
85
  * Default arguments for future commands
84
86
  */
85
- defaultArgs(): Promise<Record<string, string[]>>;
87
+ defaultArgs(): Promise<string[]>;
86
88
  /**
87
89
  * Retrieve a directory at the given path. Mounts are included.
88
90
  */
@@ -90,15 +92,15 @@ export declare class Container extends BaseClient {
90
92
  /**
91
93
  * Entrypoint to be prepended to the arguments of all commands
92
94
  */
93
- entrypoint(): Promise<Record<string, string[]>>;
95
+ entrypoint(): Promise<string[]>;
94
96
  /**
95
97
  * The value of the specified environment variable
96
98
  */
97
- envVariable(name: string): Promise<Record<string, string>>;
99
+ envVariable(name: string): Promise<string>;
98
100
  /**
99
101
  * A list of environment variables passed to commands
100
102
  */
101
- envVariables(): Promise<Record<string, EnvVariable[]>>;
103
+ envVariables(): Promise<EnvVariable[]>;
102
104
  /**
103
105
  * This container after executing the specified command inside it
104
106
  *
@@ -109,11 +111,11 @@ export declare class Container extends BaseClient {
109
111
  * Exit code of the last executed command. Zero means success.
110
112
  * Null if no command has been executed.
111
113
  */
112
- exitCode(): Promise<Record<string, number>>;
114
+ exitCode(): Promise<number>;
113
115
  /**
114
116
  * Write the container as an OCI tarball to the destination file path on the host
115
117
  */
116
- export(path: string, platformVariants?: ContainerID[]): Promise<Record<string, boolean>>;
118
+ export(path: string, platformVariants?: ContainerID[] | Container[]): Promise<boolean>;
117
119
  /**
118
120
  * Retrieve a file at the given path. Mounts are included.
119
121
  */
@@ -131,19 +133,19 @@ export declare class Container extends BaseClient {
131
133
  /**
132
134
  * A unique identifier for this container
133
135
  */
134
- id(): Promise<Record<string, ContainerID>>;
136
+ id(): Promise<ContainerID>;
135
137
  /**
136
138
  * List of paths where a directory is mounted
137
139
  */
138
- mounts(): Promise<Record<string, string[]>>;
140
+ mounts(): Promise<string[]>;
139
141
  /**
140
142
  * The platform this container executes and publishes as
141
143
  */
142
- platform(): Promise<Record<string, Platform>>;
144
+ platform(): Promise<Platform>;
143
145
  /**
144
146
  * Publish this container as a new image, returning a fully qualified ref
145
147
  */
146
- publish(address: string, platformVariants?: ContainerID[]): Promise<Record<string, string>>;
148
+ publish(address: string, platformVariants?: ContainerID[] | Container[]): Promise<string>;
147
149
  /**
148
150
  * This container's root filesystem. Mounts are not included.
149
151
  */
@@ -152,16 +154,16 @@ export declare class Container extends BaseClient {
152
154
  * The error stream of the last executed command.
153
155
  * Null if no command has been executed.
154
156
  */
155
- stderr(): Promise<Record<string, string>>;
157
+ stderr(): Promise<string>;
156
158
  /**
157
159
  * The output stream of the last executed command.
158
160
  * Null if no command has been executed.
159
161
  */
160
- stdout(): Promise<Record<string, string>>;
162
+ stdout(): Promise<string>;
161
163
  /**
162
164
  * The user to be set for all commands
163
165
  */
164
- user(): Promise<Record<string, string>>;
166
+ user(): Promise<string>;
165
167
  /**
166
168
  * Configures default arguments for future commands
167
169
  */
@@ -183,23 +185,23 @@ export declare class Container extends BaseClient {
183
185
  *
184
186
  * @deprecated Replaced by withRootfs.
185
187
  */
186
- withFS(id: DirectoryID): Container;
188
+ withFS(id: DirectoryID | Directory): Container;
187
189
  /**
188
190
  * This container plus a cache volume mounted at the given path
189
191
  */
190
- withMountedCache(path: string, cache: CacheID, source?: DirectoryID): Container;
192
+ withMountedCache(path: string, cache: CacheID | CacheVolume, source?: DirectoryID | Directory): Container;
191
193
  /**
192
194
  * This container plus a directory mounted at the given path
193
195
  */
194
- withMountedDirectory(path: string, source: DirectoryID): Container;
196
+ withMountedDirectory(path: string, source: DirectoryID | Directory): Container;
195
197
  /**
196
198
  * This container plus a file mounted at the given path
197
199
  */
198
- withMountedFile(path: string, source: FileID): Container;
200
+ withMountedFile(path: string, source: FileID | File): Container;
199
201
  /**
200
202
  * This container plus a secret mounted into a file at the given path
201
203
  */
202
- withMountedSecret(path: string, source: SecretID): Container;
204
+ withMountedSecret(path: string, source: SecretID | Secret): Container;
203
205
  /**
204
206
  * This container plus a temporary directory mounted at the given path
205
207
  */
@@ -207,11 +209,15 @@ export declare class Container extends BaseClient {
207
209
  /**
208
210
  * Initialize this container from this DirectoryID
209
211
  */
210
- withRootfs(id: DirectoryID): Container;
212
+ withRootfs(id: DirectoryID | Directory): Container;
211
213
  /**
212
214
  * This container plus an env variable containing the given secret
213
215
  */
214
- withSecretVariable(name: string, secret: SecretID): Container;
216
+ withSecretVariable(name: string, secret: SecretID | Secret): Container;
217
+ /**
218
+ * This container plus a socket forwarded to the given Unix socket path
219
+ */
220
+ withUnixSocket(path: string, source: SocketID): Container;
215
221
  /**
216
222
  * This container but with a different command user
217
223
  */
@@ -228,10 +234,14 @@ export declare class Container extends BaseClient {
228
234
  * This container after unmounting everything at the given path.
229
235
  */
230
236
  withoutMount(path: string): Container;
237
+ /**
238
+ * This container with a previously added Unix socket removed
239
+ */
240
+ withoutUnixSocket(path: string): Container;
231
241
  /**
232
242
  * The working directory for all commands
233
243
  */
234
- workdir(): Promise<Record<string, string>>;
244
+ workdir(): Promise<string>;
235
245
  }
236
246
  /**
237
247
  * A directory
@@ -240,19 +250,23 @@ export declare class Directory extends BaseClient {
240
250
  /**
241
251
  * The difference between this directory and an another directory
242
252
  */
243
- diff(other: DirectoryID): Directory;
253
+ diff(other: DirectoryID | Directory): Directory;
244
254
  /**
245
255
  * Retrieve a directory at the given path
246
256
  */
247
257
  directory(path: string): Directory;
258
+ /**
259
+ * Build a new Docker container from this directory
260
+ */
261
+ dockerBuild(dockerfile?: string, platform?: Platform): Container;
248
262
  /**
249
263
  * Return a list of files and directories at the given path
250
264
  */
251
- entries(path?: string): Promise<Record<string, string[]>>;
265
+ entries(path?: string): Promise<string[]>;
252
266
  /**
253
267
  * Write the contents of the directory to a path on the host
254
268
  */
255
- export(path: string): Promise<Record<string, boolean>>;
269
+ export(path: string): Promise<boolean>;
256
270
  /**
257
271
  * Retrieve a file at the given path
258
272
  */
@@ -260,7 +274,7 @@ export declare class Directory extends BaseClient {
260
274
  /**
261
275
  * The content-addressed identifier of the directory
262
276
  */
263
- id(): Promise<Record<string, DirectoryID>>;
277
+ id(): Promise<DirectoryID>;
264
278
  /**
265
279
  * load a project's metadata
266
280
  */
@@ -268,11 +282,11 @@ export declare class Directory extends BaseClient {
268
282
  /**
269
283
  * This directory plus a directory written at the given path
270
284
  */
271
- withDirectory(path: string, directory: DirectoryID, exclude?: string[], include?: string[]): Directory;
285
+ withDirectory(path: string, directory: DirectoryID | Directory, exclude?: string[], include?: string[]): Directory;
272
286
  /**
273
287
  * This directory plus the contents of the given file copied to the given path
274
288
  */
275
- withFile(path: string, source: FileID): Directory;
289
+ withFile(path: string, source: FileID | File): Directory;
276
290
  /**
277
291
  * This directory plus a new directory created at the given path
278
292
  */
@@ -297,11 +311,11 @@ export declare class EnvVariable extends BaseClient {
297
311
  /**
298
312
  * name is the environment variable name.
299
313
  */
300
- name(): Promise<Record<string, string>>;
314
+ name(): Promise<string>;
301
315
  /**
302
316
  * value is the environment variable value
303
317
  */
304
- value(): Promise<Record<string, string>>;
318
+ value(): Promise<string>;
305
319
  }
306
320
  /**
307
321
  * A file
@@ -310,20 +324,20 @@ export declare class File extends BaseClient {
310
324
  /**
311
325
  * The contents of the file
312
326
  */
313
- contents(): Promise<Record<string, string>>;
327
+ contents(): Promise<string>;
314
328
  /**
315
329
  * Write the file to a file path on the host
316
330
  */
317
- export(path: string): Promise<Record<string, boolean>>;
331
+ export(path: string): Promise<boolean>;
318
332
  /**
319
333
  * The content-addressed identifier of the file
320
334
  */
321
- id(): Promise<Record<string, FileID>>;
335
+ id(): Promise<FileID>;
322
336
  secret(): Secret;
323
337
  /**
324
338
  * The size of the file, in bytes
325
339
  */
326
- size(): Promise<Record<string, number>>;
340
+ size(): Promise<number>;
327
341
  }
328
342
  /**
329
343
  * A git ref (tag or branch)
@@ -332,11 +346,11 @@ export declare class GitRef extends BaseClient {
332
346
  /**
333
347
  * The digest of the current value of this ref
334
348
  */
335
- digest(): Promise<Record<string, string>>;
349
+ digest(): Promise<string>;
336
350
  /**
337
351
  * The filesystem tree at this ref
338
352
  */
339
- tree(): Directory;
353
+ tree(sshKnownHosts?: string, sshAuthSocket?: SocketID): Directory;
340
354
  }
341
355
  /**
342
356
  * A git repository
@@ -349,7 +363,7 @@ export declare class GitRepository extends BaseClient {
349
363
  /**
350
364
  * List of branches on the repository
351
365
  */
352
- branches(): Promise<Record<string, string[]>>;
366
+ branches(): Promise<string[]>;
353
367
  /**
354
368
  * Details on one commit
355
369
  */
@@ -361,7 +375,7 @@ export declare class GitRepository extends BaseClient {
361
375
  /**
362
376
  * List of tags on the repository
363
377
  */
364
- tags(): Promise<Record<string, string[]>>;
378
+ tags(): Promise<string[]>;
365
379
  }
366
380
  /**
367
381
  * Information about the host execution environment
@@ -372,9 +386,13 @@ export declare class Host extends BaseClient {
372
386
  */
373
387
  directory(path: string, exclude?: string[], include?: string[]): Directory;
374
388
  /**
375
- * Lookup the value of an environment variable. Null if the variable is not available.
389
+ * Access an environment variable on the host
376
390
  */
377
391
  envVariable(name: string): HostVariable;
392
+ /**
393
+ * Access a Unix socket on the host
394
+ */
395
+ unixSocket(path: string): Socket;
378
396
  /**
379
397
  * The current working directory on the host
380
398
  *
@@ -393,7 +411,7 @@ export declare class HostVariable extends BaseClient {
393
411
  /**
394
412
  * The value of this variable
395
413
  */
396
- value(): Promise<Record<string, string>>;
414
+ value(): Promise<string>;
397
415
  }
398
416
  /**
399
417
  * A set of scripts and/or extensions
@@ -402,7 +420,7 @@ export declare class Project extends BaseClient {
402
420
  /**
403
421
  * extensions in this project
404
422
  */
405
- extensions(): Promise<Record<string, Project[]>>;
423
+ extensions(): Promise<Project[]>;
406
424
  /**
407
425
  * Code files generated by the SDKs in the project
408
426
  */
@@ -410,19 +428,19 @@ export declare class Project extends BaseClient {
410
428
  /**
411
429
  * install the project's schema
412
430
  */
413
- install(): Promise<Record<string, boolean>>;
431
+ install(): Promise<boolean>;
414
432
  /**
415
433
  * name of the project
416
434
  */
417
- name(): Promise<Record<string, string>>;
435
+ name(): Promise<string>;
418
436
  /**
419
437
  * schema provided by the project
420
438
  */
421
- schema(): Promise<Record<string, string>>;
439
+ schema(): Promise<string>;
422
440
  /**
423
441
  * sdk used to generate code for and/or execute this project
424
442
  */
425
- sdk(): Promise<Record<string, string>>;
443
+ sdk(): Promise<string>;
426
444
  }
427
445
  export default class Client extends BaseClient {
428
446
  /**
@@ -434,19 +452,19 @@ export default class Client extends BaseClient {
434
452
  * Null ID returns an empty container (scratch).
435
453
  * Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
436
454
  */
437
- container(id?: ContainerID, platform?: Platform): Container;
455
+ container(id?: ContainerID | Container, platform?: Platform): Container;
438
456
  /**
439
457
  * The default platform of the builder.
440
458
  */
441
- defaultPlatform(): Promise<Record<string, Platform>>;
459
+ defaultPlatform(): Promise<Platform>;
442
460
  /**
443
461
  * Load a directory by ID. No argument produces an empty directory.
444
462
  */
445
- directory(id?: DirectoryID): Directory;
463
+ directory(id?: DirectoryID | Directory): Directory;
446
464
  /**
447
465
  * Load a file by ID
448
466
  */
449
- file(id: FileID): File;
467
+ file(id: FileID | File): File;
450
468
  /**
451
469
  * Query a git repository
452
470
  */
@@ -466,7 +484,11 @@ export default class Client extends BaseClient {
466
484
  /**
467
485
  * Load a secret from its ID
468
486
  */
469
- secret(id: SecretID): Secret;
487
+ secret(id: SecretID | Secret): Secret;
488
+ /**
489
+ * Load a socket by ID
490
+ */
491
+ socket(id?: SocketID): Socket;
470
492
  }
471
493
  /**
472
494
  * A reference to a secret value, which can be handled more safely than the value itself
@@ -475,11 +497,17 @@ export declare class Secret extends BaseClient {
475
497
  /**
476
498
  * The identifier for this secret
477
499
  */
478
- id(): Promise<Record<string, SecretID>>;
500
+ id(): Promise<SecretID>;
479
501
  /**
480
502
  * The value of this secret
481
503
  */
482
- plaintext(): Promise<Record<string, string>>;
504
+ plaintext(): Promise<string>;
505
+ }
506
+ export declare class Socket extends BaseClient {
507
+ /**
508
+ * The content-addressed identifier of the socket
509
+ */
510
+ id(): Promise<SocketID>;
483
511
  }
484
512
  export {};
485
513
  //# sourceMappingURL=client.gen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.gen.d.ts","sourceRoot":"","sources":["../../api/client.gen.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI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C;CAenC;AAED,qBAAa,MAAO,SAAQ,UAAU;IACpC;;OAEG;IACG,EAAE,IAAI,OAAO,CAAC,QAAQ,CAAC;CAe9B"}
@@ -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, gql } from "graphql-request";
15
- import { queryBuilder, queryFlatten } from "./utils.js";
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
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._compute();
363
+ const response = yield queryBuilder(this._queryTree, this.client);
383
364
  return response;
384
365
  });
385
366
  }
@@ -571,6 +552,21 @@ export class Container extends BaseClient {
571
552
  host: this.clientHost,
572
553
  });
573
554
  }
555
+ /**
556
+ * This container plus a socket forwarded to the given Unix socket path
557
+ */
558
+ withUnixSocket(path, source) {
559
+ return new Container({
560
+ queryTree: [
561
+ ...this._queryTree,
562
+ {
563
+ operation: "withUnixSocket",
564
+ args: { path, source },
565
+ },
566
+ ],
567
+ host: this.clientHost,
568
+ });
569
+ }
574
570
  /**
575
571
  * This container but with a different command user
576
572
  */
@@ -631,6 +627,21 @@ export class Container extends BaseClient {
631
627
  host: this.clientHost,
632
628
  });
633
629
  }
630
+ /**
631
+ * This container with a previously added Unix socket removed
632
+ */
633
+ withoutUnixSocket(path) {
634
+ return new Container({
635
+ queryTree: [
636
+ ...this._queryTree,
637
+ {
638
+ operation: "withoutUnixSocket",
639
+ args: { path },
640
+ },
641
+ ],
642
+ host: this.clientHost,
643
+ });
644
+ }
634
645
  /**
635
646
  * The working directory for all commands
636
647
  */
@@ -642,7 +653,7 @@ export class Container extends BaseClient {
642
653
  operation: "workdir",
643
654
  },
644
655
  ];
645
- const response = yield this._compute();
656
+ const response = yield queryBuilder(this._queryTree, this.client);
646
657
  return response;
647
658
  });
648
659
  }
@@ -681,6 +692,21 @@ export class Directory extends BaseClient {
681
692
  host: this.clientHost,
682
693
  });
683
694
  }
695
+ /**
696
+ * Build a new Docker container from this directory
697
+ */
698
+ dockerBuild(dockerfile, platform) {
699
+ return new Container({
700
+ queryTree: [
701
+ ...this._queryTree,
702
+ {
703
+ operation: "dockerBuild",
704
+ args: { dockerfile, platform },
705
+ },
706
+ ],
707
+ host: this.clientHost,
708
+ });
709
+ }
684
710
  /**
685
711
  * Return a list of files and directories at the given path
686
712
  */
@@ -693,7 +719,7 @@ export class Directory extends BaseClient {
693
719
  args: { path },
694
720
  },
695
721
  ];
696
- const response = yield this._compute();
722
+ const response = yield queryBuilder(this._queryTree, this.client);
697
723
  return response;
698
724
  });
699
725
  }
@@ -709,7 +735,7 @@ export class Directory extends BaseClient {
709
735
  args: { path },
710
736
  },
711
737
  ];
712
- const response = yield this._compute();
738
+ const response = yield queryBuilder(this._queryTree, this.client);
713
739
  return response;
714
740
  });
715
741
  }
@@ -739,7 +765,7 @@ export class Directory extends BaseClient {
739
765
  operation: "id",
740
766
  },
741
767
  ];
742
- const response = yield this._compute();
768
+ const response = yield queryBuilder(this._queryTree, this.client);
743
769
  return response;
744
770
  });
745
771
  }
@@ -864,7 +890,7 @@ export class EnvVariable extends BaseClient {
864
890
  operation: "name",
865
891
  },
866
892
  ];
867
- const response = yield this._compute();
893
+ const response = yield queryBuilder(this._queryTree, this.client);
868
894
  return response;
869
895
  });
870
896
  }
@@ -879,7 +905,7 @@ export class EnvVariable extends BaseClient {
879
905
  operation: "value",
880
906
  },
881
907
  ];
882
- const response = yield this._compute();
908
+ const response = yield queryBuilder(this._queryTree, this.client);
883
909
  return response;
884
910
  });
885
911
  }
@@ -899,7 +925,7 @@ export class File extends BaseClient {
899
925
  operation: "contents",
900
926
  },
901
927
  ];
902
- const response = yield this._compute();
928
+ const response = yield queryBuilder(this._queryTree, this.client);
903
929
  return response;
904
930
  });
905
931
  }
@@ -915,7 +941,7 @@ export class File extends BaseClient {
915
941
  args: { path },
916
942
  },
917
943
  ];
918
- const response = yield this._compute();
944
+ const response = yield queryBuilder(this._queryTree, this.client);
919
945
  return response;
920
946
  });
921
947
  }
@@ -930,7 +956,7 @@ export class File extends BaseClient {
930
956
  operation: "id",
931
957
  },
932
958
  ];
933
- const response = yield this._compute();
959
+ const response = yield queryBuilder(this._queryTree, this.client);
934
960
  return response;
935
961
  });
936
962
  }
@@ -956,7 +982,7 @@ export class File extends BaseClient {
956
982
  operation: "size",
957
983
  },
958
984
  ];
959
- const response = yield this._compute();
985
+ const response = yield queryBuilder(this._queryTree, this.client);
960
986
  return response;
961
987
  });
962
988
  }
@@ -976,19 +1002,20 @@ export class GitRef extends BaseClient {
976
1002
  operation: "digest",
977
1003
  },
978
1004
  ];
979
- const response = yield this._compute();
1005
+ const response = yield queryBuilder(this._queryTree, this.client);
980
1006
  return response;
981
1007
  });
982
1008
  }
983
1009
  /**
984
1010
  * The filesystem tree at this ref
985
1011
  */
986
- tree() {
1012
+ tree(sshKnownHosts, sshAuthSocket) {
987
1013
  return new Directory({
988
1014
  queryTree: [
989
1015
  ...this._queryTree,
990
1016
  {
991
1017
  operation: "tree",
1018
+ args: { sshKnownHosts, sshAuthSocket },
992
1019
  },
993
1020
  ],
994
1021
  host: this.clientHost,
@@ -1025,7 +1052,7 @@ export class GitRepository extends BaseClient {
1025
1052
  operation: "branches",
1026
1053
  },
1027
1054
  ];
1028
- const response = yield this._compute();
1055
+ const response = yield queryBuilder(this._queryTree, this.client);
1029
1056
  return response;
1030
1057
  });
1031
1058
  }
@@ -1070,7 +1097,7 @@ export class GitRepository extends BaseClient {
1070
1097
  operation: "tags",
1071
1098
  },
1072
1099
  ];
1073
- const response = yield this._compute();
1100
+ const response = yield queryBuilder(this._queryTree, this.client);
1074
1101
  return response;
1075
1102
  });
1076
1103
  }
@@ -1095,7 +1122,7 @@ export class Host extends BaseClient {
1095
1122
  });
1096
1123
  }
1097
1124
  /**
1098
- * Lookup the value of an environment variable. Null if the variable is not available.
1125
+ * Access an environment variable on the host
1099
1126
  */
1100
1127
  envVariable(name) {
1101
1128
  return new HostVariable({
@@ -1109,6 +1136,21 @@ export class Host extends BaseClient {
1109
1136
  host: this.clientHost,
1110
1137
  });
1111
1138
  }
1139
+ /**
1140
+ * Access a Unix socket on the host
1141
+ */
1142
+ unixSocket(path) {
1143
+ return new Socket({
1144
+ queryTree: [
1145
+ ...this._queryTree,
1146
+ {
1147
+ operation: "unixSocket",
1148
+ args: { path },
1149
+ },
1150
+ ],
1151
+ host: this.clientHost,
1152
+ });
1153
+ }
1112
1154
  /**
1113
1155
  * The current working directory on the host
1114
1156
  *
@@ -1156,7 +1198,7 @@ export class HostVariable extends BaseClient {
1156
1198
  operation: "value",
1157
1199
  },
1158
1200
  ];
1159
- const response = yield this._compute();
1201
+ const response = yield queryBuilder(this._queryTree, this.client);
1160
1202
  return response;
1161
1203
  });
1162
1204
  }
@@ -1176,7 +1218,7 @@ export class Project extends BaseClient {
1176
1218
  operation: "extensions",
1177
1219
  },
1178
1220
  ];
1179
- const response = yield this._compute();
1221
+ const response = yield queryBuilder(this._queryTree, this.client);
1180
1222
  return response;
1181
1223
  });
1182
1224
  }
@@ -1205,7 +1247,7 @@ export class Project extends BaseClient {
1205
1247
  operation: "install",
1206
1248
  },
1207
1249
  ];
1208
- const response = yield this._compute();
1250
+ const response = yield queryBuilder(this._queryTree, this.client);
1209
1251
  return response;
1210
1252
  });
1211
1253
  }
@@ -1220,7 +1262,7 @@ export class Project extends BaseClient {
1220
1262
  operation: "name",
1221
1263
  },
1222
1264
  ];
1223
- const response = yield this._compute();
1265
+ const response = yield queryBuilder(this._queryTree, this.client);
1224
1266
  return response;
1225
1267
  });
1226
1268
  }
@@ -1235,7 +1277,7 @@ export class Project extends BaseClient {
1235
1277
  operation: "schema",
1236
1278
  },
1237
1279
  ];
1238
- const response = yield this._compute();
1280
+ const response = yield queryBuilder(this._queryTree, this.client);
1239
1281
  return response;
1240
1282
  });
1241
1283
  }
@@ -1250,7 +1292,7 @@ export class Project extends BaseClient {
1250
1292
  operation: "sdk",
1251
1293
  },
1252
1294
  ];
1253
- const response = yield this._compute();
1295
+ const response = yield queryBuilder(this._queryTree, this.client);
1254
1296
  return response;
1255
1297
  });
1256
1298
  }
@@ -1299,7 +1341,7 @@ export default class Client extends BaseClient {
1299
1341
  operation: "defaultPlatform",
1300
1342
  },
1301
1343
  ];
1302
- const response = yield this._compute();
1344
+ const response = yield queryBuilder(this._queryTree, this.client);
1303
1345
  return response;
1304
1346
  });
1305
1347
  }
@@ -1407,6 +1449,21 @@ export default class Client extends BaseClient {
1407
1449
  host: this.clientHost,
1408
1450
  });
1409
1451
  }
1452
+ /**
1453
+ * Load a socket by ID
1454
+ */
1455
+ socket(id) {
1456
+ return new Socket({
1457
+ queryTree: [
1458
+ ...this._queryTree,
1459
+ {
1460
+ operation: "socket",
1461
+ args: { id },
1462
+ },
1463
+ ],
1464
+ host: this.clientHost,
1465
+ });
1466
+ }
1410
1467
  }
1411
1468
  /**
1412
1469
  * A reference to a secret value, which can be handled more safely than the value itself
@@ -1423,7 +1480,7 @@ export class Secret extends BaseClient {
1423
1480
  operation: "id",
1424
1481
  },
1425
1482
  ];
1426
- const response = yield this._compute();
1483
+ const response = yield queryBuilder(this._queryTree, this.client);
1427
1484
  return response;
1428
1485
  });
1429
1486
  }
@@ -1438,7 +1495,24 @@ export class Secret extends BaseClient {
1438
1495
  operation: "plaintext",
1439
1496
  },
1440
1497
  ];
1441
- const response = yield this._compute();
1498
+ const response = yield queryBuilder(this._queryTree, this.client);
1499
+ return response;
1500
+ });
1501
+ }
1502
+ }
1503
+ export class Socket extends BaseClient {
1504
+ /**
1505
+ * The content-addressed identifier of the socket
1506
+ */
1507
+ id() {
1508
+ return __awaiter(this, void 0, void 0, function* () {
1509
+ this._queryTree = [
1510
+ ...this._queryTree,
1511
+ {
1512
+ operation: "id",
1513
+ },
1514
+ ];
1515
+ const response = yield queryBuilder(this._queryTree, this.client);
1442
1516
  return response;
1443
1517
  });
1444
1518
  }
@@ -1,4 +1,28 @@
1
+ import { GraphQLClient } from "graphql-request";
1
2
  import { QueryTree } from "./client.gen.js";
2
- export declare function queryBuilder(q: QueryTree[]): string;
3
- export declare function queryFlatten(res: Record<string, any>): Record<string, any>;
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
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../api/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,UAmC1C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAc1E"}
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
- export function queryBuilder(q) {
2
- const args = (item) => {
3
- const regex = /\{"[a-zA-Z]+"/gi;
4
- const entries = Object.entries(item.args)
5
- .filter((value) => value[1] !== undefined)
6
- .map((value) => {
7
- if (typeof value[1] === "object") {
8
- return `${value[0]}: ${JSON.stringify(value[1]).replace(regex, (str) => str.replace(/"/g, ""))}`;
9
- }
10
- if (typeof value[1] === "number") {
11
- return `${value[0]}: ${value[1]}`;
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
- return "(" + entries + ")";
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 ? `${args(item)}` : ""} ${q.length - 1 !== index ? "{" : "}".repeat(q.length - 1)}
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.replace(/\s+/g, "");
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
- export function queryFlatten(res) {
30
- if (res.errors)
31
- throw res.errors[0];
32
- return Object.assign({}, ...(function _flatten(o) {
33
- return [].concat(...Object.keys(o).map((k) => {
34
- if (typeof o[k] === "object" && !(o[k] instanceof Array))
35
- return _flatten(o[k]);
36
- else
37
- return { [k]: o[k] };
38
- }));
39
- })(res));
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.5@sha256:41f71f0036167fcc8b926792b079d840c52066eec093f3e177881468fd122c83";
2
+ const DEFAULT_IMAGE_REF = "ghcr.io/dagger/engine:v0.3.6@sha256:d124de285773409fd83d203d3f46364e20149ee46842c50eec6cc51c50fffb62";
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.1.1",
3
+ "version": "0.2.0",
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.1.2",
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.43.0",
38
- "@typescript-eslint/parser": "^5.43.0",
39
- "eslint": "^8.27.0",
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.7.1",
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",