ic-mops 1.7.2 → 1.8.0

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