ic-mops 0.30.0 → 0.31.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.
Files changed (59) hide show
  1. package/commands/add.ts +12 -3
  2. package/commands/install.ts +2 -2
  3. package/commands/update.ts +30 -2
  4. package/dist/commands/add.js +11 -3
  5. package/dist/commands/install.js +2 -2
  6. package/dist/commands/update.js +27 -2
  7. package/dist/mops.d.ts +4 -2
  8. package/dist/mops.js +18 -4
  9. package/dist/package.json +1 -1
  10. package/dist/vessel.js +10 -10
  11. package/mops.ts +19 -5
  12. package/package.json +1 -1
  13. package/vessel.ts +10 -10
  14. package/dist/bench/$USER_BENCH_FILE.mo +0 -45
  15. package/dist/bench/bench-canister.mo +0 -57
  16. package/dist/commands/bench/$USER_BENCH_FILE.mo +0 -45
  17. package/dist/commands/bench/bench/$USER_BENCH_FILE.mo +0 -45
  18. package/dist/commands/bench/bench/bench-canister.mo +0 -57
  19. package/dist/commands/bench/bench-canister.mo +0 -85
  20. package/dist/commands/bench/declarations/bench/bench.did.d.ts +0 -6
  21. package/dist/commands/bench/declarations/bench/bench.did.js +0 -22
  22. package/dist/commands/bench/declarations/bench/index.d.ts +0 -2
  23. package/dist/commands/bench/declarations/bench/index.js +0 -30
  24. package/dist/commands/bench/declarations/main/index.d.ts +0 -2
  25. package/dist/commands/bench/declarations/main/index.js +0 -30
  26. package/dist/commands/bench/declarations/main/main.did.d.ts +0 -6
  27. package/dist/commands/bench/declarations/main/main.did.js +0 -242
  28. package/dist/commands/bench/declarations/storage/index.d.ts +0 -4
  29. package/dist/commands/bench/declarations/storage/index.js +0 -26
  30. package/dist/commands/bench/declarations/storage/storage.did.d.ts +0 -6
  31. package/dist/commands/bench/declarations/storage/storage.did.js +0 -34
  32. package/dist/commands/bench/user-bench.mo +0 -14
  33. package/dist/commands/bench.d.ts +0 -10
  34. package/dist/commands/bench.js +0 -214
  35. package/dist/commands/mmf1.d.ts +0 -21
  36. package/dist/commands/mmf1.js +0 -93
  37. package/dist/commands/test/reporter-files.d.ts +0 -10
  38. package/dist/commands/test/reporter-files.js +0 -48
  39. package/dist/commands/test/reporter-verbose.d.ts +0 -10
  40. package/dist/commands/test/reporter-verbose.js +0 -56
  41. package/dist/commands/test.d.ts +0 -4
  42. package/dist/commands/test.js +0 -186
  43. package/dist/declarations/bench/bench.did +0 -24
  44. package/dist/declarations/bench/bench.did.d.ts +0 -24
  45. package/dist/declarations/bench/bench.did.js +0 -24
  46. package/dist/declarations/bench/index.d.ts +0 -50
  47. package/dist/declarations/bench/index.js +0 -41
  48. package/dist/helpers/get-dfx-version.d.ts +0 -1
  49. package/dist/helpers/get-dfx-version.js +0 -9
  50. package/dist/helpers/get-moc-path.d.ts +0 -1
  51. package/dist/helpers/get-moc-path.js +0 -11
  52. package/dist/helpers/get-moc-version.d.ts +0 -1
  53. package/dist/helpers/get-moc-version.js +0 -7
  54. package/dist/out/cli.d.ts +0 -2
  55. package/dist/out/cli.js +0 -114581
  56. package/dist/parse-changelog.d.ts +0 -1
  57. package/dist/parse-changelog.js +0 -1435
  58. package/dist/test.d.ts +0 -1
  59. package/dist/test.js +0 -1411
