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
//! The paths of the Warg REST API.

use warg_crypto::hash::AnyHash;
use warg_protocol::registry::{LogId, RecordId};

/// The path of the "fetch logs" API.
pub fn fetch_logs() -> &'static str {
    "v1/fetch/logs"
}

/// The path of the "fetch checkpoint" API.
pub fn fetch_checkpoint() -> &'static str {
    "v1/fetch/checkpoint"
}

/// The path of the "fetch package names" API.
pub fn fetch_package_names() -> &'static str {
    "v1/fetch/names"
}

/// The path of the get ledger sources.
pub fn ledger_sources() -> &'static str {
    "v1/ledger"
}

/// The path of the "publish package record" API.
pub fn publish_package_record(log_id: &LogId) -> String {
    format!("v1/package/{log_id}/record")
}

/// The path to request download of content digest.
pub fn content_sources(digest: &AnyHash) -> String {
    format!("v1/content/{digest}")
}

/// The path for a package record.
pub fn package_record(log_id: &LogId, record_id: &RecordId) -> String {
    format!("v1/package/{log_id}/record/{record_id}")
}

/// The path for proving checkpoint consistency.
pub fn prove_consistency() -> &'static str {
    "v1/proof/consistency"
}

/// The path for proving checkpoint inclusion.
pub fn prove_inclusion() -> &'static str {
    "v1/proof/inclusion"
}

/// The path for verifying a checkpoint.
pub fn verify_checkpoint() -> &'static str {
    "v1/verify/checkpoint"
}