@junobuild/admin 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/console/console.did.d.ts +6 -3
- package/declarations/console/console.factory.did.js +6 -2
- package/declarations/console/console.factory.did.mjs +6 -2
- package/declarations/mission_control/mission_control.did.d.ts +19 -2
- package/declarations/mission_control/mission_control.factory.did.js +28 -2
- package/declarations/observatory/observatory.did.d.ts +4 -2
- package/declarations/observatory/observatory.factory.did.js +4 -2
- package/declarations/observatory/observatory.factory.did.mjs +4 -2
- package/declarations/orbiter/index.d.ts +45 -0
- package/declarations/orbiter/index.js +37 -0
- package/declarations/orbiter/orbiter.did.d.ts +103 -0
- package/declarations/orbiter/orbiter.factory.did.js +124 -0
- package/declarations/satellite/satellite.factory.did.js +1 -1
- package/declarations/satellite/satellite.factory.did.mjs +1 -1
- package/dist/browser/index.js +7 -7
- package/dist/browser/index.js.map +4 -4
- package/dist/declarations/console/console.did.d.ts +6 -3
- package/dist/declarations/console/console.factory.did.js +6 -2
- package/dist/declarations/console/console.factory.did.mjs +6 -2
- package/dist/declarations/mission_control/mission_control.did.d.ts +19 -2
- package/dist/declarations/mission_control/mission_control.factory.did.js +28 -2
- package/dist/declarations/observatory/observatory.did.d.ts +4 -2
- package/dist/declarations/observatory/observatory.factory.did.js +4 -2
- package/dist/declarations/observatory/observatory.factory.did.mjs +4 -2
- package/dist/declarations/orbiter/index.d.ts +45 -0
- package/dist/declarations/orbiter/index.js +37 -0
- package/dist/declarations/orbiter/orbiter.did.d.ts +103 -0
- package/dist/declarations/orbiter/orbiter.factory.did.js +124 -0
- package/dist/declarations/satellite/satellite.factory.did.js +1 -1
- package/dist/declarations/satellite/satellite.factory.did.mjs +1 -1
- package/dist/node/index.mjs +7 -7
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/actor.api.d.ts +3 -1
- package/dist/types/api/orbiter.api.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/orbiter.services.d.ts +8 -0
- package/dist/types/types/actor.types.d.ts +3 -0
- package/dist/types/utils/idl.utils.d.ts +3 -0
- package/package.json +4 -5
|
@@ -9,7 +9,7 @@ export interface AssertMissionControlCenterArgs {
|
|
|
9
9
|
user: Principal;
|
|
10
10
|
}
|
|
11
11
|
export type ControllerScope = {Write: null} | {Admin: null};
|
|
12
|
-
export interface
|
|
12
|
+
export interface CreateCanisterArgs {
|
|
13
13
|
block_index: [] | [bigint];
|
|
14
14
|
user: Principal;
|
|
15
15
|
}
|
|
@@ -33,9 +33,10 @@ export interface RateConfig {
|
|
|
33
33
|
}
|
|
34
34
|
export interface ReleasesVersion {
|
|
35
35
|
satellite: [] | [string];
|
|
36
|
+
orbiter: [] | [string];
|
|
36
37
|
mission_control: [] | [string];
|
|
37
38
|
}
|
|
38
|
-
export type Segment = {MissionControl: null} | {Satellite: null};
|
|
39
|
+
export type Segment = {Orbiter: null} | {MissionControl: null} | {Satellite: null};
|
|
39
40
|
export interface SetController {
|
|
40
41
|
metadata: Array<[string, string]>;
|
|
41
42
|
scope: ControllerScope;
|
|
@@ -52,8 +53,10 @@ export interface _SERVICE {
|
|
|
52
53
|
add_credits: ActorMethod<[AddCreditsArgs], undefined>;
|
|
53
54
|
add_invitation_code: ActorMethod<[string], undefined>;
|
|
54
55
|
assert_mission_control_center: ActorMethod<[AssertMissionControlCenterArgs], undefined>;
|
|
55
|
-
|
|
56
|
+
create_orbiter: ActorMethod<[CreateCanisterArgs], Principal>;
|
|
57
|
+
create_satellite: ActorMethod<[CreateCanisterArgs], Principal>;
|
|
56
58
|
del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
|
|
59
|
+
get_create_orbiter_fee: ActorMethod<[AddCreditsArgs], [] | [Tokens]>;
|
|
57
60
|
get_create_satellite_fee: ActorMethod<[AddCreditsArgs], [] | [Tokens]>;
|
|
58
61
|
get_credits: ActorMethod<[], Tokens>;
|
|
59
62
|
get_releases_version: ActorMethod<[], ReleasesVersion>;
|
|
@@ -5,7 +5,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
5
5
|
mission_control_id: IDL.Principal,
|
|
6
6
|
user: IDL.Principal
|
|
7
7
|
});
|
|
8
|
-
const
|
|
8
|
+
const CreateCanisterArgs = IDL.Record({
|
|
9
9
|
block_index: IDL.Opt(IDL.Nat64),
|
|
10
10
|
user: IDL.Principal
|
|
11
11
|
});
|
|
@@ -15,6 +15,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
15
15
|
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
16
16
|
const ReleasesVersion = IDL.Record({
|
|
17
17
|
satellite: IDL.Opt(IDL.Text),
|
|
18
|
+
orbiter: IDL.Opt(IDL.Text),
|
|
18
19
|
mission_control: IDL.Opt(IDL.Text)
|
|
19
20
|
});
|
|
20
21
|
const MissionControl = IDL.Record({
|
|
@@ -25,6 +26,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
25
26
|
created_at: IDL.Nat64
|
|
26
27
|
});
|
|
27
28
|
const Segment = IDL.Variant({
|
|
29
|
+
Orbiter: IDL.Null,
|
|
28
30
|
MissionControl: IDL.Null,
|
|
29
31
|
Satellite: IDL.Null
|
|
30
32
|
});
|
|
@@ -50,8 +52,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
50
52
|
add_credits: IDL.Func([AddCreditsArgs], [], []),
|
|
51
53
|
add_invitation_code: IDL.Func([IDL.Text], [], []),
|
|
52
54
|
assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
|
|
53
|
-
|
|
55
|
+
create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
|
|
56
|
+
create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
|
|
54
57
|
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
58
|
+
get_create_orbiter_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
|
|
55
59
|
get_create_satellite_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
|
|
56
60
|
get_credits: IDL.Func([], [Tokens], ['query']),
|
|
57
61
|
get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
|
|
@@ -5,7 +5,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
5
5
|
mission_control_id: IDL.Principal,
|
|
6
6
|
user: IDL.Principal
|
|
7
7
|
});
|
|
8
|
-
const
|
|
8
|
+
const CreateCanisterArgs = IDL.Record({
|
|
9
9
|
block_index: IDL.Opt(IDL.Nat64),
|
|
10
10
|
user: IDL.Principal
|
|
11
11
|
});
|
|
@@ -15,6 +15,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
15
15
|
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
16
16
|
const ReleasesVersion = IDL.Record({
|
|
17
17
|
satellite: IDL.Opt(IDL.Text),
|
|
18
|
+
orbiter: IDL.Opt(IDL.Text),
|
|
18
19
|
mission_control: IDL.Opt(IDL.Text)
|
|
19
20
|
});
|
|
20
21
|
const MissionControl = IDL.Record({
|
|
@@ -25,6 +26,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
25
26
|
created_at: IDL.Nat64
|
|
26
27
|
});
|
|
27
28
|
const Segment = IDL.Variant({
|
|
29
|
+
Orbiter: IDL.Null,
|
|
28
30
|
MissionControl: IDL.Null,
|
|
29
31
|
Satellite: IDL.Null
|
|
30
32
|
});
|
|
@@ -50,8 +52,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
50
52
|
add_credits: IDL.Func([AddCreditsArgs], [], []),
|
|
51
53
|
add_invitation_code: IDL.Func([IDL.Text], [], []),
|
|
52
54
|
assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
|
|
53
|
-
|
|
55
|
+
create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
|
|
56
|
+
create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
|
|
54
57
|
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
58
|
+
get_create_orbiter_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
|
|
55
59
|
get_create_satellite_fee: IDL.Func([AddCreditsArgs], [IDL.Opt(Tokens)], ['query']),
|
|
56
60
|
get_credits: IDL.Func([], [Tokens], ['query']),
|
|
57
61
|
get_releases_version: IDL.Func([], [ReleasesVersion], ['query']),
|
|
@@ -18,7 +18,7 @@ export interface Controller {
|
|
|
18
18
|
expires_at: [] | [bigint];
|
|
19
19
|
}
|
|
20
20
|
export type ControllerScope = {Write: null} | {Admin: null};
|
|
21
|
-
export interface
|
|
21
|
+
export interface CronJobStatusesConfig {
|
|
22
22
|
enabled: boolean;
|
|
23
23
|
cycles_threshold: [] | [bigint];
|
|
24
24
|
}
|
|
@@ -28,6 +28,12 @@ export interface DefiniteCanisterSettings {
|
|
|
28
28
|
memory_allocation: bigint;
|
|
29
29
|
compute_allocation: bigint;
|
|
30
30
|
}
|
|
31
|
+
export interface Orbiter {
|
|
32
|
+
updated_at: bigint;
|
|
33
|
+
orbiter_id: Principal;
|
|
34
|
+
metadata: Array<[string, string]>;
|
|
35
|
+
created_at: bigint;
|
|
36
|
+
}
|
|
31
37
|
export type Result = {Ok: SegmentStatus} | {Err: string};
|
|
32
38
|
export interface Satellite {
|
|
33
39
|
updated_at: bigint;
|
|
@@ -42,6 +48,7 @@ export interface SegmentStatus {
|
|
|
42
48
|
status_at: bigint;
|
|
43
49
|
}
|
|
44
50
|
export interface SegmentsStatuses {
|
|
51
|
+
orbiters: [] | [Array<Result>];
|
|
45
52
|
satellites: [] | [Array<Result>];
|
|
46
53
|
mission_control: Result;
|
|
47
54
|
}
|
|
@@ -52,7 +59,8 @@ export interface SetController {
|
|
|
52
59
|
}
|
|
53
60
|
export interface StatusesArgs {
|
|
54
61
|
mission_control_cycles_threshold: [] | [bigint];
|
|
55
|
-
|
|
62
|
+
orbiters: Array<[Principal, CronJobStatusesConfig]>;
|
|
63
|
+
satellites: Array<[Principal, CronJobStatusesConfig]>;
|
|
56
64
|
cycles_threshold: [] | [bigint];
|
|
57
65
|
}
|
|
58
66
|
export interface Tokens {
|
|
@@ -61,18 +69,27 @@ export interface Tokens {
|
|
|
61
69
|
export interface _SERVICE {
|
|
62
70
|
add_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
|
|
63
71
|
add_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
|
|
72
|
+
create_orbiter: ActorMethod<[[] | [string]], Orbiter>;
|
|
64
73
|
create_satellite: ActorMethod<[string], Satellite>;
|
|
65
74
|
del_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
|
|
75
|
+
del_orbiters_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
|
|
66
76
|
del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
|
|
67
77
|
get_user: ActorMethod<[], Principal>;
|
|
68
78
|
list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
|
|
69
79
|
list_mission_control_statuses: ActorMethod<[], Array<[bigint, Result]>>;
|
|
80
|
+
list_orbiter_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result]>]>;
|
|
81
|
+
list_orbiters: ActorMethod<[], Array<[Principal, Orbiter]>>;
|
|
70
82
|
list_satellite_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result]>]>;
|
|
71
83
|
list_satellites: ActorMethod<[], Array<[Principal, Satellite]>>;
|
|
72
84
|
remove_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
|
|
73
85
|
remove_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
|
|
74
86
|
set_metadata: ActorMethod<[Array<[string, string]>], undefined>;
|
|
75
87
|
set_mission_control_controllers: ActorMethod<[Array<Principal>, SetController], undefined>;
|
|
88
|
+
set_orbiter_metadata: ActorMethod<[Principal, Array<[string, string]>], Orbiter>;
|
|
89
|
+
set_orbiters_controllers: ActorMethod<
|
|
90
|
+
[Array<Principal>, Array<Principal>, SetController],
|
|
91
|
+
undefined
|
|
92
|
+
>;
|
|
76
93
|
set_satellite_metadata: ActorMethod<[Principal, Array<[string, string]>], Satellite>;
|
|
77
94
|
set_satellites_controllers: ActorMethod<
|
|
78
95
|
[Array<Principal>, Array<Principal>, SetController],
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const Orbiter = IDL.Record({
|
|
4
|
+
updated_at: IDL.Nat64,
|
|
5
|
+
orbiter_id: IDL.Principal,
|
|
6
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
7
|
+
created_at: IDL.Nat64
|
|
8
|
+
});
|
|
3
9
|
const Satellite = IDL.Record({
|
|
4
10
|
updated_at: IDL.Nat64,
|
|
5
11
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
@@ -48,16 +54,18 @@ export const idlFactory = ({IDL}) => {
|
|
|
48
54
|
scope: ControllerScope,
|
|
49
55
|
expires_at: IDL.Opt(IDL.Nat64)
|
|
50
56
|
});
|
|
51
|
-
const
|
|
57
|
+
const CronJobStatusesConfig = IDL.Record({
|
|
52
58
|
enabled: IDL.Bool,
|
|
53
59
|
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
54
60
|
});
|
|
55
61
|
const StatusesArgs = IDL.Record({
|
|
56
62
|
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
57
|
-
|
|
63
|
+
orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
64
|
+
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
58
65
|
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
59
66
|
});
|
|
60
67
|
const SegmentsStatuses = IDL.Record({
|
|
68
|
+
orbiters: IDL.Opt(IDL.Vec(Result)),
|
|
61
69
|
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
62
70
|
mission_control: Result
|
|
63
71
|
});
|
|
@@ -65,8 +73,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
65
73
|
return IDL.Service({
|
|
66
74
|
add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
67
75
|
add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
|
|
76
|
+
create_orbiter: IDL.Func([IDL.Opt(IDL.Text)], [Orbiter], []),
|
|
68
77
|
create_satellite: IDL.Func([IDL.Text], [Satellite], []),
|
|
69
78
|
del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
79
|
+
del_orbiters_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
|
|
70
80
|
del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
|
|
71
81
|
get_user: IDL.Func([], [IDL.Principal], ['query']),
|
|
72
82
|
list_mission_control_controllers: IDL.Func(
|
|
@@ -75,6 +85,12 @@ export const idlFactory = ({IDL}) => {
|
|
|
75
85
|
['query']
|
|
76
86
|
),
|
|
77
87
|
list_mission_control_statuses: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Result))], ['query']),
|
|
88
|
+
list_orbiter_statuses: IDL.Func(
|
|
89
|
+
[IDL.Principal],
|
|
90
|
+
[IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result)))],
|
|
91
|
+
['query']
|
|
92
|
+
),
|
|
93
|
+
list_orbiters: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Orbiter))], ['query']),
|
|
78
94
|
list_satellite_statuses: IDL.Func(
|
|
79
95
|
[IDL.Principal],
|
|
80
96
|
[IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result)))],
|
|
@@ -89,6 +105,16 @@ export const idlFactory = ({IDL}) => {
|
|
|
89
105
|
),
|
|
90
106
|
set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
|
|
91
107
|
set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),
|
|
108
|
+
set_orbiter_metadata: IDL.Func(
|
|
109
|
+
[IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
|
|
110
|
+
[Orbiter],
|
|
111
|
+
[]
|
|
112
|
+
),
|
|
113
|
+
set_orbiters_controllers: IDL.Func(
|
|
114
|
+
[IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],
|
|
115
|
+
[],
|
|
116
|
+
[]
|
|
117
|
+
),
|
|
92
118
|
set_satellite_metadata: IDL.Func(
|
|
93
119
|
[IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
|
|
94
120
|
[Satellite],
|
|
@@ -13,11 +13,12 @@ export type CanisterStatusType = {stopped: null} | {stopping: null} | {running:
|
|
|
13
13
|
export type ControllerScope = {Write: null} | {Admin: null};
|
|
14
14
|
export interface CronJobStatuses {
|
|
15
15
|
mission_control_cycles_threshold: [] | [bigint];
|
|
16
|
-
|
|
16
|
+
orbiters: Array<[Principal, CronJobStatusesConfig]>;
|
|
17
|
+
satellites: Array<[Principal, CronJobStatusesConfig]>;
|
|
17
18
|
enabled: boolean;
|
|
18
19
|
cycles_threshold: [] | [bigint];
|
|
19
20
|
}
|
|
20
|
-
export interface
|
|
21
|
+
export interface CronJobStatusesConfig {
|
|
21
22
|
enabled: boolean;
|
|
22
23
|
cycles_threshold: [] | [bigint];
|
|
23
24
|
}
|
|
@@ -57,6 +58,7 @@ export interface SegmentStatus {
|
|
|
57
58
|
status_at: bigint;
|
|
58
59
|
}
|
|
59
60
|
export interface SegmentsStatuses {
|
|
61
|
+
orbiters: [] | [Array<Result>];
|
|
60
62
|
satellites: [] | [Array<Result>];
|
|
61
63
|
mission_control: Result;
|
|
62
64
|
}
|
|
@@ -3,13 +3,14 @@ export const idlFactory = ({IDL}) => {
|
|
|
3
3
|
const DeleteControllersArgs = IDL.Record({
|
|
4
4
|
controllers: IDL.Vec(IDL.Principal)
|
|
5
5
|
});
|
|
6
|
-
const
|
|
6
|
+
const CronJobStatusesConfig = IDL.Record({
|
|
7
7
|
enabled: IDL.Bool,
|
|
8
8
|
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
9
9
|
});
|
|
10
10
|
const CronJobStatuses = IDL.Record({
|
|
11
11
|
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
12
|
-
|
|
12
|
+
orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
13
|
+
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
13
14
|
enabled: IDL.Bool,
|
|
14
15
|
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
15
16
|
});
|
|
@@ -51,6 +52,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
51
52
|
});
|
|
52
53
|
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
53
54
|
const SegmentsStatuses = IDL.Record({
|
|
55
|
+
orbiters: IDL.Opt(IDL.Vec(Result)),
|
|
54
56
|
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
55
57
|
mission_control: Result
|
|
56
58
|
});
|
|
@@ -3,13 +3,14 @@ export const idlFactory = ({IDL}) => {
|
|
|
3
3
|
const DeleteControllersArgs = IDL.Record({
|
|
4
4
|
controllers: IDL.Vec(IDL.Principal)
|
|
5
5
|
});
|
|
6
|
-
const
|
|
6
|
+
const CronJobStatusesConfig = IDL.Record({
|
|
7
7
|
enabled: IDL.Bool,
|
|
8
8
|
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
9
9
|
});
|
|
10
10
|
const CronJobStatuses = IDL.Record({
|
|
11
11
|
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
12
|
-
|
|
12
|
+
orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
13
|
+
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
|
|
13
14
|
enabled: IDL.Bool,
|
|
14
15
|
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
15
16
|
});
|
|
@@ -51,6 +52,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
51
52
|
});
|
|
52
53
|
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
53
54
|
const SegmentsStatuses = IDL.Record({
|
|
55
|
+
orbiters: IDL.Opt(IDL.Vec(Result)),
|
|
54
56
|
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
55
57
|
mission_control: Result
|
|
56
58
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type {ActorConfig, ActorSubclass, Agent, HttpAgentOptions} from '@dfinity/agent';
|
|
2
|
+
import type {IDL} from '@dfinity/candid';
|
|
3
|
+
import type {Principal} from '@dfinity/principal';
|
|
4
|
+
|
|
5
|
+
import {_SERVICE} from './orbiter.did';
|
|
6
|
+
|
|
7
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
8
|
+
export declare const canisterId: string;
|
|
9
|
+
|
|
10
|
+
export declare interface CreateActorOptions {
|
|
11
|
+
/**
|
|
12
|
+
* @see {@link Agent}
|
|
13
|
+
*/
|
|
14
|
+
agent?: Agent;
|
|
15
|
+
/**
|
|
16
|
+
* @see {@link HttpAgentOptions}
|
|
17
|
+
*/
|
|
18
|
+
agentOptions?: HttpAgentOptions;
|
|
19
|
+
/**
|
|
20
|
+
* @see {@link ActorConfig}
|
|
21
|
+
*/
|
|
22
|
+
actorOptions?: ActorConfig;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister.
|
|
27
|
+
* @constructs {@link ActorSubClass}
|
|
28
|
+
* @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to
|
|
29
|
+
* @param {CreateActorOptions} options - see {@link CreateActorOptions}
|
|
30
|
+
* @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions
|
|
31
|
+
* @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent
|
|
32
|
+
* @see {@link HttpAgentOptions}
|
|
33
|
+
* @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor
|
|
34
|
+
* @see {@link ActorConfig}
|
|
35
|
+
*/
|
|
36
|
+
export declare const createActor: (
|
|
37
|
+
canisterId: string | Principal,
|
|
38
|
+
options?: CreateActorOptions
|
|
39
|
+
) => ActorSubclass<_SERVICE>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Intialized Actor using default settings, ready to talk to a canister using its candid interface
|
|
43
|
+
* @constructs {@link ActorSubClass}
|
|
44
|
+
*/
|
|
45
|
+
export declare const orbiter: ActorSubclass<_SERVICE>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
+
|
|
3
|
+
// Imports and re-exports candid interface
|
|
4
|
+
import {idlFactory} from './orbiter.did.js';
|
|
5
|
+
export {idlFactory} from './orbiter.did.js';
|
|
6
|
+
|
|
7
|
+
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
+
* Note: canister environment variable will be standardized as
|
|
9
|
+
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
+
* beginning in dfx 0.15.0
|
|
11
|
+
*/
|
|
12
|
+
export const canisterId = process.env.CANISTER_ID_ORBITER || process.env.ORBITER_CANISTER_ID;
|
|
13
|
+
|
|
14
|
+
export const createActor = (canisterId, options = {}) => {
|
|
15
|
+
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
16
|
+
|
|
17
|
+
if (options.agent && options.agentOptions) {
|
|
18
|
+
console.warn(
|
|
19
|
+
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Fetch root key for certificate validation during development
|
|
24
|
+
if (process.env.DFX_NETWORK !== 'ic') {
|
|
25
|
+
agent.fetchRootKey().catch((err) => {
|
|
26
|
+
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
27
|
+
console.error(err);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Creates an actor with using the candid interface and the HttpAgent
|
|
32
|
+
return Actor.createActor(idlFactory, {
|
|
33
|
+
agent,
|
|
34
|
+
canisterId,
|
|
35
|
+
...options.actorOptions
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
+
import type {Principal} from '@dfinity/principal';
|
|
3
|
+
|
|
4
|
+
export interface AnalyticKey {
|
|
5
|
+
key: string;
|
|
6
|
+
session_id: string;
|
|
7
|
+
satellite_id: Principal;
|
|
8
|
+
}
|
|
9
|
+
export interface Controller {
|
|
10
|
+
updated_at: bigint;
|
|
11
|
+
metadata: Array<[string, string]>;
|
|
12
|
+
created_at: bigint;
|
|
13
|
+
scope: ControllerScope;
|
|
14
|
+
expires_at: [] | [bigint];
|
|
15
|
+
}
|
|
16
|
+
export type ControllerScope = {Write: null} | {Admin: null};
|
|
17
|
+
export interface DelOriginConfig {
|
|
18
|
+
updated_at: [] | [bigint];
|
|
19
|
+
}
|
|
20
|
+
export interface DeleteControllersArgs {
|
|
21
|
+
controllers: Array<Principal>;
|
|
22
|
+
}
|
|
23
|
+
export interface GetAnalytics {
|
|
24
|
+
to: [] | [bigint];
|
|
25
|
+
from: [] | [bigint];
|
|
26
|
+
satellite_id: [] | [Principal];
|
|
27
|
+
}
|
|
28
|
+
export interface OriginConfig {
|
|
29
|
+
key: Principal;
|
|
30
|
+
updated_at: bigint;
|
|
31
|
+
created_at: bigint;
|
|
32
|
+
filter: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PageView {
|
|
35
|
+
title: string;
|
|
36
|
+
updated_at: bigint;
|
|
37
|
+
referrer: [] | [string];
|
|
38
|
+
time_zone: string;
|
|
39
|
+
href: string;
|
|
40
|
+
created_at: bigint;
|
|
41
|
+
device: PageViewDevice;
|
|
42
|
+
user_agent: [] | [string];
|
|
43
|
+
collected_at: bigint;
|
|
44
|
+
}
|
|
45
|
+
export interface PageViewDevice {
|
|
46
|
+
inner_height: number;
|
|
47
|
+
inner_width: number;
|
|
48
|
+
}
|
|
49
|
+
export type Result = {Ok: PageView} | {Err: string};
|
|
50
|
+
export type Result_1 = {Ok: null} | {Err: string};
|
|
51
|
+
export type Result_2 = {Ok: TrackEvent} | {Err: string};
|
|
52
|
+
export interface SetController {
|
|
53
|
+
metadata: Array<[string, string]>;
|
|
54
|
+
scope: ControllerScope;
|
|
55
|
+
expires_at: [] | [bigint];
|
|
56
|
+
}
|
|
57
|
+
export interface SetControllersArgs {
|
|
58
|
+
controller: SetController;
|
|
59
|
+
controllers: Array<Principal>;
|
|
60
|
+
}
|
|
61
|
+
export interface SetOriginConfig {
|
|
62
|
+
key: Principal;
|
|
63
|
+
updated_at: [] | [bigint];
|
|
64
|
+
filter: string;
|
|
65
|
+
}
|
|
66
|
+
export interface SetPageView {
|
|
67
|
+
title: string;
|
|
68
|
+
updated_at: [] | [bigint];
|
|
69
|
+
referrer: [] | [string];
|
|
70
|
+
time_zone: string;
|
|
71
|
+
href: string;
|
|
72
|
+
device: PageViewDevice;
|
|
73
|
+
user_agent: [] | [string];
|
|
74
|
+
collected_at: bigint;
|
|
75
|
+
}
|
|
76
|
+
export interface SetTrackEvent {
|
|
77
|
+
updated_at: [] | [bigint];
|
|
78
|
+
metadata: [] | [Array<[string, string]>];
|
|
79
|
+
name: string;
|
|
80
|
+
collected_at: bigint;
|
|
81
|
+
}
|
|
82
|
+
export interface TrackEvent {
|
|
83
|
+
updated_at: bigint;
|
|
84
|
+
metadata: [] | [Array<[string, string]>];
|
|
85
|
+
name: string;
|
|
86
|
+
created_at: bigint;
|
|
87
|
+
collected_at: bigint;
|
|
88
|
+
}
|
|
89
|
+
export interface _SERVICE {
|
|
90
|
+
del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
|
|
91
|
+
del_origin_config: ActorMethod<[Principal, DelOriginConfig], undefined>;
|
|
92
|
+
get_page_views: ActorMethod<[GetAnalytics], Array<[AnalyticKey, PageView]>>;
|
|
93
|
+
get_track_events: ActorMethod<[GetAnalytics], Array<[AnalyticKey, TrackEvent]>>;
|
|
94
|
+
list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
|
|
95
|
+
list_origin_configs: ActorMethod<[], Array<[Principal, OriginConfig]>>;
|
|
96
|
+
set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
|
|
97
|
+
set_origin_config: ActorMethod<[Principal, SetOriginConfig], OriginConfig>;
|
|
98
|
+
set_page_view: ActorMethod<[AnalyticKey, SetPageView], Result>;
|
|
99
|
+
set_page_views: ActorMethod<[Array<[AnalyticKey, SetPageView]>], Result_1>;
|
|
100
|
+
set_track_event: ActorMethod<[AnalyticKey, SetTrackEvent], Result_2>;
|
|
101
|
+
set_track_events: ActorMethod<[Array<[AnalyticKey, SetTrackEvent]>], Result_1>;
|
|
102
|
+
version: ActorMethod<[], string>;
|
|
103
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const DeleteControllersArgs = IDL.Record({
|
|
4
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
5
|
+
});
|
|
6
|
+
const ControllerScope = IDL.Variant({
|
|
7
|
+
Write: IDL.Null,
|
|
8
|
+
Admin: IDL.Null
|
|
9
|
+
});
|
|
10
|
+
const Controller = IDL.Record({
|
|
11
|
+
updated_at: IDL.Nat64,
|
|
12
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
13
|
+
created_at: IDL.Nat64,
|
|
14
|
+
scope: ControllerScope,
|
|
15
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
16
|
+
});
|
|
17
|
+
const DelOriginConfig = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});
|
|
18
|
+
const GetAnalytics = IDL.Record({
|
|
19
|
+
to: IDL.Opt(IDL.Nat64),
|
|
20
|
+
from: IDL.Opt(IDL.Nat64),
|
|
21
|
+
satellite_id: IDL.Opt(IDL.Principal)
|
|
22
|
+
});
|
|
23
|
+
const AnalyticKey = IDL.Record({
|
|
24
|
+
key: IDL.Text,
|
|
25
|
+
session_id: IDL.Text,
|
|
26
|
+
satellite_id: IDL.Principal
|
|
27
|
+
});
|
|
28
|
+
const PageViewDevice = IDL.Record({
|
|
29
|
+
inner_height: IDL.Nat16,
|
|
30
|
+
inner_width: IDL.Nat16
|
|
31
|
+
});
|
|
32
|
+
const PageView = IDL.Record({
|
|
33
|
+
title: IDL.Text,
|
|
34
|
+
updated_at: IDL.Nat64,
|
|
35
|
+
referrer: IDL.Opt(IDL.Text),
|
|
36
|
+
time_zone: IDL.Text,
|
|
37
|
+
href: IDL.Text,
|
|
38
|
+
created_at: IDL.Nat64,
|
|
39
|
+
device: PageViewDevice,
|
|
40
|
+
user_agent: IDL.Opt(IDL.Text),
|
|
41
|
+
collected_at: IDL.Nat64
|
|
42
|
+
});
|
|
43
|
+
const TrackEvent = IDL.Record({
|
|
44
|
+
updated_at: IDL.Nat64,
|
|
45
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
46
|
+
name: IDL.Text,
|
|
47
|
+
created_at: IDL.Nat64,
|
|
48
|
+
collected_at: IDL.Nat64
|
|
49
|
+
});
|
|
50
|
+
const OriginConfig = IDL.Record({
|
|
51
|
+
key: IDL.Principal,
|
|
52
|
+
updated_at: IDL.Nat64,
|
|
53
|
+
created_at: IDL.Nat64,
|
|
54
|
+
filter: IDL.Text
|
|
55
|
+
});
|
|
56
|
+
const SetController = IDL.Record({
|
|
57
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
58
|
+
scope: ControllerScope,
|
|
59
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
60
|
+
});
|
|
61
|
+
const SetControllersArgs = IDL.Record({
|
|
62
|
+
controller: SetController,
|
|
63
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
64
|
+
});
|
|
65
|
+
const SetOriginConfig = IDL.Record({
|
|
66
|
+
key: IDL.Principal,
|
|
67
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
68
|
+
filter: IDL.Text
|
|
69
|
+
});
|
|
70
|
+
const SetPageView = IDL.Record({
|
|
71
|
+
title: IDL.Text,
|
|
72
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
73
|
+
referrer: IDL.Opt(IDL.Text),
|
|
74
|
+
time_zone: IDL.Text,
|
|
75
|
+
href: IDL.Text,
|
|
76
|
+
device: PageViewDevice,
|
|
77
|
+
user_agent: IDL.Opt(IDL.Text),
|
|
78
|
+
collected_at: IDL.Nat64
|
|
79
|
+
});
|
|
80
|
+
const Result = IDL.Variant({Ok: PageView, Err: IDL.Text});
|
|
81
|
+
const Result_1 = IDL.Variant({Ok: IDL.Null, Err: IDL.Text});
|
|
82
|
+
const SetTrackEvent = IDL.Record({
|
|
83
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
84
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
85
|
+
name: IDL.Text,
|
|
86
|
+
collected_at: IDL.Nat64
|
|
87
|
+
});
|
|
88
|
+
const Result_2 = IDL.Variant({Ok: TrackEvent, Err: IDL.Text});
|
|
89
|
+
return IDL.Service({
|
|
90
|
+
del_controllers: IDL.Func(
|
|
91
|
+
[DeleteControllersArgs],
|
|
92
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
93
|
+
[]
|
|
94
|
+
),
|
|
95
|
+
del_origin_config: IDL.Func([IDL.Principal, DelOriginConfig], [], []),
|
|
96
|
+
get_page_views: IDL.Func(
|
|
97
|
+
[GetAnalytics],
|
|
98
|
+
[IDL.Vec(IDL.Tuple(AnalyticKey, PageView))],
|
|
99
|
+
['query']
|
|
100
|
+
),
|
|
101
|
+
get_track_events: IDL.Func(
|
|
102
|
+
[GetAnalytics],
|
|
103
|
+
[IDL.Vec(IDL.Tuple(AnalyticKey, TrackEvent))],
|
|
104
|
+
['query']
|
|
105
|
+
),
|
|
106
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
|
|
107
|
+
list_origin_configs: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, OriginConfig))], ['query']),
|
|
108
|
+
set_controllers: IDL.Func(
|
|
109
|
+
[SetControllersArgs],
|
|
110
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
111
|
+
[]
|
|
112
|
+
),
|
|
113
|
+
set_origin_config: IDL.Func([IDL.Principal, SetOriginConfig], [OriginConfig], []),
|
|
114
|
+
set_page_view: IDL.Func([AnalyticKey, SetPageView], [Result], []),
|
|
115
|
+
set_page_views: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetPageView))], [Result_1], []),
|
|
116
|
+
set_track_event: IDL.Func([AnalyticKey, SetTrackEvent], [Result_2], []),
|
|
117
|
+
set_track_events: IDL.Func([IDL.Vec(IDL.Tuple(AnalyticKey, SetTrackEvent))], [Result_1], []),
|
|
118
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
export const init = ({IDL}) => {
|
|
123
|
+
return [];
|
|
124
|
+
};
|
|
@@ -50,7 +50,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
50
50
|
const StreamingStrategy = IDL.Variant({
|
|
51
51
|
Callback: IDL.Record({
|
|
52
52
|
token: StreamingCallbackToken,
|
|
53
|
-
callback: IDL.Func([], [], [])
|
|
53
|
+
callback: IDL.Func([], [], ['query'])
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
56
|
const HttpResponse = IDL.Record({
|
|
@@ -50,7 +50,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
50
50
|
const StreamingStrategy = IDL.Variant({
|
|
51
51
|
Callback: IDL.Record({
|
|
52
52
|
token: StreamingCallbackToken,
|
|
53
|
-
callback: IDL.Func([], [], [])
|
|
53
|
+
callback: IDL.Func([], [], ['query'])
|
|
54
54
|
})
|
|
55
55
|
});
|
|
56
56
|
const HttpResponse = IDL.Record({
|