ic-mops 1.7.2 → 1.8.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 (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bundle/bench/bench-canister.mo +113 -0
  3. package/bundle/bench/user-bench.mo +14 -0
  4. package/bundle/bin/moc-wrapper.sh +40 -0
  5. package/bundle/bin/mops.js +3 -0
  6. package/bundle/cli.js +14 -14
  7. package/bundle/cli.tgz +0 -0
  8. package/bundle/declarations/bench/bench.did +30 -0
  9. package/bundle/declarations/bench/bench.did.d.ts +33 -0
  10. package/bundle/declarations/bench/bench.did.js +30 -0
  11. package/bundle/declarations/bench/index.d.ts +50 -0
  12. package/bundle/declarations/bench/index.js +40 -0
  13. package/bundle/declarations/main/index.d.ts +50 -0
  14. package/bundle/declarations/main/index.js +40 -0
  15. package/bundle/declarations/main/main.did +465 -0
  16. package/bundle/declarations/main/main.did.d.ts +392 -0
  17. package/bundle/declarations/main/main.did.js +454 -0
  18. package/bundle/declarations/storage/index.d.ts +50 -0
  19. package/bundle/declarations/storage/index.js +30 -0
  20. package/bundle/declarations/storage/storage.did +46 -0
  21. package/bundle/declarations/storage/storage.did.d.ts +40 -0
  22. package/bundle/declarations/storage/storage.did.js +38 -0
  23. package/bundle/package.json +35 -0
  24. package/bundle/templates/README.md +13 -0
  25. package/bundle/templates/licenses/Apache-2.0 +202 -0
  26. package/bundle/templates/licenses/Apache-2.0-NOTICE +13 -0
  27. package/bundle/templates/licenses/MIT +21 -0
  28. package/bundle/templates/mops-publish.yml +17 -0
  29. package/bundle/templates/mops-test.yml +24 -0
  30. package/bundle/templates/src/lib.mo +15 -0
  31. package/bundle/templates/test/lib.test.mo +4 -0
  32. package/bundle/wasm_bg.wasm +0 -0
  33. package/cli.ts +16 -0
  34. package/commands/format.ts +169 -0
  35. package/commands/publish.ts +1 -0
  36. package/commands/watch/formatter.ts +74 -0
  37. package/commands/watch/watch.ts +23 -2
  38. package/dist/cli.js +15 -0
  39. package/dist/commands/format.d.ts +14 -0
  40. package/dist/commands/format.js +131 -0
  41. package/dist/commands/publish.js +1 -0
  42. package/dist/commands/watch/formatter.d.ts +19 -0
  43. package/dist/commands/watch/formatter.js +57 -0
  44. package/dist/commands/watch/watch.d.ts +1 -0
  45. package/dist/commands/watch/watch.js +19 -1
  46. package/dist/package.json +4 -2
  47. package/package.json +6 -4
  48. package/types.ts +10 -0
@@ -0,0 +1,392 @@
1
+ import type { Principal } from '@dfinity/principal';
2
+ import type { ActorMethod } from '@dfinity/agent';
3
+ import type { IDL } from '@dfinity/candid';
4
+
5
+ export interface Benchmark {
6
+ 'gc' : string,
7
+ 'metrics' : Array<[BenchmarkMetric, Array<Array<bigint>>]>,
8
+ 'cols' : Array<string>,
9
+ 'file' : string,
10
+ 'name' : string,
11
+ 'rows' : Array<string>,
12
+ 'description' : string,
13
+ 'compilerVersion' : string,
14
+ 'compiler' : string,
15
+ 'replica' : string,
16
+ 'replicaVersion' : string,
17
+ 'forceGC' : boolean,
18
+ }
19
+ export type BenchmarkMetric = string;
20
+ export type Benchmarks = Array<Benchmark>;
21
+ export type Benchmarks__1 = Array<Benchmark>;
22
+ export interface DepChange {
23
+ 'oldVersion' : string,
24
+ 'name' : string,
25
+ 'newVersion' : string,
26
+ }
27
+ export interface DependencyV2 {
28
+ 'name' : PackageName,
29
+ 'repo' : string,
30
+ 'version' : string,
31
+ }
32
+ export type DepsStatus = { 'allLatest' : null } |
33
+ { 'tooOld' : null } |
34
+ { 'updatesAvailable' : null };
35
+ export interface DownloadsSnapshot {
36
+ 'startTime' : Time,
37
+ 'endTime' : Time,
38
+ 'downloads' : bigint,
39
+ }
40
+ export interface DownloadsSnapshot__1 {
41
+ 'startTime' : Time,
42
+ 'endTime' : Time,
43
+ 'downloads' : bigint,
44
+ }
45
+ export type Err = string;
46
+ export type FileId = string;
47
+ export type Header = [string, string];
48
+ export interface HttpHeader { 'value' : string, 'name' : string }
49
+ export interface HttpResponse {
50
+ 'status' : bigint,
51
+ 'body' : Uint8Array | number[],
52
+ 'headers' : Array<HttpHeader>,
53
+ }
54
+ export interface HttpTransformArg {
55
+ 'context' : Uint8Array | number[],
56
+ 'response' : HttpResponse,
57
+ }
58
+ export interface Main {
59
+ 'addMaintainer' : ActorMethod<[PackageName__1, Principal], Result_3>,
60
+ 'addOwner' : ActorMethod<[PackageName__1, Principal], Result_3>,
61
+ 'backup' : ActorMethod<[], undefined>,
62
+ 'computeHashesForExistingFiles' : ActorMethod<[], undefined>,
63
+ 'finishPublish' : ActorMethod<[PublishingId], Result>,
64
+ 'getApiVersion' : ActorMethod<[], Text>,
65
+ 'getBackupCanisterId' : ActorMethod<[], Principal>,
66
+ 'getDefaultPackages' : ActorMethod<
67
+ [string],
68
+ Array<[PackageName__1, PackageVersion__1]>
69
+ >,
70
+ 'getDownloadTrendByPackageId' : ActorMethod<
71
+ [PackageId],
72
+ Array<DownloadsSnapshot__1>
73
+ >,
74
+ 'getDownloadTrendByPackageName' : ActorMethod<
75
+ [PackageName__1],
76
+ Array<DownloadsSnapshot__1>
77
+ >,
78
+ 'getFileHashes' : ActorMethod<[PackageName__1, PackageVersion__1], Result_8>,
79
+ 'getFileHashesByPackageIds' : ActorMethod<
80
+ [Array<PackageId>],
81
+ Array<[PackageId, Array<[FileId, Uint8Array | number[]]>]>
82
+ >,
83
+ 'getFileHashesQuery' : ActorMethod<
84
+ [PackageName__1, PackageVersion__1],
85
+ Result_8
86
+ >,
87
+ 'getFileIds' : ActorMethod<[PackageName__1, PackageVersion__1], Result_7>,
88
+ 'getHighestSemverBatch' : ActorMethod<
89
+ [Array<[PackageName__1, PackageVersion__1, SemverPart]>],
90
+ Result_6
91
+ >,
92
+ 'getHighestVersion' : ActorMethod<[PackageName__1], Result_5>,
93
+ 'getMostDownloadedPackages' : ActorMethod<[], Array<PackageSummary>>,
94
+ 'getMostDownloadedPackagesIn7Days' : ActorMethod<[], Array<PackageSummary>>,
95
+ 'getNewPackages' : ActorMethod<[], Array<PackageSummary>>,
96
+ 'getPackageDetails' : ActorMethod<
97
+ [PackageName__1, PackageVersion__1],
98
+ Result_4
99
+ >,
100
+ 'getPackageMaintainers' : ActorMethod<[PackageName__1], Array<Principal>>,
101
+ 'getPackageOwners' : ActorMethod<[PackageName__1], Array<Principal>>,
102
+ 'getPackagesByCategory' : ActorMethod<
103
+ [],
104
+ Array<[string, Array<PackageSummary>]>
105
+ >,
106
+ 'getRecentlyUpdatedPackages' : ActorMethod<
107
+ [],
108
+ Array<PackageSummaryWithChanges>
109
+ >,
110
+ 'getStoragesStats' : ActorMethod<[], Array<[StorageId, StorageStats]>>,
111
+ 'getTotalDownloads' : ActorMethod<[], bigint>,
112
+ 'getTotalPackages' : ActorMethod<[], bigint>,
113
+ 'getUser' : ActorMethod<[Principal], [] | [User__1]>,
114
+ 'http_request' : ActorMethod<[Request], Response>,
115
+ 'notifyInstall' : ActorMethod<[PackageName__1, PackageVersion__1], undefined>,
116
+ 'notifyInstalls' : ActorMethod<
117
+ [Array<[PackageName__1, PackageVersion__1]>],
118
+ undefined
119
+ >,
120
+ 'removeMaintainer' : ActorMethod<[PackageName__1, Principal], Result_3>,
121
+ 'removeOwner' : ActorMethod<[PackageName__1, Principal], Result_3>,
122
+ 'restore' : ActorMethod<[bigint], undefined>,
123
+ 'search' : ActorMethod<
124
+ [Text, [] | [bigint], [] | [bigint]],
125
+ [Array<PackageSummary>, PageCount]
126
+ >,
127
+ 'setUserProp' : ActorMethod<[string, string], Result_3>,
128
+ 'startFileUpload' : ActorMethod<
129
+ [PublishingId, Text, bigint, Uint8Array | number[]],
130
+ Result_2
131
+ >,
132
+ 'startPublish' : ActorMethod<[PackageConfigV3_Publishing], Result_1>,
133
+ 'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>,
134
+ 'uploadBenchmarks' : ActorMethod<[PublishingId, Benchmarks], Result>,
135
+ 'uploadFileChunk' : ActorMethod<
136
+ [PublishingId, FileId, bigint, Uint8Array | number[]],
137
+ Result
138
+ >,
139
+ 'uploadNotes' : ActorMethod<[PublishingId, string], Result>,
140
+ 'uploadTestStats' : ActorMethod<[PublishingId, TestStats], Result>,
141
+ }
142
+ export interface PackageChanges {
143
+ 'tests' : TestsChanges,
144
+ 'deps' : Array<DepChange>,
145
+ 'curBenchmarks' : Benchmarks__1,
146
+ 'prevBenchmarks' : Benchmarks__1,
147
+ 'notes' : string,
148
+ 'devDeps' : Array<DepChange>,
149
+ }
150
+ export interface PackageConfigV3 {
151
+ 'dfx' : string,
152
+ 'moc' : string,
153
+ 'scripts' : Array<Script>,
154
+ 'baseDir' : string,
155
+ 'documentation' : string,
156
+ 'name' : PackageName,
157
+ 'homepage' : string,
158
+ 'description' : string,
159
+ 'version' : string,
160
+ 'keywords' : Array<string>,
161
+ 'donation' : string,
162
+ 'devDependencies' : Array<DependencyV2>,
163
+ 'repository' : string,
164
+ 'dependencies' : Array<DependencyV2>,
165
+ 'requirements' : Array<Requirement>,
166
+ 'license' : string,
167
+ 'readme' : string,
168
+ }
169
+ export interface PackageConfigV3_Publishing {
170
+ 'dfx' : string,
171
+ 'moc' : string,
172
+ 'scripts' : Array<Script>,
173
+ 'baseDir' : string,
174
+ 'documentation' : string,
175
+ 'name' : PackageName,
176
+ 'homepage' : string,
177
+ 'description' : string,
178
+ 'version' : string,
179
+ 'keywords' : Array<string>,
180
+ 'donation' : string,
181
+ 'devDependencies' : Array<DependencyV2>,
182
+ 'repository' : string,
183
+ 'dependencies' : Array<DependencyV2>,
184
+ 'requirements' : [] | [Array<Requirement>],
185
+ 'license' : string,
186
+ 'readme' : string,
187
+ }
188
+ export interface PackageDetails {
189
+ 'benchmarks' : Benchmarks__1,
190
+ 'ownerInfo' : User,
191
+ 'owners' : Array<User>,
192
+ 'maintainers' : Array<User>,
193
+ 'owner' : Principal,
194
+ 'depAlias' : string,
195
+ 'deps' : Array<PackageSummary__1>,
196
+ 'quality' : PackageQuality,
197
+ 'publisher' : User,
198
+ 'testStats' : TestStats__1,
199
+ 'highestVersion' : PackageVersion,
200
+ 'downloadsTotal' : bigint,
201
+ 'downloadsInLast30Days' : bigint,
202
+ 'downloadTrend' : Array<DownloadsSnapshot>,
203
+ 'fileStats' : PackageFileStatsPublic,
204
+ 'versionHistory' : Array<PackageSummaryWithChanges__1>,
205
+ 'dependents' : Array<PackageSummary__1>,
206
+ 'devDeps' : Array<PackageSummary__1>,
207
+ 'downloadsInLast7Days' : bigint,
208
+ 'config' : PackageConfigV3,
209
+ 'changes' : PackageChanges,
210
+ 'publication' : PackagePublication,
211
+ }
212
+ export interface PackageFileStatsPublic {
213
+ 'sourceFiles' : bigint,
214
+ 'sourceSize' : bigint,
215
+ }
216
+ export type PackageId = string;
217
+ export type PackageName = string;
218
+ export type PackageName__1 = string;
219
+ export interface PackagePublication {
220
+ 'storage' : Principal,
221
+ 'time' : Time,
222
+ 'user' : Principal,
223
+ }
224
+ export interface PackageQuality {
225
+ 'depsStatus' : DepsStatus,
226
+ 'hasDescription' : boolean,
227
+ 'hasKeywords' : boolean,
228
+ 'hasLicense' : boolean,
229
+ 'hasDocumentation' : boolean,
230
+ 'hasTests' : boolean,
231
+ 'hasRepository' : boolean,
232
+ 'hasReleaseNotes' : boolean,
233
+ }
234
+ export interface PackageSummary {
235
+ 'ownerInfo' : User,
236
+ 'owners' : Array<User>,
237
+ 'maintainers' : Array<User>,
238
+ 'owner' : Principal,
239
+ 'depAlias' : string,
240
+ 'quality' : PackageQuality,
241
+ 'publisher' : User,
242
+ 'highestVersion' : PackageVersion,
243
+ 'downloadsTotal' : bigint,
244
+ 'downloadsInLast30Days' : bigint,
245
+ 'downloadsInLast7Days' : bigint,
246
+ 'config' : PackageConfigV3,
247
+ 'publication' : PackagePublication,
248
+ }
249
+ export interface PackageSummaryWithChanges {
250
+ 'ownerInfo' : User,
251
+ 'owners' : Array<User>,
252
+ 'maintainers' : Array<User>,
253
+ 'owner' : Principal,
254
+ 'depAlias' : string,
255
+ 'quality' : PackageQuality,
256
+ 'publisher' : User,
257
+ 'highestVersion' : PackageVersion,
258
+ 'downloadsTotal' : bigint,
259
+ 'downloadsInLast30Days' : bigint,
260
+ 'downloadsInLast7Days' : bigint,
261
+ 'config' : PackageConfigV3,
262
+ 'changes' : PackageChanges,
263
+ 'publication' : PackagePublication,
264
+ }
265
+ export interface PackageSummaryWithChanges__1 {
266
+ 'ownerInfo' : User,
267
+ 'owners' : Array<User>,
268
+ 'maintainers' : Array<User>,
269
+ 'owner' : Principal,
270
+ 'depAlias' : string,
271
+ 'quality' : PackageQuality,
272
+ 'publisher' : User,
273
+ 'highestVersion' : PackageVersion,
274
+ 'downloadsTotal' : bigint,
275
+ 'downloadsInLast30Days' : bigint,
276
+ 'downloadsInLast7Days' : bigint,
277
+ 'config' : PackageConfigV3,
278
+ 'changes' : PackageChanges,
279
+ 'publication' : PackagePublication,
280
+ }
281
+ export interface PackageSummary__1 {
282
+ 'ownerInfo' : User,
283
+ 'owners' : Array<User>,
284
+ 'maintainers' : Array<User>,
285
+ 'owner' : Principal,
286
+ 'depAlias' : string,
287
+ 'quality' : PackageQuality,
288
+ 'publisher' : User,
289
+ 'highestVersion' : PackageVersion,
290
+ 'downloadsTotal' : bigint,
291
+ 'downloadsInLast30Days' : bigint,
292
+ 'downloadsInLast7Days' : bigint,
293
+ 'config' : PackageConfigV3,
294
+ 'publication' : PackagePublication,
295
+ }
296
+ export type PackageVersion = string;
297
+ export type PackageVersion__1 = string;
298
+ export type PageCount = bigint;
299
+ export type PublishingId = string;
300
+ export interface Request {
301
+ 'url' : string,
302
+ 'method' : string,
303
+ 'body' : Uint8Array | number[],
304
+ 'headers' : Array<Header>,
305
+ 'certificate_version' : [] | [number],
306
+ }
307
+ export interface Requirement { 'value' : string, 'name' : string }
308
+ export interface Response {
309
+ 'body' : Uint8Array | number[],
310
+ 'headers' : Array<Header>,
311
+ 'upgrade' : [] | [boolean],
312
+ 'streaming_strategy' : [] | [StreamingStrategy],
313
+ 'status_code' : number,
314
+ }
315
+ export type Result = { 'ok' : null } |
316
+ { 'err' : Err };
317
+ export type Result_1 = { 'ok' : PublishingId } |
318
+ { 'err' : Err };
319
+ export type Result_2 = { 'ok' : FileId } |
320
+ { 'err' : Err };
321
+ export type Result_3 = { 'ok' : null } |
322
+ { 'err' : string };
323
+ export type Result_4 = { 'ok' : PackageDetails } |
324
+ { 'err' : Err };
325
+ export type Result_5 = { 'ok' : PackageVersion__1 } |
326
+ { 'err' : Err };
327
+ export type Result_6 = { 'ok' : Array<[PackageName__1, PackageVersion__1]> } |
328
+ { 'err' : Err };
329
+ export type Result_7 = { 'ok' : Array<FileId> } |
330
+ { 'err' : Err };
331
+ export type Result_8 = { 'ok' : Array<[FileId, Uint8Array | number[]]> } |
332
+ { 'err' : Err };
333
+ export interface Script { 'value' : string, 'name' : string }
334
+ export type SemverPart = { 'major' : null } |
335
+ { 'minor' : null } |
336
+ { 'patch' : null };
337
+ export type StorageId = Principal;
338
+ export interface StorageStats {
339
+ 'fileCount' : bigint,
340
+ 'cyclesBalance' : bigint,
341
+ 'memorySize' : bigint,
342
+ }
343
+ export type StreamingCallback = ActorMethod<
344
+ [StreamingToken],
345
+ [] | [StreamingCallbackResponse]
346
+ >;
347
+ export interface StreamingCallbackResponse {
348
+ 'token' : [] | [StreamingToken],
349
+ 'body' : Uint8Array | number[],
350
+ }
351
+ export type StreamingStrategy = {
352
+ 'Callback' : { 'token' : StreamingToken, 'callback' : StreamingCallback }
353
+ };
354
+ export type StreamingToken = Uint8Array | number[];
355
+ export interface TestStats { 'passedNames' : Array<string>, 'passed' : bigint }
356
+ export interface TestStats__1 {
357
+ 'passedNames' : Array<string>,
358
+ 'passed' : bigint,
359
+ }
360
+ export interface TestsChanges {
361
+ 'addedNames' : Array<string>,
362
+ 'removedNames' : Array<string>,
363
+ }
364
+ export type Text = string;
365
+ export type Time = bigint;
366
+ export interface User {
367
+ 'id' : Principal,
368
+ 'emailVerified' : boolean,
369
+ 'twitter' : string,
370
+ 'displayName' : string,
371
+ 'name' : string,
372
+ 'site' : string,
373
+ 'email' : string,
374
+ 'twitterVerified' : boolean,
375
+ 'githubVerified' : boolean,
376
+ 'github' : string,
377
+ }
378
+ export interface User__1 {
379
+ 'id' : Principal,
380
+ 'emailVerified' : boolean,
381
+ 'twitter' : string,
382
+ 'displayName' : string,
383
+ 'name' : string,
384
+ 'site' : string,
385
+ 'email' : string,
386
+ 'twitterVerified' : boolean,
387
+ 'githubVerified' : boolean,
388
+ 'github' : string,
389
+ }
390
+ export interface _SERVICE extends Main {}
391
+ export declare const idlFactory: IDL.InterfaceFactory;
392
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];