ic-mops 0.40.0 → 0.41.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.
- package/.DS_Store +0 -0
- package/.npmrc +2 -1
- package/CHANGELOG.md +8 -0
- package/DEVELOPMENT.md +25 -0
- package/bundle/bench/bench-canister.mo +87 -0
- package/bundle/bench/user-bench.mo +14 -0
- package/bundle/bin/moc-wrapper.sh +3 -0
- package/bundle/bin/mops.js +3 -0
- package/bundle/cli.js +88 -0
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/bench/bench.did +26 -0
- package/bundle/declarations/bench/bench.did.d.ts +29 -0
- package/bundle/declarations/bench/bench.did.js +26 -0
- package/bundle/declarations/bench/index.d.ts +50 -0
- package/bundle/declarations/bench/index.js +40 -0
- package/bundle/declarations/main/index.d.ts +50 -0
- package/bundle/declarations/main/index.js +40 -0
- package/bundle/declarations/main/main.did +433 -0
- package/bundle/declarations/main/main.did.d.ts +355 -0
- package/bundle/declarations/main/main.did.js +407 -0
- package/bundle/declarations/storage/index.d.ts +50 -0
- package/bundle/declarations/storage/index.js +30 -0
- package/bundle/declarations/storage/storage.did +46 -0
- package/bundle/declarations/storage/storage.did.d.ts +37 -0
- package/bundle/declarations/storage/storage.did.js +38 -0
- package/bundle/package.json +31 -0
- package/bundle/templates/README.md +13 -0
- package/bundle/templates/licenses/Apache-2.0 +202 -0
- package/bundle/templates/licenses/Apache-2.0-NOTICE +13 -0
- package/bundle/templates/licenses/MIT +21 -0
- package/bundle/templates/mops-publish.yml +17 -0
- package/bundle/templates/mops-test.yml +22 -0
- package/bundle/templates/src/lib.mo +15 -0
- package/bundle/templates/test/lib.test.mo +4 -0
- package/bundle-package-json.ts +17 -0
- package/check-requirements.ts +50 -0
- package/cli.ts +22 -19
- package/commands/add.ts +4 -0
- package/commands/install-all.ts +2 -0
- package/commands/publish.ts +18 -30
- package/commands/self.ts +75 -0
- package/commands/template.ts +9 -10
- package/commands/toolchain/index.ts +7 -0
- package/declarations/bench/bench.did.d.ts +1 -1
- package/declarations/bench/index.js +1 -2
- package/declarations/main/index.js +1 -2
- package/declarations/main/main.did +15 -8
- package/declarations/main/main.did.d.ts +12 -9
- package/declarations/main/main.did.js +11 -8
- package/dist/api/actors.d.ts +0 -0
- package/dist/api/actors.js +0 -0
- package/dist/api/downloadPackageFiles.d.ts +0 -0
- package/dist/api/downloadPackageFiles.js +0 -0
- package/dist/api/getHighestVersion.d.ts +0 -0
- package/dist/api/getHighestVersion.js +0 -0
- package/dist/api/index.d.ts +0 -0
- package/dist/api/index.js +0 -0
- package/dist/api/network.d.ts +0 -0
- package/dist/api/network.js +0 -0
- package/dist/api/resolveVersion.d.ts +0 -0
- package/dist/api/resolveVersion.js +0 -0
- package/dist/bin/mops.d.ts +1 -1
- package/dist/bin/mops.js +2 -1
- package/dist/bundle-package-json.d.ts +0 -0
- package/dist/bundle-package-json.js +2 -0
- package/dist/cache.d.ts +0 -0
- package/dist/cache.js +0 -0
- package/dist/check-requirements.d.ts +3 -0
- package/dist/check-requirements.js +44 -0
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +18 -18
- package/dist/commands/add.d.ts +0 -0
- package/dist/commands/add.js +2 -0
- package/dist/commands/available-updates.d.ts +0 -0
- package/dist/commands/available-updates.js +0 -0
- package/dist/commands/bench-replica.d.ts +0 -0
- package/dist/commands/bench-replica.js +0 -0
- package/dist/commands/bench.d.ts +0 -0
- package/dist/commands/bench.js +0 -0
- package/dist/commands/bump.d.ts +0 -0
- package/dist/commands/bump.js +0 -0
- package/dist/commands/docs.d.ts +0 -0
- package/dist/commands/docs.js +0 -0
- package/dist/commands/import-identity.d.ts +0 -0
- package/dist/commands/import-identity.js +0 -0
- package/dist/commands/init.d.ts +0 -0
- package/dist/commands/init.js +0 -0
- package/dist/commands/install-all.d.ts +0 -0
- package/dist/commands/install-all.js +2 -0
- package/dist/commands/install-local.d.ts +0 -0
- package/dist/commands/install-local.js +0 -0
- package/dist/commands/install.d.ts +0 -0
- package/dist/commands/install.js +0 -0
- package/dist/commands/outdated.d.ts +0 -0
- package/dist/commands/outdated.js +0 -0
- package/dist/commands/publish.d.ts +0 -0
- package/dist/commands/publish.js +14 -25
- package/dist/commands/remove.d.ts +0 -0
- package/dist/commands/remove.js +0 -0
- package/dist/commands/search.d.ts +0 -0
- package/dist/commands/search.js +0 -0
- package/dist/commands/self.js +1 -1
- package/dist/commands/sources.d.ts +0 -0
- package/dist/commands/sources.js +0 -0
- package/dist/commands/sync.d.ts +0 -0
- package/dist/commands/sync.js +0 -0
- package/dist/commands/template.d.ts +0 -0
- package/dist/commands/template.js +9 -10
- package/dist/commands/test/mmf1.d.ts +0 -0
- package/dist/commands/test/mmf1.js +0 -0
- package/dist/commands/test/reporters/compact-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/compact-reporter.js +0 -0
- package/dist/commands/test/reporters/files-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/files-reporter.js +0 -0
- package/dist/commands/test/reporters/reporter.d.ts +0 -0
- package/dist/commands/test/reporters/reporter.js +0 -0
- package/dist/commands/test/reporters/silent-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/silent-reporter.js +0 -0
- package/dist/commands/test/reporters/verbose-reporter.d.ts +0 -0
- package/dist/commands/test/reporters/verbose-reporter.js +0 -0
- package/dist/commands/test/test.d.ts +0 -0
- package/dist/commands/test/test.js +0 -0
- package/dist/commands/test/utils.d.ts +0 -0
- package/dist/commands/test/utils.js +0 -0
- package/dist/commands/toolchain/index.d.ts +0 -0
- package/dist/commands/toolchain/index.js +5 -0
- package/dist/commands/toolchain/moc.d.ts +0 -0
- package/dist/commands/toolchain/moc.js +0 -0
- package/dist/commands/toolchain/pocket-ic.d.ts +0 -0
- package/dist/commands/toolchain/pocket-ic.js +0 -0
- package/dist/commands/toolchain/toolchain-utils.d.ts +0 -0
- package/dist/commands/toolchain/toolchain-utils.js +0 -0
- package/dist/commands/toolchain/wasmtime.d.ts +0 -0
- package/dist/commands/toolchain/wasmtime.js +0 -0
- package/dist/commands/transfer-ownership.d.ts +0 -0
- package/dist/commands/transfer-ownership.js +0 -0
- package/dist/commands/update.d.ts +0 -0
- package/dist/commands/update.js +0 -0
- package/dist/commands/user.d.ts +0 -0
- package/dist/commands/user.js +0 -0
- package/dist/commands/whoami.d.ts +0 -0
- package/dist/commands/whoami.js +0 -0
- package/dist/declarations/bench/bench.did +0 -0
- package/dist/declarations/bench/bench.did.d.ts +1 -1
- package/dist/declarations/bench/bench.did.js +0 -0
- package/dist/declarations/bench/index.d.ts +0 -0
- package/dist/declarations/bench/index.js +1 -2
- package/dist/declarations/main/index.d.ts +0 -0
- package/dist/declarations/main/index.js +1 -2
- package/dist/declarations/main/main.did +15 -8
- package/dist/declarations/main/main.did.d.ts +12 -9
- package/dist/declarations/main/main.did.js +11 -8
- package/dist/helpers/find-changelog-entry.d.ts +0 -0
- package/dist/helpers/find-changelog-entry.js +0 -0
- package/dist/helpers/get-dfx-version.d.ts +0 -0
- package/dist/helpers/get-dfx-version.js +0 -0
- package/dist/helpers/get-moc-path.d.ts +0 -0
- package/dist/helpers/get-moc-path.js +0 -0
- package/dist/helpers/get-moc-version.d.ts +0 -0
- package/dist/helpers/get-moc-version.js +0 -0
- package/dist/integrity.d.ts +0 -0
- package/dist/integrity.js +0 -0
- package/dist/mops.d.ts +1 -0
- package/dist/mops.js +12 -1
- package/dist/notify-installs.d.ts +0 -0
- package/dist/notify-installs.js +0 -0
- package/dist/package.json +18 -24
- package/dist/parallel.d.ts +0 -0
- package/dist/parallel.js +0 -0
- package/dist/pem.d.ts +0 -0
- package/dist/pem.js +0 -0
- package/dist/release-cli.d.ts +0 -0
- package/dist/release-cli.js +13 -7
- package/dist/resolve-packages.d.ts +0 -0
- package/dist/resolve-packages.js +0 -0
- package/dist/templates.d.ts +1 -0
- package/dist/templates.js +4 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +0 -0
- package/dist/vessel.d.ts +0 -0
- package/dist/vessel.js +0 -0
- package/helpers/find-changelog-entry.ts +27 -0
- package/mops.ts +15 -1
- package/package.json +26 -17
- package/release-cli.ts +67 -0
- package/remove-scripts.ts +6 -0
- package/templates.ts +5 -0
- package/tsconfig.json +1 -1
- package/types.ts +7 -2
- package/commands/self-update.ts +0 -6
- package/dist/commands/self-update.d.ts +0 -3
- package/dist/commands/self-update.js +0 -5
- /package/bin/{mops.ts → mops.js} +0 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
export const idlFactory = ({ IDL }) => {
|
|
2
|
+
const PublishingId = IDL.Text;
|
|
3
|
+
const Err = IDL.Text;
|
|
4
|
+
const Result = IDL.Variant({ 'ok' : IDL.Null, 'err' : Err });
|
|
5
|
+
const Text = IDL.Text;
|
|
6
|
+
const PackageName = IDL.Text;
|
|
7
|
+
const PackageVersion = IDL.Text;
|
|
8
|
+
const PackageId = IDL.Text;
|
|
9
|
+
const Time = IDL.Int;
|
|
10
|
+
const DownloadsSnapshot__1 = IDL.Record({
|
|
11
|
+
'startTime' : Time,
|
|
12
|
+
'endTime' : Time,
|
|
13
|
+
'downloads' : IDL.Nat,
|
|
14
|
+
});
|
|
15
|
+
const FileId = IDL.Text;
|
|
16
|
+
const Result_8 = IDL.Variant({
|
|
17
|
+
'ok' : IDL.Vec(IDL.Tuple(FileId, IDL.Vec(IDL.Nat8))),
|
|
18
|
+
'err' : Err,
|
|
19
|
+
});
|
|
20
|
+
const Result_7 = IDL.Variant({ 'ok' : IDL.Vec(FileId), 'err' : Err });
|
|
21
|
+
const SemverPart = IDL.Variant({
|
|
22
|
+
'major' : IDL.Null,
|
|
23
|
+
'minor' : IDL.Null,
|
|
24
|
+
'patch' : IDL.Null,
|
|
25
|
+
});
|
|
26
|
+
const Result_6 = IDL.Variant({
|
|
27
|
+
'ok' : IDL.Vec(IDL.Tuple(PackageName, PackageVersion)),
|
|
28
|
+
'err' : Err,
|
|
29
|
+
});
|
|
30
|
+
const Result_5 = IDL.Variant({ 'ok' : PackageVersion, 'err' : Err });
|
|
31
|
+
const User = IDL.Record({
|
|
32
|
+
'id' : IDL.Principal,
|
|
33
|
+
'emailVerified' : IDL.Bool,
|
|
34
|
+
'twitter' : IDL.Text,
|
|
35
|
+
'displayName' : IDL.Text,
|
|
36
|
+
'name' : IDL.Text,
|
|
37
|
+
'site' : IDL.Text,
|
|
38
|
+
'email' : IDL.Text,
|
|
39
|
+
'twitterVerified' : IDL.Bool,
|
|
40
|
+
'githubVerified' : IDL.Bool,
|
|
41
|
+
'github' : IDL.Text,
|
|
42
|
+
});
|
|
43
|
+
const DepsStatus = IDL.Variant({
|
|
44
|
+
'allLatest' : IDL.Null,
|
|
45
|
+
'tooOld' : IDL.Null,
|
|
46
|
+
'updatesAvailable' : IDL.Null,
|
|
47
|
+
});
|
|
48
|
+
const PackageQuality = IDL.Record({
|
|
49
|
+
'depsStatus' : DepsStatus,
|
|
50
|
+
'hasDescription' : IDL.Bool,
|
|
51
|
+
'hasKeywords' : IDL.Bool,
|
|
52
|
+
'hasLicense' : IDL.Bool,
|
|
53
|
+
'hasDocumentation' : IDL.Bool,
|
|
54
|
+
'hasTests' : IDL.Bool,
|
|
55
|
+
'hasRepository' : IDL.Bool,
|
|
56
|
+
'hasReleaseNotes' : IDL.Bool,
|
|
57
|
+
});
|
|
58
|
+
const Script = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
59
|
+
const PackageName__1 = IDL.Text;
|
|
60
|
+
const DependencyV2 = IDL.Record({
|
|
61
|
+
'name' : PackageName__1,
|
|
62
|
+
'repo' : IDL.Text,
|
|
63
|
+
'version' : IDL.Text,
|
|
64
|
+
});
|
|
65
|
+
const Requirement = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
66
|
+
const PackageConfigV3 = IDL.Record({
|
|
67
|
+
'dfx' : IDL.Text,
|
|
68
|
+
'moc' : IDL.Text,
|
|
69
|
+
'scripts' : IDL.Vec(Script),
|
|
70
|
+
'baseDir' : IDL.Text,
|
|
71
|
+
'documentation' : IDL.Text,
|
|
72
|
+
'name' : PackageName__1,
|
|
73
|
+
'homepage' : IDL.Text,
|
|
74
|
+
'description' : IDL.Text,
|
|
75
|
+
'version' : IDL.Text,
|
|
76
|
+
'keywords' : IDL.Vec(IDL.Text),
|
|
77
|
+
'donation' : IDL.Text,
|
|
78
|
+
'devDependencies' : IDL.Vec(DependencyV2),
|
|
79
|
+
'repository' : IDL.Text,
|
|
80
|
+
'dependencies' : IDL.Vec(DependencyV2),
|
|
81
|
+
'requirements' : IDL.Vec(Requirement),
|
|
82
|
+
'license' : IDL.Text,
|
|
83
|
+
'readme' : IDL.Text,
|
|
84
|
+
});
|
|
85
|
+
const PackagePublication = IDL.Record({
|
|
86
|
+
'storage' : IDL.Principal,
|
|
87
|
+
'time' : Time,
|
|
88
|
+
'user' : IDL.Principal,
|
|
89
|
+
});
|
|
90
|
+
const PackageSummary = IDL.Record({
|
|
91
|
+
'ownerInfo' : User,
|
|
92
|
+
'owner' : IDL.Principal,
|
|
93
|
+
'quality' : PackageQuality,
|
|
94
|
+
'downloadsTotal' : IDL.Nat,
|
|
95
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
96
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
97
|
+
'config' : PackageConfigV3,
|
|
98
|
+
'publication' : PackagePublication,
|
|
99
|
+
});
|
|
100
|
+
const BenchmarkMetric = IDL.Text;
|
|
101
|
+
const Benchmark = IDL.Record({
|
|
102
|
+
'gc' : IDL.Text,
|
|
103
|
+
'metrics' : IDL.Vec(IDL.Tuple(BenchmarkMetric, IDL.Vec(IDL.Vec(IDL.Int)))),
|
|
104
|
+
'cols' : IDL.Vec(IDL.Text),
|
|
105
|
+
'file' : IDL.Text,
|
|
106
|
+
'name' : IDL.Text,
|
|
107
|
+
'rows' : IDL.Vec(IDL.Text),
|
|
108
|
+
'description' : IDL.Text,
|
|
109
|
+
'compilerVersion' : IDL.Text,
|
|
110
|
+
'compiler' : IDL.Text,
|
|
111
|
+
'replica' : IDL.Text,
|
|
112
|
+
'replicaVersion' : IDL.Text,
|
|
113
|
+
'forceGC' : IDL.Bool,
|
|
114
|
+
});
|
|
115
|
+
const Benchmarks__1 = IDL.Vec(Benchmark);
|
|
116
|
+
const PackageSummary__1 = IDL.Record({
|
|
117
|
+
'ownerInfo' : User,
|
|
118
|
+
'owner' : IDL.Principal,
|
|
119
|
+
'quality' : PackageQuality,
|
|
120
|
+
'downloadsTotal' : IDL.Nat,
|
|
121
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
122
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
123
|
+
'config' : PackageConfigV3,
|
|
124
|
+
'publication' : PackagePublication,
|
|
125
|
+
});
|
|
126
|
+
const TestStats__1 = IDL.Record({
|
|
127
|
+
'passedNames' : IDL.Vec(IDL.Text),
|
|
128
|
+
'passed' : IDL.Nat,
|
|
129
|
+
});
|
|
130
|
+
const DownloadsSnapshot = IDL.Record({
|
|
131
|
+
'startTime' : Time,
|
|
132
|
+
'endTime' : Time,
|
|
133
|
+
'downloads' : IDL.Nat,
|
|
134
|
+
});
|
|
135
|
+
const PackageFileStatsPublic = IDL.Record({
|
|
136
|
+
'sourceFiles' : IDL.Nat,
|
|
137
|
+
'sourceSize' : IDL.Nat,
|
|
138
|
+
});
|
|
139
|
+
const TestsChanges = IDL.Record({
|
|
140
|
+
'addedNames' : IDL.Vec(IDL.Text),
|
|
141
|
+
'removedNames' : IDL.Vec(IDL.Text),
|
|
142
|
+
});
|
|
143
|
+
const DepChange = IDL.Record({
|
|
144
|
+
'oldVersion' : IDL.Text,
|
|
145
|
+
'name' : IDL.Text,
|
|
146
|
+
'newVersion' : IDL.Text,
|
|
147
|
+
});
|
|
148
|
+
const PackageChanges = IDL.Record({
|
|
149
|
+
'tests' : TestsChanges,
|
|
150
|
+
'deps' : IDL.Vec(DepChange),
|
|
151
|
+
'curBenchmarks' : Benchmarks__1,
|
|
152
|
+
'prevBenchmarks' : Benchmarks__1,
|
|
153
|
+
'notes' : IDL.Text,
|
|
154
|
+
'devDeps' : IDL.Vec(DepChange),
|
|
155
|
+
});
|
|
156
|
+
const PackageSummaryWithChanges__1 = IDL.Record({
|
|
157
|
+
'ownerInfo' : User,
|
|
158
|
+
'owner' : IDL.Principal,
|
|
159
|
+
'quality' : PackageQuality,
|
|
160
|
+
'downloadsTotal' : IDL.Nat,
|
|
161
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
162
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
163
|
+
'config' : PackageConfigV3,
|
|
164
|
+
'changes' : PackageChanges,
|
|
165
|
+
'publication' : PackagePublication,
|
|
166
|
+
});
|
|
167
|
+
const PackageDetails = IDL.Record({
|
|
168
|
+
'benchmarks' : Benchmarks__1,
|
|
169
|
+
'ownerInfo' : User,
|
|
170
|
+
'owner' : IDL.Principal,
|
|
171
|
+
'deps' : IDL.Vec(PackageSummary__1),
|
|
172
|
+
'quality' : PackageQuality,
|
|
173
|
+
'testStats' : TestStats__1,
|
|
174
|
+
'downloadsTotal' : IDL.Nat,
|
|
175
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
176
|
+
'downloadTrend' : IDL.Vec(DownloadsSnapshot),
|
|
177
|
+
'fileStats' : PackageFileStatsPublic,
|
|
178
|
+
'versionHistory' : IDL.Vec(PackageSummaryWithChanges__1),
|
|
179
|
+
'dependents' : IDL.Vec(PackageSummary__1),
|
|
180
|
+
'devDeps' : IDL.Vec(PackageSummary__1),
|
|
181
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
182
|
+
'config' : PackageConfigV3,
|
|
183
|
+
'changes' : PackageChanges,
|
|
184
|
+
'publication' : PackagePublication,
|
|
185
|
+
});
|
|
186
|
+
const Result_4 = IDL.Variant({ 'ok' : PackageDetails, 'err' : Err });
|
|
187
|
+
const PackageSummaryWithChanges = IDL.Record({
|
|
188
|
+
'ownerInfo' : User,
|
|
189
|
+
'owner' : IDL.Principal,
|
|
190
|
+
'quality' : PackageQuality,
|
|
191
|
+
'downloadsTotal' : IDL.Nat,
|
|
192
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
193
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
194
|
+
'config' : PackageConfigV3,
|
|
195
|
+
'changes' : PackageChanges,
|
|
196
|
+
'publication' : PackagePublication,
|
|
197
|
+
});
|
|
198
|
+
const StorageId = IDL.Principal;
|
|
199
|
+
const StorageStats = IDL.Record({
|
|
200
|
+
'fileCount' : IDL.Nat,
|
|
201
|
+
'cyclesBalance' : IDL.Nat,
|
|
202
|
+
'memorySize' : IDL.Nat,
|
|
203
|
+
});
|
|
204
|
+
const User__1 = IDL.Record({
|
|
205
|
+
'id' : IDL.Principal,
|
|
206
|
+
'emailVerified' : IDL.Bool,
|
|
207
|
+
'twitter' : IDL.Text,
|
|
208
|
+
'displayName' : IDL.Text,
|
|
209
|
+
'name' : IDL.Text,
|
|
210
|
+
'site' : IDL.Text,
|
|
211
|
+
'email' : IDL.Text,
|
|
212
|
+
'twitterVerified' : IDL.Bool,
|
|
213
|
+
'githubVerified' : IDL.Bool,
|
|
214
|
+
'github' : IDL.Text,
|
|
215
|
+
});
|
|
216
|
+
const Header = IDL.Tuple(IDL.Text, IDL.Text);
|
|
217
|
+
const Request = IDL.Record({
|
|
218
|
+
'url' : IDL.Text,
|
|
219
|
+
'method' : IDL.Text,
|
|
220
|
+
'body' : IDL.Vec(IDL.Nat8),
|
|
221
|
+
'headers' : IDL.Vec(Header),
|
|
222
|
+
'certificate_version' : IDL.Opt(IDL.Nat16),
|
|
223
|
+
});
|
|
224
|
+
const StreamingToken = IDL.Vec(IDL.Nat8);
|
|
225
|
+
const StreamingCallbackResponse = IDL.Record({
|
|
226
|
+
'token' : IDL.Opt(StreamingToken),
|
|
227
|
+
'body' : IDL.Vec(IDL.Nat8),
|
|
228
|
+
});
|
|
229
|
+
const StreamingCallback = IDL.Func(
|
|
230
|
+
[StreamingToken],
|
|
231
|
+
[IDL.Opt(StreamingCallbackResponse)],
|
|
232
|
+
['query'],
|
|
233
|
+
);
|
|
234
|
+
const StreamingStrategy = IDL.Variant({
|
|
235
|
+
'Callback' : IDL.Record({
|
|
236
|
+
'token' : StreamingToken,
|
|
237
|
+
'callback' : StreamingCallback,
|
|
238
|
+
}),
|
|
239
|
+
});
|
|
240
|
+
const Response = IDL.Record({
|
|
241
|
+
'body' : IDL.Vec(IDL.Nat8),
|
|
242
|
+
'headers' : IDL.Vec(Header),
|
|
243
|
+
'upgrade' : IDL.Opt(IDL.Bool),
|
|
244
|
+
'streaming_strategy' : IDL.Opt(StreamingStrategy),
|
|
245
|
+
'status_code' : IDL.Nat16,
|
|
246
|
+
});
|
|
247
|
+
const PageCount = IDL.Nat;
|
|
248
|
+
const Result_1 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
|
|
249
|
+
const Result_3 = IDL.Variant({ 'ok' : FileId, 'err' : Err });
|
|
250
|
+
const PackageConfigV3_Publishing = IDL.Record({
|
|
251
|
+
'dfx' : IDL.Text,
|
|
252
|
+
'moc' : IDL.Text,
|
|
253
|
+
'scripts' : IDL.Vec(Script),
|
|
254
|
+
'baseDir' : IDL.Text,
|
|
255
|
+
'documentation' : IDL.Text,
|
|
256
|
+
'name' : PackageName__1,
|
|
257
|
+
'homepage' : IDL.Text,
|
|
258
|
+
'description' : IDL.Text,
|
|
259
|
+
'version' : IDL.Text,
|
|
260
|
+
'keywords' : IDL.Vec(IDL.Text),
|
|
261
|
+
'donation' : IDL.Text,
|
|
262
|
+
'devDependencies' : IDL.Vec(DependencyV2),
|
|
263
|
+
'repository' : IDL.Text,
|
|
264
|
+
'dependencies' : IDL.Vec(DependencyV2),
|
|
265
|
+
'requirements' : IDL.Opt(IDL.Vec(Requirement)),
|
|
266
|
+
'license' : IDL.Text,
|
|
267
|
+
'readme' : IDL.Text,
|
|
268
|
+
});
|
|
269
|
+
const Result_2 = IDL.Variant({ 'ok' : PublishingId, 'err' : Err });
|
|
270
|
+
const HttpHeader = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
271
|
+
const HttpResponse = IDL.Record({
|
|
272
|
+
'status' : IDL.Nat,
|
|
273
|
+
'body' : IDL.Vec(IDL.Nat8),
|
|
274
|
+
'headers' : IDL.Vec(HttpHeader),
|
|
275
|
+
});
|
|
276
|
+
const HttpTransformArg = IDL.Record({
|
|
277
|
+
'context' : IDL.Vec(IDL.Nat8),
|
|
278
|
+
'response' : HttpResponse,
|
|
279
|
+
});
|
|
280
|
+
const Benchmarks = IDL.Vec(Benchmark);
|
|
281
|
+
const TestStats = IDL.Record({
|
|
282
|
+
'passedNames' : IDL.Vec(IDL.Text),
|
|
283
|
+
'passed' : IDL.Nat,
|
|
284
|
+
});
|
|
285
|
+
const Main = IDL.Service({
|
|
286
|
+
'backup' : IDL.Func([], [], []),
|
|
287
|
+
'computeHashesForExistingFiles' : IDL.Func([], [], []),
|
|
288
|
+
'finishPublish' : IDL.Func([PublishingId], [Result], []),
|
|
289
|
+
'getApiVersion' : IDL.Func([], [Text], ['query']),
|
|
290
|
+
'getBackupCanisterId' : IDL.Func([], [IDL.Principal], ['query']),
|
|
291
|
+
'getDefaultPackages' : IDL.Func(
|
|
292
|
+
[IDL.Text],
|
|
293
|
+
[IDL.Vec(IDL.Tuple(PackageName, PackageVersion))],
|
|
294
|
+
['query'],
|
|
295
|
+
),
|
|
296
|
+
'getDownloadTrendByPackageId' : IDL.Func(
|
|
297
|
+
[PackageId],
|
|
298
|
+
[IDL.Vec(DownloadsSnapshot__1)],
|
|
299
|
+
['query'],
|
|
300
|
+
),
|
|
301
|
+
'getDownloadTrendByPackageName' : IDL.Func(
|
|
302
|
+
[PackageName],
|
|
303
|
+
[IDL.Vec(DownloadsSnapshot__1)],
|
|
304
|
+
['query'],
|
|
305
|
+
),
|
|
306
|
+
'getFileHashes' : IDL.Func([PackageName, PackageVersion], [Result_8], []),
|
|
307
|
+
'getFileHashesByPackageIds' : IDL.Func(
|
|
308
|
+
[IDL.Vec(PackageId)],
|
|
309
|
+
[
|
|
310
|
+
IDL.Vec(
|
|
311
|
+
IDL.Tuple(PackageId, IDL.Vec(IDL.Tuple(FileId, IDL.Vec(IDL.Nat8))))
|
|
312
|
+
),
|
|
313
|
+
],
|
|
314
|
+
[],
|
|
315
|
+
),
|
|
316
|
+
'getFileHashesQuery' : IDL.Func(
|
|
317
|
+
[PackageName, PackageVersion],
|
|
318
|
+
[Result_8],
|
|
319
|
+
['query'],
|
|
320
|
+
),
|
|
321
|
+
'getFileIds' : IDL.Func(
|
|
322
|
+
[PackageName, PackageVersion],
|
|
323
|
+
[Result_7],
|
|
324
|
+
['query'],
|
|
325
|
+
),
|
|
326
|
+
'getHighestSemverBatch' : IDL.Func(
|
|
327
|
+
[IDL.Vec(IDL.Tuple(PackageName, PackageVersion, SemverPart))],
|
|
328
|
+
[Result_6],
|
|
329
|
+
['query'],
|
|
330
|
+
),
|
|
331
|
+
'getHighestVersion' : IDL.Func([PackageName], [Result_5], ['query']),
|
|
332
|
+
'getMostDownloadedPackages' : IDL.Func(
|
|
333
|
+
[],
|
|
334
|
+
[IDL.Vec(PackageSummary)],
|
|
335
|
+
['query'],
|
|
336
|
+
),
|
|
337
|
+
'getMostDownloadedPackagesIn7Days' : IDL.Func(
|
|
338
|
+
[],
|
|
339
|
+
[IDL.Vec(PackageSummary)],
|
|
340
|
+
['query'],
|
|
341
|
+
),
|
|
342
|
+
'getNewPackages' : IDL.Func([], [IDL.Vec(PackageSummary)], ['query']),
|
|
343
|
+
'getPackageDetails' : IDL.Func(
|
|
344
|
+
[PackageName, PackageVersion],
|
|
345
|
+
[Result_4],
|
|
346
|
+
['query'],
|
|
347
|
+
),
|
|
348
|
+
'getPackagesByCategory' : IDL.Func(
|
|
349
|
+
[],
|
|
350
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(PackageSummary)))],
|
|
351
|
+
['query'],
|
|
352
|
+
),
|
|
353
|
+
'getRecentlyUpdatedPackages' : IDL.Func(
|
|
354
|
+
[],
|
|
355
|
+
[IDL.Vec(PackageSummaryWithChanges)],
|
|
356
|
+
['query'],
|
|
357
|
+
),
|
|
358
|
+
'getStoragesStats' : IDL.Func(
|
|
359
|
+
[],
|
|
360
|
+
[IDL.Vec(IDL.Tuple(StorageId, StorageStats))],
|
|
361
|
+
['query'],
|
|
362
|
+
),
|
|
363
|
+
'getTotalDownloads' : IDL.Func([], [IDL.Nat], ['query']),
|
|
364
|
+
'getTotalPackages' : IDL.Func([], [IDL.Nat], ['query']),
|
|
365
|
+
'getUser' : IDL.Func([IDL.Principal], [IDL.Opt(User__1)], ['query']),
|
|
366
|
+
'http_request' : IDL.Func([Request], [Response], ['query']),
|
|
367
|
+
'notifyInstall' : IDL.Func([PackageName, PackageVersion], [], ['oneway']),
|
|
368
|
+
'notifyInstalls' : IDL.Func(
|
|
369
|
+
[IDL.Vec(IDL.Tuple(PackageName, PackageVersion))],
|
|
370
|
+
[],
|
|
371
|
+
['oneway'],
|
|
372
|
+
),
|
|
373
|
+
'restore' : IDL.Func([IDL.Nat], [], []),
|
|
374
|
+
'search' : IDL.Func(
|
|
375
|
+
[Text, IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)],
|
|
376
|
+
[IDL.Vec(PackageSummary), PageCount],
|
|
377
|
+
['query'],
|
|
378
|
+
),
|
|
379
|
+
'setUserProp' : IDL.Func([IDL.Text, IDL.Text], [Result_1], []),
|
|
380
|
+
'startFileUpload' : IDL.Func(
|
|
381
|
+
[PublishingId, Text, IDL.Nat, IDL.Vec(IDL.Nat8)],
|
|
382
|
+
[Result_3],
|
|
383
|
+
[],
|
|
384
|
+
),
|
|
385
|
+
'startPublish' : IDL.Func([PackageConfigV3_Publishing], [Result_2], []),
|
|
386
|
+
'transferOwnership' : IDL.Func(
|
|
387
|
+
[PackageName, IDL.Principal],
|
|
388
|
+
[Result_1],
|
|
389
|
+
[],
|
|
390
|
+
),
|
|
391
|
+
'transformRequest' : IDL.Func(
|
|
392
|
+
[HttpTransformArg],
|
|
393
|
+
[HttpResponse],
|
|
394
|
+
['query'],
|
|
395
|
+
),
|
|
396
|
+
'uploadBenchmarks' : IDL.Func([PublishingId, Benchmarks], [Result], []),
|
|
397
|
+
'uploadFileChunk' : IDL.Func(
|
|
398
|
+
[PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)],
|
|
399
|
+
[Result],
|
|
400
|
+
[],
|
|
401
|
+
),
|
|
402
|
+
'uploadNotes' : IDL.Func([PublishingId, IDL.Text], [Result], []),
|
|
403
|
+
'uploadTestStats' : IDL.Func([PublishingId, TestStats], [Result], []),
|
|
404
|
+
});
|
|
405
|
+
return Main;
|
|
406
|
+
};
|
|
407
|
+
export const init = ({ IDL }) => { return []; };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ActorSubclass,
|
|
3
|
+
HttpAgentOptions,
|
|
4
|
+
ActorConfig,
|
|
5
|
+
Agent,
|
|
6
|
+
} from "@dfinity/agent";
|
|
7
|
+
import type { Principal } from "@dfinity/principal";
|
|
8
|
+
import type { IDL } from "@dfinity/candid";
|
|
9
|
+
|
|
10
|
+
import { _SERVICE } from './storage.did';
|
|
11
|
+
|
|
12
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
13
|
+
export declare const canisterId: string;
|
|
14
|
+
|
|
15
|
+
export declare interface CreateActorOptions {
|
|
16
|
+
/**
|
|
17
|
+
* @see {@link Agent}
|
|
18
|
+
*/
|
|
19
|
+
agent?: Agent;
|
|
20
|
+
/**
|
|
21
|
+
* @see {@link HttpAgentOptions}
|
|
22
|
+
*/
|
|
23
|
+
agentOptions?: HttpAgentOptions;
|
|
24
|
+
/**
|
|
25
|
+
* @see {@link ActorConfig}
|
|
26
|
+
*/
|
|
27
|
+
actorOptions?: ActorConfig;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister.
|
|
32
|
+
* @constructs {@link ActorSubClass}
|
|
33
|
+
* @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to
|
|
34
|
+
* @param {CreateActorOptions} options - see {@link CreateActorOptions}
|
|
35
|
+
* @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions
|
|
36
|
+
* @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent
|
|
37
|
+
* @see {@link HttpAgentOptions}
|
|
38
|
+
* @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor
|
|
39
|
+
* @see {@link ActorConfig}
|
|
40
|
+
*/
|
|
41
|
+
export declare const createActor: (
|
|
42
|
+
canisterId: string | Principal,
|
|
43
|
+
options?: CreateActorOptions
|
|
44
|
+
) => ActorSubclass<_SERVICE>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Intialized Actor using default settings, ready to talk to a canister using its candid interface
|
|
48
|
+
* @constructs {@link ActorSubClass}
|
|
49
|
+
*/
|
|
50
|
+
export declare const storage: ActorSubclass<_SERVICE>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Actor, HttpAgent } from "@dfinity/agent";
|
|
2
|
+
|
|
3
|
+
// Imports and re-exports candid interface
|
|
4
|
+
import { idlFactory } from './storage.did.js';
|
|
5
|
+
export { idlFactory } from './storage.did.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent
|
|
10
|
+
* @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options]
|
|
11
|
+
* @return {import("@dfinity/agent").ActorSubclass<import("./storage.did.js")._SERVICE>}
|
|
12
|
+
*/
|
|
13
|
+
export const createActor = (canisterId, options) => {
|
|
14
|
+
const agent = new HttpAgent({ ...options?.agentOptions });
|
|
15
|
+
|
|
16
|
+
// Fetch root key for certificate validation during development
|
|
17
|
+
if(process.env.NODE_ENV !== "production") {
|
|
18
|
+
agent.fetchRootKey().catch(err=>{
|
|
19
|
+
console.warn("Unable to fetch root key. Check to ensure that your local replica is running");
|
|
20
|
+
console.error(err);
|
|
21
|
+
});
|
|
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
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type StorageStats =
|
|
2
|
+
record {
|
|
3
|
+
cyclesBalance: nat;
|
|
4
|
+
fileCount: nat;
|
|
5
|
+
memorySize: nat;
|
|
6
|
+
};
|
|
7
|
+
type Storage =
|
|
8
|
+
service {
|
|
9
|
+
acceptCycles: () -> ();
|
|
10
|
+
deleteFile: (FileId) -> ();
|
|
11
|
+
downloadChunk: (FileId, nat) -> (Result_2) query;
|
|
12
|
+
finishUpload: (FileId) -> ();
|
|
13
|
+
getFileIdsRange: (nat, nat) -> (vec FileId) query;
|
|
14
|
+
getFileMeta: (FileId) -> (Result_1) query;
|
|
15
|
+
getStats: () -> (StorageStats) query;
|
|
16
|
+
startUpload: (FileMeta) -> (Result);
|
|
17
|
+
updateFileOwners: (FileId, vec principal) -> ();
|
|
18
|
+
uploadChunk: (FileId, nat, Chunk) -> ();
|
|
19
|
+
};
|
|
20
|
+
type Result_2 =
|
|
21
|
+
variant {
|
|
22
|
+
err: Err;
|
|
23
|
+
ok: Chunk;
|
|
24
|
+
};
|
|
25
|
+
type Result_1 =
|
|
26
|
+
variant {
|
|
27
|
+
err: Err;
|
|
28
|
+
ok: FileMeta;
|
|
29
|
+
};
|
|
30
|
+
type Result =
|
|
31
|
+
variant {
|
|
32
|
+
err: Err;
|
|
33
|
+
ok;
|
|
34
|
+
};
|
|
35
|
+
type FileMeta =
|
|
36
|
+
record {
|
|
37
|
+
chunkCount: nat;
|
|
38
|
+
id: FileId__1;
|
|
39
|
+
owners: vec principal;
|
|
40
|
+
path: text;
|
|
41
|
+
};
|
|
42
|
+
type FileId__1 = text;
|
|
43
|
+
type FileId = text;
|
|
44
|
+
type Err = text;
|
|
45
|
+
type Chunk = blob;
|
|
46
|
+
service : () -> Storage
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Principal } from '@dfinity/principal';
|
|
2
|
+
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
|
|
4
|
+
export type Chunk = Array<number>;
|
|
5
|
+
export type Err = string;
|
|
6
|
+
export type FileId = string;
|
|
7
|
+
export type FileId__1 = string;
|
|
8
|
+
export interface FileMeta {
|
|
9
|
+
'id' : FileId__1,
|
|
10
|
+
'owners' : Array<Principal>,
|
|
11
|
+
'path' : string,
|
|
12
|
+
'chunkCount' : bigint,
|
|
13
|
+
}
|
|
14
|
+
export type Result = { 'ok' : null } |
|
|
15
|
+
{ 'err' : Err };
|
|
16
|
+
export type Result_1 = { 'ok' : FileMeta } |
|
|
17
|
+
{ 'err' : Err };
|
|
18
|
+
export type Result_2 = { 'ok' : Chunk } |
|
|
19
|
+
{ 'err' : Err };
|
|
20
|
+
export interface Storage {
|
|
21
|
+
'acceptCycles' : ActorMethod<[], undefined>,
|
|
22
|
+
'deleteFile' : ActorMethod<[FileId], undefined>,
|
|
23
|
+
'downloadChunk' : ActorMethod<[FileId, bigint], Result_2>,
|
|
24
|
+
'finishUpload' : ActorMethod<[FileId], undefined>,
|
|
25
|
+
'getFileIdsRange' : ActorMethod<[bigint, bigint], Array<FileId>>,
|
|
26
|
+
'getFileMeta' : ActorMethod<[FileId], Result_1>,
|
|
27
|
+
'getStats' : ActorMethod<[], StorageStats>,
|
|
28
|
+
'startUpload' : ActorMethod<[FileMeta], Result>,
|
|
29
|
+
'updateFileOwners' : ActorMethod<[FileId, Array<Principal>], undefined>,
|
|
30
|
+
'uploadChunk' : ActorMethod<[FileId, bigint, Chunk], undefined>,
|
|
31
|
+
}
|
|
32
|
+
export interface StorageStats {
|
|
33
|
+
'fileCount' : bigint,
|
|
34
|
+
'cyclesBalance' : bigint,
|
|
35
|
+
'memorySize' : bigint,
|
|
36
|
+
}
|
|
37
|
+
export interface _SERVICE extends Storage {}
|
|
@@ -0,0 +1,38 @@
|
|
|
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(
|
|
26
|
+
[IDL.Nat, IDL.Nat],
|
|
27
|
+
[IDL.Vec(FileId)],
|
|
28
|
+
['query'],
|
|
29
|
+
),
|
|
30
|
+
'getFileMeta' : IDL.Func([FileId], [Result_1], ['query']),
|
|
31
|
+
'getStats' : IDL.Func([], [StorageStats], ['query']),
|
|
32
|
+
'startUpload' : IDL.Func([FileMeta], [Result], []),
|
|
33
|
+
'updateFileOwners' : IDL.Func([FileId, IDL.Vec(IDL.Principal)], [], []),
|
|
34
|
+
'uploadChunk' : IDL.Func([FileId, IDL.Nat, Chunk], [], []),
|
|
35
|
+
});
|
|
36
|
+
return Storage;
|
|
37
|
+
};
|
|
38
|
+
export const init = ({ IDL }) => { return []; };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ic-mops",
|
|
3
|
+
"version": "0.41.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"mops": "bin/mops.js",
|
|
7
|
+
"ic-mops": "bin/mops.js",
|
|
8
|
+
"moc-wrapper": "bin/moc-wrapper.sh"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"*",
|
|
12
|
+
"!network.txt",
|
|
13
|
+
"!.mops",
|
|
14
|
+
"/templates"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://mops.one",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/ZenVoich/mops.git"
|
|
20
|
+
},
|
|
21
|
+
"author": "Zen Voich <zen.voich@gmail.com>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"dhall-to-json-cli": "^1.7.6",
|
|
28
|
+
"decomp-tarxz": "0.1.1",
|
|
29
|
+
"buffer": "6.0.3"
|
|
30
|
+
}
|
|
31
|
+
}
|