@@ -1,57 +0,0 @@
1
- import Nat64 "mo:base/Nat64";
2
- import Debug "mo:base/Debug";
3
- import ExperimentalInternetComputer "mo:base/ExperimentalInternetComputer";
4
- import Prim "mo:prim";
5
-
6
- // import Bench "./bench";
7
- import Bench "mo:bench";
8
-
9
- import UserBench "$USER_BENCH_FILE";
10
-
11
- actor class() {
12
- var benchOpt : ?Bench.Bench = null;
13
-
14
- public func init() : async Bench.BenchSchema {
15
- let bench = UserBench.init();
16
- benchOpt := ?bench;
17
- bench.getSchema();
18
- };
19
-
20
- // public composite query func noop() : async () {};
21
-
22
- public func runCell(rowIndex : Nat, colIndex : Nat) : async Bench.BenchResult {
23
- let ?bench = benchOpt else Debug.trap("bench not initialized");
24
-
25
- let rts_heap_size_before = Prim.rts_heap_size();
26
- let rts_memory_size_before = Prim.rts_memory_size();
27
- let rts_total_allocation_before = Prim.rts_total_allocation();
28
- let rts_mutator_instructions_before = Prim.rts_mutator_instructions();
29
- let rts_collector_instructions_before = Prim.rts_collector_instructions();
30
-
31
- let mode : Bench.BenchMode = #replica;
32
- let instructions = switch(mode) {
33
- case (#replica) {
34
- ExperimentalInternetComputer.countInstructions(func() {
35
- bench.runCell(rowIndex, colIndex, #replica);
36
- });
37
- };
38
- case (#wasi) {
39
- bench.runCell(rowIndex, colIndex, #replica);
40
- 0 : Nat64;
41
- };
42
- };
43
-
44
- // await noop();
45
-
46
- // await (func() : async () {})();
47
-
48
- {
49
- instructions = Nat64.toNat(instructions);
50
- rts_heap_size = Prim.rts_heap_size() - rts_heap_size_before;
51
- rts_memory_size = Prim.rts_memory_size() - rts_memory_size_before;
52
- rts_total_allocation = Prim.rts_total_allocation() - rts_total_allocation_before;
53
- rts_mutator_instructions = Prim.rts_mutator_instructions() - rts_mutator_instructions_before;
54
- rts_collector_instructions = Prim.rts_collector_instructions() - rts_collector_instructions_before;
55
- }
56
- };
57
- };
@@ -1,85 +0,0 @@
1
- import Nat64 "mo:base/Nat64";
2
- import Nat "mo:base/Nat";
3
- import Debug "mo:base/Debug";
4
- import ExperimentalInternetComputer "mo:base/ExperimentalInternetComputer";
5
- import Prim "mo:prim";
6
- import Bench "mo:bench";
7
-
8
- import UserBench "./user-bench";
9
-
10
- actor class() {
11
- var benchOpt : ?Bench.Bench = null;
12
-
13
- public func init() : async Bench.BenchSchema {
14
- let bench = UserBench.init();
15
- benchOpt := ?bench;
16
- bench.getSchema();
17
- };
18
-
19
- func _getStats() : Bench.BenchResult {
20
- {
21
- instructions = 0;
22
- rts_heap_size = Prim.rts_heap_size();
23
- rts_memory_size = Prim.rts_memory_size();
24
- rts_total_allocation = Prim.rts_total_allocation();
25
- rts_mutator_instructions = Prim.rts_mutator_instructions();
26
- rts_collector_instructions = Prim.rts_collector_instructions();
27
- }
28
- };
29
-
30
- func _runCell(rowIndex : Nat, colIndex : Nat) : Bench.BenchResult {
31
- let ?bench = benchOpt else Debug.trap("bench not initialized");
32
- let statsBefore = _getStats();
33
-
34
- let instructions = ExperimentalInternetComputer.countInstructions(func() {
35
- bench.runCell(rowIndex, colIndex);
36
- });
37
-
38
- // await (func() : async () {})();
39
-
40
- let statsAfter = _getStats();
41
-
42
- {
43
- instructions = Nat64.toNat(instructions);
44
- rts_heap_size = statsAfter.rts_heap_size - statsBefore.rts_heap_size;
45
- rts_memory_size = statsAfter.rts_memory_size - statsBefore.rts_memory_size;
46
- rts_total_allocation = statsAfter.rts_total_allocation - statsBefore.rts_total_allocation;
47
- rts_mutator_instructions = statsAfter.rts_mutator_instructions - statsBefore.rts_mutator_instructions;
48
- rts_collector_instructions = statsAfter.rts_collector_instructions - statsBefore.rts_collector_instructions;
49
- }
50
- };
51
-
52
- func _runCellAwait(rowIndex : Nat, colIndex : Nat) : async Bench.BenchResult {
53
- let ?bench = benchOpt else Debug.trap("bench not initialized");
54
- let statsBefore = _getStats();
55
-
56
- let instructions = ExperimentalInternetComputer.countInstructions(func() {
57
- bench.runCell(rowIndex, colIndex);
58
- });
59
-
60
- await (func() : async () {})();
61
-
62
- let statsAfter = _getStats();
63
-
64
- {
65
- instructions = Nat64.toNat(instructions);
66
- rts_heap_size = statsAfter.rts_heap_size - statsBefore.rts_heap_size;
67
- rts_memory_size = statsAfter.rts_memory_size - statsBefore.rts_memory_size;
68
- rts_total_allocation = statsAfter.rts_total_allocation - statsBefore.rts_total_allocation;
69
- rts_mutator_instructions = statsAfter.rts_mutator_instructions - statsBefore.rts_mutator_instructions;
70
- rts_collector_instructions = statsAfter.rts_collector_instructions - statsBefore.rts_collector_instructions;
71
- }
72
- };
73
-
74
- public query func getStats() : async Bench.BenchResult {
75
- _getStats();
76
- };
77
-
78
- public query func runCellQuery(rowIndex : Nat, colIndex : Nat) : async Bench.BenchResult {
79
- _runCell(rowIndex, colIndex);
80
- };
81
-
82
- public func runCellUpdate(rowIndex : Nat, colIndex : Nat) : async Bench.BenchResult {
83
- await _runCellAwait(rowIndex, colIndex);
84
- };
85
- };
@@ -1,6 +0,0 @@
1
- export function idlFactory({ IDL }: {
2
- IDL: any;
3
- }): any;
4
- export function init({ IDL }: {
5
- IDL: any;
6
- }): never[];
@@ -1,22 +0,0 @@
1
- export const idlFactory = ({ IDL }) => {
2
- const BenchSchema = IDL.Record({
3
- 'title': IDL.Text,
4
- 'cols': IDL.Vec(IDL.Text),
5
- 'rows': IDL.Vec(IDL.Text),
6
- 'description': IDL.Text,
7
- });
8
- const BenchResult = IDL.Record({
9
- 'instructions': IDL.Nat,
10
- 'rts_memory_size': IDL.Nat,
11
- 'rts_total_allocation': IDL.Nat,
12
- 'rts_collector_instructions': IDL.Nat,
13
- 'rts_mutator_instructions': IDL.Nat,
14
- 'rts_heap_size': IDL.Nat,
15
- });
16
- const anon_class_11_1 = IDL.Service({
17
- 'init': IDL.Func([], [BenchSchema], []),
18
- 'runCell': IDL.Func([IDL.Nat, IDL.Nat], [BenchResult], []),
19
- });
20
- return anon_class_11_1;
21
- };
22
- export const init = ({ IDL }) => { return []; };
@@ -1,2 +0,0 @@
1
- export const canisterId: string | undefined;
2
- export function createActor(canisterId: any, options?: {}): import("@dfinity/agent").ActorSubclass<Record<string, import("@dfinity/agent").ActorMethod<unknown[], unknown>>>;
@@ -1,30 +0,0 @@
1
- import { Actor, HttpAgent } from "@dfinity/agent";
2
- // Imports and re-exports candid interface
3
- import { idlFactory } from "./bench.did.js";
4
- export { idlFactory } from "./bench.did.js";
5
- /* CANISTER_ID is replaced by webpack based on node environment
6
- * Note: canister environment variable will be standardized as
7
- * process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
8
- * beginning in dfx 0.15.0
9
- */
10
- export const canisterId = process.env.CANISTER_ID_BENCH ||
11
- process.env.BENCH_CANISTER_ID;
12
- export const createActor = (canisterId, options = {}) => {
13
- const agent = options.agent || new HttpAgent({ ...options.agentOptions });
14
- if (options.agent && options.agentOptions) {
15
- console.warn("Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.");
16
- }
17
- // Fetch root key for certificate validation during development
18
- if (process.env.DFX_NETWORK !== "ic") {
19
- agent.fetchRootKey().catch((err) => {
20
- console.warn("Unable to fetch root key. Check to ensure that your local replica is running");
21
- console.error(err);
22
- });
23
- }
24
- // Creates an actor with using the candid interface and the HttpAgent
25
- return Actor.createActor(idlFactory, {
26
- agent,
27
- canisterId,
28
- ...options.actorOptions,
29
- });
30
- };
@@ -1,2 +0,0 @@
1
- export const canisterId: string | undefined;
2
- export function createActor(canisterId: any, options?: {}): import("@dfinity/agent").ActorSubclass<Record<string, import("@dfinity/agent").ActorMethod<unknown[], unknown>>>;
@@ -1,30 +0,0 @@
1
- import { Actor, HttpAgent } from "@dfinity/agent";
2
- // Imports and re-exports candid interface
3
- import { idlFactory } from "./main.did.js";
4
- export { idlFactory } from "./main.did.js";
5
- /* CANISTER_ID is replaced by webpack based on node environment
6
- * Note: canister environment variable will be standardized as
7
- * process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
8
- * beginning in dfx 0.15.0
9
- */
10
- export const canisterId = process.env.CANISTER_ID_MAIN ||
11
- process.env.MAIN_CANISTER_ID;
12
- export const createActor = (canisterId, options = {}) => {
13
- const agent = options.agent || new HttpAgent({ ...options.agentOptions });
14
- if (options.agent && options.agentOptions) {
15
- console.warn("Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.");
16
- }
17
- // Fetch root key for certificate validation during development
18
- if (process.env.DFX_NETWORK !== "ic") {
19
- agent.fetchRootKey().catch((err) => {
20
- console.warn("Unable to fetch root key. Check to ensure that your local replica is running");
21
- console.error(err);
22
- });
23
- }
24
- // Creates an actor with using the candid interface and the HttpAgent
25
- return Actor.createActor(idlFactory, {
26
- agent,
27
- canisterId,
28
- ...options.actorOptions,
29
- });
30
- };
@@ -1,6 +0,0 @@
1
- export function idlFactory({ IDL }: {
2
- IDL: any;
3
- }): any;
4
- export function init({ IDL }: {
5
- IDL: any;
6
- }): never[];
@@ -1,242 +0,0 @@
1
- export const idlFactory = ({ IDL }) => {
2
- const TestsChanges = IDL.Record({
3
- 'addedNames': IDL.Vec(IDL.Text),
4
- 'removedNames': IDL.Vec(IDL.Text),
5
- });
6
- const DepChange = IDL.Record({
7
- 'oldVersion': IDL.Text,
8
- 'name': IDL.Text,
9
- 'newVersion': IDL.Text,
10
- });
11
- const PackageChanges__1 = IDL.Record({
12
- 'tests': TestsChanges,
13
- 'deps': IDL.Vec(DepChange),
14
- 'notes': IDL.Text,
15
- 'devDeps': IDL.Vec(DepChange),
16
- });
17
- const PublishingId = IDL.Text;
18
- const Err = IDL.Text;
19
- const Result = IDL.Variant({ 'ok': IDL.Null, 'err': Err });
20
- const Text = IDL.Text;
21
- const PackageName__1 = IDL.Text;
22
- const PackageVersion = IDL.Text;
23
- const PackageId = IDL.Text;
24
- const Time = IDL.Int;
25
- const DownloadsSnapshot__1 = IDL.Record({
26
- 'startTime': Time,
27
- 'endTime': Time,
28
- 'downloads': IDL.Nat,
29
- });
30
- const FileId = IDL.Text;
31
- const Result_7 = IDL.Variant({ 'ok': IDL.Vec(FileId), 'err': Err });
32
- const SemverPart = IDL.Variant({
33
- 'major': IDL.Null,
34
- 'minor': IDL.Null,
35
- 'patch': IDL.Null,
36
- });
37
- const Result_6 = IDL.Variant({
38
- 'ok': IDL.Vec(IDL.Tuple(PackageName__1, PackageVersion)),
39
- 'err': Err,
40
- });
41
- const Result_5 = IDL.Variant({ 'ok': PackageVersion, 'err': Err });
42
- const User = IDL.Record({
43
- 'id': IDL.Principal,
44
- 'emailVerified': IDL.Bool,
45
- 'twitter': IDL.Text,
46
- 'displayName': IDL.Text,
47
- 'name': IDL.Text,
48
- 'site': IDL.Text,
49
- 'email': IDL.Text,
50
- 'twitterVerified': IDL.Bool,
51
- 'githubVerified': IDL.Bool,
52
- 'github': IDL.Text,
53
- });
54
- const Script = IDL.Record({ 'value': IDL.Text, 'name': IDL.Text });
55
- const PackageName = IDL.Text;
56
- const DependencyV2 = IDL.Record({
57
- 'name': PackageName,
58
- 'repo': IDL.Text,
59
- 'version': IDL.Text,
60
- });
61
- const PackageConfigV2__1 = IDL.Record({
62
- 'dfx': IDL.Text,
63
- 'moc': IDL.Text,
64
- 'scripts': IDL.Vec(Script),
65
- 'baseDir': IDL.Text,
66
- 'documentation': IDL.Text,
67
- 'name': PackageName,
68
- 'homepage': IDL.Text,
69
- 'description': IDL.Text,
70
- 'version': IDL.Text,
71
- 'keywords': IDL.Vec(IDL.Text),
72
- 'donation': IDL.Text,
73
- 'devDependencies': IDL.Vec(DependencyV2),
74
- 'repository': IDL.Text,
75
- 'dependencies': IDL.Vec(DependencyV2),
76
- 'license': IDL.Text,
77
- 'readme': IDL.Text,
78
- });
79
- const PackagePublication = IDL.Record({
80
- 'storage': IDL.Principal,
81
- 'time': Time,
82
- 'user': IDL.Principal,
83
- });
84
- const PackageSummary = IDL.Record({
85
- 'ownerInfo': User,
86
- 'owner': IDL.Principal,
87
- 'downloadsTotal': IDL.Nat,
88
- 'downloadsInLast30Days': IDL.Nat,
89
- 'downloadsInLast7Days': IDL.Nat,
90
- 'config': PackageConfigV2__1,
91
- 'publication': PackagePublication,
92
- });
93
- const PackageSummary__1 = IDL.Record({
94
- 'ownerInfo': User,
95
- 'owner': IDL.Principal,
96
- 'downloadsTotal': IDL.Nat,
97
- 'downloadsInLast30Days': IDL.Nat,
98
- 'downloadsInLast7Days': IDL.Nat,
99
- 'config': PackageConfigV2__1,
100
- 'publication': PackagePublication,
101
- });
102
- const TestStats__1 = IDL.Record({
103
- 'passedNames': IDL.Vec(IDL.Text),
104
- 'passed': IDL.Nat,
105
- });
106
- const DownloadsSnapshot = IDL.Record({
107
- 'startTime': Time,
108
- 'endTime': Time,
109
- 'downloads': IDL.Nat,
110
- });
111
- const PackageFileStatsPublic = IDL.Record({
112
- 'sourceFiles': IDL.Nat,
113
- 'sourceSize': IDL.Nat,
114
- });
115
- const PackageChanges = IDL.Record({
116
- 'tests': TestsChanges,
117
- 'deps': IDL.Vec(DepChange),
118
- 'notes': IDL.Text,
119
- 'devDeps': IDL.Vec(DepChange),
120
- });
121
- const PackageSummaryWithChanges__1 = IDL.Record({
122
- 'ownerInfo': User,
123
- 'owner': IDL.Principal,
124
- 'downloadsTotal': IDL.Nat,
125
- 'downloadsInLast30Days': IDL.Nat,
126
- 'downloadsInLast7Days': IDL.Nat,
127
- 'config': PackageConfigV2__1,
128
- 'changes': PackageChanges,
129
- 'publication': PackagePublication,
130
- });
131
- const PackageDetails = IDL.Record({
132
- 'ownerInfo': User,
133
- 'owner': IDL.Principal,
134
- 'deps': IDL.Vec(PackageSummary__1),
135
- 'testStats': TestStats__1,
136
- 'downloadsTotal': IDL.Nat,
137
- 'downloadsInLast30Days': IDL.Nat,
138
- 'downloadTrend': IDL.Vec(DownloadsSnapshot),
139
- 'fileStats': PackageFileStatsPublic,
140
- 'versionHistory': IDL.Vec(PackageSummaryWithChanges__1),
141
- 'dependents': IDL.Vec(PackageSummary__1),
142
- 'devDeps': IDL.Vec(PackageSummary__1),
143
- 'downloadsInLast7Days': IDL.Nat,
144
- 'config': PackageConfigV2__1,
145
- 'changes': PackageChanges,
146
- 'publication': PackagePublication,
147
- });
148
- const Result_4 = IDL.Variant({ 'ok': PackageDetails, 'err': Err });
149
- const PackageSummaryWithChanges = IDL.Record({
150
- 'ownerInfo': User,
151
- 'owner': IDL.Principal,
152
- 'downloadsTotal': IDL.Nat,
153
- 'downloadsInLast30Days': IDL.Nat,
154
- 'downloadsInLast7Days': IDL.Nat,
155
- 'config': PackageConfigV2__1,
156
- 'changes': PackageChanges,
157
- 'publication': PackagePublication,
158
- });
159
- const StorageId = IDL.Principal;
160
- const StorageStats = IDL.Record({
161
- 'fileCount': IDL.Nat,
162
- 'cyclesBalance': IDL.Nat,
163
- 'memorySize': IDL.Nat,
164
- });
165
- const User__1 = IDL.Record({
166
- 'id': IDL.Principal,
167
- 'emailVerified': IDL.Bool,
168
- 'twitter': IDL.Text,
169
- 'displayName': IDL.Text,
170
- 'name': IDL.Text,
171
- 'site': IDL.Text,
172
- 'email': IDL.Text,
173
- 'twitterVerified': IDL.Bool,
174
- 'githubVerified': IDL.Bool,
175
- 'github': IDL.Text,
176
- });
177
- const PageCount = IDL.Nat;
178
- const Result_3 = IDL.Variant({ 'ok': IDL.Null, 'err': IDL.Text });
179
- const Result_2 = IDL.Variant({ 'ok': FileId, 'err': Err });
180
- const PackageConfigV2 = IDL.Record({
181
- 'dfx': IDL.Text,
182
- 'moc': IDL.Text,
183
- 'scripts': IDL.Vec(Script),
184
- 'baseDir': IDL.Text,
185
- 'documentation': IDL.Text,
186
- 'name': PackageName,
187
- 'homepage': IDL.Text,
188
- 'description': IDL.Text,
189
- 'version': IDL.Text,
190
- 'keywords': IDL.Vec(IDL.Text),
191
- 'donation': IDL.Text,
192
- 'devDependencies': IDL.Vec(DependencyV2),
193
- 'repository': IDL.Text,
194
- 'dependencies': IDL.Vec(DependencyV2),
195
- 'license': IDL.Text,
196
- 'readme': IDL.Text,
197
- });
198
- const PublishingErr = IDL.Text;
199
- const Result_1 = IDL.Variant({ 'ok': PublishingId, 'err': PublishingErr });
200
- const TestStats = IDL.Record({
201
- 'passedNames': IDL.Vec(IDL.Text),
202
- 'passed': IDL.Nat,
203
- });
204
- return IDL.Service({
205
- 'backup': IDL.Func([], [], []),
206
- 'claimAirdrop': IDL.Func([IDL.Principal], [IDL.Text], []),
207
- 'diff': IDL.Func([IDL.Text, IDL.Text], [PackageChanges__1], ['query']),
208
- 'finishPublish': IDL.Func([PublishingId], [Result], []),
209
- 'getAirdropAmount': IDL.Func([], [IDL.Nat], ['query']),
210
- 'getAirdropAmountAll': IDL.Func([], [IDL.Nat], ['query']),
211
- 'getApiVersion': IDL.Func([], [Text], ['query']),
212
- 'getBackupCanisterId': IDL.Func([], [IDL.Principal], ['query']),
213
- 'getDefaultPackages': IDL.Func([IDL.Text], [IDL.Vec(IDL.Tuple(PackageName__1, PackageVersion))], ['query']),
214
- 'getDownloadTrendByPackageId': IDL.Func([PackageId], [IDL.Vec(DownloadsSnapshot__1)], ['query']),
215
- 'getDownloadTrendByPackageName': IDL.Func([PackageName__1], [IDL.Vec(DownloadsSnapshot__1)], ['query']),
216
- 'getFileIds': IDL.Func([PackageName__1, PackageVersion], [Result_7], ['query']),
217
- 'getHighestSemverBatch': IDL.Func([IDL.Vec(IDL.Tuple(PackageName__1, PackageVersion, SemverPart))], [Result_6], ['query']),
218
- 'getHighestVersion': IDL.Func([PackageName__1], [Result_5], ['query']),
219
- 'getMostDownloadedPackages': IDL.Func([], [IDL.Vec(PackageSummary)], ['query']),
220
- 'getMostDownloadedPackagesIn7Days': IDL.Func([], [IDL.Vec(PackageSummary)], ['query']),
221
- 'getNewPackages': IDL.Func([], [IDL.Vec(PackageSummary)], ['query']),
222
- 'getPackageDetails': IDL.Func([PackageName__1, PackageVersion], [Result_4], ['query']),
223
- 'getPackagesByCategory': IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(PackageSummary)))], ['query']),
224
- 'getRecentlyUpdatedPackages': IDL.Func([], [IDL.Vec(PackageSummaryWithChanges)], ['query']),
225
- 'getStoragesStats': IDL.Func([], [IDL.Vec(IDL.Tuple(StorageId, StorageStats))], ['query']),
226
- 'getTotalDownloads': IDL.Func([], [IDL.Nat], ['query']),
227
- 'getTotalPackages': IDL.Func([], [IDL.Nat], ['query']),
228
- 'getUser': IDL.Func([IDL.Principal], [IDL.Opt(User__1)], ['query']),
229
- 'notifyInstall': IDL.Func([PackageName__1, PackageVersion], [], ['oneway']),
230
- 'notifyInstalls': IDL.Func([IDL.Vec(IDL.Tuple(PackageName__1, PackageVersion))], [], ['oneway']),
231
- 'restore': IDL.Func([IDL.Nat, IDL.Nat], [], []),
232
- 'search': IDL.Func([Text, IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)], [IDL.Vec(PackageSummary), PageCount], ['query']),
233
- 'setUserProp': IDL.Func([IDL.Text, IDL.Text], [Result_3], []),
234
- 'startFileUpload': IDL.Func([PublishingId, Text, IDL.Nat, IDL.Vec(IDL.Nat8)], [Result_2], []),
235
- 'startPublish': IDL.Func([PackageConfigV2], [Result_1], []),
236
- 'takeAirdropSnapshot': IDL.Func([], [], ['oneway']),
237
- 'uploadFileChunk': IDL.Func([PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)], [Result], []),
238
- 'uploadNotes': IDL.Func([PublishingId, IDL.Text], [Result], []),
239
- 'uploadTestStats': IDL.Func([PublishingId, TestStats], [Result], []),
240
- });
241
- };
242
- export const init = ({ IDL }) => { return []; };
@@ -1,4 +0,0 @@
1
- export function createActor(canisterId: string | import("@dfinity/principal").Principal, options?: {
2
- agentOptions?: import("@dfinity/agent").HttpAgentOptions;
3
- actorOptions?: import("@dfinity/agent").ActorConfig;
4
- } | undefined): import("@dfinity/agent").ActorSubclass<import("./storage.did.js")._SERVICE>;
@@ -1,26 +0,0 @@
1
- import { Actor, HttpAgent } from "@dfinity/agent";
2
- // Imports and re-exports candid interface
3
- import { idlFactory } from './storage.did.js';
4
- export { idlFactory } from './storage.did.js';
5
- /**
6
- *
7
- * @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent
8
- * @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options]
9
- * @return {import("@dfinity/agent").ActorSubclass<import("./storage.did.js")._SERVICE>}
10
- */
11
- export const createActor = (canisterId, options) => {
12
- const agent = new HttpAgent({ ...options?.agentOptions });
13
- // Fetch root key for certificate validation during development
14
- if (process.env.NODE_ENV !== "production") {
15
- agent.fetchRootKey().catch(err => {
16
- console.warn("Unable to fetch root key. Check to ensure that your local replica is running");
17
- console.error(err);
18
- });
19
- }
20
- // Creates an actor with using the candid interface and the HttpAgent
21
- return Actor.createActor(idlFactory, {
22
- agent,
23
- canisterId,
24
- ...options?.actorOptions,
25
- });
26
- };
@@ -1,6 +0,0 @@
1
- export function idlFactory({ IDL }: {
2
- IDL: any;
3
- }): any;
4
- export function init({ IDL }: {
5
- IDL: any;
6
- }): never[];
@@ -1,34 +0,0 @@
1
- export const idlFactory = ({ IDL }) => {
2
- const FileId = IDL.Text;
3
- const Chunk = IDL.Vec(IDL.Nat8);
4
- const Err = IDL.Text;
5
- const Result_2 = IDL.Variant({ 'ok': Chunk, 'err': Err });
6
- const FileId__1 = IDL.Text;
7
- const FileMeta = IDL.Record({
8
- 'id': FileId__1,
9
- 'owners': IDL.Vec(IDL.Principal),
10
- 'path': IDL.Text,
11
- 'chunkCount': IDL.Nat,
12
- });
13
- const Result_1 = IDL.Variant({ 'ok': FileMeta, 'err': Err });
14
- const StorageStats = IDL.Record({
15
- 'fileCount': IDL.Nat,
16
- 'cyclesBalance': IDL.Nat,
17
- 'memorySize': IDL.Nat,
18
- });
19
- const Result = IDL.Variant({ 'ok': IDL.Null, 'err': Err });
20
- const Storage = IDL.Service({
21
- 'acceptCycles': IDL.Func([], [], []),
22
- 'deleteFile': IDL.Func([FileId], [], []),
23
- 'downloadChunk': IDL.Func([FileId, IDL.Nat], [Result_2], ['query']),
24
- 'finishUpload': IDL.Func([FileId], [], []),
25
- 'getFileIdsRange': IDL.Func([IDL.Nat, IDL.Nat], [IDL.Vec(FileId)], ['query']),
26
- 'getFileMeta': IDL.Func([FileId], [Result_1], ['query']),
27
- 'getStats': IDL.Func([], [StorageStats], ['query']),
28
- 'startUpload': IDL.Func([FileMeta], [Result], []),
29
- 'updateFileOwners': IDL.Func([FileId, IDL.Vec(IDL.Principal)], [], []),
30
- 'uploadChunk': IDL.Func([FileId, IDL.Nat, Chunk], [], []),
31
- });
32
- return Storage;
33
- };
34
- export const init = ({ IDL }) => { return []; };
@@ -1,14 +0,0 @@
1
- import Nat "mo:base/Nat";
2
- import Iter "mo:base/Iter";
3
- import Buffer "mo:base/Buffer";
4
- import Vector "mo:vector/Class";
5
- import Bench "mo:bench";
6
-
7
- // placeholder file that will be replaced with the *.bench.mo file
8
- module {
9
- public func init() : Bench.Bench {
10
- let bench = Bench.Bench();
11
- // benchmark code goes here...
12
- bench;
13
- };
14
- };
@@ -1,10 +0,0 @@
1
- type BenchOptions = {
2
- verbose?: boolean;
3
- save?: boolean;
4
- compare?: boolean;
5
- dfx?: string;
6
- moc?: string;
7
- gc?: 'copying' | 'compacting' | 'generational' | 'incremental' | 'none';
8
- };
9
- export declare function bench(filter?: string, options?: BenchOptions): Promise<boolean>;
10
- export {};