@junobuild/admin 0.0.61 → 0.1.1

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.
@@ -6,7 +6,9 @@ export interface Account {
6
6
  owner: Principal;
7
7
  subaccount: [] | [Uint8Array | number[]];
8
8
  }
9
- export type CanisterStatusType = {stopped: null} | {stopping: null} | {running: null};
9
+ export interface Config {
10
+ monitoring: [] | [MonitoringConfig];
11
+ }
10
12
  export interface Controller {
11
13
  updated_at: bigint;
12
14
  metadata: Array<[string, string]>;
@@ -19,64 +21,109 @@ export interface CreateCanisterConfig {
19
21
  subnet_id: [] | [Principal];
20
22
  name: [] | [string];
21
23
  }
22
- export interface CronJobStatusesConfig {
24
+ export interface CyclesBalance {
25
+ timestamp: bigint;
26
+ amount: bigint;
27
+ }
28
+ export interface CyclesMonitoring {
29
+ strategy: [] | [CyclesMonitoringStrategy];
23
30
  enabled: boolean;
24
- cycles_threshold: [] | [bigint];
31
+ }
32
+ export interface CyclesMonitoringConfig {
33
+ notification: [] | [DepositedCyclesEmailNotification];
34
+ default_strategy: [] | [CyclesMonitoringStrategy];
35
+ }
36
+ export interface CyclesMonitoringStartConfig {
37
+ orbiters_strategy: [] | [SegmentsMonitoringStrategy];
38
+ mission_control_strategy: [] | [CyclesMonitoringStrategy];
39
+ satellites_strategy: [] | [SegmentsMonitoringStrategy];
40
+ }
41
+ export interface CyclesMonitoringStatus {
42
+ monitored_ids: Array<Principal>;
43
+ running: boolean;
44
+ }
45
+ export interface CyclesMonitoringStopConfig {
46
+ satellite_ids: [] | [Array<Principal>];
47
+ try_mission_control: [] | [boolean];
48
+ orbiter_ids: [] | [Array<Principal>];
49
+ }
50
+ export type CyclesMonitoringStrategy = {BelowThreshold: CyclesThreshold};
51
+ export interface CyclesThreshold {
52
+ fund_cycles: bigint;
53
+ min_cycles: bigint;
25
54
  }
26
55
  export interface DepositCyclesArgs {
27
56
  cycles: bigint;
28
57
  destination_id: Principal;
29
58
  }
59
+ export interface DepositedCyclesEmailNotification {
60
+ to: [] | [string];
61
+ enabled: boolean;
62
+ }
63
+ export interface GetMonitoringHistory {
64
+ to: [] | [bigint];
65
+ from: [] | [bigint];
66
+ segment_id: Principal;
67
+ }
68
+ export interface MissionControlSettings {
69
+ updated_at: bigint;
70
+ created_at: bigint;
71
+ monitoring: [] | [Monitoring];
72
+ }
73
+ export interface Monitoring {
74
+ cycles: [] | [CyclesMonitoring];
75
+ }
76
+ export interface MonitoringConfig {
77
+ cycles: [] | [CyclesMonitoringConfig];
78
+ }
79
+ export interface MonitoringHistory {
80
+ cycles: [] | [MonitoringHistoryCycles];
81
+ }
82
+ export interface MonitoringHistoryCycles {
83
+ deposited_cycles: [] | [CyclesBalance];
84
+ cycles: CyclesBalance;
85
+ }
86
+ export interface MonitoringHistoryKey {
87
+ segment_id: Principal;
88
+ created_at: bigint;
89
+ nonce: number;
90
+ }
91
+ export interface MonitoringStartConfig {
92
+ cycles_config: [] | [CyclesMonitoringStartConfig];
93
+ }
94
+ export interface MonitoringStatus {
95
+ cycles: [] | [CyclesMonitoringStatus];
96
+ }
97
+ export interface MonitoringStopConfig {
98
+ cycles_config: [] | [CyclesMonitoringStopConfig];
99
+ }
30
100
  export interface Orbiter {
31
101
  updated_at: bigint;
32
102
  orbiter_id: Principal;
33
103
  metadata: Array<[string, string]>;
34
104
  created_at: bigint;
105
+ settings: [] | [Settings];
35
106
  }
36
107
  export type Result = {Ok: bigint} | {Err: TransferError};
37
108
  export type Result_1 = {Ok: bigint} | {Err: TransferError_1};
38
- export type Result_2 = {Ok: SegmentStatus} | {Err: string};
39
109
  export interface Satellite {
40
110
  updated_at: bigint;
41
111
  metadata: Array<[string, string]>;
42
112
  created_at: bigint;
43
113
  satellite_id: Principal;
114
+ settings: [] | [Settings];
44
115
  }
45
- export interface SegmentCanisterSettings {
46
- freezing_threshold: bigint;
47
- controllers: Array<Principal>;
48
- memory_allocation: bigint;
49
- compute_allocation: bigint;
50
- }
51
- export interface SegmentCanisterStatus {
52
- status: CanisterStatusType;
53
- memory_size: bigint;
54
- cycles: bigint;
55
- settings: SegmentCanisterSettings;
56
- idle_cycles_burned_per_day: bigint;
57
- module_hash: [] | [Uint8Array | number[]];
58
- }
59
- export interface SegmentStatus {
60
- id: Principal;
61
- status: SegmentCanisterStatus;
62
- metadata: [] | [Array<[string, string]>];
63
- status_at: bigint;
64
- }
65
- export interface SegmentsStatuses {
66
- orbiters: [] | [Array<Result_2>];
67
- satellites: [] | [Array<Result_2>];
68
- mission_control: Result_2;
116
+ export interface SegmentsMonitoringStrategy {
117
+ ids: Array<Principal>;
118
+ strategy: CyclesMonitoringStrategy;
69
119
  }
70
120
  export interface SetController {
71
121
  metadata: Array<[string, string]>;
72
122
  scope: ControllerScope;
73
123
  expires_at: [] | [bigint];
74
124
  }
75
- export interface StatusesArgs {
76
- mission_control_cycles_threshold: [] | [bigint];
77
- orbiters: Array<[Principal, CronJobStatusesConfig]>;
78
- satellites: Array<[Principal, CronJobStatusesConfig]>;
79
- cycles_threshold: [] | [bigint];
125
+ export interface Settings {
126
+ monitoring: [] | [Monitoring];
80
127
  }
81
128
  export interface Timestamp {
82
129
  timestamp_nanos: bigint;
@@ -119,6 +166,13 @@ export type TransferError_1 =
119
166
  | {CreatedInFuture: {ledger_time: bigint}}
120
167
  | {TooOld: null}
121
168
  | {InsufficientFunds: {balance: bigint}};
169
+ export interface User {
170
+ updated_at: bigint;
171
+ metadata: Array<[string, string]>;
172
+ user: [] | [Principal];
173
+ created_at: bigint;
174
+ config: [] | [Config];
175
+ }
122
176
  export interface _SERVICE {
123
177
  add_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
124
178
  add_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
@@ -132,17 +186,24 @@ export interface _SERVICE {
132
186
  del_satellite: ActorMethod<[Principal, bigint], undefined>;
133
187
  del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
134
188
  deposit_cycles: ActorMethod<[DepositCyclesArgs], undefined>;
189
+ get_config: ActorMethod<[], [] | [Config]>;
190
+ get_metadata: ActorMethod<[], Array<[string, string]>>;
191
+ get_monitoring_history: ActorMethod<
192
+ [GetMonitoringHistory],
193
+ Array<[MonitoringHistoryKey, MonitoringHistory]>
194
+ >;
195
+ get_monitoring_status: ActorMethod<[], MonitoringStatus>;
196
+ get_settings: ActorMethod<[], [] | [MissionControlSettings]>;
135
197
  get_user: ActorMethod<[], Principal>;
198
+ get_user_data: ActorMethod<[], User>;
136
199
  icp_transfer: ActorMethod<[TransferArgs], Result>;
137
200
  icrc_transfer: ActorMethod<[Principal, TransferArg], Result_1>;
138
201
  list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
139
- list_mission_control_statuses: ActorMethod<[], Array<[bigint, Result_2]>>;
140
- list_orbiter_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result_2]>]>;
141
202
  list_orbiters: ActorMethod<[], Array<[Principal, Orbiter]>>;
142
- list_satellite_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result_2]>]>;
143
203
  list_satellites: ActorMethod<[], Array<[Principal, Satellite]>>;
144
204
  remove_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
145
205
  remove_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
206
+ set_config: ActorMethod<[[] | [Config]], undefined>;
146
207
  set_metadata: ActorMethod<[Array<[string, string]>], undefined>;
147
208
  set_mission_control_controllers: ActorMethod<[Array<Principal>, SetController], undefined>;
148
209
  set_orbiter: ActorMethod<[Principal, [] | [string]], Orbiter>;
@@ -157,10 +218,13 @@ export interface _SERVICE {
157
218
  [Array<Principal>, Array<Principal>, SetController],
158
219
  undefined
159
220
  >;
160
- status: ActorMethod<[StatusesArgs], SegmentsStatuses>;
221
+ start_monitoring: ActorMethod<[], undefined>;
222
+ stop_monitoring: ActorMethod<[], undefined>;
161
223
  top_up: ActorMethod<[Principal, Tokens], undefined>;
162
224
  unset_orbiter: ActorMethod<[Principal], undefined>;
163
225
  unset_satellite: ActorMethod<[Principal], undefined>;
226
+ update_and_start_monitoring: ActorMethod<[MonitoringStartConfig], undefined>;
227
+ update_and_stop_monitoring: ActorMethod<[MonitoringStopConfig], undefined>;
164
228
  version: ActorMethod<[], string>;
165
229
  }
166
230
  export declare const idlFactory: IDL.InterfaceFactory;
@@ -1,10 +1,24 @@
1
1
  // @ts-ignore
2
2
  export const idlFactory = ({IDL}) => {
3
+ const CyclesThreshold = IDL.Record({
4
+ fund_cycles: IDL.Nat,
5
+ min_cycles: IDL.Nat
6
+ });
7
+ const CyclesMonitoringStrategy = IDL.Variant({
8
+ BelowThreshold: CyclesThreshold
9
+ });
10
+ const CyclesMonitoring = IDL.Record({
11
+ strategy: IDL.Opt(CyclesMonitoringStrategy),
12
+ enabled: IDL.Bool
13
+ });
14
+ const Monitoring = IDL.Record({cycles: IDL.Opt(CyclesMonitoring)});
15
+ const Settings = IDL.Record({monitoring: IDL.Opt(Monitoring)});
3
16
  const Orbiter = IDL.Record({
4
17
  updated_at: IDL.Nat64,
5
18
  orbiter_id: IDL.Principal,
6
19
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
7
- created_at: IDL.Nat64
20
+ created_at: IDL.Nat64,
21
+ settings: IDL.Opt(Settings)
8
22
  });
9
23
  const CreateCanisterConfig = IDL.Record({
10
24
  subnet_id: IDL.Opt(IDL.Principal),
@@ -14,12 +28,65 @@ export const idlFactory = ({IDL}) => {
14
28
  updated_at: IDL.Nat64,
15
29
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
16
30
  created_at: IDL.Nat64,
17
- satellite_id: IDL.Principal
31
+ satellite_id: IDL.Principal,
32
+ settings: IDL.Opt(Settings)
18
33
  });
19
34
  const DepositCyclesArgs = IDL.Record({
20
35
  cycles: IDL.Nat,
21
36
  destination_id: IDL.Principal
22
37
  });
38
+ const DepositedCyclesEmailNotification = IDL.Record({
39
+ to: IDL.Opt(IDL.Text),
40
+ enabled: IDL.Bool
41
+ });
42
+ const CyclesMonitoringConfig = IDL.Record({
43
+ notification: IDL.Opt(DepositedCyclesEmailNotification),
44
+ default_strategy: IDL.Opt(CyclesMonitoringStrategy)
45
+ });
46
+ const MonitoringConfig = IDL.Record({
47
+ cycles: IDL.Opt(CyclesMonitoringConfig)
48
+ });
49
+ const Config = IDL.Record({monitoring: IDL.Opt(MonitoringConfig)});
50
+ const GetMonitoringHistory = IDL.Record({
51
+ to: IDL.Opt(IDL.Nat64),
52
+ from: IDL.Opt(IDL.Nat64),
53
+ segment_id: IDL.Principal
54
+ });
55
+ const MonitoringHistoryKey = IDL.Record({
56
+ segment_id: IDL.Principal,
57
+ created_at: IDL.Nat64,
58
+ nonce: IDL.Int32
59
+ });
60
+ const CyclesBalance = IDL.Record({
61
+ timestamp: IDL.Nat64,
62
+ amount: IDL.Nat
63
+ });
64
+ const MonitoringHistoryCycles = IDL.Record({
65
+ deposited_cycles: IDL.Opt(CyclesBalance),
66
+ cycles: CyclesBalance
67
+ });
68
+ const MonitoringHistory = IDL.Record({
69
+ cycles: IDL.Opt(MonitoringHistoryCycles)
70
+ });
71
+ const CyclesMonitoringStatus = IDL.Record({
72
+ monitored_ids: IDL.Vec(IDL.Principal),
73
+ running: IDL.Bool
74
+ });
75
+ const MonitoringStatus = IDL.Record({
76
+ cycles: IDL.Opt(CyclesMonitoringStatus)
77
+ });
78
+ const MissionControlSettings = IDL.Record({
79
+ updated_at: IDL.Nat64,
80
+ created_at: IDL.Nat64,
81
+ monitoring: IDL.Opt(Monitoring)
82
+ });
83
+ const User = IDL.Record({
84
+ updated_at: IDL.Nat64,
85
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
86
+ user: IDL.Opt(IDL.Principal),
87
+ created_at: IDL.Nat64,
88
+ config: IDL.Opt(Config)
89
+ });
23
90
  const Tokens = IDL.Record({e8s: IDL.Nat64});
24
91
  const Timestamp = IDL.Record({timestamp_nanos: IDL.Nat64});
25
92
  const TransferArgs = IDL.Record({
@@ -75,51 +142,30 @@ export const idlFactory = ({IDL}) => {
75
142
  scope: ControllerScope,
76
143
  expires_at: IDL.Opt(IDL.Nat64)
77
144
  });
78
- const CanisterStatusType = IDL.Variant({
79
- stopped: IDL.Null,
80
- stopping: IDL.Null,
81
- running: IDL.Null
82
- });
83
- const SegmentCanisterSettings = IDL.Record({
84
- freezing_threshold: IDL.Nat,
85
- controllers: IDL.Vec(IDL.Principal),
86
- memory_allocation: IDL.Nat,
87
- compute_allocation: IDL.Nat
88
- });
89
- const SegmentCanisterStatus = IDL.Record({
90
- status: CanisterStatusType,
91
- memory_size: IDL.Nat,
92
- cycles: IDL.Nat,
93
- settings: SegmentCanisterSettings,
94
- idle_cycles_burned_per_day: IDL.Nat,
95
- module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
96
- });
97
- const SegmentStatus = IDL.Record({
98
- id: IDL.Principal,
99
- status: SegmentCanisterStatus,
100
- metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
101
- status_at: IDL.Nat64
102
- });
103
- const Result_2 = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
104
145
  const SetController = IDL.Record({
105
146
  metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
106
147
  scope: ControllerScope,
107
148
  expires_at: IDL.Opt(IDL.Nat64)
108
149
  });
109
- const CronJobStatusesConfig = IDL.Record({
110
- enabled: IDL.Bool,
111
- cycles_threshold: IDL.Opt(IDL.Nat64)
150
+ const SegmentsMonitoringStrategy = IDL.Record({
151
+ ids: IDL.Vec(IDL.Principal),
152
+ strategy: CyclesMonitoringStrategy
153
+ });
154
+ const CyclesMonitoringStartConfig = IDL.Record({
155
+ orbiters_strategy: IDL.Opt(SegmentsMonitoringStrategy),
156
+ mission_control_strategy: IDL.Opt(CyclesMonitoringStrategy),
157
+ satellites_strategy: IDL.Opt(SegmentsMonitoringStrategy)
158
+ });
159
+ const MonitoringStartConfig = IDL.Record({
160
+ cycles_config: IDL.Opt(CyclesMonitoringStartConfig)
112
161
  });
113
- const StatusesArgs = IDL.Record({
114
- mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
115
- orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
116
- satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
117
- cycles_threshold: IDL.Opt(IDL.Nat64)
162
+ const CyclesMonitoringStopConfig = IDL.Record({
163
+ satellite_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
164
+ try_mission_control: IDL.Opt(IDL.Bool),
165
+ orbiter_ids: IDL.Opt(IDL.Vec(IDL.Principal))
118
166
  });
119
- const SegmentsStatuses = IDL.Record({
120
- orbiters: IDL.Opt(IDL.Vec(Result_2)),
121
- satellites: IDL.Opt(IDL.Vec(Result_2)),
122
- mission_control: Result_2
167
+ const MonitoringStopConfig = IDL.Record({
168
+ cycles_config: IDL.Opt(CyclesMonitoringStopConfig)
123
169
  });
124
170
  return IDL.Service({
125
171
  add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
@@ -134,7 +180,17 @@ export const idlFactory = ({IDL}) => {
134
180
  del_satellite: IDL.Func([IDL.Principal, IDL.Nat], [], []),
135
181
  del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
136
182
  deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
183
+ get_config: IDL.Func([], [IDL.Opt(Config)], ['query']),
184
+ get_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], ['query']),
185
+ get_monitoring_history: IDL.Func(
186
+ [GetMonitoringHistory],
187
+ [IDL.Vec(IDL.Tuple(MonitoringHistoryKey, MonitoringHistory))],
188
+ ['query']
189
+ ),
190
+ get_monitoring_status: IDL.Func([], [MonitoringStatus], ['query']),
191
+ get_settings: IDL.Func([], [IDL.Opt(MissionControlSettings)], ['query']),
137
192
  get_user: IDL.Func([], [IDL.Principal], ['query']),
193
+ get_user_data: IDL.Func([], [User], ['query']),
138
194
  icp_transfer: IDL.Func([TransferArgs], [Result], []),
139
195
  icrc_transfer: IDL.Func([IDL.Principal, TransferArg], [Result_1], []),
140
196
  list_mission_control_controllers: IDL.Func(
@@ -142,22 +198,7 @@ export const idlFactory = ({IDL}) => {
142
198
  [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
143
199
  ['query']
144
200
  ),
145
- list_mission_control_statuses: IDL.Func(
146
- [],
147
- [IDL.Vec(IDL.Tuple(IDL.Nat64, Result_2))],
148
- ['query']
149
- ),
150
- list_orbiter_statuses: IDL.Func(
151
- [IDL.Principal],
152
- [IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result_2)))],
153
- ['query']
154
- ),
155
201
  list_orbiters: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Orbiter))], ['query']),
156
- list_satellite_statuses: IDL.Func(
157
- [IDL.Principal],
158
- [IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result_2)))],
159
- ['query']
160
- ),
161
202
  list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),
162
203
  remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
163
204
  remove_satellites_controllers: IDL.Func(
@@ -165,6 +206,7 @@ export const idlFactory = ({IDL}) => {
165
206
  [],
166
207
  []
167
208
  ),
209
+ set_config: IDL.Func([IDL.Opt(Config)], [], []),
168
210
  set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
169
211
  set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),
170
212
  set_orbiter: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Orbiter], []),
@@ -189,10 +231,13 @@ export const idlFactory = ({IDL}) => {
189
231
  [],
190
232
  []
191
233
  ),
192
- status: IDL.Func([StatusesArgs], [SegmentsStatuses], []),
234
+ start_monitoring: IDL.Func([], [], []),
235
+ stop_monitoring: IDL.Func([], [], []),
193
236
  top_up: IDL.Func([IDL.Principal, Tokens], [], []),
194
237
  unset_orbiter: IDL.Func([IDL.Principal], [], []),
195
238
  unset_satellite: IDL.Func([IDL.Principal], [], []),
239
+ update_and_start_monitoring: IDL.Func([MonitoringStartConfig], [], []),
240
+ update_and_stop_monitoring: IDL.Func([MonitoringStopConfig], [], []),
196
241
  version: IDL.Func([], [IDL.Text], ['query'])
197
242
  });
198
243
  };