ic-mops 0.31.0 → 0.31.2
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/dist/commands/bench/bench-canister.mo +5 -0
- package/dist/commands/bench.js +29 -16
- package/dist/declarations/bench/bench.did +1 -0
- package/dist/declarations/bench/bench.did.d.ts +1 -0
- package/dist/declarations/bench/bench.did.js +7 -6
- package/dist/package.json +1 -1
- package/dist/resolve-packages.js +1 -1
- package/dist/vessel.d.ts +2 -1
- package/dist/vessel.js +9 -7
- package/package.json +1 -1
- package/resolve-packages.ts +1 -1
- package/vessel.ts +10 -8
- package/dist/bench/$USER_BENCH_FILE.mo +0 -45
- package/dist/bench/bench-canister.mo +0 -57
- package/dist/commands/bench/$USER_BENCH_FILE.mo +0 -45
- package/dist/commands/bench/bench/$USER_BENCH_FILE.mo +0 -45
- package/dist/commands/bench/bench/bench-canister.mo +0 -57
- package/dist/commands/bench/declarations/bench/bench.did.d.ts +0 -6
- package/dist/commands/bench/declarations/bench/bench.did.js +0 -22
- package/dist/commands/bench/declarations/bench/index.d.ts +0 -2
- package/dist/commands/bench/declarations/bench/index.js +0 -30
- package/dist/commands/bench/declarations/main/index.d.ts +0 -2
- package/dist/commands/bench/declarations/main/index.js +0 -30
- package/dist/commands/bench/declarations/main/main.did.d.ts +0 -6
- package/dist/commands/bench/declarations/main/main.did.js +0 -242
- package/dist/commands/bench/declarations/storage/index.d.ts +0 -4
- package/dist/commands/bench/declarations/storage/index.js +0 -26
- package/dist/commands/bench/declarations/storage/storage.did.d.ts +0 -6
- package/dist/commands/bench/declarations/storage/storage.did.js +0 -34
- package/dist/commands/mmf1.d.ts +0 -21
- package/dist/commands/mmf1.js +0 -93
- package/dist/commands/test/reporter-files.d.ts +0 -10
- package/dist/commands/test/reporter-files.js +0 -48
- package/dist/commands/test/reporter-verbose.d.ts +0 -10
- package/dist/commands/test/reporter-verbose.js +0 -56
- package/dist/commands/test.d.ts +0 -4
- package/dist/commands/test.js +0 -186
- package/dist/integrity.d.ts +0 -4
- package/dist/integrity.js +0 -92
- package/dist/out/cli.d.ts +0 -2
- package/dist/out/cli.js +0 -114581
- package/dist/parse-changelog.d.ts +0 -1
- package/dist/parse-changelog.js +0 -1435
- package/dist/test.d.ts +0 -1
- package/dist/test.js +0 -1411
|
@@ -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,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,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 []; };
|
package/dist/commands/mmf1.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
type Strategy = 'store' | 'print';
|
|
2
|
-
export declare class MMF1 {
|
|
3
|
-
stack: string[];
|
|
4
|
-
currSuite: string;
|
|
5
|
-
failed: number;
|
|
6
|
-
passed: number;
|
|
7
|
-
skipped: number;
|
|
8
|
-
srategy: Strategy;
|
|
9
|
-
output: string[];
|
|
10
|
-
constructor(srategy: Strategy);
|
|
11
|
-
_log(...args: string[]): void;
|
|
12
|
-
flush(): void;
|
|
13
|
-
parseLine(line: string): void;
|
|
14
|
-
_testStart(name: string): void;
|
|
15
|
-
_testEnd(name: string): void;
|
|
16
|
-
_testSkip(name: string): void;
|
|
17
|
-
_status(name: string, status: string): void;
|
|
18
|
-
fail(stderr: string): void;
|
|
19
|
-
pass(): void;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
package/dist/commands/mmf1.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// mops message format v1
|
|
2
|
-
// mops:1:start
|
|
3
|
-
// mops:1:end
|
|
4
|
-
// mops:1:skip
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
export class MMF1 {
|
|
7
|
-
constructor(srategy) {
|
|
8
|
-
this.stack = [];
|
|
9
|
-
this.currSuite = '';
|
|
10
|
-
this.failed = 0;
|
|
11
|
-
this.passed = 0;
|
|
12
|
-
this.skipped = 0;
|
|
13
|
-
this.output = [];
|
|
14
|
-
this.srategy = srategy;
|
|
15
|
-
}
|
|
16
|
-
_log(...args) {
|
|
17
|
-
if (this.srategy === 'store') {
|
|
18
|
-
this.output.push(args.join(' '));
|
|
19
|
-
}
|
|
20
|
-
else if (this.srategy === 'print') {
|
|
21
|
-
console.log(...args);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
flush() {
|
|
25
|
-
for (let out of this.output) {
|
|
26
|
-
console.log(out);
|
|
27
|
-
}
|
|
28
|
-
this.output = [];
|
|
29
|
-
}
|
|
30
|
-
parseLine(line) {
|
|
31
|
-
if (line.startsWith('mops:1:start ')) {
|
|
32
|
-
this._testStart(line.split('mops:1:start ')[1] || '');
|
|
33
|
-
}
|
|
34
|
-
else if (line.startsWith('mops:1:end ')) {
|
|
35
|
-
this._testEnd(line.split('mops:1:end ')[1] || '');
|
|
36
|
-
}
|
|
37
|
-
else if (line.startsWith('mops:1:skip ')) {
|
|
38
|
-
this._testSkip(line.split('mops:1:skip ')[1] || '');
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this._log(' '.repeat(this.stack.length * 2), chalk.gray('stdout'), line);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
_testStart(name) {
|
|
45
|
-
let suite = this.stack[this.stack.length - 1];
|
|
46
|
-
if (suite) {
|
|
47
|
-
if (this.currSuite !== suite) {
|
|
48
|
-
this.currSuite = suite;
|
|
49
|
-
this._log(' '.repeat((this.stack.length - 1) * 2), (chalk.gray('•')) + '', suite);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
this.stack.push(name);
|
|
53
|
-
}
|
|
54
|
-
_testEnd(name) {
|
|
55
|
-
if (name !== this.stack.pop()) {
|
|
56
|
-
throw 'mmf1._testEnd: start and end test mismatch';
|
|
57
|
-
}
|
|
58
|
-
this._status(name, 'pass');
|
|
59
|
-
}
|
|
60
|
-
_testSkip(name) {
|
|
61
|
-
this._status(name, 'skip');
|
|
62
|
-
}
|
|
63
|
-
_status(name, status) {
|
|
64
|
-
if (status === 'pass') {
|
|
65
|
-
// do not print suite at the end
|
|
66
|
-
if (name === this.currSuite) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
this.passed++;
|
|
70
|
-
this._log(' '.repeat(this.stack.length * 2), chalk.green('✓'), name);
|
|
71
|
-
}
|
|
72
|
-
else if (status === 'fail') {
|
|
73
|
-
this.failed++;
|
|
74
|
-
this._log(' '.repeat(this.stack.length * 2), chalk.red('✖'), name);
|
|
75
|
-
}
|
|
76
|
-
else if (status === 'skip') {
|
|
77
|
-
this.skipped++;
|
|
78
|
-
this._log(' '.repeat(this.stack.length * 2), chalk.yellow('−'), name);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
fail(stderr) {
|
|
82
|
-
let name = this.stack.pop() || '';
|
|
83
|
-
this._status(name, 'fail');
|
|
84
|
-
this._log(' '.repeat(this.stack.length * 2), chalk.red('FAIL'), stderr);
|
|
85
|
-
}
|
|
86
|
-
pass() {
|
|
87
|
-
let name = this.stack.pop();
|
|
88
|
-
if (name) {
|
|
89
|
-
this._status(name, 'pass');
|
|
90
|
-
}
|
|
91
|
-
this._log(' '.repeat(this.stack.length * 2), chalk.green('PASS'));
|
|
92
|
-
}
|
|
93
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { MMF1 } from './mmf1.js';
|
|
2
|
-
export declare class FilesReporter {
|
|
3
|
-
#private;
|
|
4
|
-
passed: number;
|
|
5
|
-
failed: number;
|
|
6
|
-
skipped: number;
|
|
7
|
-
addFiles(files: string[]): void;
|
|
8
|
-
addRun(file: string, mmf: MMF1, state: Promise<void>, wasiMode: boolean): void;
|
|
9
|
-
done(): boolean;
|
|
10
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _FilesReporter_startTime;
|
|
7
|
-
import chalk from 'chalk';
|
|
8
|
-
import { absToRel } from './utils.js';
|
|
9
|
-
export class FilesReporter {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.passed = 0;
|
|
12
|
-
this.failed = 0;
|
|
13
|
-
this.skipped = 0;
|
|
14
|
-
_FilesReporter_startTime.set(this, Date.now());
|
|
15
|
-
}
|
|
16
|
-
addFiles(files) {
|
|
17
|
-
console.log(`Test files: ${files.length}`);
|
|
18
|
-
console.log('='.repeat(50));
|
|
19
|
-
}
|
|
20
|
-
addRun(file, mmf, state, wasiMode) {
|
|
21
|
-
state.then(() => {
|
|
22
|
-
this.passed += mmf.passed;
|
|
23
|
-
this.failed += mmf.failed;
|
|
24
|
-
this.skipped += mmf.skipped;
|
|
25
|
-
if (this.failed) {
|
|
26
|
-
mmf.flush();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
console.log(`${chalk.green('✓')} ${absToRel(file)} ${wasiMode ? chalk.gray('(wasi)') : ''}`);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
done() {
|
|
34
|
-
console.log('='.repeat(50));
|
|
35
|
-
if (this.failed) {
|
|
36
|
-
console.log(chalk.redBright('Tests failed'));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
console.log(chalk.greenBright('Tests passed'));
|
|
40
|
-
}
|
|
41
|
-
console.log(`Done in ${chalk.gray(((Date.now() - __classPrivateFieldGet(this, _FilesReporter_startTime, "f")) / 1000).toFixed(2) + 's')}`
|
|
42
|
-
+ `, passed ${chalk.greenBright(this.passed)}`
|
|
43
|
-
+ (this.skipped ? `, skipped ${chalk[this.skipped ? 'yellowBright' : 'gray'](this.skipped)}` : '')
|
|
44
|
-
+ (this.failed ? `, failed ${chalk[this.failed ? 'redBright' : 'gray'](this.failed)}` : ''));
|
|
45
|
-
return this.failed === 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
_FilesReporter_startTime = new WeakMap();
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { MMF1 } from './mmf1.js';
|
|
2
|
-
export declare class VerboseReporter {
|
|
3
|
-
#private;
|
|
4
|
-
passed: number;
|
|
5
|
-
failed: number;
|
|
6
|
-
skipped: number;
|
|
7
|
-
addFiles(files: string[]): void;
|
|
8
|
-
addRun(file: string, mmf: MMF1, state: Promise<void>, wasiMode: boolean): void;
|
|
9
|
-
done(): boolean;
|
|
10
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _VerboseReporter_startTime, _VerboseReporter_curFileIndex;
|
|
13
|
-
import chalk from 'chalk';
|
|
14
|
-
import { absToRel } from './utils.js';
|
|
15
|
-
export class VerboseReporter {
|
|
16
|
-
constructor() {
|
|
17
|
-
this.passed = 0;
|
|
18
|
-
this.failed = 0;
|
|
19
|
-
this.skipped = 0;
|
|
20
|
-
_VerboseReporter_startTime.set(this, Date.now());
|
|
21
|
-
_VerboseReporter_curFileIndex.set(this, 0);
|
|
22
|
-
}
|
|
23
|
-
addFiles(files) {
|
|
24
|
-
console.log('Test files:');
|
|
25
|
-
for (let file of files) {
|
|
26
|
-
console.log(chalk.gray(`• ${absToRel(file)}`));
|
|
27
|
-
}
|
|
28
|
-
console.log('='.repeat(50));
|
|
29
|
-
}
|
|
30
|
-
addRun(file, mmf, state, wasiMode) {
|
|
31
|
-
state.then(() => {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
this.passed += mmf.passed;
|
|
34
|
-
this.failed += mmf.failed;
|
|
35
|
-
this.skipped += mmf.skipped;
|
|
36
|
-
(__classPrivateFieldSet(this, _VerboseReporter_curFileIndex, (_b = __classPrivateFieldGet(this, _VerboseReporter_curFileIndex, "f"), _a = _b++, _b), "f"), _a) && console.log('-'.repeat(50));
|
|
37
|
-
console.log(`Running ${chalk.gray(absToRel(file))} ${wasiMode ? chalk.gray('(wasi)') : ''}`);
|
|
38
|
-
mmf.flush();
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
done() {
|
|
42
|
-
console.log('='.repeat(50));
|
|
43
|
-
if (this.failed) {
|
|
44
|
-
console.log(chalk.redBright('Tests failed'));
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
console.log(chalk.greenBright('Tests passed'));
|
|
48
|
-
}
|
|
49
|
-
console.log(`Done in ${chalk.gray(((Date.now() - __classPrivateFieldGet(this, _VerboseReporter_startTime, "f")) / 1000).toFixed(2) + 's')}`
|
|
50
|
-
+ `, passed ${chalk.greenBright(this.passed)}`
|
|
51
|
-
+ (this.skipped ? `, skipped ${chalk[this.skipped ? 'yellowBright' : 'gray'](this.skipped)}` : '')
|
|
52
|
-
+ (this.failed ? `, failed ${chalk[this.failed ? 'redBright' : 'gray'](this.failed)}` : ''));
|
|
53
|
-
return this.failed === 0;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
_VerboseReporter_startTime = new WeakMap(), _VerboseReporter_curFileIndex = new WeakMap();
|
package/dist/commands/test.d.ts
DELETED