@junobuild/admin 0.0.14 → 0.0.16

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.
Files changed (58) hide show
  1. package/declarations/cmc/cmc.factory.did.js +2 -0
  2. package/declarations/console/console.did.d.ts +8 -1
  3. package/declarations/console/console.factory.did.js +13 -1
  4. package/declarations/console/console.factory.did.mjs +13 -1
  5. package/declarations/frontend/frontend.factory.did.js +2 -0
  6. package/declarations/ic/ic.factory.did.js +3 -0
  7. package/declarations/internet_identity/internet_identity.did +49 -1
  8. package/declarations/internet_identity/internet_identity.did.d.ts +28 -1
  9. package/declarations/internet_identity/internet_identity.factory.did.js +45 -1
  10. package/declarations/ledger/ledger.did +22 -5
  11. package/declarations/ledger/ledger.did.d.ts +18 -1
  12. package/declarations/ledger/ledger.factory.did.js +18 -1
  13. package/declarations/mission_control/mission_control.did.d.ts +42 -0
  14. package/declarations/mission_control/mission_control.factory.did.js +55 -0
  15. package/declarations/observatory/index.d.ts +45 -0
  16. package/declarations/observatory/index.js +32 -0
  17. package/declarations/observatory/observatory.did.d.ts +84 -0
  18. package/declarations/observatory/observatory.factory.did.js +93 -0
  19. package/declarations/observatory/observatory.factory.did.mjs +93 -0
  20. package/declarations/satellite/satellite-deprecated-no-scope.did.d.ts +183 -0
  21. package/declarations/satellite/satellite-deprecated-no-scope.factory.did.js +194 -0
  22. package/declarations/satellite/satellite-deprecated-no-scope.factory.did.mjs +192 -0
  23. package/declarations/satellite/satellite.did.d.ts +19 -3
  24. package/declarations/satellite/satellite.factory.did.js +26 -7
  25. package/declarations/satellite/satellite.factory.did.mjs +28 -7
  26. package/dist/browser/index.js +9 -9
  27. package/dist/browser/index.js.map +4 -4
  28. package/dist/declarations/cmc/cmc.factory.did.js +2 -0
  29. package/dist/declarations/console/console.did.d.ts +8 -1
  30. package/dist/declarations/console/console.factory.did.js +13 -1
  31. package/dist/declarations/console/console.factory.did.mjs +13 -1
  32. package/dist/declarations/frontend/frontend.factory.did.js +2 -0
  33. package/dist/declarations/ic/ic.factory.did.js +3 -0
  34. package/dist/declarations/internet_identity/internet_identity.did +49 -1
  35. package/dist/declarations/internet_identity/internet_identity.did.d.ts +28 -1
  36. package/dist/declarations/internet_identity/internet_identity.factory.did.js +45 -1
  37. package/dist/declarations/ledger/ledger.did +22 -5
  38. package/dist/declarations/ledger/ledger.did.d.ts +18 -1
  39. package/dist/declarations/ledger/ledger.factory.did.js +18 -1
  40. package/dist/declarations/mission_control/mission_control.did.d.ts +42 -0
  41. package/dist/declarations/mission_control/mission_control.factory.did.js +55 -0
  42. package/dist/declarations/observatory/index.d.ts +45 -0
  43. package/dist/declarations/observatory/index.js +32 -0
  44. package/dist/declarations/observatory/observatory.did.d.ts +84 -0
  45. package/dist/declarations/observatory/observatory.factory.did.js +93 -0
  46. package/dist/declarations/observatory/observatory.factory.did.mjs +93 -0
  47. package/dist/declarations/satellite/satellite-deprecated-no-scope.did.d.ts +183 -0
  48. package/dist/declarations/satellite/satellite-deprecated-no-scope.factory.did.js +194 -0
  49. package/dist/declarations/satellite/satellite-deprecated-no-scope.factory.did.mjs +192 -0
  50. package/dist/declarations/satellite/satellite.did.d.ts +19 -3
  51. package/dist/declarations/satellite/satellite.factory.did.js +26 -7
  52. package/dist/declarations/satellite/satellite.factory.did.mjs +28 -7
  53. package/dist/node/index.mjs +24 -24
  54. package/dist/node/index.mjs.map +4 -4
  55. package/dist/types/api/actor.api.d.ts +2 -0
  56. package/dist/types/api/satellite.api.d.ts +3 -0
  57. package/dist/types/services/satellite.services.d.ts +2 -1
  58. 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
