Skip to main content

ic_query/ic/
mod.rs

1//! Official IC Dashboard API report models, adapters, builders, and renderers.
2
3#[cfg(feature = "host")]
4mod build;
5#[cfg(feature = "host")]
6mod live;
7mod model;
8#[cfg(feature = "host")]
9mod source;
10mod text;
11
12#[cfg(feature = "host")]
13pub use build::{
14    build_ic_canister_count_report, build_ic_canister_count_report_with_source,
15    build_ic_canister_page_report, build_ic_canister_page_report_with_source,
16};
17#[cfg(feature = "host")]
18pub use build::{build_ic_canister_report, build_ic_canister_report_with_source};
19#[cfg(feature = "host")]
20pub use live::LiveIcSource;
21pub use model::{
22    IcCanisterCountReport, IcCanisterCountRequest, IcCanisterFilters, IcCanisterPageController,
23    IcCanisterPageReport, IcCanisterPageRequest, IcCanisterPageRow, IcCanisterReport,
24    IcCanisterRequest, IcCanisterUpgrade, IcDashboardReportProvenance,
25};
26#[cfg(feature = "host")]
27pub use model::{
28    IcCanisterCountSourceData, IcCanisterPageSourceData, IcCanisterSourceData, IcHostError,
29    IcSourceRequest,
30};
31#[cfg(feature = "host")]
32pub use source::{IcCanisterCollectionSource, IcCanisterSource};
33pub use text::{
34    ic_canister_count_report_text, ic_canister_page_report_text, ic_canister_report_text,
35};
36
37/// Default base endpoint for the official IC Dashboard API.
38pub const DEFAULT_IC_DASHBOARD_SOURCE_ENDPOINT: &str = "https://ic-api.internetcomputer.org/api/v3";
39
40/// Default base endpoint for official IC Dashboard canister collection queries.
41pub const DEFAULT_IC_DASHBOARD_CANISTER_COLLECTION_SOURCE_ENDPOINT: &str =
42    "https://ic-api.internetcomputer.org/api/v4";
43
44/// Default row limit for one official Dashboard canister page.
45pub const DEFAULT_IC_CANISTER_PAGE_LIMIT: u16 = 50;
46
47/// Maximum row limit accepted for one official Dashboard canister page.
48pub const MAX_IC_CANISTER_PAGE_LIMIT: u16 = 100;
49
50#[cfg(feature = "host")]
51const IC_CANISTER_REPORT_SCHEMA_VERSION: u32 = 1;
52#[cfg(feature = "host")]
53const IC_DASHBOARD_AUTHORITY: &str = "official_ic_dashboard_api";
54#[cfg(feature = "host")]
55const IC_DASHBOARD_NETWORK: &str = "ic";
56
57#[cfg(all(test, feature = "host"))]
58mod tests;