@archildata/api-types 0.0.101 → 0.0.102

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 (2) hide show
  1. package/index.d.ts +107 -4
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -988,6 +988,12 @@ export interface paths {
988
988
  * start from a snapshot, and sandboxes created from its `image_id` get
989
989
  * that size unless they set their own; other sizes boot from scratch.
990
990
  * Each size of a source is a separate image.
991
+ *
992
+ * `dockerfile` builds the image from a Dockerfile instead of pulling
993
+ * `source`, and the image is visible only to its account. Requesting
994
+ * the same Dockerfile, `context` and size again returns the same image;
995
+ * a `ready` one is returned without building again, even if a `FROM`
996
+ * tag has moved since.
991
997
  */
992
998
  post: operations["createImage"];
993
999
  delete?: never;
@@ -996,6 +1002,35 @@ export interface paths {
996
1002
  patch?: never;
997
1003
  trace?: never;
998
1004
  };
1005
+ "/api/images/contexts": {
1006
+ parameters: {
1007
+ query?: never;
1008
+ header?: never;
1009
+ path?: never;
1010
+ cookie?: never;
1011
+ };
1012
+ get?: never;
1013
+ put?: never;
1014
+ /**
1015
+ * Upload a Dockerfile build context
1016
+ * @description Prepares the upload of a build context: a gzip-compressed tar of the
1017
+ * files a Dockerfile's `COPY` and `ADD` read, named by the SHA-256 of
1018
+ * the compressed archive. If the account already stored that archive,
1019
+ * `present` is true and there is nothing to upload. Otherwise `PUT` the
1020
+ * archive to `upload_url` with every header in `upload_headers` before
1021
+ * `expires_at`; a body of another size or hash is rejected.
1022
+ *
1023
+ * Pass `sha256:<sha256>` as `context` to `POST /api/images`. Contexts
1024
+ * are deleted about a day after upload; a build requested after that
1025
+ * needs the context uploaded again.
1026
+ */
1027
+ post: operations["createImageContext"];
1028
+ delete?: never;
1029
+ options?: never;
1030
+ head?: never;
1031
+ patch?: never;
1032
+ trace?: never;
1033
+ };
999
1034
  "/api/images/{image_id}": {
1000
1035
  parameters: {
1001
1036
  query?: never;
@@ -2515,10 +2550,15 @@ export interface components {
2515
2550
  /** @description Password or access token, such as a GitHub personal access token with `read:packages`. */
2516
2551
  password: string;
2517
2552
  };
2553
+ /** @description Set either `source` (with optional `registry_auth`) or `dockerfile`. */
2518
2554
  CreateImageRequest: {
2519
2555
  /** @description Linux OCI image reference. Docker shorthand and tags are accepted. */
2520
- source: string;
2556
+ source?: string;
2521
2557
  registry_auth?: components["schemas"]["RegistryAuth"];
2558
+ /** @description Dockerfile to build the image from, up to 64 KiB. Its `FROM` images must be public. */
2559
+ dockerfile?: string;
2560
+ /** @description Build context uploaded with `POST /api/images/contexts`, as `sha256:` and the archive's SHA-256. Without it, the Dockerfile builds with an empty context. */
2561
+ context?: string;
2522
2562
  /** @default 1 */
2523
2563
  vcpu_count: number;
2524
2564
  /** @default 2048 */
@@ -2528,12 +2568,12 @@ export interface components {
2528
2568
  ImageState: "building" | "ready" | "failed";
2529
2569
  Image: {
2530
2570
  image_id: string;
2531
- /** @description Normalized OCI reference the image is pulled from. */
2571
+ /** @description Normalized OCI reference the image is pulled from. For a Dockerfile image, `dockerfile@sha256:` and a digest of the Dockerfile and context. */
2532
2572
  source: string;
2533
2573
  /** @description The size sandboxes created from this image get by default. */
2534
2574
  vcpu_count: number;
2535
2575
  mem_size_mib: number;
2536
- /** @description Whether the image is pulled with registry credentials. */
2576
+ /** @description Whether the image is visible only to its account: it is pulled with registry credentials or built from a Dockerfile. */
2537
2577
  private: boolean;
2538
2578
  status: components["schemas"]["ImageState"];
2539
2579
  /** @description The most recent successful build. Sandboxes created from this `image_id` boot it, and keep it after the image is rebuilt. */
@@ -2541,10 +2581,12 @@ export interface components {
2541
2581
  /** @description The pulled manifest, as `repository@sha256:...`. */
2542
2582
  canonical_source?: string;
2543
2583
  /**
2544
- * @description Set when `failed`. `invalid_source`: the registry reported the image missing or denied access, so requesting it again will not help. `interrupted`: the build did not finish; request the image again.
2584
+ * @description Set when `failed`. `invalid_source`: the registry reported the image missing or denied access, or the Dockerfile build failed (see `build_log`), so requesting the same image again will not help. `interrupted`: the build did not finish; request the image again.
2545
2585
  * @enum {string}
2546
2586
  */
2547
2587
  failure_reason?: "invalid_source" | "interrupted";
2588
+ /** @description The last 64 KiB of a failed Dockerfile build's output, set with `invalid_source`. */
2589
+ build_log?: string;
2548
2590
  /** Format: date-time */
2549
2591
  created_at: string;
2550
2592
  /** Format: date-time */
@@ -2555,6 +2597,29 @@ export interface components {
2555
2597
  success: boolean;
2556
2598
  data: components["schemas"]["Image"];
2557
2599
  };
2600
+ ImageContextRequest: {
2601
+ /** @description SHA-256 of the gzip-compressed tar archive, in hex. */
2602
+ sha256: string;
2603
+ /**
2604
+ * Format: int64
2605
+ * @description Size of the compressed archive, up to 512 MiB.
2606
+ */
2607
+ size_bytes: number;
2608
+ };
2609
+ ImageContextUpload: {
2610
+ present: boolean;
2611
+ upload_url?: string;
2612
+ upload_headers?: {
2613
+ [key: string]: string;
2614
+ };
2615
+ /** Format: date-time */
2616
+ expires_at?: string;
2617
+ };
2618
+ ApiResponse_ImageContextUpload: {
2619
+ /** @example true */
2620
+ success: boolean;
2621
+ data: components["schemas"]["ImageContextUpload"];
2622
+ };
2558
2623
  ApiResponse_Sandbox: {
2559
2624
  /** @example true */
2560
2625
  success: boolean;
@@ -3799,6 +3864,15 @@ export interface components {
3799
3864
  "application/json": components["schemas"]["ErrorResponse"];
3800
3865
  };
3801
3866
  };
3867
+ /** @description This fleet cannot build images from Dockerfiles (`dockerfile_builds_unavailable`) */
3868
+ DockerfileBuildsUnavailable: {
3869
+ headers: {
3870
+ [name: string]: unknown;
3871
+ };
3872
+ content: {
3873
+ "application/json": components["schemas"]["ErrorResponse"];
3874
+ };
3875
+ };
3802
3876
  /** @description The lifecycle transition is temporarily blocked and can be retried */
3803
3877
  RetryableUnavailable: {
3804
3878
  headers: {
@@ -5886,6 +5960,35 @@ export interface operations {
5886
5960
  400: components["responses"]["ValidationError"];
5887
5961
  401: components["responses"]["Unauthorized"];
5888
5962
  500: components["responses"]["InternalError"];
5963
+ 501: components["responses"]["DockerfileBuildsUnavailable"];
5964
+ };
5965
+ };
5966
+ createImageContext: {
5967
+ parameters: {
5968
+ query?: never;
5969
+ header?: never;
5970
+ path?: never;
5971
+ cookie?: never;
5972
+ };
5973
+ requestBody: {
5974
+ content: {
5975
+ "application/json": components["schemas"]["ImageContextRequest"];
5976
+ };
5977
+ };
5978
+ responses: {
5979
+ /** @description The context is stored, or where to upload it */
5980
+ 200: {
5981
+ headers: {
5982
+ [name: string]: unknown;
5983
+ };
5984
+ content: {
5985
+ "application/json": components["schemas"]["ApiResponse_ImageContextUpload"];
5986
+ };
5987
+ };
5988
+ 400: components["responses"]["ValidationError"];
5989
+ 401: components["responses"]["Unauthorized"];
5990
+ 500: components["responses"]["InternalError"];
5991
+ 501: components["responses"]["DockerfileBuildsUnavailable"];
5889
5992
  };
5890
5993
  };
5891
5994
  getImage: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/api-types",
3
- "version": "0.0.101",
3
+ "version": "0.0.102",
4
4
  "description": "Public API types for Archil",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",