Skip to content

Commit

Permalink
build: generate did
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 25, 2023
1 parent a3030b1 commit 8531372
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions src/declarations/orbiter/orbiter.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export interface GetAnalytics {
from: [] | [bigint];
satellite_id: [] | [Principal];
}
export interface OrbiterSatelliteConfig {
updated_at: bigint;
created_at: bigint;
enabled: boolean;
}
export interface PageView {
title: string;
updated_at: bigint;
Expand All @@ -47,11 +52,6 @@ export interface PageViewDevice {
export type Result = { Ok: PageView } | { Err: string };
export type Result_1 = { Ok: null } | { Err: Array<[AnalyticKey, string]> };
export type Result_2 = { Ok: TrackEvent } | { Err: string };
export interface SatelliteConfig {
updated_at: bigint;
created_at: bigint;
enabled: boolean;
}
export interface SetController {
metadata: Array<[string, string]>;
scope: ControllerScope;
Expand Down Expand Up @@ -99,13 +99,13 @@ export interface _SERVICE {
get_page_views: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PageView]>>;
get_track_events: ActorMethod<[GetAnalytics], Array<[AnalyticKey, TrackEvent]>>;
list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
list_satellite_configs: ActorMethod<[], Array<[Principal, SatelliteConfig]>>;
list_satellite_configs: ActorMethod<[], Array<[Principal, OrbiterSatelliteConfig]>>;
set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
set_page_view: ActorMethod<[AnalyticKey, SetPageView], Result>;
set_page_views: ActorMethod<[Array<[AnalyticKey, SetPageView]>], Result_1>;
set_satellite_configs: ActorMethod<
[Array<[Principal, SetSatelliteConfig]>],
Array<[Principal, SatelliteConfig]>
Array<[Principal, OrbiterSatelliteConfig]>
>;
set_track_event: ActorMethod<[AnalyticKey, SetTrackEvent], Result_2>;
set_track_events: ActorMethod<[Array<[AnalyticKey, SetTrackEvent]>], Result_1>;
Expand Down
6 changes: 3 additions & 3 deletions src/declarations/orbiter/orbiter.factory.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const idlFactory = ({ IDL }) => {
created_at: IDL.Nat64,
satellite_id: IDL.Principal
});
const SatelliteConfig = IDL.Record({
const OrbiterSatelliteConfig = IDL.Record({
updated_at: IDL.Nat64,
created_at: IDL.Nat64,
enabled: IDL.Bool
Expand Down Expand Up @@ -116,7 +116,7 @@ export const idlFactory = ({ IDL }) => {
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
list_satellite_configs: IDL.Func(
[],
[IDL.Vec(IDL.Tuple(IDL.Principal, SatelliteConfig))],
[IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],
['query']
),
set_controllers: IDL.Func(
Expand All @@ -128,7 +128,7 @@ export const idlFactory = ({ IDL }) => {
set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),
set_satellite_configs: IDL.Func(
[IDL.Vec(IDL.Tuple(IDL.Principal, SetSatelliteConfig))],
[IDL.Vec(IDL.Tuple(IDL.Principal, SatelliteConfig))],
[IDL.Vec(IDL.Tuple(IDL.Principal, OrbiterSatelliteConfig))],
[]
),
set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_2], []),
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/lib/api/orbiter.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
AnalyticKey,
Controller,
PageView,
SatelliteConfig,
OrbiterSatelliteConfig as SatelliteConfig,
SetSatelliteConfig,
TrackEvent
} from '$declarations/orbiter/orbiter.did';
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/lib/types/ortbiter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SatelliteConfig } from '$declarations/orbiter/orbiter.did';
import type { OrbiterSatelliteConfig as SatelliteConfig } from '$declarations/orbiter/orbiter.did';

export interface PageViewsPeriod {
from?: Date;
Expand Down
14 changes: 7 additions & 7 deletions src/orbiter/orbiter.did
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ type GetAnalytics = record {
from : opt nat64;
satellite_id : opt principal;
};
type OrbiterSatelliteConfig = record {
updated_at : nat64;
created_at : nat64;
enabled : bool;
};
type PageView = record {
title : text;
updated_at : nat64;
Expand All @@ -31,11 +36,6 @@ type PageViewDevice = record { inner_height : nat16; inner_width : nat16 };
type Result = variant { Ok : PageView; Err : text };
type Result_1 = variant { Ok; Err : vec record { AnalyticKey; text } };
type Result_2 = variant { Ok : TrackEvent; Err : text };
type SatelliteConfig = record {
updated_at : nat64;
created_at : nat64;
enabled : bool;
};
type SetController = record {
metadata : vec record { text; text };
scope : ControllerScope;
Expand Down Expand Up @@ -87,15 +87,15 @@ service : () -> {
) query;
list_controllers : () -> (vec record { principal; Controller }) query;
list_satellite_configs : () -> (
vec record { principal; SatelliteConfig },
vec record { principal; OrbiterSatelliteConfig },
) query;
set_controllers : (SetControllersArgs) -> (
vec record { principal; Controller },
);
set_page_view : (AnalyticKey, SetPageView) -> (Result);
set_page_views : (vec record { AnalyticKey; SetPageView }) -> (Result_1);
set_satellite_configs : (vec record { principal; SetSatelliteConfig }) -> (
vec record { principal; SatelliteConfig },
vec record { principal; OrbiterSatelliteConfig },
);
set_track_event : (AnalyticKey, SetTrackEvent) -> (Result_2);
set_track_events : (vec record { AnalyticKey; SetTrackEvent }) -> (Result_1);
Expand Down

0 comments on commit 8531372

Please sign in to comment.