@junobuild/admin 0.0.13 → 0.0.15
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/cmc/cmc.factory.did.js +2 -0
- package/declarations/console/console.did.d.ts +8 -1
- package/declarations/console/console.factory.did.js +13 -1
- package/declarations/console/console.factory.did.mjs +13 -1
- package/declarations/frontend/frontend.factory.did.js +2 -0
- package/declarations/ic/ic.factory.did.js +3 -0
- package/declarations/internet_identity/internet_identity.did +49 -1
- package/declarations/internet_identity/internet_identity.did.d.ts +28 -1
- package/declarations/internet_identity/internet_identity.factory.did.js +45 -1
- package/declarations/ledger/ledger.did +22 -5
- package/declarations/ledger/ledger.did.d.ts +18 -1
- package/declarations/ledger/ledger.factory.did.js +18 -1
- package/declarations/mission_control/mission_control.did.d.ts +42 -0
- package/declarations/mission_control/mission_control.factory.did.js +55 -0
- package/declarations/observatory/index.d.ts +45 -0
- package/declarations/observatory/index.js +32 -0
- package/declarations/observatory/observatory.did.d.ts +84 -0
- package/declarations/observatory/observatory.factory.did.js +93 -0
- package/declarations/observatory/observatory.factory.did.mjs +93 -0
- package/declarations/satellite/satellite.did.d.ts +19 -3
- package/declarations/satellite/satellite.factory.did.js +26 -7
- package/declarations/satellite/satellite.factory.did.mjs +28 -7
- package/dist/browser/index.js +12 -12
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/cmc/cmc.factory.did.js +2 -0
- package/dist/declarations/console/console.did.d.ts +8 -1
- package/dist/declarations/console/console.factory.did.js +13 -1
- package/dist/declarations/console/console.factory.did.mjs +13 -1
- package/dist/declarations/frontend/frontend.factory.did.js +2 -0
- package/dist/declarations/ic/ic.factory.did.js +3 -0
- package/dist/declarations/internet_identity/internet_identity.did +49 -1
- package/dist/declarations/internet_identity/internet_identity.did.d.ts +28 -1
- package/dist/declarations/internet_identity/internet_identity.factory.did.js +45 -1
- package/dist/declarations/ledger/ledger.did +22 -5
- package/dist/declarations/ledger/ledger.did.d.ts +18 -1
- package/dist/declarations/ledger/ledger.factory.did.js +18 -1
- package/dist/declarations/mission_control/mission_control.did.d.ts +42 -0
- package/dist/declarations/mission_control/mission_control.factory.did.js +55 -0
- package/dist/declarations/observatory/index.d.ts +45 -0
- package/dist/declarations/observatory/index.js +32 -0
- package/dist/declarations/observatory/observatory.did.d.ts +84 -0
- package/dist/declarations/observatory/observatory.factory.did.js +93 -0
- package/dist/declarations/observatory/observatory.factory.did.mjs +93 -0
- package/dist/declarations/satellite/satellite.did.d.ts +19 -3
- package/dist/declarations/satellite/satellite.factory.did.js +26 -7
- package/dist/declarations/satellite/satellite.factory.did.mjs +28 -7
- package/dist/node/index.mjs +18 -18
- package/dist/node/index.mjs.map +3 -3
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
export const idlFactory = ({IDL}) => {
|
|
2
3
|
const Satellite = IDL.Record({
|
|
3
4
|
updated_at: IDL.Nat64,
|
|
@@ -5,16 +6,61 @@ export const idlFactory = ({IDL}) => {
|
|
|
5
6
|
created_at: IDL.Nat64,
|
|
6
7
|
satellite_id: IDL.Principal
|
|
7
8
|
});
|
|
9
|
+
const ControllerScope = IDL.Variant({
|
|
10
|
+
Write: IDL.Null,
|
|
11
|
+
Admin: IDL.Null
|
|
12
|
+
});
|
|
8
13
|
const Controller = IDL.Record({
|
|
9
14
|
updated_at: IDL.Nat64,
|
|
10
15
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
11
16
|
created_at: IDL.Nat64,
|
|
17
|
+
scope: ControllerScope,
|
|
12
18
|
expires_at: IDL.Opt(IDL.Nat64)
|
|
13
19
|
});
|
|
20
|
+
const CanisterStatusType = IDL.Variant({
|
|
21
|
+
stopped: IDL.Null,
|
|
22
|
+
stopping: IDL.Null,
|
|
23
|
+
running: IDL.Null
|
|
24
|
+
});
|
|
25
|
+
const DefiniteCanisterSettings = IDL.Record({
|
|
26
|
+
freezing_threshold: IDL.Nat,
|
|
27
|
+
controllers: IDL.Vec(IDL.Principal),
|
|
28
|
+
memory_allocation: IDL.Nat,
|
|
29
|
+
compute_allocation: IDL.Nat
|
|
30
|
+
});
|
|
31
|
+
const CanisterStatusResponse = IDL.Record({
|
|
32
|
+
status: CanisterStatusType,
|
|
33
|
+
memory_size: IDL.Nat,
|
|
34
|
+
cycles: IDL.Nat,
|
|
35
|
+
settings: DefiniteCanisterSettings,
|
|
36
|
+
idle_cycles_burned_per_day: IDL.Nat,
|
|
37
|
+
module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
38
|
+
});
|
|
39
|
+
const SegmentStatus = IDL.Record({
|
|
40
|
+
id: IDL.Principal,
|
|
41
|
+
status: CanisterStatusResponse,
|
|
42
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
43
|
+
status_at: IDL.Nat64
|
|
44
|
+
});
|
|
45
|
+
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
14
46
|
const SetController = IDL.Record({
|
|
15
47
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
48
|
+
scope: ControllerScope,
|
|
16
49
|
expires_at: IDL.Opt(IDL.Nat64)
|
|
17
50
|
});
|
|
51
|
+
const CronJobStatusesSatelliteConfig = IDL.Record({
|
|
52
|
+
enabled: IDL.Bool,
|
|
53
|
+
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
54
|
+
});
|
|
55
|
+
const StatusesArgs = IDL.Record({
|
|
56
|
+
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
57
|
+
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesSatelliteConfig)),
|
|
58
|
+
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
59
|
+
});
|
|
60
|
+
const SegmentsStatuses = IDL.Record({
|
|
61
|
+
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
62
|
+
mission_control: Result
|
|
63
|
+
});
|
|
18
64
|
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
19
65
|
return IDL.Service({
|
|
20
66
|
add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
@@ -28,6 +74,12 @@ export const idlFactory = ({IDL}) => {
|
|
|
28
74
|
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
29
75
|
['query']
|
|
30
76
|
),
|
|
77
|
+
list_mission_control_statuses: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Result))], ['query']),
|
|
78
|
+
list_satellite_statuses: IDL.Func(
|
|
79
|
+
[IDL.Principal],
|
|
80
|
+
[IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result)))],
|
|
81
|
+
['query']
|
|
82
|
+
),
|
|
31
83
|
list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),
|
|
32
84
|
remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
33
85
|
remove_satellites_controllers: IDL.Func(
|
|
@@ -35,16 +87,19 @@ export const idlFactory = ({IDL}) => {
|
|
|
35
87
|
[],
|
|
36
88
|
[]
|
|
37
89
|
),
|
|
90
|
+
set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
|
|
38
91
|
set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),
|
|
39
92
|
set_satellites_controllers: IDL.Func(
|
|
40
93
|
[IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],
|
|
41
94
|
[],
|
|
42
95
|
[]
|
|
43
96
|
),
|
|
97
|
+
status: IDL.Func([StatusesArgs], [SegmentsStatuses], []),
|
|
44
98
|
top_up: IDL.Func([IDL.Principal, Tokens], [], []),
|
|
45
99
|
version: IDL.Func([], [IDL.Text], ['query'])
|
|
46
100
|
});
|
|
47
101
|
};
|
|
102
|
+
// @ts-ignore
|
|
48
103
|
export const init = ({IDL}) => {
|
|
49
104
|
return [];
|
|
50
105
|
};
|
|
@@ -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 './observatory.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 observatory: ActorSubclass<_SERVICE>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
+
|
|
3
|
+
// Imports and re-exports candid interface
|
|
4
|
+
import {idlFactory} from './observatory.did.js';
|
|
5
|
+
export {idlFactory} from './observatory.did.js';
|
|
6
|
+
|
|
7
|
+
// CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
+
|
|
9
|
+
export const createActor = (canisterId, options = {}) => {
|
|
10
|
+
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
11
|
+
|
|
12
|
+
if (options.agent && options.agentOptions) {
|
|
13
|
+
console.warn(
|
|
14
|
+
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Fetch root key for certificate validation during development
|
|
19
|
+
if (process.env.DFX_NETWORK !== 'ic') {
|
|
20
|
+
agent.fetchRootKey().catch((err) => {
|
|
21
|
+
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
22
|
+
console.error(err);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Creates an actor with using the candid interface and the HttpAgent
|
|
27
|
+
return Actor.createActor(idlFactory, {
|
|
28
|
+
agent,
|
|
29
|
+
canisterId,
|
|
30
|
+
...options.actorOptions
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
+
import type {Principal} from '@dfinity/principal';
|
|
3
|
+
|
|
4
|
+
export interface CanisterStatusResponse {
|
|
5
|
+
status: CanisterStatusType;
|
|
6
|
+
memory_size: bigint;
|
|
7
|
+
cycles: bigint;
|
|
8
|
+
settings: DefiniteCanisterSettings;
|
|
9
|
+
idle_cycles_burned_per_day: bigint;
|
|
10
|
+
module_hash: [] | [Uint8Array | number[]];
|
|
11
|
+
}
|
|
12
|
+
export type CanisterStatusType = {stopped: null} | {stopping: null} | {running: null};
|
|
13
|
+
export type ControllerScope = {Write: null} | {Admin: null};
|
|
14
|
+
export interface CronJobStatuses {
|
|
15
|
+
mission_control_cycles_threshold: [] | [bigint];
|
|
16
|
+
satellites: Array<[Principal, CronJobStatusesSatelliteConfig]>;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
cycles_threshold: [] | [bigint];
|
|
19
|
+
}
|
|
20
|
+
export interface CronJobStatusesSatelliteConfig {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
cycles_threshold: [] | [bigint];
|
|
23
|
+
}
|
|
24
|
+
export interface CronJobs {
|
|
25
|
+
metadata: Array<[string, string]>;
|
|
26
|
+
statuses: CronJobStatuses;
|
|
27
|
+
}
|
|
28
|
+
export interface CronTab {
|
|
29
|
+
cron_jobs: CronJobs;
|
|
30
|
+
updated_at: bigint;
|
|
31
|
+
mission_control_id: Principal;
|
|
32
|
+
created_at: bigint;
|
|
33
|
+
}
|
|
34
|
+
export interface DefiniteCanisterSettings {
|
|
35
|
+
freezing_threshold: bigint;
|
|
36
|
+
controllers: Array<Principal>;
|
|
37
|
+
memory_allocation: bigint;
|
|
38
|
+
compute_allocation: bigint;
|
|
39
|
+
}
|
|
40
|
+
export interface DeleteControllersArgs {
|
|
41
|
+
controllers: Array<Principal>;
|
|
42
|
+
}
|
|
43
|
+
export interface ListStatuses {
|
|
44
|
+
cron_jobs: CronJobs;
|
|
45
|
+
statuses: Result_1;
|
|
46
|
+
timestamp: bigint;
|
|
47
|
+
}
|
|
48
|
+
export interface ListStatusesArgs {
|
|
49
|
+
time_delta: [] | [bigint];
|
|
50
|
+
}
|
|
51
|
+
export type Result = {Ok: SegmentStatus} | {Err: string};
|
|
52
|
+
export type Result_1 = {Ok: SegmentsStatuses} | {Err: string};
|
|
53
|
+
export interface SegmentStatus {
|
|
54
|
+
id: Principal;
|
|
55
|
+
status: CanisterStatusResponse;
|
|
56
|
+
metadata: [] | [Array<[string, string]>];
|
|
57
|
+
status_at: bigint;
|
|
58
|
+
}
|
|
59
|
+
export interface SegmentsStatuses {
|
|
60
|
+
satellites: [] | [Array<Result>];
|
|
61
|
+
mission_control: Result;
|
|
62
|
+
}
|
|
63
|
+
export interface SetController {
|
|
64
|
+
metadata: Array<[string, string]>;
|
|
65
|
+
scope: ControllerScope;
|
|
66
|
+
expires_at: [] | [bigint];
|
|
67
|
+
}
|
|
68
|
+
export interface SetControllersArgs {
|
|
69
|
+
controller: SetController;
|
|
70
|
+
controllers: Array<Principal>;
|
|
71
|
+
}
|
|
72
|
+
export interface SetCronTab {
|
|
73
|
+
cron_jobs: CronJobs;
|
|
74
|
+
updated_at: [] | [bigint];
|
|
75
|
+
mission_control_id: Principal;
|
|
76
|
+
}
|
|
77
|
+
export interface _SERVICE {
|
|
78
|
+
del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
|
|
79
|
+
get_cron_tab: ActorMethod<[], [] | [CronTab]>;
|
|
80
|
+
list_statuses: ActorMethod<[ListStatusesArgs], Array<ListStatuses>>;
|
|
81
|
+
set_controllers: ActorMethod<[SetControllersArgs], undefined>;
|
|
82
|
+
set_cron_tab: ActorMethod<[SetCronTab], CronTab>;
|
|
83
|
+
version: ActorMethod<[], string>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const DeleteControllersArgs = IDL.Record({
|
|
4
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
5
|
+
});
|
|
6
|
+
const CronJobStatusesSatelliteConfig = IDL.Record({
|
|
7
|
+
enabled: IDL.Bool,
|
|
8
|
+
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
9
|
+
});
|
|
10
|
+
const CronJobStatuses = IDL.Record({
|
|
11
|
+
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
12
|
+
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesSatelliteConfig)),
|
|
13
|
+
enabled: IDL.Bool,
|
|
14
|
+
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
15
|
+
});
|
|
16
|
+
const CronJobs = IDL.Record({
|
|
17
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
18
|
+
statuses: CronJobStatuses
|
|
19
|
+
});
|
|
20
|
+
const CronTab = IDL.Record({
|
|
21
|
+
cron_jobs: CronJobs,
|
|
22
|
+
updated_at: IDL.Nat64,
|
|
23
|
+
mission_control_id: IDL.Principal,
|
|
24
|
+
created_at: IDL.Nat64
|
|
25
|
+
});
|
|
26
|
+
const ListStatusesArgs = IDL.Record({time_delta: IDL.Opt(IDL.Nat64)});
|
|
27
|
+
const CanisterStatusType = IDL.Variant({
|
|
28
|
+
stopped: IDL.Null,
|
|
29
|
+
stopping: IDL.Null,
|
|
30
|
+
running: IDL.Null
|
|
31
|
+
});
|
|
32
|
+
const DefiniteCanisterSettings = IDL.Record({
|
|
33
|
+
freezing_threshold: IDL.Nat,
|
|
34
|
+
controllers: IDL.Vec(IDL.Principal),
|
|
35
|
+
memory_allocation: IDL.Nat,
|
|
36
|
+
compute_allocation: IDL.Nat
|
|
37
|
+
});
|
|
38
|
+
const CanisterStatusResponse = IDL.Record({
|
|
39
|
+
status: CanisterStatusType,
|
|
40
|
+
memory_size: IDL.Nat,
|
|
41
|
+
cycles: IDL.Nat,
|
|
42
|
+
settings: DefiniteCanisterSettings,
|
|
43
|
+
idle_cycles_burned_per_day: IDL.Nat,
|
|
44
|
+
module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
45
|
+
});
|
|
46
|
+
const SegmentStatus = IDL.Record({
|
|
47
|
+
id: IDL.Principal,
|
|
48
|
+
status: CanisterStatusResponse,
|
|
49
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
50
|
+
status_at: IDL.Nat64
|
|
51
|
+
});
|
|
52
|
+
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
53
|
+
const SegmentsStatuses = IDL.Record({
|
|
54
|
+
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
55
|
+
mission_control: Result
|
|
56
|
+
});
|
|
57
|
+
const Result_1 = IDL.Variant({Ok: SegmentsStatuses, Err: IDL.Text});
|
|
58
|
+
const ListStatuses = IDL.Record({
|
|
59
|
+
cron_jobs: CronJobs,
|
|
60
|
+
statuses: Result_1,
|
|
61
|
+
timestamp: IDL.Nat64
|
|
62
|
+
});
|
|
63
|
+
const ControllerScope = IDL.Variant({
|
|
64
|
+
Write: IDL.Null,
|
|
65
|
+
Admin: IDL.Null
|
|
66
|
+
});
|
|
67
|
+
const SetController = IDL.Record({
|
|
68
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
69
|
+
scope: ControllerScope,
|
|
70
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
71
|
+
});
|
|
72
|
+
const SetControllersArgs = IDL.Record({
|
|
73
|
+
controller: SetController,
|
|
74
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
75
|
+
});
|
|
76
|
+
const SetCronTab = IDL.Record({
|
|
77
|
+
cron_jobs: CronJobs,
|
|
78
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
79
|
+
mission_control_id: IDL.Principal
|
|
80
|
+
});
|
|
81
|
+
return IDL.Service({
|
|
82
|
+
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
83
|
+
get_cron_tab: IDL.Func([], [IDL.Opt(CronTab)], ['query']),
|
|
84
|
+
list_statuses: IDL.Func([ListStatusesArgs], [IDL.Vec(ListStatuses)], ['query']),
|
|
85
|
+
set_controllers: IDL.Func([SetControllersArgs], [], []),
|
|
86
|
+
set_cron_tab: IDL.Func([SetCronTab], [CronTab], []),
|
|
87
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
export const init = ({IDL}) => {
|
|
92
|
+
return [];
|
|
93
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const DeleteControllersArgs = IDL.Record({
|
|
4
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
5
|
+
});
|
|
6
|
+
const CronJobStatusesSatelliteConfig = IDL.Record({
|
|
7
|
+
enabled: IDL.Bool,
|
|
8
|
+
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
9
|
+
});
|
|
10
|
+
const CronJobStatuses = IDL.Record({
|
|
11
|
+
mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
|
|
12
|
+
satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesSatelliteConfig)),
|
|
13
|
+
enabled: IDL.Bool,
|
|
14
|
+
cycles_threshold: IDL.Opt(IDL.Nat64)
|
|
15
|
+
});
|
|
16
|
+
const CronJobs = IDL.Record({
|
|
17
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
18
|
+
statuses: CronJobStatuses
|
|
19
|
+
});
|
|
20
|
+
const CronTab = IDL.Record({
|
|
21
|
+
cron_jobs: CronJobs,
|
|
22
|
+
updated_at: IDL.Nat64,
|
|
23
|
+
mission_control_id: IDL.Principal,
|
|
24
|
+
created_at: IDL.Nat64
|
|
25
|
+
});
|
|
26
|
+
const ListStatusesArgs = IDL.Record({time_delta: IDL.Opt(IDL.Nat64)});
|
|
27
|
+
const CanisterStatusType = IDL.Variant({
|
|
28
|
+
stopped: IDL.Null,
|
|
29
|
+
stopping: IDL.Null,
|
|
30
|
+
running: IDL.Null
|
|
31
|
+
});
|
|
32
|
+
const DefiniteCanisterSettings = IDL.Record({
|
|
33
|
+
freezing_threshold: IDL.Nat,
|
|
34
|
+
controllers: IDL.Vec(IDL.Principal),
|
|
35
|
+
memory_allocation: IDL.Nat,
|
|
36
|
+
compute_allocation: IDL.Nat
|
|
37
|
+
});
|
|
38
|
+
const CanisterStatusResponse = IDL.Record({
|
|
39
|
+
status: CanisterStatusType,
|
|
40
|
+
memory_size: IDL.Nat,
|
|
41
|
+
cycles: IDL.Nat,
|
|
42
|
+
settings: DefiniteCanisterSettings,
|
|
43
|
+
idle_cycles_burned_per_day: IDL.Nat,
|
|
44
|
+
module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
45
|
+
});
|
|
46
|
+
const SegmentStatus = IDL.Record({
|
|
47
|
+
id: IDL.Principal,
|
|
48
|
+
status: CanisterStatusResponse,
|
|
49
|
+
metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
|
|
50
|
+
status_at: IDL.Nat64
|
|
51
|
+
});
|
|
52
|
+
const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
|
|
53
|
+
const SegmentsStatuses = IDL.Record({
|
|
54
|
+
satellites: IDL.Opt(IDL.Vec(Result)),
|
|
55
|
+
mission_control: Result
|
|
56
|
+
});
|
|
57
|
+
const Result_1 = IDL.Variant({Ok: SegmentsStatuses, Err: IDL.Text});
|
|
58
|
+
const ListStatuses = IDL.Record({
|
|
59
|
+
cron_jobs: CronJobs,
|
|
60
|
+
statuses: Result_1,
|
|
61
|
+
timestamp: IDL.Nat64
|
|
62
|
+
});
|
|
63
|
+
const ControllerScope = IDL.Variant({
|
|
64
|
+
Write: IDL.Null,
|
|
65
|
+
Admin: IDL.Null
|
|
66
|
+
});
|
|
67
|
+
const SetController = IDL.Record({
|
|
68
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
69
|
+
scope: ControllerScope,
|
|
70
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
71
|
+
});
|
|
72
|
+
const SetControllersArgs = IDL.Record({
|
|
73
|
+
controller: SetController,
|
|
74
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
75
|
+
});
|
|
76
|
+
const SetCronTab = IDL.Record({
|
|
77
|
+
cron_jobs: CronJobs,
|
|
78
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
79
|
+
mission_control_id: IDL.Principal
|
|
80
|
+
});
|
|
81
|
+
return IDL.Service({
|
|
82
|
+
del_controllers: IDL.Func([DeleteControllersArgs], [], []),
|
|
83
|
+
get_cron_tab: IDL.Func([], [IDL.Opt(CronTab)], ['query']),
|
|
84
|
+
list_statuses: IDL.Func([ListStatusesArgs], [IDL.Vec(ListStatuses)], ['query']),
|
|
85
|
+
set_controllers: IDL.Func([SetControllersArgs], [], []),
|
|
86
|
+
set_cron_tab: IDL.Func([SetCronTab], [CronTab], []),
|
|
87
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
export const init = ({IDL}) => {
|
|
92
|
+
return [];
|
|
93
|
+
};
|
|
@@ -11,6 +11,7 @@ export interface AssetKey {
|
|
|
11
11
|
collection: string;
|
|
12
12
|
owner: Principal;
|
|
13
13
|
name: string;
|
|
14
|
+
description: [] | [string];
|
|
14
15
|
full_path: string;
|
|
15
16
|
}
|
|
16
17
|
export interface AssetNoContent {
|
|
@@ -36,8 +37,10 @@ export interface Controller {
|
|
|
36
37
|
updated_at: bigint;
|
|
37
38
|
metadata: Array<[string, string]>;
|
|
38
39
|
created_at: bigint;
|
|
40
|
+
scope: ControllerScope;
|
|
39
41
|
expires_at: [] | [bigint];
|
|
40
42
|
}
|
|
43
|
+
export type ControllerScope = {Write: null} | {Admin: null};
|
|
41
44
|
export interface CustomDomain {
|
|
42
45
|
updated_at: bigint;
|
|
43
46
|
created_at: bigint;
|
|
@@ -53,6 +56,7 @@ export interface Doc {
|
|
|
53
56
|
updated_at: bigint;
|
|
54
57
|
owner: Principal;
|
|
55
58
|
data: Uint8Array | number[];
|
|
59
|
+
description: [] | [string];
|
|
56
60
|
created_at: bigint;
|
|
57
61
|
}
|
|
58
62
|
export interface HttpRequest {
|
|
@@ -71,12 +75,17 @@ export interface InitAssetKey {
|
|
|
71
75
|
token: [] | [string];
|
|
72
76
|
collection: string;
|
|
73
77
|
name: string;
|
|
78
|
+
description: [] | [string];
|
|
74
79
|
encoding_type: [] | [string];
|
|
75
80
|
full_path: string;
|
|
76
81
|
}
|
|
77
82
|
export interface InitUploadResult {
|
|
78
83
|
batch_id: bigint;
|
|
79
84
|
}
|
|
85
|
+
export interface ListMatcher {
|
|
86
|
+
key: [] | [string];
|
|
87
|
+
description: [] | [string];
|
|
88
|
+
}
|
|
80
89
|
export interface ListOrder {
|
|
81
90
|
field: ListOrderField;
|
|
82
91
|
desc: boolean;
|
|
@@ -89,18 +98,22 @@ export interface ListPaginate {
|
|
|
89
98
|
export interface ListParams {
|
|
90
99
|
order: [] | [ListOrder];
|
|
91
100
|
owner: [] | [Principal];
|
|
92
|
-
matcher: [] | [
|
|
101
|
+
matcher: [] | [ListMatcher];
|
|
93
102
|
paginate: [] | [ListPaginate];
|
|
94
103
|
}
|
|
95
104
|
export interface ListResults {
|
|
105
|
+
matches_pages: [] | [bigint];
|
|
96
106
|
matches_length: bigint;
|
|
97
|
-
|
|
107
|
+
items_page: [] | [bigint];
|
|
98
108
|
items: Array<[string, AssetNoContent]>;
|
|
109
|
+
items_length: bigint;
|
|
99
110
|
}
|
|
100
111
|
export interface ListResults_1 {
|
|
112
|
+
matches_pages: [] | [bigint];
|
|
101
113
|
matches_length: bigint;
|
|
102
|
-
|
|
114
|
+
items_page: [] | [bigint];
|
|
103
115
|
items: Array<[string, Doc]>;
|
|
116
|
+
items_length: bigint;
|
|
104
117
|
}
|
|
105
118
|
export type Permission = {Controllers: null} | {Private: null} | {Public: null} | {Managed: null};
|
|
106
119
|
export interface Rule {
|
|
@@ -113,6 +126,7 @@ export interface Rule {
|
|
|
113
126
|
export type RulesType = {Db: null} | {Storage: null};
|
|
114
127
|
export interface SetController {
|
|
115
128
|
metadata: Array<[string, string]>;
|
|
129
|
+
scope: ControllerScope;
|
|
116
130
|
expires_at: [] | [bigint];
|
|
117
131
|
}
|
|
118
132
|
export interface SetControllersArgs {
|
|
@@ -122,6 +136,7 @@ export interface SetControllersArgs {
|
|
|
122
136
|
export interface SetDoc {
|
|
123
137
|
updated_at: [] | [bigint];
|
|
124
138
|
data: Uint8Array | number[];
|
|
139
|
+
description: [] | [string];
|
|
125
140
|
}
|
|
126
141
|
export interface SetRule {
|
|
127
142
|
updated_at: [] | [bigint];
|
|
@@ -160,6 +175,7 @@ export interface _SERVICE {
|
|
|
160
175
|
del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
|
|
161
176
|
del_custom_domain: ActorMethod<[string], undefined>;
|
|
162
177
|
del_doc: ActorMethod<[string, string, DelDoc], undefined>;
|
|
178
|
+
del_rule: ActorMethod<[RulesType, string, DelDoc], undefined>;
|
|
163
179
|
get_config: ActorMethod<[], Config>;
|
|
164
180
|
get_doc: ActorMethod<[string, string], [] | [Doc]>;
|
|
165
181
|
http_request: ActorMethod<[HttpRequest], HttpResponse>;
|
|
@@ -8,13 +8,19 @@ export const idlFactory = ({IDL}) => {
|
|
|
8
8
|
const DeleteControllersArgs = IDL.Record({
|
|
9
9
|
controllers: IDL.Vec(IDL.Principal)
|
|
10
10
|
});
|
|
11
|
+
const ControllerScope = IDL.Variant({
|
|
12
|
+
Write: IDL.Null,
|
|
13
|
+
Admin: IDL.Null
|
|
14
|
+
});
|
|
11
15
|
const Controller = IDL.Record({
|
|
12
16
|
updated_at: IDL.Nat64,
|
|
13
17
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
14
18
|
created_at: IDL.Nat64,
|
|
19
|
+
scope: ControllerScope,
|
|
15
20
|
expires_at: IDL.Opt(IDL.Nat64)
|
|
16
21
|
});
|
|
17
22
|
const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});
|
|
23
|
+
const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
18
24
|
const StorageConfig = IDL.Record({
|
|
19
25
|
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))
|
|
20
26
|
});
|
|
@@ -23,6 +29,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
23
29
|
updated_at: IDL.Nat64,
|
|
24
30
|
owner: IDL.Principal,
|
|
25
31
|
data: IDL.Vec(IDL.Nat8),
|
|
32
|
+
description: IDL.Opt(IDL.Text),
|
|
26
33
|
created_at: IDL.Nat64
|
|
27
34
|
});
|
|
28
35
|
const HttpRequest = IDL.Record({
|
|
@@ -59,6 +66,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
59
66
|
token: IDL.Opt(IDL.Text),
|
|
60
67
|
collection: IDL.Text,
|
|
61
68
|
name: IDL.Text,
|
|
69
|
+
description: IDL.Opt(IDL.Text),
|
|
62
70
|
encoding_type: IDL.Opt(IDL.Text),
|
|
63
71
|
full_path: IDL.Text
|
|
64
72
|
});
|
|
@@ -69,6 +77,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
69
77
|
CreatedAt: IDL.Null
|
|
70
78
|
});
|
|
71
79
|
const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
|
|
80
|
+
const ListMatcher = IDL.Record({
|
|
81
|
+
key: IDL.Opt(IDL.Text),
|
|
82
|
+
description: IDL.Opt(IDL.Text)
|
|
83
|
+
});
|
|
72
84
|
const ListPaginate = IDL.Record({
|
|
73
85
|
start_after: IDL.Opt(IDL.Text),
|
|
74
86
|
limit: IDL.Opt(IDL.Nat64)
|
|
@@ -76,7 +88,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
76
88
|
const ListParams = IDL.Record({
|
|
77
89
|
order: IDL.Opt(ListOrder),
|
|
78
90
|
owner: IDL.Opt(IDL.Principal),
|
|
79
|
-
matcher: IDL.Opt(
|
|
91
|
+
matcher: IDL.Opt(ListMatcher),
|
|
80
92
|
paginate: IDL.Opt(ListPaginate)
|
|
81
93
|
});
|
|
82
94
|
const AssetKey = IDL.Record({
|
|
@@ -84,6 +96,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
84
96
|
collection: IDL.Text,
|
|
85
97
|
owner: IDL.Principal,
|
|
86
98
|
name: IDL.Text,
|
|
99
|
+
description: IDL.Opt(IDL.Text),
|
|
87
100
|
full_path: IDL.Text
|
|
88
101
|
});
|
|
89
102
|
const AssetEncodingNoContent = IDL.Record({
|
|
@@ -99,9 +112,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
99
112
|
created_at: IDL.Nat64
|
|
100
113
|
});
|
|
101
114
|
const ListResults = IDL.Record({
|
|
115
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
102
116
|
matches_length: IDL.Nat64,
|
|
103
|
-
|
|
104
|
-
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent))
|
|
117
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
118
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
|
|
119
|
+
items_length: IDL.Nat64
|
|
105
120
|
});
|
|
106
121
|
const CustomDomain = IDL.Record({
|
|
107
122
|
updated_at: IDL.Nat64,
|
|
@@ -109,11 +124,12 @@ export const idlFactory = ({IDL}) => {
|
|
|
109
124
|
bn_id: IDL.Opt(IDL.Text)
|
|
110
125
|
});
|
|
111
126
|
const ListResults_1 = IDL.Record({
|
|
127
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
112
128
|
matches_length: IDL.Nat64,
|
|
113
|
-
|
|
114
|
-
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc))
|
|
129
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
130
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
|
|
131
|
+
items_length: IDL.Nat64
|
|
115
132
|
});
|
|
116
|
-
const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
117
133
|
const Permission = IDL.Variant({
|
|
118
134
|
Controllers: IDL.Null,
|
|
119
135
|
Private: IDL.Null,
|
|
@@ -129,6 +145,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
129
145
|
});
|
|
130
146
|
const SetController = IDL.Record({
|
|
131
147
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
148
|
+
scope: ControllerScope,
|
|
132
149
|
expires_at: IDL.Opt(IDL.Nat64)
|
|
133
150
|
});
|
|
134
151
|
const SetControllersArgs = IDL.Record({
|
|
@@ -137,7 +154,8 @@ export const idlFactory = ({IDL}) => {
|
|
|
137
154
|
});
|
|
138
155
|
const SetDoc = IDL.Record({
|
|
139
156
|
updated_at: IDL.Opt(IDL.Nat64),
|
|
140
|
-
data: IDL.Vec(IDL.Nat8)
|
|
157
|
+
data: IDL.Vec(IDL.Nat8),
|
|
158
|
+
description: IDL.Opt(IDL.Text)
|
|
141
159
|
});
|
|
142
160
|
const SetRule = IDL.Record({
|
|
143
161
|
updated_at: IDL.Opt(IDL.Nat64),
|
|
@@ -161,6 +179,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
161
179
|
),
|
|
162
180
|
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
163
181
|
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
|
|
182
|
+
del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
|
|
164
183
|
get_config: IDL.Func([], [Config], []),
|
|
165
184
|
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
|
|
166
185
|
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|