Skip to content

Commit

Permalink
feat: Satellite v0.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Nov 17, 2024
1 parent 07920a2 commit 3077752
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
10 changes: 5 additions & 5 deletions templates/eject/src/satellite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ crate-type = ["cdylib"]

[dependencies]
candid = "0.10.2"
ic-cdk = "0.15.1"
ic-cdk-macros = "0.15.0"
ic-cdk = "0.17.0"
ic-cdk-macros = "0.17.0"
serde = "1.0.190"
serde_cbor = "0.11.2"
junobuild-satellite = "0.0.20"
junobuild-macros = "0.0.2"
junobuild-utils = "0.0.3"
junobuild-satellite = "= 0.0.21-patch.1"
junobuild-macros = "0.0.3"
junobuild-utils = "0.0.4"

8 changes: 7 additions & 1 deletion templates/eject/src/satellite/satellite.did
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ type ListResults_1 = record {
type Memory = variant { Heap; Stable };
type MemorySize = record { stable : nat64; heap : nat64 };
type Permission = variant { Controllers; Private; Public; Managed };
type RateConfig = record { max_tokens : nat64; time_per_token_ns : nat64 };
type Rule = record {
max_capacity : opt nat32;
memory : opt Memory;
Expand All @@ -126,6 +127,7 @@ type Rule = record {
created_at : nat64;
version : opt nat64;
mutable_permissions : opt bool;
rate_config : opt RateConfig;
write : Permission;
};
type RulesType = variant { Db; Storage };
Expand All @@ -150,6 +152,7 @@ type SetRule = record {
read : Permission;
version : opt nat64;
mutable_permissions : opt bool;
rate_config : opt RateConfig;
write : Permission;
};
type StorageConfig = record {
Expand Down Expand Up @@ -208,6 +211,8 @@ service : () -> {
del_custom_domain : (text) -> ();
del_doc : (text, text, DelDoc) -> ();
del_docs : (text) -> ();
del_filtered_assets : (text, ListParams) -> ();
del_filtered_docs : (text, ListParams) -> ();
del_many_assets : (vec record { text; text }) -> ();
del_many_docs : (vec record { text; text; DelDoc }) -> ();
del_rule : (RulesType, text, DelRule) -> ();
Expand All @@ -223,6 +228,7 @@ service : () -> {
get_many_docs : (vec record { text; text }) -> (
vec record { text; opt Doc },
) query;
get_rule : (RulesType, text) -> (opt Rule) query;
get_storage_config : () -> (StorageConfig) query;
http_request : (HttpRequest) -> (HttpResponse) query;
http_request_streaming_callback : (StreamingCallbackToken) -> (
Expand All @@ -245,7 +251,7 @@ service : () -> {
set_many_docs : (vec record { text; text; SetDoc }) -> (
vec record { text; Doc },
);
set_rule : (RulesType, text, SetRule) -> ();
set_rule : (RulesType, text, SetRule) -> (Rule);
set_storage_config : (StorageConfig) -> ();
upload_asset_chunk : (UploadChunk) -> (UploadChunkResult);
version : () -> (text) query;
Expand Down
16 changes: 13 additions & 3 deletions templates/eject/src/satellite/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use junobuild_macros::{
assert_delete_asset, assert_delete_doc, assert_set_doc, assert_upload_asset, on_delete_asset,
on_delete_doc, on_delete_many_assets, on_delete_many_docs, on_set_doc, on_set_many_docs,
on_upload_asset,
on_delete_doc, on_delete_filtered_assets, on_delete_filtered_docs, on_delete_many_assets,
on_delete_many_docs, on_set_doc, on_set_many_docs, on_upload_asset,
};
use junobuild_satellite::{
include_satellite, AssertDeleteAssetContext, AssertDeleteDocContext, AssertSetDocContext,
AssertUploadAssetContext, OnDeleteAssetContext, OnDeleteDocContext, OnDeleteManyAssetsContext,
AssertUploadAssetContext, OnDeleteAssetContext, OnDeleteDocContext,
OnDeleteFilteredAssetsContext, OnDeleteFilteredDocsContext, OnDeleteManyAssetsContext,
OnDeleteManyDocsContext, OnSetDocContext, OnSetManyDocsContext, OnUploadAssetContext,
};

Expand All @@ -29,6 +30,11 @@ async fn on_delete_many_docs(_context: OnDeleteManyDocsContext) -> Result<(), St
Ok(())
}

#[on_delete_filtered_docs]
async fn on_delete_filtered_docs(_context: OnDeleteFilteredDocsContext) -> Result<(), String> {
Ok(())
}

#[on_upload_asset]
async fn on_upload_asset(_context: OnUploadAssetContext) -> Result<(), String> {
Ok(())
Expand All @@ -44,6 +50,10 @@ async fn on_delete_many_assets(_context: OnDeleteManyAssetsContext) -> Result<()
Ok(())
}

#[on_delete_filtered_assets]
async fn on_delete_filtered_assets(_context: OnDeleteFilteredAssetsContext) -> Result<(), String> {
Ok(())
}
#[assert_set_doc]
fn assert_set_doc(_context: AssertSetDocContext) -> Result<(), String> {
Ok(())
Expand Down

0 comments on commit 3077752

Please sign in to comment.