@junobuild/analytics 0.0.9 → 0.0.11

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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/workers/analytics.worker.js +15 -15
  3. package/dist/workers/analytics.worker.js.gz +0 -0
  4. package/dist/workers/analytics.worker.js.map +2 -2
  5. package/package.json +3 -3
  6. package/declarations/cmc/cmc.did +0 -122
  7. package/declarations/cmc/cmc.did.d.ts +0 -48
  8. package/declarations/cmc/cmc.factory.did.js +0 -67
  9. package/declarations/cmc/index.d.ts +0 -45
  10. package/declarations/cmc/index.js +0 -37
  11. package/declarations/console/console.did.d.ts +0 -71
  12. package/declarations/console/console.factory.did.js +0 -79
  13. package/declarations/console/console.factory.did.mjs +0 -79
  14. package/declarations/console/index.d.ts +0 -45
  15. package/declarations/console/index.js +0 -37
  16. package/declarations/ic/ic.did +0 -195
  17. package/declarations/ic/ic.did.d.ts +0 -208
  18. package/declarations/ic/ic.factory.did.js +0 -274
  19. package/declarations/mission_control/index.d.ts +0 -45
  20. package/declarations/mission_control/index.js +0 -38
  21. package/declarations/mission_control/mission_control.did.d.ts +0 -101
  22. package/declarations/mission_control/mission_control.factory.did.js +0 -136
  23. package/declarations/observatory/index.d.ts +0 -45
  24. package/declarations/observatory/index.js +0 -38
  25. package/declarations/observatory/observatory.did.d.ts +0 -86
  26. package/declarations/observatory/observatory.factory.did.js +0 -95
  27. package/declarations/observatory/observatory.factory.did.mjs +0 -95
  28. package/declarations/satellite/index.d.ts +0 -45
  29. package/declarations/satellite/index.js +0 -37
  30. package/declarations/satellite/satellite.did.d.ts +0 -201
  31. package/declarations/satellite/satellite.factory.did.js +0 -215
  32. package/declarations/satellite/satellite.factory.did.mjs +0 -215
  33. package/dist/declarations/cmc/cmc.did +0 -122
  34. package/dist/declarations/cmc/cmc.did.d.ts +0 -48
  35. package/dist/declarations/cmc/cmc.factory.did.js +0 -67
  36. package/dist/declarations/cmc/index.d.ts +0 -45
  37. package/dist/declarations/cmc/index.js +0 -37
  38. package/dist/declarations/console/console.did.d.ts +0 -71
  39. package/dist/declarations/console/console.factory.did.js +0 -79
  40. package/dist/declarations/console/console.factory.did.mjs +0 -79
  41. package/dist/declarations/console/index.d.ts +0 -45
  42. package/dist/declarations/console/index.js +0 -37
  43. package/dist/declarations/ic/ic.did +0 -195
  44. package/dist/declarations/ic/ic.did.d.ts +0 -208
  45. package/dist/declarations/ic/ic.factory.did.js +0 -274
  46. package/dist/declarations/mission_control/index.d.ts +0 -45
  47. package/dist/declarations/mission_control/index.js +0 -38
  48. package/dist/declarations/mission_control/mission_control.did.d.ts +0 -101
  49. package/dist/declarations/mission_control/mission_control.factory.did.js +0 -136
  50. package/dist/declarations/observatory/index.d.ts +0 -45
  51. package/dist/declarations/observatory/index.js +0 -38
  52. package/dist/declarations/observatory/observatory.did.d.ts +0 -86
  53. package/dist/declarations/observatory/observatory.factory.did.js +0 -95
  54. package/dist/declarations/observatory/observatory.factory.did.mjs +0 -95
  55. package/dist/declarations/satellite/index.d.ts +0 -45
  56. package/dist/declarations/satellite/index.js +0 -37
  57. package/dist/declarations/satellite/satellite.did.d.ts +0 -201
  58. package/dist/declarations/satellite/satellite.factory.did.js +0 -215
  59. package/dist/declarations/satellite/satellite.factory.did.mjs +0 -215
