@dagger.io/dagger 0.2.1 → 0.3.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.
Files changed (81) hide show
  1. package/README.md +72 -1
  2. package/dist/api/client.gen.d.ts +332 -126
  3. package/dist/api/client.gen.d.ts.map +1 -1
  4. package/dist/api/client.gen.js +355 -272
  5. package/dist/api/utils.d.ts +1 -1
  6. package/dist/api/utils.d.ts.map +1 -1
  7. package/dist/api/utils.js +63 -43
  8. package/dist/common/errors/DaggerSDKError.d.ts +32 -0
  9. package/dist/common/errors/DaggerSDKError.d.ts.map +1 -0
  10. package/dist/common/errors/DaggerSDKError.js +22 -0
  11. package/dist/common/errors/DockerImageRefValidationError.d.ts +22 -0
  12. package/dist/common/errors/DockerImageRefValidationError.d.ts.map +1 -0
  13. package/dist/common/errors/DockerImageRefValidationError.js +17 -0
  14. package/dist/common/errors/EngineSessionConnectParamsParseError.d.ts +21 -0
  15. package/dist/common/errors/EngineSessionConnectParamsParseError.d.ts.map +1 -0
  16. package/dist/common/errors/EngineSessionConnectParamsParseError.js +16 -0
  17. package/dist/common/errors/EngineSessionConnectionTimeoutError.d.ts +21 -0
  18. package/dist/common/errors/EngineSessionConnectionTimeoutError.d.ts.map +1 -0
  19. package/dist/common/errors/EngineSessionConnectionTimeoutError.js +16 -0
  20. package/dist/common/errors/EngineSessionEOFErrorOptions.d.ts +16 -0
  21. package/dist/common/errors/EngineSessionEOFErrorOptions.d.ts.map +1 -0
  22. package/dist/common/errors/EngineSessionEOFErrorOptions.js +16 -0
  23. package/dist/common/errors/GraphQLRequestError.d.ts +27 -0
  24. package/dist/common/errors/GraphQLRequestError.d.ts.map +1 -0
  25. package/dist/common/errors/GraphQLRequestError.js +17 -0
  26. package/dist/common/errors/InitEngineSessionBinaryError.d.ts +13 -0
  27. package/dist/common/errors/InitEngineSessionBinaryError.d.ts.map +1 -0
  28. package/dist/common/errors/InitEngineSessionBinaryError.js +15 -0
  29. package/dist/common/errors/TooManyNestedObjectsError.d.ts +21 -0
  30. package/dist/common/errors/TooManyNestedObjectsError.d.ts.map +1 -0
  31. package/dist/common/errors/TooManyNestedObjectsError.js +16 -0
  32. package/dist/common/errors/UnknownDaggerError.d.ts +13 -0
  33. package/dist/common/errors/UnknownDaggerError.d.ts.map +1 -0
  34. package/dist/common/errors/UnknownDaggerError.js +15 -0
  35. package/dist/common/errors/errors-codes.d.ts +43 -0
  36. package/dist/common/errors/errors-codes.d.ts.map +1 -0
  37. package/dist/common/errors/errors-codes.js +35 -0
  38. package/dist/common/errors/index.d.ts +11 -0
  39. package/dist/common/errors/index.d.ts.map +1 -0
  40. package/dist/common/errors/index.js +10 -0
  41. package/dist/common/utils.d.ts +65 -0
  42. package/dist/common/utils.d.ts.map +1 -0
  43. package/dist/common/utils.js +2 -0
  44. package/dist/connect.d.ts +25 -3
  45. package/dist/connect.d.ts.map +1 -1
  46. package/dist/connect.js +29 -5
  47. package/dist/index.d.ts +1 -2
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +0 -1
  50. package/dist/provisioning/{docker-provision/image.d.ts → bin.d.ts} +31 -29
  51. package/dist/provisioning/bin.d.ts.map +1 -0
  52. package/dist/provisioning/bin.js +328 -0
  53. package/dist/provisioning/default.d.ts +1 -1
  54. package/dist/provisioning/default.d.ts.map +1 -1
  55. package/dist/provisioning/default.js +1 -2
  56. package/dist/provisioning/engineconn.d.ts +1 -1
  57. package/dist/provisioning/engineconn.d.ts.map +1 -1
  58. package/dist/provisioning/index.d.ts +1 -2
  59. package/dist/provisioning/index.d.ts.map +1 -1
  60. package/dist/provisioning/index.js +1 -2
  61. package/package.json +19 -15
  62. package/dist/provisioning/bin/bin.d.ts +0 -21
  63. package/dist/provisioning/bin/bin.d.ts.map +0 -1
  64. package/dist/provisioning/bin/bin.js +0 -112
  65. package/dist/provisioning/bin/index.d.ts +0 -2
  66. package/dist/provisioning/bin/index.d.ts.map +0 -1
  67. package/dist/provisioning/bin/index.js +0 -1
  68. package/dist/provisioning/docker-provision/image.d.ts.map +0 -1
  69. package/dist/provisioning/docker-provision/image.js +0 -269
  70. package/dist/provisioning/docker-provision/index.d.ts +0 -2
  71. package/dist/provisioning/docker-provision/index.d.ts.map +0 -1
  72. package/dist/provisioning/docker-provision/index.js +0 -1
  73. package/dist/provisioning/http/http.d.ts +0 -14
  74. package/dist/provisioning/http/http.d.ts.map +0 -1
  75. package/dist/provisioning/http/http.js +0 -33
  76. package/dist/provisioning/http/index.d.ts +0 -2
  77. package/dist/provisioning/http/index.d.ts.map +0 -1
  78. package/dist/provisioning/http/index.js +0 -1
  79. package/dist/provisioning/provisioner.d.ts +0 -11
  80. package/dist/provisioning/provisioner.d.ts.map +0 -1
  81. package/dist/provisioning/provisioner.js +0 -26
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was auto-generated by `cloak clientgen`.
2
+ * This file was auto-generated by `client-gen`.
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
  import { GraphQLClient } from "graphql-request";
