1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! Client-facing wire types shared between the `ZLayer` daemon and SDK
//! clients (CLI, `zlayer-docker`, `zlayer-py`, future language SDKs).
//!
//! These were originally defined in `zlayer-client`; they are pure serde
//! DTOs with no transport or async state, so they live here so that
//! crates which want the wire shapes don't have to pull in the full HTTP
//! client.
use HashMap;
use ;
use ;
// ---------------------------------------------------------------------------
// Session
// ---------------------------------------------------------------------------
/// Persisted CLI session record (lives at `~/.zlayer/session.json`,
/// mode 0600 on Unix).
///
/// Stores the JWT returned by `POST /auth/token` (or `/auth/login`) so
/// subsequent CLI invocations don't need to re-authenticate. The daemon
/// client attaches `Authorization: Bearer <token>` from this record when
/// present.
// ---------------------------------------------------------------------------
// Build DTOs (client-side mirrors of zlayer-api build request/response shapes)
// ---------------------------------------------------------------------------
/// Specification sent to the daemon's `POST /api/v1/build/json` endpoint to
/// start an image build against a server-side context path.
///
/// Mirrors `zlayer_api::handlers::build::BuildRequestWithContext` on the
/// wire; the server-side type is `Deserialize`-only so we carry a
/// `Serialize` mirror here.
/// Handle returned by the daemon `start_build` endpoint. Mirrors the wire
/// shape of `zlayer_api::handlers::build::TriggerBuildResponse` (which is
/// `Serialize`-only, so we carry a `Deserialize` mirror here).
///
/// The `build_id` can be fed to `GET /api/v1/build/{id}`,
/// `GET /api/v1/build/{id}/stream`, and `GET /api/v1/build/{id}/logs`.