@@ -1,38 +0,0 @@
1
- import {Actor, HttpAgent} from '@dfinity/agent';
2
-
3
- // Imports and re-exports candid interface
4
- import {idlFactory} from './mission_control.did.js';
5
- export {idlFactory} from './mission_control.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 =
13
- process.env.CANISTER_ID_MISSION_CONTROL || process.env.MISSION_CONTROL_CANISTER_ID;
14
-
15
- export const createActor = (canisterId, options = {}) => {
16
- const agent = options.agent || new HttpAgent({...options.agentOptions});
17
-
18
- if (options.agent && options.agentOptions) {
19
- console.warn(
20
- 'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
21
- );
22
- }
23
-
24
- // Fetch root key for certificate validation during development
25
- if (process.env.DFX_NETWORK !== 'ic') {
26
- agent.fetchRootKey().catch((err) => {
27
- console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
28
- console.error(err);
29
- });
30
- }
31
-
32
- // Creates an actor with using the candid interface and the HttpAgent
33
- return Actor.createActor(idlFactory, {
34
- agent,
35
- canisterId,
36
- ...options.actorOptions
37
- });
38
- };
@@ -1,101 +0,0 @@
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 interface Controller {
14
- updated_at: bigint;
15
- metadata: Array<[string, string]>;
16
- created_at: bigint;
17
- scope: ControllerScope;
18
- expires_at: [] | [bigint];
19
- }
20
- export type ControllerScope = {Write: null} | {Admin: null};
21
- export interface CronJobStatusesConfig {
22
- enabled: boolean;
23
- cycles_threshold: [] | [bigint];
24
- }
25
- export interface DefiniteCanisterSettings {
26
- freezing_threshold: bigint;
27
- controllers: Array<Principal>;
28
- memory_allocation: bigint;
29
- compute_allocation: bigint;
30
- }
31
- export interface Orbiter {
32
- updated_at: bigint;
33
- orbiter_id: Principal;
34
- metadata: Array<[string, string]>;
35
- created_at: bigint;
36
- }
37
- export type Result = {Ok: SegmentStatus} | {Err: string};
38
- export interface Satellite {
39
- updated_at: bigint;
40
- metadata: Array<[string, string]>;
41
- created_at: bigint;
42
- satellite_id: Principal;
43
- }
44
- export interface SegmentStatus {
45
- id: Principal;
46
- status: CanisterStatusResponse;
47
- metadata: [] | [Array<[string, string]>];
48
- status_at: bigint;
49
- }
50
- export interface SegmentsStatuses {
51
- orbiters: [] | [Array<Result>];
52
- satellites: [] | [Array<Result>];
53
- mission_control: Result;
54
- }
55
- export interface SetController {
56
- metadata: Array<[string, string]>;
57
- scope: ControllerScope;
58
- expires_at: [] | [bigint];
59
- }
60
- export interface StatusesArgs {
61
- mission_control_cycles_threshold: [] | [bigint];
62
- orbiters: Array<[Principal, CronJobStatusesConfig]>;
63
- satellites: Array<[Principal, CronJobStatusesConfig]>;
64
- cycles_threshold: [] | [bigint];
65
- }
66
- export interface Tokens {
67
- e8s: bigint;
68
- }
69
- export interface _SERVICE {
70
- add_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
71
- add_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
72
- create_orbiter: ActorMethod<[[] | [string]], Orbiter>;
73
- create_satellite: ActorMethod<[string], Satellite>;
74
- del_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
75
- del_orbiters_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
76
- del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
77
- get_user: ActorMethod<[], Principal>;
78
- list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
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]>>;
82
- list_satellite_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result]>]>;
83
- list_satellites: ActorMethod<[], Array<[Principal, Satellite]>>;
84
- remove_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
85
- remove_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
86
- set_metadata: ActorMethod<[Array<[string, string]>], undefined>;
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
- >;
93
- set_satellite_metadata: ActorMethod<[Principal, Array<[string, string]>], Satellite>;
94
- set_satellites_controllers: ActorMethod<
95
- [Array<Principal>, Array<Principal>, SetController],
96
- undefined
97
- >;
98
- status: ActorMethod<[StatusesArgs], SegmentsStatuses>;
99
- top_up: ActorMethod<[Principal, Tokens], undefined>;
100
- version: ActorMethod<[], string>;
101
- }
@@ -1,136 +0,0 @@
1
- // @ts-ignore
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
- });
9
- const Satellite = IDL.Record({
10
- updated_at: IDL.Nat64,
11
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
12
- created_at: IDL.Nat64,
13
- satellite_id: IDL.Principal
14
- });
15
- const ControllerScope = IDL.Variant({
16
- Write: IDL.Null,
17
- Admin: IDL.Null
18
- });
19
- const Controller = IDL.Record({
20
- updated_at: IDL.Nat64,
21
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
22
- created_at: IDL.Nat64,
23
- scope: ControllerScope,
24
- expires_at: IDL.Opt(IDL.Nat64)
25
- });
26
- const CanisterStatusType = IDL.Variant({
27
- stopped: IDL.Null,
28
- stopping: IDL.Null,
29
- running: IDL.Null
30
- });
31
- const DefiniteCanisterSettings = IDL.Record({
32
- freezing_threshold: IDL.Nat,
33
- controllers: IDL.Vec(IDL.Principal),
34
- memory_allocation: IDL.Nat,
35
- compute_allocation: IDL.Nat
36
- });
37
- const CanisterStatusResponse = IDL.Record({
38
- status: CanisterStatusType,
39
- memory_size: IDL.Nat,
40
- cycles: IDL.Nat,
41
- settings: DefiniteCanisterSettings,
42
- idle_cycles_burned_per_day: IDL.Nat,
43
- module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
44
- });
45
- const SegmentStatus = IDL.Record({
46
- id: IDL.Principal,
47
- status: CanisterStatusResponse,
48
- metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
49
- status_at: IDL.Nat64
50
- });
51
- const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
52
- const SetController = IDL.Record({
53
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
54
- scope: ControllerScope,
55
- expires_at: IDL.Opt(IDL.Nat64)
56
- });
57
- const CronJobStatusesConfig = IDL.Record({
58
- enabled: IDL.Bool,
59
- cycles_threshold: IDL.Opt(IDL.Nat64)
60
- });
61
- const StatusesArgs = IDL.Record({
62
- mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
63
- orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
64
- satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
65
- cycles_threshold: IDL.Opt(IDL.Nat64)
66
- });
67
- const SegmentsStatuses = IDL.Record({
68
- orbiters: IDL.Opt(IDL.Vec(Result)),
69
- satellites: IDL.Opt(IDL.Vec(Result)),
70
- mission_control: Result
71
- });
72
- const Tokens = IDL.Record({e8s: IDL.Nat64});
73
- return IDL.Service({
74
- add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
75
- add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
76
- create_orbiter: IDL.Func([IDL.Opt(IDL.Text)], [Orbiter], []),
77
- create_satellite: IDL.Func([IDL.Text], [Satellite], []),
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)], [], []),
80
- del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
81
- get_user: IDL.Func([], [IDL.Principal], ['query']),
82
- list_mission_control_controllers: IDL.Func(
83
- [],
84
- [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
85
- ['query']
86
- ),
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']),
94
- list_satellite_statuses: IDL.Func(
95
- [IDL.Principal],
96
- [IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result)))],
97
- ['query']
98
- ),
99
- list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),
100
- remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
101
- remove_satellites_controllers: IDL.Func(
102
- [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)],
103
- [],
104
- []
105
- ),
106
- set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
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
- ),
118
- set_satellite_metadata: IDL.Func(
119
- [IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
120
- [Satellite],
121
- []
122
- ),
123
- set_satellites_controllers: IDL.Func(
124
- [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],
125
- [],
126
- []
127
- ),
128
- status: IDL.Func([StatusesArgs], [SegmentsStatuses], []),
129
- top_up: IDL.Func([IDL.Principal, Tokens], [], []),
130
- version: IDL.Func([], [IDL.Text], ['query'])
131
- });
132
- };
133
- // @ts-ignore
134
- export const init = ({IDL}) => {
135
- return [];
136
- };
@@ -1,45 +0,0 @@
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>;
@@ -1,38 +0,0 @@
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
- * 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 =
13
- process.env.CANISTER_ID_OBSERVATORY || process.env.OBSERVATORY_CANISTER_ID;
14
-
15
- export const createActor = (canisterId, options = {}) => {
16
- const agent = options.agent || new HttpAgent({...options.agentOptions});
17
-
18
- if (options.agent && options.agentOptions) {
19
- console.warn(
20
- 'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
21
- );
22
- }
23
-
24
- // Fetch root key for certificate validation during development
25
- if (process.env.DFX_NETWORK !== 'ic') {
26
- agent.fetchRootKey().catch((err) => {
27
- console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
28
- console.error(err);
29
- });
30
- }
31
-
32
- // Creates an actor with using the candid interface and the HttpAgent
33
- return Actor.createActor(idlFactory, {
34
- agent,
35
- canisterId,
36
- ...options.actorOptions
37
- });
38
- };
@@ -1,86 +0,0 @@
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
- orbiters: Array<[Principal, CronJobStatusesConfig]>;
17
- satellites: Array<[Principal, CronJobStatusesConfig]>;
18
- enabled: boolean;
19
- cycles_threshold: [] | [bigint];
20
- }
21
- export interface CronJobStatusesConfig {
22
- enabled: boolean;
23
- cycles_threshold: [] | [bigint];
24
- }
25
- export interface CronJobs {
26
- metadata: Array<[string, string]>;
27
- statuses: CronJobStatuses;
28
- }
29
- export interface CronTab {
30
- cron_jobs: CronJobs;
31
- updated_at: bigint;
32
- mission_control_id: Principal;
33
- created_at: bigint;
34
- }
35
- export interface DefiniteCanisterSettings {
36
- freezing_threshold: bigint;
37
- controllers: Array<Principal>;
38
- memory_allocation: bigint;
39
- compute_allocation: bigint;
40
- }
41
- export interface DeleteControllersArgs {
42
- controllers: Array<Principal>;
43
- }
44
- export interface ListStatuses {
45
- cron_jobs: CronJobs;
46
- statuses: Result_1;
47
- timestamp: bigint;
48
- }
49
- export interface ListStatusesArgs {
50
- time_delta: [] | [bigint];
51
- }
52
- export type Result = {Ok: SegmentStatus} | {Err: string};
53
- export type Result_1 = {Ok: SegmentsStatuses} | {Err: string};
54
- export interface SegmentStatus {
55
- id: Principal;
56
- status: CanisterStatusResponse;
57
- metadata: [] | [Array<[string, string]>];
58
- status_at: bigint;
59
- }
60
- export interface SegmentsStatuses {
61
- orbiters: [] | [Array<Result>];
62
- satellites: [] | [Array<Result>];
63
- mission_control: Result;
64
- }
65
- export interface SetController {
66
- metadata: Array<[string, string]>;
67
- scope: ControllerScope;
68
- expires_at: [] | [bigint];
69
- }
70
- export interface SetControllersArgs {
71
- controller: SetController;
72
- controllers: Array<Principal>;
73
- }
74
- export interface SetCronTab {
75
- cron_jobs: CronJobs;
76
- updated_at: [] | [bigint];
77
- mission_control_id: Principal;
78
- }
79
- export interface _SERVICE {
80
- del_controllers: ActorMethod<[DeleteControllersArgs], undefined>;
81
- get_cron_tab: ActorMethod<[], [] | [CronTab]>;
82
- list_statuses: ActorMethod<[ListStatusesArgs], Array<ListStatuses>>;
83
- set_controllers: ActorMethod<[SetControllersArgs], undefined>;
84
- set_cron_tab: ActorMethod<[SetCronTab], CronTab>;
85
- version: ActorMethod<[], string>;
86
- }
@@ -1,95 +0,0 @@
1
- // @ts-ignore
2
- export const idlFactory = ({IDL}) => {
3
- const DeleteControllersArgs = IDL.Record({
4
- controllers: IDL.Vec(IDL.Principal)
5
- });
6
- const CronJobStatusesConfig = 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
- orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
13
- satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
14
- enabled: IDL.Bool,
15
- cycles_threshold: IDL.Opt(IDL.Nat64)
16
- });
17
- const CronJobs = IDL.Record({
18
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
19
- statuses: CronJobStatuses
20
- });
21
- const CronTab = IDL.Record({
22
- cron_jobs: CronJobs,
23
- updated_at: IDL.Nat64,
24
- mission_control_id: IDL.Principal,
25
- created_at: IDL.Nat64
26
- });
27
- const ListStatusesArgs = IDL.Record({time_delta: IDL.Opt(IDL.Nat64)});
28
- const CanisterStatusType = IDL.Variant({
29
- stopped: IDL.Null,
30
- stopping: IDL.Null,
31
- running: IDL.Null
32
- });
33
- const DefiniteCanisterSettings = IDL.Record({
34
- freezing_threshold: IDL.Nat,
35
- controllers: IDL.Vec(IDL.Principal),
36
- memory_allocation: IDL.Nat,
37
- compute_allocation: IDL.Nat
38
- });
39
- const CanisterStatusResponse = IDL.Record({
40
- status: CanisterStatusType,
41
- memory_size: IDL.Nat,
42
- cycles: IDL.Nat,
43
- settings: DefiniteCanisterSettings,
44
- idle_cycles_burned_per_day: IDL.Nat,
45
- module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
46
- });
47
- const SegmentStatus = IDL.Record({
48
- id: IDL.Principal,
49
- status: CanisterStatusResponse,
50
- metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
51
- status_at: IDL.Nat64
52
- });
53
- const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
54
- const SegmentsStatuses = IDL.Record({
55
- orbiters: IDL.Opt(IDL.Vec(Result)),
56
- satellites: IDL.Opt(IDL.Vec(Result)),
57
- mission_control: Result
58
- });
59
- const Result_1 = IDL.Variant({Ok: SegmentsStatuses, Err: IDL.Text});
60
- const ListStatuses = IDL.Record({
61
- cron_jobs: CronJobs,
62
- statuses: Result_1,
63
- timestamp: IDL.Nat64
64
- });
65
- const ControllerScope = IDL.Variant({
66
- Write: IDL.Null,
67
- Admin: IDL.Null
68
- });
69
- const SetController = IDL.Record({
70
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
71
- scope: ControllerScope,
72
- expires_at: IDL.Opt(IDL.Nat64)
73
- });
74
- const SetControllersArgs = IDL.Record({
75
- controller: SetController,
76
- controllers: IDL.Vec(IDL.Principal)
77
- });
78
- const SetCronTab = IDL.Record({
79
- cron_jobs: CronJobs,
80
- updated_at: IDL.Opt(IDL.Nat64),
81
- mission_control_id: IDL.Principal
82
- });
83
- return IDL.Service({
84
- del_controllers: IDL.Func([DeleteControllersArgs], [], []),
85
- get_cron_tab: IDL.Func([], [IDL.Opt(CronTab)], ['query']),
86
- list_statuses: IDL.Func([ListStatusesArgs], [IDL.Vec(ListStatuses)], ['query']),
87
- set_controllers: IDL.Func([SetControllersArgs], [], []),
88
- set_cron_tab: IDL.Func([SetCronTab], [CronTab], []),
89
- version: IDL.Func([], [IDL.Text], ['query'])
90
- });
91
- };
92
- // @ts-ignore
93
- export const init = ({IDL}) => {
94
- return [];
95
- };
@@ -1,95 +0,0 @@
1
- // @ts-ignore
2
- export const idlFactory = ({IDL}) => {
3
- const DeleteControllersArgs = IDL.Record({
4
- controllers: IDL.Vec(IDL.Principal)
5
- });
6
- const CronJobStatusesConfig = 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
- orbiters: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
13
- satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesConfig)),
14
- enabled: IDL.Bool,
15
- cycles_threshold: IDL.Opt(IDL.Nat64)
16
- });
17
- const CronJobs = IDL.Record({
18
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
19
- statuses: CronJobStatuses
20
- });
21
- const CronTab = IDL.Record({
22
- cron_jobs: CronJobs,
23
- updated_at: IDL.Nat64,
24
- mission_control_id: IDL.Principal,
25
- created_at: IDL.Nat64
26
- });
27
- const ListStatusesArgs = IDL.Record({time_delta: IDL.Opt(IDL.Nat64)});
28
- const CanisterStatusType = IDL.Variant({
29
- stopped: IDL.Null,
30
- stopping: IDL.Null,
31
- running: IDL.Null
32
- });
33
- const DefiniteCanisterSettings = IDL.Record({
34
- freezing_threshold: IDL.Nat,
35
- controllers: IDL.Vec(IDL.Principal),
36
- memory_allocation: IDL.Nat,
37
- compute_allocation: IDL.Nat
38
- });
39
- const CanisterStatusResponse = IDL.Record({
40
- status: CanisterStatusType,
41
- memory_size: IDL.Nat,
42
- cycles: IDL.Nat,
43
- settings: DefiniteCanisterSettings,
44
- idle_cycles_burned_per_day: IDL.Nat,
45
- module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
46
- });
47
- const SegmentStatus = IDL.Record({
48
- id: IDL.Principal,
49
- status: CanisterStatusResponse,
50
- metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
51
- status_at: IDL.Nat64
52
- });
53
- const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
54
- const SegmentsStatuses = IDL.Record({
55
- orbiters: IDL.Opt(IDL.Vec(Result)),
56
- satellites: IDL.Opt(IDL.Vec(Result)),
57
- mission_control: Result
58
- });
59
- const Result_1 = IDL.Variant({Ok: SegmentsStatuses, Err: IDL.Text});
60
- const ListStatuses = IDL.Record({
61
- cron_jobs: CronJobs,
62
- statuses: Result_1,
63
- timestamp: IDL.Nat64
64
- });
65
- const ControllerScope = IDL.Variant({
66
- Write: IDL.Null,
67
- Admin: IDL.Null
68
- });
69
- const SetController = IDL.Record({
70
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
71
- scope: ControllerScope,
72
- expires_at: IDL.Opt(IDL.Nat64)
73
- });
74
- const SetControllersArgs = IDL.Record({
75
- controller: SetController,
76
- controllers: IDL.Vec(IDL.Principal)
77
- });
78
- const SetCronTab = IDL.Record({
79
- cron_jobs: CronJobs,
80
- updated_at: IDL.Opt(IDL.Nat64),
81
- mission_control_id: IDL.Principal
82
- });
83
- return IDL.Service({
84
- del_controllers: IDL.Func([DeleteControllersArgs], [], []),
85
- get_cron_tab: IDL.Func([], [IDL.Opt(CronTab)], ['query']),
86
- list_statuses: IDL.Func([ListStatusesArgs], [IDL.Vec(ListStatuses)], ['query']),
87
- set_controllers: IDL.Func([SetControllersArgs], [], []),
88
- set_cron_tab: IDL.Func([SetCronTab], [CronTab], []),
89
- version: IDL.Func([], [IDL.Text], ['query'])
90
- });
91
- };
92
- // @ts-ignore
93
- export const init = ({IDL}) => {
94
- return [];
95
- };
@@ -1,45 +0,0 @@
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 './satellite.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 satellite: ActorSubclass<_SERVICE>;