-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from go-bazzinga/rupansh/profile-view
feat: initial profile view
- Loading branch information
Showing
23 changed files
with
1,082 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
type CanisterInstallMode = variant { reinstall; upgrade; install }; | ||
type CanisterStatusResponse = record { | ||
status : CanisterStatusType; | ||
memory_size : nat; | ||
cycles : nat; | ||
settings : DefiniteCanisterSettings; | ||
idle_cycles_burned_per_day : nat; | ||
module_hash : opt vec nat8; | ||
}; | ||
type CanisterStatusType = variant { stopped; stopping; running }; | ||
type DefiniteCanisterSettings = record { | ||
freezing_threshold : nat; | ||
controllers : vec principal; | ||
memory_allocation : nat; | ||
compute_allocation : nat; | ||
}; | ||
type KnownPrincipalType = variant { | ||
CanisterIdUserIndex; | ||
CanisterIdConfiguration; | ||
CanisterIdProjectMemberIndex; | ||
CanisterIdTopicCacheIndex; | ||
CanisterIdRootCanister; | ||
CanisterIdDataBackup; | ||
CanisterIdPostCache; | ||
CanisterIdSNSController; | ||
UserIdGlobalSuperAdmin; | ||
}; | ||
type RejectionCode = variant { | ||
NoError; | ||
CanisterError; | ||
SysTransient; | ||
DestinationInvalid; | ||
Unknown; | ||
SysFatal; | ||
CanisterReject; | ||
}; | ||
type Result = variant { | ||
Ok : record { CanisterStatusResponse }; | ||
Err : record { RejectionCode; text }; | ||
}; | ||
type Result_1 = variant { Ok; Err : SetUniqueUsernameError }; | ||
type SetUniqueUsernameError = variant { | ||
UsernameAlreadyTaken; | ||
SendingCanisterDoesNotMatchUserCanisterId; | ||
UserCanisterEntryDoesNotExist; | ||
}; | ||
type SystemTime = record { | ||
nanos_since_epoch : nat32; | ||
secs_since_epoch : nat64; | ||
}; | ||
type UpgradeStatus = record { | ||
version_number : nat64; | ||
last_run_on : SystemTime; | ||
failed_canister_ids : vec record { principal; principal; text }; | ||
successful_upgrade_count : nat32; | ||
}; | ||
type UserAccessRole = variant { | ||
CanisterController; | ||
ProfileOwner; | ||
CanisterAdmin; | ||
ProjectCanister; | ||
}; | ||
type UserIndexInitArgs = record { | ||
known_principal_ids : opt vec record { KnownPrincipalType; principal }; | ||
access_control_map : opt vec record { principal; vec UserAccessRole }; | ||
}; | ||
service : (UserIndexInitArgs) -> { | ||
backup_all_individual_user_canisters : () -> (); | ||
get_index_details_is_user_name_taken : (text) -> (bool) query; | ||
get_index_details_last_upgrade_status : () -> (UpgradeStatus) query; | ||
get_requester_principals_canister_id_create_if_not_exists_and_optionally_allow_referrer : ( | ||
opt principal, | ||
) -> (principal); | ||
get_user_canister_id_from_unique_user_name : (text) -> (opt principal) query; | ||
get_user_canister_id_from_user_principal_id : (principal) -> ( | ||
opt principal, | ||
) query; | ||
get_user_canister_status : (principal) -> (Result); | ||
get_user_index_canister_count : () -> (nat64) query; | ||
get_user_index_canister_cycle_balance : () -> (nat) query; | ||
get_well_known_principal_value : (KnownPrincipalType) -> ( | ||
opt principal, | ||
) query; | ||
receive_data_from_backup_canister_and_restore_data_to_heap : ( | ||
principal, | ||
principal, | ||
text, | ||
) -> (); | ||
set_permission_to_upgrade_individual_canisters : (bool) -> (text); | ||
start_upgrades_for_individual_canisters : () -> (text); | ||
update_index_with_unique_user_name_corresponding_to_user_principal_id : ( | ||
text, | ||
principal, | ||
) -> (Result_1); | ||
upgrade_specific_individual_user_canister_with_latest_wasm : ( | ||
principal, | ||
principal, | ||
opt CanisterInstallMode, | ||
bool, | ||
) -> (text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
//! Auto generated bindings for canisters | ||
include!(concat!(env!("OUT_DIR"), "/did/mod.rs")); | ||
pub mod utils; | ||
|
||
pub const AGENT_URL: &str = "https://ic0.app"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use std::fmt::Display; | ||
|
||
use crate::consts::CF_STREAM_BASE; | ||
|
||
pub fn bg_url(uid: impl Display) -> String { | ||
format!("{CF_STREAM_BASE}/{uid}/thumbnails/thumbnail.jpg") | ||
} | ||
|
||
pub fn stream_url(uid: impl Display) -> String { | ||
format!("{CF_STREAM_BASE}/{uid}/manifest/video.m3u8") | ||
} |
Oops, something went wrong.