Skip to content

Commit

Permalink
feat: did types
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Nov 17, 2023
1 parent d397faf commit fcca354
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/declarations/mission_control/mission_control.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export interface _SERVICE {
del_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
del_orbiters_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
delete_orbiter: ActorMethod<[Principal, bigint], undefined>;
delete_satellite: ActorMethod<[Principal, bigint], undefined>;
get_user: ActorMethod<[], Principal>;
list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
list_mission_control_statuses: ActorMethod<[], Array<[bigint, Result]>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const idlFactory = ({ IDL }) => {
del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
del_orbiters_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
delete_orbiter: IDL.Func([IDL.Principal, IDL.Nat], [], []),
delete_satellite: IDL.Func([IDL.Principal, IDL.Nat], [], []),
get_user: IDL.Func([], [IDL.Principal], ['query']),
list_mission_control_controllers: IDL.Func(
[],
Expand Down
5 changes: 5 additions & 0 deletions src/declarations/orbiter/orbiter.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export interface DelSatelliteConfig {
export interface DeleteControllersArgs {
controllers: Array<Principal>;
}
export interface DepositCyclesArgs {
cycles_to_retain: bigint;
destination_id: Principal;
}
export interface GetAnalytics {
to: [] | [bigint];
from: [] | [bigint];
Expand Down Expand Up @@ -91,6 +95,7 @@ export interface TrackEvent {
export interface _SERVICE {
del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
del_satellite_config: ActorMethod<[Principal, DelSatelliteConfig], undefined>;
deposit_cycles: ActorMethod<[DepositCyclesArgs], undefined>;
get_page_views: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PageView]>>;
get_track_events: ActorMethod<[GetAnalytics], Array<[AnalyticKey, TrackEvent]>>;
list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
Expand Down
5 changes: 5 additions & 0 deletions src/declarations/orbiter/orbiter.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export const idlFactory = ({ IDL }) => {
expires_at: IDL.Opt(IDL.Nat64)
});
const DelSatelliteConfig = IDL.Record({ updated_at: IDL.Opt(IDL.Nat64) });
const DepositCyclesArgs = IDL.Record({
cycles_to_retain: IDL.Nat,
destination_id: IDL.Principal
});
const GetAnalytics = IDL.Record({
to: IDL.Opt(IDL.Nat64),
from: IDL.Opt(IDL.Nat64),
Expand Down Expand Up @@ -98,6 +102,7 @@ export const idlFactory = ({ IDL }) => {
[]
),
del_satellite_config: IDL.Func([IDL.Principal, DelSatelliteConfig], [], []),
deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
get_page_views: IDL.Func(
[GetAnalytics],
[IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],
Expand Down
5 changes: 5 additions & 0 deletions src/declarations/satellite/satellite.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export interface DelDoc {
export interface DeleteControllersArgs {
controllers: Array<Principal>;
}
export interface DepositCyclesArgs {
cycles_to_retain: bigint;
destination_id: Principal;
}
export interface Doc {
updated_at: bigint;
owner: Principal;
Expand Down Expand Up @@ -194,6 +198,7 @@ export interface _SERVICE {
del_custom_domain: ActorMethod<[string], undefined>;
del_doc: ActorMethod<[string, string, DelDoc], undefined>;
del_rule: ActorMethod<[RulesType, string, DelDoc], undefined>;
deposit_cycles: ActorMethod<[DepositCyclesArgs], undefined>;
get_config: ActorMethod<[], Config>;
get_doc: ActorMethod<[string, string], [] | [Doc]>;
http_request: ActorMethod<[HttpRequest], HttpResponse>;
Expand Down
5 changes: 5 additions & 0 deletions src/declarations/satellite/satellite.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const idlFactory = ({ IDL }) => {
});
const DelDoc = IDL.Record({ updated_at: IDL.Opt(IDL.Nat64) });
const RulesType = IDL.Variant({ Db: IDL.Null, Storage: IDL.Null });
const DepositCyclesArgs = IDL.Record({
cycles_to_retain: IDL.Nat,
destination_id: IDL.Principal
});
const StorageConfigRedirect = IDL.Record({
status_code: IDL.Nat16,
location: IDL.Text
Expand Down Expand Up @@ -194,6 +198,7 @@ export const idlFactory = ({ IDL }) => {
del_custom_domain: IDL.Func([IDL.Text], [], []),
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
get_config: IDL.Func([], [Config], []),
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
Expand Down
5 changes: 5 additions & 0 deletions src/declarations/satellite/satellite.factory.did.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const idlFactory = ({ IDL }) => {
});
const DelDoc = IDL.Record({ updated_at: IDL.Opt(IDL.Nat64) });
const RulesType = IDL.Variant({ Db: IDL.Null, Storage: IDL.Null });
const DepositCyclesArgs = IDL.Record({
cycles_to_retain: IDL.Nat,
destination_id: IDL.Principal
});
const StorageConfigRedirect = IDL.Record({
status_code: IDL.Nat16,
location: IDL.Text
Expand Down Expand Up @@ -194,6 +198,7 @@ export const idlFactory = ({ IDL }) => {
del_custom_domain: IDL.Func([IDL.Text], [], []),
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
get_config: IDL.Func([], [Config], []),
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
Expand Down
2 changes: 2 additions & 0 deletions src/mission_control/mission_control.did
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ service : () -> {
del_mission_control_controllers : (vec principal) -> ();
del_orbiters_controllers : (vec principal, vec principal) -> ();
del_satellites_controllers : (vec principal, vec principal) -> ();
delete_orbiter : (principal, nat) -> ();
delete_satellite : (principal, nat) -> ();
get_user : () -> (principal) query;
list_mission_control_controllers : () -> (
vec record { principal; Controller },
Expand Down
5 changes: 5 additions & 0 deletions src/orbiter/orbiter.did
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ type Controller = record {
type ControllerScope = variant { Write; Admin };
type DelSatelliteConfig = record { updated_at : opt nat64 };
type DeleteControllersArgs = record { controllers : vec principal };
type DepositCyclesArgs = record {
cycles_to_retain : nat;
destination_id : principal;
};
type GetAnalytics = record {
to : opt nat64;
from : opt nat64;
Expand Down Expand Up @@ -77,6 +81,7 @@ service : () -> {
vec record { principal; Controller },
);
del_satellite_config : (principal, DelSatelliteConfig) -> ();
deposit_cycles : (DepositCyclesArgs) -> ();
get_page_views : (GetAnalytics) -> (
vec record { AnalyticKey; PageView },
) query;
Expand Down
5 changes: 5 additions & 0 deletions src/satellite/satellite.did
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ type CustomDomain = record {
};
type DelDoc = record { updated_at : opt nat64 };
type DeleteControllersArgs = record { controllers : vec principal };
type DepositCyclesArgs = record {
cycles_to_retain : nat;
destination_id : principal;
};
type Doc = record {
updated_at : nat64;
owner : principal;
Expand Down Expand Up @@ -167,6 +171,7 @@ service : () -> {
del_custom_domain : (text) -> ();
del_doc : (text, text, DelDoc) -> ();
del_rule : (RulesType, text, DelDoc) -> ();
deposit_cycles : (DepositCyclesArgs) -> ();
get_config : () -> (Config);
get_doc : (text, text) -> (opt Doc) query;
http_request : (HttpRequest) -> (HttpResponse) query;
Expand Down

0 comments on commit fcca354

Please sign in to comment.