@@ -13,6 +13,7 @@ export type QueryTree = {
13
13
  interface ClientConfig {
14
14
  queryTree?: QueryTree[];
15
15
  host?: string;
16
+ sessionToken?: string;
16
17
  }
17
18
  declare class BaseClient {
18
19
  protected _queryTree: QueryTree[];
@@ -21,19 +22,110 @@ declare class BaseClient {
21
22
  * @defaultValue `127.0.0.1:8080`
22
23
  */
23
24
  clientHost: string;
25
+ sessionToken: string;
24
26
  /**
25
27
  * @hidden
26
28
  */
27
- constructor({ queryTree, host }?: ClientConfig);
29
+ constructor({ queryTree, host, sessionToken }?: ClientConfig);
28
30
  /**
29
31
  * @hidden
30
32
  */
31
33
  get queryTree(): QueryTree[];
32
34
  }
35
+ export type BuildArg = {
36
+ name: string;
37
+ value: string;
38
+ };
33
39
  /**
34
- * A global cache volume identifier
40
+ * A global cache volume identifier.
35
41
  */
36
42
  export type CacheID = string;
43
+ export type ContainerBuildOpts = {
44
+ /**
45
+ * Path to the Dockerfile to use.
46
+ * Defaults to './Dockerfile'.
47
+ */
48
+ dockerfile?: string;
49
+ /**
50
+ * Additional build arguments.
51
+ */
52
+ buildArgs?: BuildArg[];
53
+ };
54
+ export type ContainerExecOpts = {
55
+ /**
56
+ * Command to run instead of the container's default command.
57
+ */
58
+ args?: string[];
59
+ /**
60
+ * Content to write to the command's standard input before closing.
61
+ */
62
+ stdin?: string;
63
+ /**
64
+ * Redirect the command's standard output to a file in the container.
65
+ */
66
+ redirectStdout?: string;
67
+ /**
68
+ * Redirect the command's standard error to a file in the container.
69
+ */
70
+ redirectStderr?: string;
71
+ /**
72
+ * Provide dagger access to the executed command.
73
+ * Do not use this option unless you trust the command being executed.
74
+ * The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
75
+ */
76
+ experimentalPrivilegedNesting?: boolean;
77
+ };
78
+ export type ContainerExportOpts = {
79
+ /**
80
+ * Identifiers for other platform specific containers.
81
+ * Used for multi-platform image.
82
+ */
83
+ platformVariants?: ContainerID[] | Container[];
84
+ };
85
+ export type ContainerPublishOpts = {
86
+ /**
87
+ * Identifiers for other platform specific containers.
88
+ * Used for multi-platform image.
89
+ */
90
+ platformVariants?: ContainerID[] | Container[];
91
+ };
92
+ export type ContainerWithDefaultArgsOpts = {
93
+ args?: string[];
94
+ };
95
+ export type ContainerWithDirectoryOpts = {
96
+ exclude?: string[];
97
+ include?: string[];
98
+ };
99
+ export type ContainerWithExecOpts = {
100
+ /**
101
+ * Content to write to the command's standard input before closing.
102
+ */
103
+ stdin?: string;
104
+ /**
105
+ * Redirect the command's standard output to a file in the container.
106
+ */
107
+ redirectStdout?: string;
108
+ /**
109
+ * Redirect the command's standard error to a file in the container.
110
+ */
111
+ redirectStderr?: string;
112
+ /**
113
+ * Provide dagger access to the executed command.
114
+ * Do not use this option unless you trust the command being executed.
115
+ * The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
116
+ */
117
+ experimentalPrivilegedNesting?: boolean;
118
+ };
119
+ export type ContainerWithFileOpts = {
120
+ permissions?: number;
121
+ };
122
+ export type ContainerWithMountedCacheOpts = {
123
+ source?: DirectoryID | Directory;
124
+ };
125
+ export type ContainerWithNewFileOpts = {
126
+ contents?: string;
127
+ permissions?: number;
128
+ };
37
129
  /**
38
130
  * A unique container identifier. Null designates an empty container (scratch).
39
131
  */
@@ -42,105 +134,196 @@ export type ContainerID = string;
42
134
  * The `DateTime` scalar type represents a DateTime. The DateTime is serialized as an RFC 3339 quoted string
43
135
  */
44
136
  export type DateTime = string;
137
+ export type DirectoryDockerBuildOpts = {
138
+ /**
139
+ * Path to the Dockerfile to use.
140
+ * Defaults to './Dockerfile'.
141
+ */
142
+ dockerfile?: string;
143
+ platform?: Platform;
144
+ buildArgs?: BuildArg[];
145
+ };
146
+ export type DirectoryEntriesOpts = {
147
+ path?: string;
148
+ };
149
+ export type DirectoryWithDirectoryOpts = {
150
+ /**
151
+ * Exclude artifacts that match the given pattern.
152
+ * (e.g. ["node_modules/", ".git*"]).
153
+ */
154
+ exclude?: string[];
155
+ /**
156
+ * Include only artifacts that match the given pattern.
157
+ * (e.g. ["app/", "package.*"]).
158
+ */
159
+ include?: string[];
160
+ };
161
+ export type DirectoryWithFileOpts = {
162
+ permissions?: number;
163
+ };
164
+ export type DirectoryWithNewDirectoryOpts = {
165
+ permissions?: number;
166
+ };
167
+ export type DirectoryWithNewFileOpts = {
168
+ permissions?: number;
169
+ };
45
170
  /**
46
- * A content-addressed directory identifier
171
+ * A content-addressed directory identifier.
47
172
  */
48
173
  export type DirectoryID = string;
174
+ /**
175
+ * A file identifier.
176
+ */
49
177
  export type FileID = string;
178
+ export type GitRefTreeOpts = {
179
+ sshKnownHosts?: string;
180
+ sshAuthSocket?: SocketID | Socket;
181
+ };
182
+ export type HostDirectoryOpts = {
183
+ exclude?: string[];
184
+ include?: string[];
185
+ };
186
+ export type HostWorkdirOpts = {
187
+ exclude?: string[];
188
+ include?: string[];
189
+ };
50
190
  /**
51
191
  * 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.
52
192
  */
53
193
  export type ID = string;
194
+ /**
195
+ * The platform config OS and architecture in a Container.
196
+ * The format is {os}/{platform}/{version} (e.g. darwin/arm64/v7, windows/amd64, linux/arm64).
197
+ */
54
198
  export type Platform = string;
199
+ export type ClientContainerOpts = {
200
+ id?: ContainerID | Container;
201
+ platform?: Platform;
202
+ };
203
+ export type ClientDirectoryOpts = {
204
+ id?: DirectoryID | Directory;
205
+ };
206
+ export type ClientGitOpts = {
207
+ keepGitDir?: boolean;
208
+ };
209
+ export type ClientSocketOpts = {
210
+ id?: SocketID | Socket;
211
+ };
55
212
  /**
56
- * A unique identifier for a secret
213
+ * A unique identifier for a secret.
57
214
  */
58
215
  export type SecretID = string;
59
216
  /**
60
- * A content-addressed socket identifier
217
+ * A content-addressed socket identifier.
61
218
  */
62
219
  export type SocketID = string;
220
+ export type __TypeEnumValuesOpts = {
221
+ includeDeprecated?: boolean;
222
+ };
223
+ export type __TypeFieldsOpts = {
224
+ includeDeprecated?: boolean;
225
+ };
63
226
  /**
64
- * A directory whose contents persist across runs
227
+ * A directory whose contents persist across runs.
65
228
  */
66
229
  export declare class CacheVolume extends BaseClient {
67
230
  id(): Promise<CacheID>;
68
231
  }
69
232
  /**
70
- * An OCI-compatible container, also known as a docker container
233
+ * An OCI-compatible container, also known as a docker container.
71
234
  */
72
235
  export declare class Container extends BaseClient {
73
236
  /**
74
- * Initialize this container from a Dockerfile build
237
+ * Initializes this container from a Dockerfile build, using the context, a dockerfile file path and some additional buildArgs.
238
+ * @param context Directory context used by the Dockerfile.
239
+ * @param opts.dockerfile Path to the Dockerfile to use.
240
+ Defaults to './Dockerfile'.
241
+ * @param opts.buildArgs Additional build arguments.
75
242
  */
76
- build(context: DirectoryID | Directory, dockerfile?: string): Container;
243
+ build(context: DirectoryID | Directory, opts?: ContainerBuildOpts): Container;
77
244
  /**
78
- * Default arguments for future commands
245
+ * Retrieves default arguments for future commands.
79
246
  */
80
247
  defaultArgs(): Promise<string[]>;
81
248
  /**
82
- * Retrieve a directory at the given path. Mounts are included.
249
+ * Retrieves a directory at the given path. Mounts are included.
83
250
  */
84
251
  directory(path: string): Directory;
85
252
  /**
86
- * Entrypoint to be prepended to the arguments of all commands
253
+ * Retrieves entrypoint to be prepended to the arguments of all commands.
87
254
  */
88
255
  entrypoint(): Promise<string[]>;
89
256
  /**
90
- * The value of the specified environment variable
257
+ * Retrieves the value of the specified environment variable.
91
258
  */
92
259
  envVariable(name: string): Promise<string>;
93
260
  /**
94
- * A list of environment variables passed to commands
261
+ * Retrieves the list of environment variables passed to commands.
95
262
  */
96
263
  envVariables(): Promise<EnvVariable[]>;
97
264
  /**
98
- * This container after executing the specified command inside it
99
- *
265
+ * Retrieves this container after executing the specified command inside it.
266
+ * @param opts.args Command to run instead of the container's default command.
267
+ * @param opts.stdin Content to write to the command's standard input before closing.
268
+ * @param opts.redirectStdout Redirect the command's standard output to a file in the container.
269
+ * @param opts.redirectStderr Redirect the command's standard error to a file in the container.
270
+ * @param opts.experimentalPrivilegedNesting Provide dagger access to the executed command.
271
+ Do not use this option unless you trust the command being executed.
272
+ The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
100
273
  * @deprecated Replaced by withExec.
101
274
  */
102
- exec(args?: string[], stdin?: string, redirectStdout?: string, redirectStderr?: string, experimentalPrivilegedNesting?: boolean): Container;
275
+ exec(opts?: ContainerExecOpts): Container;
103
276
  /**
104
277
  * Exit code of the last executed command. Zero means success.
105
278
  * Null if no command has been executed.
106
279
  */
107
280
  exitCode(): Promise<number>;
108
281
  /**
109
- * Write the container as an OCI tarball to the destination file path on the host
282
+ * Writes the container as an OCI tarball to the destination file path on the host for the specified platformVariants.
283
+ * Return true on success.
284
+ * @param path Host's destination path.
285
+ Path can be relative to the engine's workdir or absolute.
286
+ * @param opts.platformVariants Identifiers for other platform specific containers.
287
+ Used for multi-platform image.
110
288
  */
111
- export(path: string, platformVariants?: ContainerID[] | Container[]): Promise<boolean>;
289
+ export(path: string, opts?: ContainerExportOpts): Promise<boolean>;
112
290
  /**
113
- * Retrieve a file at the given path. Mounts are included.
291
+ * Retrieves a file at the given path. Mounts are included.
114
292
  */
115
293
  file(path: string): File;
116
294
  /**
117
- * Initialize this container from the base image published at the given address
295
+ * Initializes this container from the base image published at the given address.
296
+ * @param address Image's address from its registry.
297
+ Formatted as {host}/{user}/{repo}:{tag} (e.g. docker.io/dagger/dagger:main).
118
298
  */
119
299
  from(address: string): Container;
120
300
  /**
121
- * This container's root filesystem. Mounts are not included.
122
- *
301
+ * Retrieves this container's root filesystem. Mounts are not included.
123
302
  * @deprecated Replaced by rootfs.
124
303
  */
125
304
  fs(): Directory;
126
305
  /**
127
- * A unique identifier for this container
306
+ * A unique identifier for this container.
128
307
  */
129
308
  id(): Promise<ContainerID>;
130
309
  /**
131
- * List of paths where a directory is mounted
310
+ * Retrieves the list of paths where a directory is mounted.
132
311
  */
133
312
  mounts(): Promise<string[]>;
134
313
  /**
135
- * The platform this container executes and publishes as
314
+ * The platform this container executes and publishes as.
136
315
  */
137
316
  platform(): Promise<Platform>;
138
317
  /**
139
- * Publish this container as a new image, returning a fully qualified ref
318
+ * Publishes this container as a new image to the specified address, for the platformVariants, returning a fully qualified ref.
319
+ * @param address Registry's address to publish the image to.
320
+ Formatted as {host}/{user}/{repo}:{tag} (e.g. docker.io/dagger/dagger:main).
321
+ * @param opts.platformVariants Identifiers for other platform specific containers.
322
+ Used for multi-platform image.
140
323
  */
141
- publish(address: string, platformVariants?: ContainerID[] | Container[]): Promise<string>;
324
+ publish(address: string, opts?: ContainerPublishOpts): Promise<string>;
142
325
  /**
143
- * This container's root filesystem. Mounts are not included.
326
+ * Retrieves this container's root filesystem. Mounts are not included.
144
327
  */
145
328
  rootfs(): Directory;
146
329
  /**
@@ -154,130 +337,138 @@ export declare class Container extends BaseClient {
154
337
  */
155
338
  stdout(): Promise<string>;
156
339
  /**
157
- * The user to be set for all commands
340
+ * Retrieves the user to be set for all commands.
158
341
  */
159
342
  user(): Promise<string>;
160
343
  /**
161
- * Configures default arguments for future commands
344
+ * Configures default arguments for future commands.
162
345
  */
163
- withDefaultArgs(args?: string[]): Container;
346
+ withDefaultArgs(opts?: ContainerWithDefaultArgsOpts): Container;
164
347
  /**
165
- * This container plus a directory written at the given path
348
+ * Retrieves this container plus a directory written at the given path.
166
349
  */
167
- withDirectory(path: string, directory: DirectoryID | Directory, exclude?: string[], include?: string[]): Container;
350
+ withDirectory(path: string, directory: DirectoryID | Directory, opts?: ContainerWithDirectoryOpts): Container;
168
351
  /**
169
- * This container but with a different command entrypoint
352
+ * Retrieves this container but with a different command entrypoint.
170
353
  */
171
354
  withEntrypoint(args: string[]): Container;
172
355
  /**
173
- * This container plus the given environment variable
356
+ * Retrieves this container plus the given environment variable.
174
357
  */
175
358
  withEnvVariable(name: string, value: string): Container;
176
359
  /**
177
- * This container after executing the specified command inside it
360
+ * Retrieves this container after executing the specified command inside it.
361
+ * @param args Command to run instead of the container's default command.
362
+ * @param opts.stdin Content to write to the command's standard input before closing.
363
+ * @param opts.redirectStdout Redirect the command's standard output to a file in the container.
364
+ * @param opts.redirectStderr Redirect the command's standard error to a file in the container.
365
+ * @param opts.experimentalPrivilegedNesting Provide dagger access to the executed command.
366
+ Do not use this option unless you trust the command being executed.
367
+ The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
178
368
  */
179
- withExec(args: string[], stdin?: string, redirectStdout?: string, redirectStderr?: string, experimentalPrivilegedNesting?: boolean): Container;
369
+ withExec(args: string[], opts?: ContainerWithExecOpts): Container;
180
370
  /**
181
- * Initialize this container from this DirectoryID
182
- *
371
+ * Initializes this container from this DirectoryID.
183
372
  * @deprecated Replaced by withRootfs.
184
373
  */
185
374
  withFS(id: DirectoryID | Directory): Container;
186
375
  /**
187
- * This container plus the contents of the given file copied to the given path
376
+ * Retrieves this container plus the contents of the given file copied to the given path.
188
377
  */
189
- withFile(path: string, source: FileID | File): Container;
378
+ withFile(path: string, source: FileID | File, opts?: ContainerWithFileOpts): Container;
190
379
  /**
191
- * This container plus a cache volume mounted at the given path
380
+ * Retrieves this container plus a cache volume mounted at the given path.
192
381
  */
193
- withMountedCache(path: string, cache: CacheID | CacheVolume, source?: DirectoryID | Directory): Container;
382
+ withMountedCache(path: string, cache: CacheID | CacheVolume, opts?: ContainerWithMountedCacheOpts): Container;
194
383
  /**
195
- * This container plus a directory mounted at the given path
384
+ * Retrieves this container plus a directory mounted at the given path.
196
385
  */
197
386
  withMountedDirectory(path: string, source: DirectoryID | Directory): Container;
198
387
  /**
199
- * This container plus a file mounted at the given path
388
+ * Retrieves this container plus a file mounted at the given path.
200
389
  */
201
390
  withMountedFile(path: string, source: FileID | File): Container;
202
391
  /**
203
- * This container plus a secret mounted into a file at the given path
392
+ * Retrieves this container plus a secret mounted into a file at the given path.
204
393
  */
205
394
  withMountedSecret(path: string, source: SecretID | Secret): Container;
206
395
  /**
207
- * This container plus a temporary directory mounted at the given path
396
+ * Retrieves this container plus a temporary directory mounted at the given path.
208
397
  */
209
398
  withMountedTemp(path: string): Container;
210
399
  /**
211
- * This container plus a new file written at the given path
400
+ * Retrieves this container plus a new file written at the given path.
212
401
  */
213
- withNewFile(path: string, contents?: string): Container;
402
+ withNewFile(path: string, opts?: ContainerWithNewFileOpts): Container;
214
403
  /**
215
- * Initialize this container from this DirectoryID
404
+ * Initializes this container from this DirectoryID.
216
405
  */
217
406
  withRootfs(id: DirectoryID | Directory): Container;
218
407
  /**
219
- * This container plus an env variable containing the given secret
408
+ * Retrieves this container plus an env variable containing the given secret.
220
409
  */
221
410
  withSecretVariable(name: string, secret: SecretID | Secret): Container;
222
411
  /**
223
- * This container plus a socket forwarded to the given Unix socket path
412
+ * Retrieves this container plus a socket forwarded to the given Unix socket path.
224
413
  */
225
- withUnixSocket(path: string, source: SocketID): Container;
414
+ withUnixSocket(path: string, source: SocketID | Socket): Container;
226
415
  /**
227
- * This container but with a different command user
416
+ * Retrieves this containers with a different command user.
228
417
  */
229
418
  withUser(name: string): Container;
230
419
  /**
231
- * This container but with a different working directory
420
+ * Retrieves this container with a different working directory.
232
421
  */
233
422
  withWorkdir(path: string): Container;
234
423
  /**
235
- * This container minus the given environment variable
424
+ * Retrieves this container minus the given environment variable.
236
425
  */
237
426
  withoutEnvVariable(name: string): Container;
238
427
  /**
239
- * This container after unmounting everything at the given path.
428
+ * Retrieves this container after unmounting everything at the given path.
240
429
  */
241
430
  withoutMount(path: string): Container;
242
431
  /**
243
- * This container with a previously added Unix socket removed
432
+ * Retrieves this container with a previously added Unix socket removed.
244
433
  */
245
434
  withoutUnixSocket(path: string): Container;
246
435
  /**
247
- * The working directory for all commands
436
+ * Retrieves the working directory for all commands.
248
437
  */
249
438
  workdir(): Promise<string>;
250
439
  }
251
440
  /**
252
- * A directory
441
+ * A directory.
253
442
  */
254
443
  export declare class Directory extends BaseClient {
255
444
  /**
256
- * The difference between this directory and an another directory
445
+ * Gets the difference between this directory and an another directory.
257
446
  */
258
447
  diff(other: DirectoryID | Directory): Directory;
259
448
  /**
260
- * Retrieve a directory at the given path
449
+ * Retrieves a directory at the given path.
261
450
  */
262
451
  directory(path: string): Directory;
263
452
  /**
264
- * Build a new Docker container from this directory
453
+ * Builds a new Docker container from this directory.
454
+ * @param opts.dockerfile Path to the Dockerfile to use.
455
+ Defaults to './Dockerfile'.
265
456
  */
266
- dockerBuild(dockerfile?: string, platform?: Platform): Container;
457
+ dockerBuild(opts?: DirectoryDockerBuildOpts): Container;
267
458
  /**
268
- * Return a list of files and directories at the given path
459
+ * Returns a list of files and directories at the given path.
269
460
  */
270
- entries(path?: string): Promise<string[]>;
461
+ entries(opts?: DirectoryEntriesOpts): Promise<string[]>;
271
462
  /**
272
- * Write the contents of the directory to a path on the host
463
+ * Writes the contents of the directory to a path on the host.
273
464
  */
274
465
  export(path: string): Promise<boolean>;
275
466
  /**
276
- * Retrieve a file at the given path
467
+ * Retrieves a file at the given path.
277
468
  */
278
469
  file(path: string): File;
279
470
  /**
280
- * The content-addressed identifier of the directory
471
+ * The content-addressed identifier of the directory.
281
472
  */
282
473
  id(): Promise<DirectoryID>;
283
474
  /**
@@ -285,136 +476,150 @@ export declare class Directory extends BaseClient {
285
476
  */
286
477
  loadProject(configPath: string): Project;
287
478
  /**
288
- * This directory plus a directory written at the given path
479
+ * Retrieves this directory plus a directory written at the given path.
480
+ * @param opts.exclude Exclude artifacts that match the given pattern.
481
+ (e.g. ["node_modules/", ".git*"]).
482
+ * @param opts.include Include only artifacts that match the given pattern.
483
+ (e.g. ["app/", "package.*"]).
484
+ */
485
+ withDirectory(path: string, directory: DirectoryID | Directory, opts?: DirectoryWithDirectoryOpts): Directory;
486
+ /**
487
+ * Retrieves this directory plus the contents of the given file copied to the given path.
289
488
  */
290
- withDirectory(path: string, directory: DirectoryID | Directory, exclude?: string[], include?: string[]): Directory;
489
+ withFile(path: string, source: FileID | File, opts?: DirectoryWithFileOpts): Directory;
291
490
  /**
292
- * This directory plus the contents of the given file copied to the given path
491
+ * Retrieves this directory plus a new directory created at the given path.
293
492
  */
294
- withFile(path: string, source: FileID | File): Directory;
493
+ withNewDirectory(path: string, opts?: DirectoryWithNewDirectoryOpts): Directory;
295
494
  /**
296
- * This directory plus a new directory created at the given path
495
+ * Retrieves this directory plus a new file written at the given path.
297
496
  */
298
- withNewDirectory(path: string): Directory;
497
+ withNewFile(path: string, contents: string, opts?: DirectoryWithNewFileOpts): Directory;
299
498
  /**
300
- * This directory plus a new file written at the given path
499
+ * Retrieves this directory with all file/dir timestamps set to the given time, in seconds from the Unix epoch.
301
500
  */
302
- withNewFile(path: string, contents: string): Directory;
501
+ withTimestamps(timestamp: number): Directory;
303
502
  /**
304
- * This directory with the directory at the given path removed
503
+ * Retrieves this directory with the directory at the given path removed.
305
504
  */
306
505
  withoutDirectory(path: string): Directory;
307
506
  /**
308
- * This directory with the file at the given path removed
507
+ * Retrieves this directory with the file at the given path removed.
309
508
  */
310
509
  withoutFile(path: string): Directory;
311
510
  }
312
511
  /**
313
- * EnvVariable is a simple key value object that represents an environment variable.
512
+ * A simple key value object that represents an environment variable.
314
513
  */
315
514
  export declare class EnvVariable extends BaseClient {
316
515
  /**
317
- * name is the environment variable name.
516
+ * The environment variable name.
318
517
  */
319
518
  name(): Promise<string>;
320
519
  /**
321
- * value is the environment variable value
520
+ * The environment variable value.
322
521
  */
323
522
  value(): Promise<string>;
324
523
  }
325
524
  /**
326
- * A file
525
+ * A file.
327
526
  */
328
527
  export declare class File extends BaseClient {
329
528
  /**
330
- * The contents of the file
529
+ * Retrieves the contents of the file.
331
530
  */
332
531
  contents(): Promise<string>;
333
532
  /**
334
- * Write the file to a file path on the host
533
+ * Writes the file to a file path on the host.
335
534
  */
336
535
  export(path: string): Promise<boolean>;
337
536
  /**
338
- * The content-addressed identifier of the file
537
+ * Retrieves the content-addressed identifier of the file.
339
538
  */
340
539
  id(): Promise<FileID>;
540
+ /**
541
+ * Retrieves a secret referencing the contents of this file.
542
+ */
341
543
  secret(): Secret;
342
544
  /**
343
- * The size of the file, in bytes
545
+ * Gets the size of the file, in bytes.
344
546
  */
345
547
  size(): Promise<number>;
548
+ /**
549
+ * Retrieves this file with its created/modified timestamps set to the given time, in seconds from the Unix epoch.
550
+ */
551
+ withTimestamps(timestamp: number): File;
346
552
  }
347
553
  /**
348
- * A git ref (tag or branch)
554
+ * A git ref (tag, branch or commit).
349
555
  */
350
556
  export declare class GitRef extends BaseClient {
351
557
  /**
352
- * The digest of the current value of this ref
558
+ * The digest of the current value of this ref.
353
559
  */
354
560
  digest(): Promise<string>;
355
561
  /**
356
- * The filesystem tree at this ref
562
+ * The filesystem tree at this ref.
357
563
  */
358
- tree(sshKnownHosts?: string, sshAuthSocket?: SocketID): Directory;
564
+ tree(opts?: GitRefTreeOpts): Directory;
359
565
  }
360
566
  /**
361
- * A git repository
567
+ * A git repository.
362
568
  */
363
569
  export declare class GitRepository extends BaseClient {
364
570
  /**
365
- * Details on one branch
571
+ * Returns details on one branch.
366
572
  */
367
573
  branch(name: string): GitRef;
368
574
  /**
369
- * List of branches on the repository
575
+ * Lists of branches on the repository.
370
576
  */
371
577
  branches(): Promise<string[]>;
372
578
  /**
373
- * Details on one commit
579
+ * Returns details on one commit.
374
580
  */
375
581
  commit(id: string): GitRef;
376
582
  /**
377
- * Details on one tag
583
+ * Returns details on one tag.
378
584
  */
379
585
  tag(name: string): GitRef;
380
586
  /**
381
- * List of tags on the repository
587
+ * Lists of tags on the repository.
382
588
  */
383
589
  tags(): Promise<string[]>;
384
590
  }
385
591
  /**
386
- * Information about the host execution environment
592
+ * Information about the host execution environment.
387
593
  */
388
594
  export declare class Host extends BaseClient {
389
595
  /**
390
- * Access a directory on the host
596
+ * Accesses a directory on the host.
391
597
  */
392
- directory(path: string, exclude?: string[], include?: string[]): Directory;
598
+ directory(path: string, opts?: HostDirectoryOpts): Directory;
393
599
  /**
394
- * Access an environment variable on the host
600
+ * Accesses an environment variable on the host.
395
601
  */
396
602
  envVariable(name: string): HostVariable;
397
603
  /**
398
- * Access a Unix socket on the host
604
+ * Accesses a Unix socket on the host.
399
605
  */
400
606
  unixSocket(path: string): Socket;
401
607
  /**
402
- * The current working directory on the host
403
- *
608
+ * Retrieves the current working directory on the host.
404
609
  * @deprecated Use directory with path set to '.' instead.
405
610
  */
406
- workdir(exclude?: string[], include?: string[]): Directory;
611
+ workdir(opts?: HostWorkdirOpts): Directory;
407
612
  }
408
613
  /**
409
- * An environment variable on the host environment
614
+ * An environment variable on the host environment.
410
615
  */
411
616
  export declare class HostVariable extends BaseClient {
412
617
  /**
413
- * A secret referencing the value of this variable
618
+ * A secret referencing the value of this variable.
414
619
  */
415
620
  secret(): Secret;
416
621
  /**
417
- * The value of this variable
622
+ * The value of this variable.
418
623
  */
419
624
  value(): Promise<string>;
420
625
  }
@@ -449,15 +654,16 @@ export declare class Project extends BaseClient {
449
654
  }
450
655
  export default class Client extends BaseClient {
451
656
  /**
452
- * Construct a cache volume for a given cache key
657
+ * Constructs a cache volume for a given cache key.
658
+ * @param key A string identifier to target this cache volume (e.g. "myapp-cache").
453
659
  */
454
660
  cacheVolume(key: string): CacheVolume;
455
661
  /**
456
- * Load a container from ID.
662
+ * Loads a container from ID.
457
663
  * Null ID returns an empty container (scratch).
458
664
  * Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
459
665
  */
460
- container(id?: ContainerID | Container, platform?: Platform): Container;
666
+ container(opts?: ClientContainerOpts): Container;
461
667
  /**
462
668
  * The default platform of the builder.
463
669
  */
@@ -465,21 +671,21 @@ export default class Client extends BaseClient {
465
671
  /**
466
672
  * Load a directory by ID. No argument produces an empty directory.
467
673
  */
468
- directory(id?: DirectoryID | Directory): Directory;
674
+ directory(opts?: ClientDirectoryOpts): Directory;
469
675
  /**
470
- * Load a file by ID
676
+ * Loads a file by ID.
471
677
  */
472
678
  file(id: FileID | File): File;
473
679
  /**
474
- * Query a git repository
680
+ * Queries a git repository.
475
681
  */
476
- git(url: string, keepGitDir?: boolean): GitRepository;
682
+ git(url: string, opts?: ClientGitOpts): GitRepository;
477
683
  /**
478
- * Query the host environment
684
+ * Queries the host environment.
479
685
  */
480
686
  host(): Host;
481
687
  /**
482
- * An http remote
688
+ * Returns a file containing an http remote url content.
483
689
  */
484
690
  http(url: string): File;
485
691
  /**
@@ -487,30 +693,30 @@ export default class Client extends BaseClient {
487
693
  */
488
694
  project(name: string): Project;
489
695
  /**
490
- * Load a secret from its ID
696
+ * Loads a secret from its ID.
491
697
  */
492
698
  secret(id: SecretID | Secret): Secret;
493
699
  /**
494
- * Load a socket by ID
700
+ * Loads a socket by its ID.
495
701
  */
496
- socket(id?: SocketID): Socket;
702
+ socket(opts?: ClientSocketOpts): Socket;
497
703
  }
498
704
  /**
499
- * A reference to a secret value, which can be handled more safely than the value itself
705
+ * A reference to a secret value, which can be handled more safely than the value itself.
500
706
  */
501
707
  export declare class Secret extends BaseClient {
502
708
  /**
503
- * The identifier for this secret
709
+ * The identifier for this secret.
504
710
  */
505
711
  id(): Promise<SecretID>;
506
712
  /**
507
- * The value of this secret
713
+ * The value of this secret.
508
714
  */
509
715
  plaintext(): Promise<string>;
510
716
  }
511
717
  export declare class Socket extends BaseClient {
512
718
  /**
513
- * The content-addressed identifier of the socket
719
+ * The content-addressed identifier of the socket.
514
720
  */
515
721
  id(): Promise<SocketID>;
516
722
  }