ic-mops 0.19.0 → 0.20.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.
- package/.gitignore +3 -0
- package/{cache.js → cache.ts} +8 -8
- package/{cli.js → cli.ts} +5 -5
- package/commands/{add.js → add.ts} +16 -8
- package/commands/{bump.js → bump.ts} +5 -5
- package/commands/{docs.js → docs.ts} +10 -10
- package/commands/{import-identity.js → import-identity.ts} +7 -7
- package/commands/{init.js → init.ts} +20 -17
- package/commands/{install-all.js → install-all.ts} +1 -1
- package/commands/{install.js → install.ts} +11 -11
- package/commands/{mmf1.js → mmf1.ts} +20 -18
- package/commands/{publish.js → publish.ts} +28 -15
- package/commands/{remove.js → remove.ts} +23 -16
- package/commands/{search.js → search.ts} +2 -2
- package/commands/self-update.ts +6 -0
- package/commands/{sources.js → sources.ts} +30 -24
- package/commands/{template.js → template.ts} +2 -2
- package/commands/{test.js → test.ts} +24 -19
- package/commands/{user.js → user.ts} +7 -2
- package/declarations/main/index.js +0 -2
- package/declarations/main/main.did +4 -1
- package/declarations/main/main.did.d.ts +4 -4
- package/declarations/main/main.did.js +20 -20
- package/declarations/storage/index.d.ts +50 -0
- package/declarations/storage/index.js +3 -11
- package/dist/cache.d.ts +5 -0
- package/dist/cache.js +46 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +265 -0
- package/dist/commands/add.d.ts +4 -0
- package/dist/commands/add.js +82 -0
- package/dist/commands/bump.d.ts +1 -0
- package/dist/commands/bump.js +50 -0
- package/dist/commands/docs.d.ts +3 -0
- package/dist/commands/docs.js +78 -0
- package/dist/commands/import-identity.d.ts +1 -0
- package/dist/commands/import-identity.js +47 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +82 -0
- package/dist/commands/install-all.d.ts +4 -0
- package/dist/commands/install-all.js +29 -0
- package/dist/commands/install.d.ts +5 -0
- package/dist/commands/install.js +110 -0
- package/dist/commands/mmf1.d.ts +21 -0
- package/dist/commands/mmf1.js +93 -0
- package/dist/commands/publish.d.ts +3 -0
- package/dist/commands/publish.js +254 -0
- package/dist/commands/remove.d.ts +5 -0
- package/dist/commands/remove.js +83 -0
- package/dist/commands/search.d.ts +1 -0
- package/dist/commands/search.js +36 -0
- package/dist/commands/self-update.d.ts +3 -0
- package/dist/commands/self-update.js +5 -0
- package/dist/commands/sources.d.ts +3 -0
- package/dist/commands/sources.js +124 -0
- package/dist/commands/template.d.ts +1 -0
- package/dist/commands/template.js +28 -0
- package/dist/commands/test.d.ts +4 -0
- package/dist/commands/test.js +201 -0
- package/dist/commands/user.d.ts +2 -0
- package/dist/commands/user.js +23 -0
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/whoami.js +11 -0
- package/dist/declarations/main/index.d.ts +50 -0
- package/dist/declarations/main/index.js +41 -0
- package/dist/declarations/main/main.did +222 -0
- package/dist/declarations/main/main.did.d.ts +198 -0
- package/dist/declarations/main/main.did.js +218 -0
- package/dist/declarations/storage/index.d.ts +50 -0
- package/dist/declarations/storage/index.js +30 -0
- package/dist/declarations/storage/storage.did +46 -0
- package/dist/declarations/storage/storage.did.d.ts +37 -0
- package/dist/declarations/storage/storage.did.js +38 -0
- package/dist/mops.d.ts +33 -0
- package/dist/mops.js +259 -0
- package/dist/package.json +79 -0
- package/dist/parallel.d.ts +1 -0
- package/dist/parallel.js +24 -0
- package/dist/pem.d.ts +5 -0
- package/dist/pem.js +49 -0
- package/dist/templates/mops-test.yml +30 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +1 -0
- package/dist/vessel.d.ts +19 -0
- package/dist/vessel.js +154 -0
- package/global.d.ts +2 -0
- package/{mops.js → mops.ts} +58 -47
- package/package.json +44 -19
- package/{parallel.js → parallel.ts} +2 -2
- package/{pem.js → pem.ts} +12 -11
- package/templates/mops-test.yml +1 -1
- package/tsconfig.json +16 -0
- package/types.ts +29 -0
- package/{vessel.js → vessel.ts} +37 -25
- package/commands/self-update.js +0 -6
- /package/commands/{whoami.js → whoami.ts} +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
type Version = text;
|
|
2
|
+
type Ver = text;
|
|
3
|
+
type User__1 =
|
|
4
|
+
record {
|
|
5
|
+
displayName: text;
|
|
6
|
+
email: text;
|
|
7
|
+
emailVerified: bool;
|
|
8
|
+
github: text;
|
|
9
|
+
githubVerified: bool;
|
|
10
|
+
id: principal;
|
|
11
|
+
name: text;
|
|
12
|
+
site: text;
|
|
13
|
+
twitter: text;
|
|
14
|
+
twitterVerified: bool;
|
|
15
|
+
};
|
|
16
|
+
type User =
|
|
17
|
+
record {
|
|
18
|
+
displayName: text;
|
|
19
|
+
email: text;
|
|
20
|
+
emailVerified: bool;
|
|
21
|
+
github: text;
|
|
22
|
+
githubVerified: bool;
|
|
23
|
+
id: principal;
|
|
24
|
+
name: text;
|
|
25
|
+
site: text;
|
|
26
|
+
twitter: text;
|
|
27
|
+
twitterVerified: bool;
|
|
28
|
+
};
|
|
29
|
+
type Time = int;
|
|
30
|
+
type Text = text;
|
|
31
|
+
type StorageStats =
|
|
32
|
+
record {
|
|
33
|
+
cyclesBalance: nat;
|
|
34
|
+
fileCount: nat;
|
|
35
|
+
memorySize: nat;
|
|
36
|
+
};
|
|
37
|
+
type StorageId = principal;
|
|
38
|
+
type Script =
|
|
39
|
+
record {
|
|
40
|
+
name: text;
|
|
41
|
+
value: text;
|
|
42
|
+
};
|
|
43
|
+
type Result_6 =
|
|
44
|
+
variant {
|
|
45
|
+
err: Err;
|
|
46
|
+
ok: vec FileId;
|
|
47
|
+
};
|
|
48
|
+
type Result_5 =
|
|
49
|
+
variant {
|
|
50
|
+
err: Err;
|
|
51
|
+
ok: Ver;
|
|
52
|
+
};
|
|
53
|
+
type Result_4 =
|
|
54
|
+
variant {
|
|
55
|
+
err: Err;
|
|
56
|
+
ok: PackageDetails;
|
|
57
|
+
};
|
|
58
|
+
type Result_3 =
|
|
59
|
+
variant {
|
|
60
|
+
err: text;
|
|
61
|
+
ok;
|
|
62
|
+
};
|
|
63
|
+
type Result_2 =
|
|
64
|
+
variant {
|
|
65
|
+
err: Err;
|
|
66
|
+
ok: FileId;
|
|
67
|
+
};
|
|
68
|
+
type Result_1 =
|
|
69
|
+
variant {
|
|
70
|
+
err: PublishingErr;
|
|
71
|
+
ok: PublishingId;
|
|
72
|
+
};
|
|
73
|
+
type Result =
|
|
74
|
+
variant {
|
|
75
|
+
err: Err;
|
|
76
|
+
ok;
|
|
77
|
+
};
|
|
78
|
+
type PublishingId = text;
|
|
79
|
+
type PublishingErr = text;
|
|
80
|
+
type PageCount = nat;
|
|
81
|
+
type PackageSummary__1 =
|
|
82
|
+
record {
|
|
83
|
+
config: PackageConfigV2__1;
|
|
84
|
+
downloadsInLast30Days: nat;
|
|
85
|
+
downloadsInLast7Days: nat;
|
|
86
|
+
downloadsTotal: nat;
|
|
87
|
+
owner: principal;
|
|
88
|
+
ownerInfo: User;
|
|
89
|
+
publication: PackagePublication;
|
|
90
|
+
};
|
|
91
|
+
type PackageSummary =
|
|
92
|
+
record {
|
|
93
|
+
config: PackageConfigV2__1;
|
|
94
|
+
downloadsInLast30Days: nat;
|
|
95
|
+
downloadsInLast7Days: nat;
|
|
96
|
+
downloadsTotal: nat;
|
|
97
|
+
owner: principal;
|
|
98
|
+
ownerInfo: User;
|
|
99
|
+
publication: PackagePublication;
|
|
100
|
+
};
|
|
101
|
+
type PackagePublication =
|
|
102
|
+
record {
|
|
103
|
+
storage: principal;
|
|
104
|
+
time: Time;
|
|
105
|
+
user: principal;
|
|
106
|
+
};
|
|
107
|
+
type PackageName__1 = text;
|
|
108
|
+
type PackageName = text;
|
|
109
|
+
type PackageId = text;
|
|
110
|
+
type PackageDetails =
|
|
111
|
+
record {
|
|
112
|
+
config: PackageConfigV2__1;
|
|
113
|
+
dependents: vec PackageSummary__1;
|
|
114
|
+
deps: vec PackageSummary__1;
|
|
115
|
+
devDeps: vec PackageSummary__1;
|
|
116
|
+
downloadTrend: vec DownloadsSnapshot;
|
|
117
|
+
downloadsInLast30Days: nat;
|
|
118
|
+
downloadsInLast7Days: nat;
|
|
119
|
+
downloadsTotal: nat;
|
|
120
|
+
owner: principal;
|
|
121
|
+
ownerInfo: User;
|
|
122
|
+
publication: PackagePublication;
|
|
123
|
+
versionHistory: vec PackageSummary__1;
|
|
124
|
+
};
|
|
125
|
+
type PackageConfigV2__1 =
|
|
126
|
+
record {
|
|
127
|
+
baseDir: text;
|
|
128
|
+
dependencies: vec DependencyV2;
|
|
129
|
+
description: text;
|
|
130
|
+
devDependencies: vec DependencyV2;
|
|
131
|
+
dfx: text;
|
|
132
|
+
documentation: text;
|
|
133
|
+
donation: text;
|
|
134
|
+
homepage: text;
|
|
135
|
+
keywords: vec text;
|
|
136
|
+
license: text;
|
|
137
|
+
moc: text;
|
|
138
|
+
name: PackageName;
|
|
139
|
+
readme: text;
|
|
140
|
+
repository: text;
|
|
141
|
+
scripts: vec Script;
|
|
142
|
+
version: text;
|
|
143
|
+
};
|
|
144
|
+
type PackageConfigV2 =
|
|
145
|
+
record {
|
|
146
|
+
baseDir: text;
|
|
147
|
+
dependencies: vec DependencyV2;
|
|
148
|
+
description: text;
|
|
149
|
+
devDependencies: vec DependencyV2;
|
|
150
|
+
dfx: text;
|
|
151
|
+
documentation: text;
|
|
152
|
+
donation: text;
|
|
153
|
+
homepage: text;
|
|
154
|
+
keywords: vec text;
|
|
155
|
+
license: text;
|
|
156
|
+
moc: text;
|
|
157
|
+
name: PackageName;
|
|
158
|
+
readme: text;
|
|
159
|
+
repository: text;
|
|
160
|
+
scripts: vec Script;
|
|
161
|
+
version: text;
|
|
162
|
+
};
|
|
163
|
+
type FileId = text;
|
|
164
|
+
type Err = text;
|
|
165
|
+
type DownloadsSnapshot__1 =
|
|
166
|
+
record {
|
|
167
|
+
downloads: nat;
|
|
168
|
+
endTime: Time;
|
|
169
|
+
startTime: Time;
|
|
170
|
+
};
|
|
171
|
+
type DownloadsSnapshot =
|
|
172
|
+
record {
|
|
173
|
+
downloads: nat;
|
|
174
|
+
endTime: Time;
|
|
175
|
+
startTime: Time;
|
|
176
|
+
};
|
|
177
|
+
type DependencyV2 =
|
|
178
|
+
record {
|
|
179
|
+
name: PackageName;
|
|
180
|
+
repo: text;
|
|
181
|
+
version: text;
|
|
182
|
+
};
|
|
183
|
+
service : {
|
|
184
|
+
claimAirdrop: (principal) -> (text);
|
|
185
|
+
finishPublish: (PublishingId) -> (Result);
|
|
186
|
+
getAirdropAmount: () -> (nat) query;
|
|
187
|
+
getAirdropAmountAll: () -> (nat) query;
|
|
188
|
+
getApiVersion: () -> (Text) query;
|
|
189
|
+
getDefaultPackages: (text) -> (vec record {
|
|
190
|
+
PackageName__1;
|
|
191
|
+
Version;
|
|
192
|
+
}) query;
|
|
193
|
+
getDownloadTrendByPackageId: (PackageId) ->
|
|
194
|
+
(vec DownloadsSnapshot__1) query;
|
|
195
|
+
getDownloadTrendByPackageName: (PackageName__1) ->
|
|
196
|
+
(vec DownloadsSnapshot__1) query;
|
|
197
|
+
getFileIds: (PackageName__1, Ver) -> (Result_6) query;
|
|
198
|
+
getHighestVersion: (PackageName__1) -> (Result_5) query;
|
|
199
|
+
getMostDownloadedPackages: () -> (vec PackageSummary) query;
|
|
200
|
+
getMostDownloadedPackagesIn7Days: () -> (vec PackageSummary) query;
|
|
201
|
+
getNewPackages: () -> (vec PackageSummary) query;
|
|
202
|
+
getPackageDetails: (PackageName__1, Ver) -> (Result_4) query;
|
|
203
|
+
getPackagesByCategory: () -> (vec record {
|
|
204
|
+
text;
|
|
205
|
+
vec PackageSummary;
|
|
206
|
+
}) query;
|
|
207
|
+
getRecentlyUpdatedPackages: () -> (vec PackageSummary) query;
|
|
208
|
+
getStoragesStats: () -> (vec record {
|
|
209
|
+
StorageId;
|
|
210
|
+
StorageStats;
|
|
211
|
+
}) query;
|
|
212
|
+
getTotalDownloads: () -> (nat) query;
|
|
213
|
+
getTotalPackages: () -> (nat) query;
|
|
214
|
+
getUser: (principal) -> (opt User__1) query;
|
|
215
|
+
notifyInstall: (PackageName__1, Ver) -> () oneway;
|
|
216
|
+
search: (Text, opt nat, opt nat) -> (vec PackageSummary, PageCount) query;
|
|
217
|
+
setUserProp: (text, text) -> (Result_3);
|
|
218
|
+
startFileUpload: (PublishingId, Text, nat, blob) -> (Result_2);
|
|
219
|
+
startPublish: (PackageConfigV2) -> (Result_1);
|
|
220
|
+
takeAirdropSnapshot: () -> () oneway;
|
|
221
|
+
uploadFileChunk: (PublishingId, FileId, nat, blob) -> (Result);
|
|
222
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { Principal } from '@dfinity/principal';
|
|
2
|
+
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
|
|
4
|
+
export interface DependencyV2 {
|
|
5
|
+
'name' : PackageName,
|
|
6
|
+
'repo' : string,
|
|
7
|
+
'version' : string,
|
|
8
|
+
}
|
|
9
|
+
export interface DownloadsSnapshot {
|
|
10
|
+
'startTime' : Time,
|
|
11
|
+
'endTime' : Time,
|
|
12
|
+
'downloads' : bigint,
|
|
13
|
+
}
|
|
14
|
+
export interface DownloadsSnapshot__1 {
|
|
15
|
+
'startTime' : Time,
|
|
16
|
+
'endTime' : Time,
|
|
17
|
+
'downloads' : bigint,
|
|
18
|
+
}
|
|
19
|
+
export type Err = string;
|
|
20
|
+
export type FileId = string;
|
|
21
|
+
export interface PackageConfigV2 {
|
|
22
|
+
'dfx' : string,
|
|
23
|
+
'moc' : string,
|
|
24
|
+
'scripts' : Array<Script>,
|
|
25
|
+
'baseDir' : string,
|
|
26
|
+
'documentation' : string,
|
|
27
|
+
'name' : PackageName,
|
|
28
|
+
'homepage' : string,
|
|
29
|
+
'description' : string,
|
|
30
|
+
'version' : string,
|
|
31
|
+
'keywords' : Array<string>,
|
|
32
|
+
'donation' : string,
|
|
33
|
+
'devDependencies' : Array<DependencyV2>,
|
|
34
|
+
'repository' : string,
|
|
35
|
+
'dependencies' : Array<DependencyV2>,
|
|
36
|
+
'license' : string,
|
|
37
|
+
'readme' : string,
|
|
38
|
+
}
|
|
39
|
+
export interface PackageConfigV2__1 {
|
|
40
|
+
'dfx' : string,
|
|
41
|
+
'moc' : string,
|
|
42
|
+
'scripts' : Array<Script>,
|
|
43
|
+
'baseDir' : string,
|
|
44
|
+
'documentation' : string,
|
|
45
|
+
'name' : PackageName,
|
|
46
|
+
'homepage' : string,
|
|
47
|
+
'description' : string,
|
|
48
|
+
'version' : string,
|
|
49
|
+
'keywords' : Array<string>,
|
|
50
|
+
'donation' : string,
|
|
51
|
+
'devDependencies' : Array<DependencyV2>,
|
|
52
|
+
'repository' : string,
|
|
53
|
+
'dependencies' : Array<DependencyV2>,
|
|
54
|
+
'license' : string,
|
|
55
|
+
'readme' : string,
|
|
56
|
+
}
|
|
57
|
+
export interface PackageDetails {
|
|
58
|
+
'ownerInfo' : User,
|
|
59
|
+
'owner' : Principal,
|
|
60
|
+
'deps' : Array<PackageSummary__1>,
|
|
61
|
+
'downloadsTotal' : bigint,
|
|
62
|
+
'downloadsInLast30Days' : bigint,
|
|
63
|
+
'downloadTrend' : Array<DownloadsSnapshot>,
|
|
64
|
+
'versionHistory' : Array<PackageSummary__1>,
|
|
65
|
+
'dependents' : Array<PackageSummary__1>,
|
|
66
|
+
'devDeps' : Array<PackageSummary__1>,
|
|
67
|
+
'downloadsInLast7Days' : bigint,
|
|
68
|
+
'config' : PackageConfigV2__1,
|
|
69
|
+
'publication' : PackagePublication,
|
|
70
|
+
}
|
|
71
|
+
export type PackageId = string;
|
|
72
|
+
export type PackageName = string;
|
|
73
|
+
export type PackageName__1 = string;
|
|
74
|
+
export interface PackagePublication {
|
|
75
|
+
'storage' : Principal,
|
|
76
|
+
'time' : Time,
|
|
77
|
+
'user' : Principal,
|
|
78
|
+
}
|
|
79
|
+
export interface PackageSummary {
|
|
80
|
+
'ownerInfo' : User,
|
|
81
|
+
'owner' : Principal,
|
|
82
|
+
'downloadsTotal' : bigint,
|
|
83
|
+
'downloadsInLast30Days' : bigint,
|
|
84
|
+
'downloadsInLast7Days' : bigint,
|
|
85
|
+
'config' : PackageConfigV2__1,
|
|
86
|
+
'publication' : PackagePublication,
|
|
87
|
+
}
|
|
88
|
+
export interface PackageSummary__1 {
|
|
89
|
+
'ownerInfo' : User,
|
|
90
|
+
'owner' : Principal,
|
|
91
|
+
'downloadsTotal' : bigint,
|
|
92
|
+
'downloadsInLast30Days' : bigint,
|
|
93
|
+
'downloadsInLast7Days' : bigint,
|
|
94
|
+
'config' : PackageConfigV2__1,
|
|
95
|
+
'publication' : PackagePublication,
|
|
96
|
+
}
|
|
97
|
+
export type PageCount = bigint;
|
|
98
|
+
export type PublishingErr = string;
|
|
99
|
+
export type PublishingId = string;
|
|
100
|
+
export type Result = { 'ok' : null } |
|
|
101
|
+
{ 'err' : Err };
|
|
102
|
+
export type Result_1 = { 'ok' : PublishingId } |
|
|
103
|
+
{ 'err' : PublishingErr };
|
|
104
|
+
export type Result_2 = { 'ok' : FileId } |
|
|
105
|
+
{ 'err' : Err };
|
|
106
|
+
export type Result_3 = { 'ok' : null } |
|
|
107
|
+
{ 'err' : string };
|
|
108
|
+
export type Result_4 = { 'ok' : PackageDetails } |
|
|
109
|
+
{ 'err' : Err };
|
|
110
|
+
export type Result_5 = { 'ok' : Ver } |
|
|
111
|
+
{ 'err' : Err };
|
|
112
|
+
export type Result_6 = { 'ok' : Array<FileId> } |
|
|
113
|
+
{ 'err' : Err };
|
|
114
|
+
export interface Script { 'value' : string, 'name' : string }
|
|
115
|
+
export type StorageId = Principal;
|
|
116
|
+
export interface StorageStats {
|
|
117
|
+
'fileCount' : bigint,
|
|
118
|
+
'cyclesBalance' : bigint,
|
|
119
|
+
'memorySize' : bigint,
|
|
120
|
+
}
|
|
121
|
+
export type Text = string;
|
|
122
|
+
export type Time = bigint;
|
|
123
|
+
export interface User {
|
|
124
|
+
'id' : Principal,
|
|
125
|
+
'emailVerified' : boolean,
|
|
126
|
+
'twitter' : string,
|
|
127
|
+
'displayName' : string,
|
|
128
|
+
'name' : string,
|
|
129
|
+
'site' : string,
|
|
130
|
+
'email' : string,
|
|
131
|
+
'twitterVerified' : boolean,
|
|
132
|
+
'githubVerified' : boolean,
|
|
133
|
+
'github' : string,
|
|
134
|
+
}
|
|
135
|
+
export interface User__1 {
|
|
136
|
+
'id' : Principal,
|
|
137
|
+
'emailVerified' : boolean,
|
|
138
|
+
'twitter' : string,
|
|
139
|
+
'displayName' : string,
|
|
140
|
+
'name' : string,
|
|
141
|
+
'site' : string,
|
|
142
|
+
'email' : string,
|
|
143
|
+
'twitterVerified' : boolean,
|
|
144
|
+
'githubVerified' : boolean,
|
|
145
|
+
'github' : string,
|
|
146
|
+
}
|
|
147
|
+
export type Ver = string;
|
|
148
|
+
export type Version = string;
|
|
149
|
+
export interface _SERVICE {
|
|
150
|
+
'claimAirdrop' : ActorMethod<[Principal], string>,
|
|
151
|
+
'finishPublish' : ActorMethod<[PublishingId], Result>,
|
|
152
|
+
'getAirdropAmount' : ActorMethod<[], bigint>,
|
|
153
|
+
'getAirdropAmountAll' : ActorMethod<[], bigint>,
|
|
154
|
+
'getApiVersion' : ActorMethod<[], Text>,
|
|
155
|
+
'getDefaultPackages' : ActorMethod<
|
|
156
|
+
[string],
|
|
157
|
+
Array<[PackageName__1, Version]>
|
|
158
|
+
>,
|
|
159
|
+
'getDownloadTrendByPackageId' : ActorMethod<
|
|
160
|
+
[PackageId],
|
|
161
|
+
Array<DownloadsSnapshot__1>
|
|
162
|
+
>,
|
|
163
|
+
'getDownloadTrendByPackageName' : ActorMethod<
|
|
164
|
+
[PackageName__1],
|
|
165
|
+
Array<DownloadsSnapshot__1>
|
|
166
|
+
>,
|
|
167
|
+
'getFileIds' : ActorMethod<[PackageName__1, Ver], Result_6>,
|
|
168
|
+
'getHighestVersion' : ActorMethod<[PackageName__1], Result_5>,
|
|
169
|
+
'getMostDownloadedPackages' : ActorMethod<[], Array<PackageSummary>>,
|
|
170
|
+
'getMostDownloadedPackagesIn7Days' : ActorMethod<[], Array<PackageSummary>>,
|
|
171
|
+
'getNewPackages' : ActorMethod<[], Array<PackageSummary>>,
|
|
172
|
+
'getPackageDetails' : ActorMethod<[PackageName__1, Ver], Result_4>,
|
|
173
|
+
'getPackagesByCategory' : ActorMethod<
|
|
174
|
+
[],
|
|
175
|
+
Array<[string, Array<PackageSummary>]>
|
|
176
|
+
>,
|
|
177
|
+
'getRecentlyUpdatedPackages' : ActorMethod<[], Array<PackageSummary>>,
|
|
178
|
+
'getStoragesStats' : ActorMethod<[], Array<[StorageId, StorageStats]>>,
|
|
179
|
+
'getTotalDownloads' : ActorMethod<[], bigint>,
|
|
180
|
+
'getTotalPackages' : ActorMethod<[], bigint>,
|
|
181
|
+
'getUser' : ActorMethod<[Principal], [] | [User__1]>,
|
|
182
|
+
'notifyInstall' : ActorMethod<[PackageName__1, Ver], undefined>,
|
|
183
|
+
'search' : ActorMethod<
|
|
184
|
+
[Text, [] | [bigint], [] | [bigint]],
|
|
185
|
+
[Array<PackageSummary>, PageCount]
|
|
186
|
+
>,
|
|
187
|
+
'setUserProp' : ActorMethod<[string, string], Result_3>,
|
|
188
|
+
'startFileUpload' : ActorMethod<
|
|
189
|
+
[PublishingId, Text, bigint, Uint8Array | number[]],
|
|
190
|
+
Result_2
|
|
191
|
+
>,
|
|
192
|
+
'startPublish' : ActorMethod<[PackageConfigV2], Result_1>,
|
|
193
|
+
'takeAirdropSnapshot' : ActorMethod<[], undefined>,
|
|
194
|
+
'uploadFileChunk' : ActorMethod<
|
|
195
|
+
[PublishingId, FileId, bigint, Uint8Array | number[]],
|
|
196
|
+
Result
|
|
197
|
+
>,
|
|
198
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
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__1 = IDL.Text;
|
|
7
|
+
const Version = 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 Ver = IDL.Text;
|
|
16
|
+
const FileId = IDL.Text;
|
|
17
|
+
const Result_6 = IDL.Variant({ 'ok' : IDL.Vec(FileId), 'err' : Err });
|
|
18
|
+
const Result_5 = IDL.Variant({ 'ok' : Ver, 'err' : Err });
|
|
19
|
+
const User = IDL.Record({
|
|
20
|
+
'id' : IDL.Principal,
|
|
21
|
+
'emailVerified' : IDL.Bool,
|
|
22
|
+
'twitter' : IDL.Text,
|
|
23
|
+
'displayName' : IDL.Text,
|
|
24
|
+
'name' : IDL.Text,
|
|
25
|
+
'site' : IDL.Text,
|
|
26
|
+
'email' : IDL.Text,
|
|
27
|
+
'twitterVerified' : IDL.Bool,
|
|
28
|
+
'githubVerified' : IDL.Bool,
|
|
29
|
+
'github' : IDL.Text,
|
|
30
|
+
});
|
|
31
|
+
const Script = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
32
|
+
const PackageName = IDL.Text;
|
|
33
|
+
const DependencyV2 = IDL.Record({
|
|
34
|
+
'name' : PackageName,
|
|
35
|
+
'repo' : IDL.Text,
|
|
36
|
+
'version' : IDL.Text,
|
|
37
|
+
});
|
|
38
|
+
const PackageConfigV2__1 = IDL.Record({
|
|
39
|
+
'dfx' : IDL.Text,
|
|
40
|
+
'moc' : IDL.Text,
|
|
41
|
+
'scripts' : IDL.Vec(Script),
|
|
42
|
+
'baseDir' : IDL.Text,
|
|
43
|
+
'documentation' : IDL.Text,
|
|
44
|
+
'name' : PackageName,
|
|
45
|
+
'homepage' : IDL.Text,
|
|
46
|
+
'description' : IDL.Text,
|
|
47
|
+
'version' : IDL.Text,
|
|
48
|
+
'keywords' : IDL.Vec(IDL.Text),
|
|
49
|
+
'donation' : IDL.Text,
|
|
50
|
+
'devDependencies' : IDL.Vec(DependencyV2),
|
|
51
|
+
'repository' : IDL.Text,
|
|
52
|
+
'dependencies' : IDL.Vec(DependencyV2),
|
|
53
|
+
'license' : IDL.Text,
|
|
54
|
+
'readme' : IDL.Text,
|
|
55
|
+
});
|
|
56
|
+
const PackagePublication = IDL.Record({
|
|
57
|
+
'storage' : IDL.Principal,
|
|
58
|
+
'time' : Time,
|
|
59
|
+
'user' : IDL.Principal,
|
|
60
|
+
});
|
|
61
|
+
const PackageSummary = IDL.Record({
|
|
62
|
+
'ownerInfo' : User,
|
|
63
|
+
'owner' : IDL.Principal,
|
|
64
|
+
'downloadsTotal' : IDL.Nat,
|
|
65
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
66
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
67
|
+
'config' : PackageConfigV2__1,
|
|
68
|
+
'publication' : PackagePublication,
|
|
69
|
+
});
|
|
70
|
+
const PackageSummary__1 = IDL.Record({
|
|
71
|
+
'ownerInfo' : User,
|
|
72
|
+
'owner' : IDL.Principal,
|
|
73
|
+
'downloadsTotal' : IDL.Nat,
|
|
74
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
75
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
76
|
+
'config' : PackageConfigV2__1,
|
|
77
|
+
'publication' : PackagePublication,
|
|
78
|
+
});
|
|
79
|
+
const DownloadsSnapshot = IDL.Record({
|
|
80
|
+
'startTime' : Time,
|
|
81
|
+
'endTime' : Time,
|
|
82
|
+
'downloads' : IDL.Nat,
|
|
83
|
+
});
|
|
84
|
+
const PackageDetails = IDL.Record({
|
|
85
|
+
'ownerInfo' : User,
|
|
86
|
+
'owner' : IDL.Principal,
|
|
87
|
+
'deps' : IDL.Vec(PackageSummary__1),
|
|
88
|
+
'downloadsTotal' : IDL.Nat,
|
|
89
|
+
'downloadsInLast30Days' : IDL.Nat,
|
|
90
|
+
'downloadTrend' : IDL.Vec(DownloadsSnapshot),
|
|
91
|
+
'versionHistory' : IDL.Vec(PackageSummary__1),
|
|
92
|
+
'dependents' : IDL.Vec(PackageSummary__1),
|
|
93
|
+
'devDeps' : IDL.Vec(PackageSummary__1),
|
|
94
|
+
'downloadsInLast7Days' : IDL.Nat,
|
|
95
|
+
'config' : PackageConfigV2__1,
|
|
96
|
+
'publication' : PackagePublication,
|
|
97
|
+
});
|
|
98
|
+
const Result_4 = IDL.Variant({ 'ok' : PackageDetails, 'err' : Err });
|
|
99
|
+
const StorageId = IDL.Principal;
|
|
100
|
+
const StorageStats = IDL.Record({
|
|
101
|
+
'fileCount' : IDL.Nat,
|
|
102
|
+
'cyclesBalance' : IDL.Nat,
|
|
103
|
+
'memorySize' : IDL.Nat,
|
|
104
|
+
});
|
|
105
|
+
const User__1 = IDL.Record({
|
|
106
|
+
'id' : IDL.Principal,
|
|
107
|
+
'emailVerified' : IDL.Bool,
|
|
108
|
+
'twitter' : IDL.Text,
|
|
109
|
+
'displayName' : IDL.Text,
|
|
110
|
+
'name' : IDL.Text,
|
|
111
|
+
'site' : IDL.Text,
|
|
112
|
+
'email' : IDL.Text,
|
|
113
|
+
'twitterVerified' : IDL.Bool,
|
|
114
|
+
'githubVerified' : IDL.Bool,
|
|
115
|
+
'github' : IDL.Text,
|
|
116
|
+
});
|
|
117
|
+
const PageCount = IDL.Nat;
|
|
118
|
+
const Result_3 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
|
|
119
|
+
const Result_2 = IDL.Variant({ 'ok' : FileId, 'err' : Err });
|
|
120
|
+
const PackageConfigV2 = IDL.Record({
|
|
121
|
+
'dfx' : IDL.Text,
|
|
122
|
+
'moc' : IDL.Text,
|
|
123
|
+
'scripts' : IDL.Vec(Script),
|
|
124
|
+
'baseDir' : IDL.Text,
|
|
125
|
+
'documentation' : IDL.Text,
|
|
126
|
+
'name' : PackageName,
|
|
127
|
+
'homepage' : IDL.Text,
|
|
128
|
+
'description' : IDL.Text,
|
|
129
|
+
'version' : IDL.Text,
|
|
130
|
+
'keywords' : IDL.Vec(IDL.Text),
|
|
131
|
+
'donation' : IDL.Text,
|
|
132
|
+
'devDependencies' : IDL.Vec(DependencyV2),
|
|
133
|
+
'repository' : IDL.Text,
|
|
134
|
+
'dependencies' : IDL.Vec(DependencyV2),
|
|
135
|
+
'license' : IDL.Text,
|
|
136
|
+
'readme' : IDL.Text,
|
|
137
|
+
});
|
|
138
|
+
const PublishingErr = IDL.Text;
|
|
139
|
+
const Result_1 = IDL.Variant({ 'ok' : PublishingId, 'err' : PublishingErr });
|
|
140
|
+
return IDL.Service({
|
|
141
|
+
'claimAirdrop' : IDL.Func([IDL.Principal], [IDL.Text], []),
|
|
142
|
+
'finishPublish' : IDL.Func([PublishingId], [Result], []),
|
|
143
|
+
'getAirdropAmount' : IDL.Func([], [IDL.Nat], ['query']),
|
|
144
|
+
'getAirdropAmountAll' : IDL.Func([], [IDL.Nat], ['query']),
|
|
145
|
+
'getApiVersion' : IDL.Func([], [Text], ['query']),
|
|
146
|
+
'getDefaultPackages' : IDL.Func(
|
|
147
|
+
[IDL.Text],
|
|
148
|
+
[IDL.Vec(IDL.Tuple(PackageName__1, Version))],
|
|
149
|
+
['query'],
|
|
150
|
+
),
|
|
151
|
+
'getDownloadTrendByPackageId' : IDL.Func(
|
|
152
|
+
[PackageId],
|
|
153
|
+
[IDL.Vec(DownloadsSnapshot__1)],
|
|
154
|
+
['query'],
|
|
155
|
+
),
|
|
156
|
+
'getDownloadTrendByPackageName' : IDL.Func(
|
|
157
|
+
[PackageName__1],
|
|
158
|
+
[IDL.Vec(DownloadsSnapshot__1)],
|
|
159
|
+
['query'],
|
|
160
|
+
),
|
|
161
|
+
'getFileIds' : IDL.Func([PackageName__1, Ver], [Result_6], ['query']),
|
|
162
|
+
'getHighestVersion' : IDL.Func([PackageName__1], [Result_5], ['query']),
|
|
163
|
+
'getMostDownloadedPackages' : IDL.Func(
|
|
164
|
+
[],
|
|
165
|
+
[IDL.Vec(PackageSummary)],
|
|
166
|
+
['query'],
|
|
167
|
+
),
|
|
168
|
+
'getMostDownloadedPackagesIn7Days' : IDL.Func(
|
|
169
|
+
[],
|
|
170
|
+
[IDL.Vec(PackageSummary)],
|
|
171
|
+
['query'],
|
|
172
|
+
),
|
|
173
|
+
'getNewPackages' : IDL.Func([], [IDL.Vec(PackageSummary)], ['query']),
|
|
174
|
+
'getPackageDetails' : IDL.Func(
|
|
175
|
+
[PackageName__1, Ver],
|
|
176
|
+
[Result_4],
|
|
177
|
+
['query'],
|
|
178
|
+
),
|
|
179
|
+
'getPackagesByCategory' : IDL.Func(
|
|
180
|
+
[],
|
|
181
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(PackageSummary)))],
|
|
182
|
+
['query'],
|
|
183
|
+
),
|
|
184
|
+
'getRecentlyUpdatedPackages' : IDL.Func(
|
|
185
|
+
[],
|
|
186
|
+
[IDL.Vec(PackageSummary)],
|
|
187
|
+
['query'],
|
|
188
|
+
),
|
|
189
|
+
'getStoragesStats' : IDL.Func(
|
|
190
|
+
[],
|
|
191
|
+
[IDL.Vec(IDL.Tuple(StorageId, StorageStats))],
|
|
192
|
+
['query'],
|
|
193
|
+
),
|
|
194
|
+
'getTotalDownloads' : IDL.Func([], [IDL.Nat], ['query']),
|
|
195
|
+
'getTotalPackages' : IDL.Func([], [IDL.Nat], ['query']),
|
|
196
|
+
'getUser' : IDL.Func([IDL.Principal], [IDL.Opt(User__1)], ['query']),
|
|
197
|
+
'notifyInstall' : IDL.Func([PackageName__1, Ver], [], ['oneway']),
|
|
198
|
+
'search' : IDL.Func(
|
|
199
|
+
[Text, IDL.Opt(IDL.Nat), IDL.Opt(IDL.Nat)],
|
|
200
|
+
[IDL.Vec(PackageSummary), PageCount],
|
|
201
|
+
['query'],
|
|
202
|
+
),
|
|
203
|
+
'setUserProp' : IDL.Func([IDL.Text, IDL.Text], [Result_3], []),
|
|
204
|
+
'startFileUpload' : IDL.Func(
|
|
205
|
+
[PublishingId, Text, IDL.Nat, IDL.Vec(IDL.Nat8)],
|
|
206
|
+
[Result_2],
|
|
207
|
+
[],
|
|
208
|
+
),
|
|
209
|
+
'startPublish' : IDL.Func([PackageConfigV2], [Result_1], []),
|
|
210
|
+
'takeAirdropSnapshot' : IDL.Func([], [], ['oneway']),
|
|
211
|
+
'uploadFileChunk' : IDL.Func(
|
|
212
|
+
[PublishingId, FileId, IDL.Nat, IDL.Vec(IDL.Nat8)],
|
|
213
|
+
[Result],
|
|
214
|
+
[],
|
|
215
|
+
),
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
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>;
|