+ };
@@ -0,0 +1,183 @@
1
+ import type {ActorMethod} from '@dfinity/agent';
2
+ import type {Principal} from '@dfinity/principal';
3
+
4
+ export interface AssetEncodingNoContent {
5
+ modified: bigint;
6
+ sha256: Uint8Array | number[];
7
+ total_length: bigint;
8
+ }
9
+ export interface AssetKey {
10
+ token: [] | [string];
11
+ collection: string;
12
+ owner: Principal;
13
+ name: string;
14
+ full_path: string;
15
+ }
16
+ export interface AssetNoContent {
17
+ key: AssetKey;
18
+ updated_at: bigint;
19
+ encodings: Array<[string, AssetEncodingNoContent]>;
20
+ headers: Array<[string, string]>;
21
+ created_at: bigint;
22
+ }
23
+ export interface Chunk {
24
+ content: Uint8Array | number[];
25
+ batch_id: bigint;
26
+ }
27
+ export interface CommitBatch {
28
+ batch_id: bigint;
29
+ headers: Array<[string, string]>;
30
+ chunk_ids: Array<bigint>;
31
+ }
32
+ export interface Config {
33
+ storage: StorageConfig;
34
+ }
35
+ export interface Controller {
36
+ updated_at: bigint;
37
+ metadata: Array<[string, string]>;
38
+ created_at: bigint;
39
+ expires_at: [] | [bigint];
40
+ }
41
+ export interface CustomDomain {
42
+ updated_at: bigint;
43
+ created_at: bigint;
44
+ bn_id: [] | [string];
45
+ }
46
+ export interface DelDoc {
47
+ updated_at: [] | [bigint];
48
+ }
49
+ export interface DeleteControllersArgs {
50
+ controllers: Array<Principal>;
51
+ }
52
+ export interface Doc {
53
+ updated_at: bigint;
54
+ owner: Principal;
55
+ data: Uint8Array | number[];
56
+ created_at: bigint;
57
+ }
58
+ export interface HttpRequest {
59
+ url: string;
60
+ method: string;
61
+ body: Uint8Array | number[];
62
+ headers: Array<[string, string]>;
63
+ }
64
+ export interface HttpResponse {
65
+ body: Uint8Array | number[];
66
+ headers: Array<[string, string]>;
67
+ streaming_strategy: [] | [StreamingStrategy];
68
+ status_code: number;
69
+ }
70
+ export interface InitAssetKey {
71
+ token: [] | [string];
72
+ collection: string;
73
+ name: string;
74
+ encoding_type: [] | [string];
75
+ full_path: string;
76
+ }
77
+ export interface InitUploadResult {
78
+ batch_id: bigint;
79
+ }
80
+ export interface ListOrder {
81
+ field: ListOrderField;
82
+ desc: boolean;
83
+ }
84
+ export type ListOrderField = {UpdatedAt: null} | {Keys: null} | {CreatedAt: null};
85
+ export interface ListPaginate {
86
+ start_after: [] | [string];
87
+ limit: [] | [bigint];
88
+ }
89
+ export interface ListParams {
90
+ order: [] | [ListOrder];
91
+ owner: [] | [Principal];
92
+ matcher: [] | [string];
93
+ paginate: [] | [ListPaginate];
94
+ }
95
+ export interface ListResults {
96
+ matches_length: bigint;
97
+ length: bigint;
98
+ items: Array<[string, AssetNoContent]>;
99
+ }
100
+ export interface ListResults_1 {
101
+ matches_length: bigint;
102
+ length: bigint;
103
+ items: Array<[string, Doc]>;
104
+ }
105
+ export type Permission = {Controllers: null} | {Private: null} | {Public: null} | {Managed: null};
106
+ export interface Rule {
107
+ updated_at: bigint;
108
+ max_size: [] | [bigint];
109
+ read: Permission;
110
+ created_at: bigint;
111
+ write: Permission;
112
+ }
113
+ export type RulesType = {Db: null} | {Storage: null};
114
+ export interface SetController {
115
+ metadata: Array<[string, string]>;
116
+ expires_at: [] | [bigint];
117
+ }
118
+ export interface SetControllersArgs {
119
+ controller: SetController;
120
+ controllers: Array<Principal>;
121
+ }
122
+ export interface SetDoc {
123
+ updated_at: [] | [bigint];
124
+ data: Uint8Array | number[];
125
+ }
126
+ export interface SetRule {
127
+ updated_at: [] | [bigint];
128
+ max_size: [] | [bigint];
129
+ read: Permission;
130
+ write: Permission;
131
+ }
132
+ export interface StorageConfig {
133
+ headers: Array<[string, Array<[string, string]>]>;
134
+ }
135
+ export interface StreamingCallbackHttpResponse {
136
+ token: [] | [StreamingCallbackToken];
137
+ body: Uint8Array | number[];
138
+ }
139
+ export interface StreamingCallbackToken {
140
+ token: [] | [string];
141
+ sha256: [] | [Uint8Array | number[]];
142
+ headers: Array<[string, string]>;
143
+ index: bigint;
144
+ encoding_type: string;
145
+ full_path: string;
146
+ }
147
+ export type StreamingStrategy = {
148
+ Callback: {
149
+ token: StreamingCallbackToken;
150
+ callback: [Principal, string];
151
+ };
152
+ };
153
+ export interface UploadChunk {
154
+ chunk_id: bigint;
155
+ }
156
+ export interface _SERVICE {
157
+ commit_asset_upload: ActorMethod<[CommitBatch], undefined>;
158
+ del_asset: ActorMethod<[string, string], undefined>;
159
+ del_assets: ActorMethod<[[] | [string]], undefined>;
160
+ del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
161
+ del_custom_domain: ActorMethod<[string], undefined>;
162
+ del_doc: ActorMethod<[string, string, DelDoc], undefined>;
163
+ get_config: ActorMethod<[], Config>;
164
+ get_doc: ActorMethod<[string, string], [] | [Doc]>;
165
+ http_request: ActorMethod<[HttpRequest], HttpResponse>;
166
+ http_request_streaming_callback: ActorMethod<
167
+ [StreamingCallbackToken],
168
+ StreamingCallbackHttpResponse
169
+ >;
170
+ init_asset_upload: ActorMethod<[InitAssetKey], InitUploadResult>;
171
+ list_assets: ActorMethod<[[] | [string], ListParams], ListResults>;
172
+ list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
173
+ list_custom_domains: ActorMethod<[], Array<[string, CustomDomain]>>;
174
+ list_docs: ActorMethod<[string, ListParams], ListResults_1>;
175
+ list_rules: ActorMethod<[RulesType], Array<[string, Rule]>>;
176
+ set_config: ActorMethod<[Config], undefined>;
177
+ set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
178
+ set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
179
+ set_doc: ActorMethod<[string, string, SetDoc], Doc>;
180
+ set_rule: ActorMethod<[RulesType, string, SetRule], undefined>;
181
+ upload_asset_chunk: ActorMethod<[Chunk], UploadChunk>;
182
+ version: ActorMethod<[], string>;
183
+ }