ic-mops 0.41.0 → 0.42.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/.DS_Store +0 -0
- package/CHANGELOG.md +12 -0
- package/api/actors.ts +2 -3
- package/bundle/bin/mops.js +0 -0
- package/bundle/cli.js +29 -29
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/bench/bench.did.d.ts +1 -1
- package/bundle/declarations/bench/index.js +0 -9
- package/bundle/declarations/main/index.js +1 -2
- package/bundle/declarations/main/main.did +15 -8
- package/bundle/declarations/main/main.did.d.ts +12 -9
- package/bundle/declarations/main/main.did.js +11 -8
- package/bundle/declarations/storage/storage.did.d.ts +3 -0
- package/bundle/package.json +2 -2
- package/bundle-package-json.ts +3 -0
- package/cache.ts +25 -7
- package/check-requirements.ts +50 -0
- package/cli.ts +3 -2
- package/commands/add.ts +13 -7
- package/commands/available-updates.ts +1 -0
- package/commands/bench-replica.ts +1 -0
- package/commands/bench.ts +1 -0
- package/commands/bump.ts +1 -0
- package/commands/docs.ts +1 -0
- package/commands/import-identity.ts +1 -0
- package/commands/init.ts +2 -1
- package/commands/install/install-all.ts +51 -0
- package/commands/install/install-dep.ts +34 -0
- package/commands/install/install-deps.ts +31 -0
- package/commands/install/install-local-dep.ts +31 -0
- package/commands/{install.ts → install/install-mops-dep.ts} +43 -43
- package/commands/install/sync-local-cache.ts +34 -0
- package/commands/publish.ts +18 -3
- package/commands/remove.ts +15 -18
- package/commands/search.ts +1 -0
- package/commands/self.ts +1 -0
- package/commands/sources.ts +1 -0
- package/commands/sync.ts +1 -0
- package/commands/test/test.ts +1 -0
- package/commands/toolchain/index.ts +8 -0
- package/commands/toolchain/moc.ts +1 -0
- package/commands/toolchain/pocket-ic.ts +1 -0
- package/commands/toolchain/toolchain-utils.ts +2 -0
- package/commands/toolchain/wasmtime.ts +1 -0
- package/commands/transfer-ownership.ts +1 -0
- package/commands/user.ts +1 -0
- package/declarations/bench/bench.did.d.ts +1 -1
- package/declarations/bench/index.js +0 -9
- 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/declarations/storage/storage.did.d.ts +3 -0
- package/dist/api/actors.js +2 -2
- package/dist/bin/mops.js +0 -0
- package/dist/bundle-package-json.js +2 -0
- package/dist/cache.d.ts +7 -3
- package/dist/cache.js +21 -7
- package/dist/check-requirements.js +9 -4
- package/dist/cli.js +3 -2
- package/dist/commands/add.js +9 -6
- package/dist/commands/available-updates.js +1 -0
- package/dist/commands/bench-replica.js +1 -0
- package/dist/commands/bench.js +1 -0
- package/dist/commands/bump.js +1 -0
- package/dist/commands/docs.js +1 -0
- package/dist/commands/import-identity.js +1 -0
- package/dist/commands/init.js +2 -1
- package/dist/commands/install/install-all.d.ts +8 -0
- package/dist/commands/install/install-all.js +36 -0
- package/dist/commands/install/install-dep.d.ts +8 -0
- package/dist/commands/install/install-dep.js +25 -0
- package/dist/commands/install/install-deps.d.ts +8 -0
- package/dist/commands/install/install-deps.js +21 -0
- package/dist/commands/install/install-local-dep.d.ts +6 -0
- package/dist/commands/install/install-local-dep.js +23 -0
- package/dist/commands/install/install-mops-dep.d.ts +8 -0
- package/dist/commands/install/install-mops-dep.js +103 -0
- package/dist/commands/install/sync-local-cache.d.ts +3 -0
- package/dist/commands/install/sync-local-cache.js +26 -0
- package/dist/commands/install-all.js +2 -0
- package/dist/commands/publish.js +14 -1
- package/dist/commands/remove.js +15 -18
- package/dist/commands/search.js +1 -0
- package/dist/commands/self.js +1 -0
- package/dist/commands/sources.js +1 -0
- package/dist/commands/sync.js +1 -0
- package/dist/commands/test/test.js +1 -0
- package/dist/commands/toolchain/index.js +6 -0
- package/dist/commands/toolchain/moc.js +1 -0
- package/dist/commands/toolchain/pocket-ic.js +1 -0
- package/dist/commands/toolchain/toolchain-utils.js +2 -0
- package/dist/commands/toolchain/wasmtime.js +1 -0
- package/dist/commands/transfer-ownership.js +1 -0
- package/dist/commands/user.js +1 -0
- package/dist/declarations/bench/bench.did.d.ts +1 -1
- package/dist/declarations/bench/index.js +0 -9
- 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/declarations/storage/storage.did.d.ts +3 -0
- package/dist/fix-dist.d.ts +1 -0
- package/dist/fix-dist.js +9 -0
- package/dist/helpers/get-moc-path.js +1 -0
- package/dist/integrity.js +1 -0
- package/dist/mops.js +11 -3
- package/dist/notify-installs.d.ts +1 -1
- package/dist/notify-installs.js +8 -5
- package/dist/package.json +3 -3
- package/dist/pem.d.ts +1 -0
- package/dist/pem.js +2 -1
- package/dist/resolve-packages.js +11 -9
- package/dist/types.d.ts +4 -0
- package/dist/vessel.js +10 -12
- package/{remove-scripts.ts → fix-dist.ts} +6 -0
- package/helpers/get-moc-path.ts +1 -0
- package/integrity.ts +1 -0
- package/mops.ts +13 -3
- package/notify-installs.ts +9 -5
- package/package.json +7 -7
- package/pem.ts +2 -1
- package/resolve-packages.ts +11 -9
- package/tsconfig.json +1 -0
- package/types.ts +7 -2
- package/vessel.ts +11 -13
- package/commands/install-all.ts +0 -56
- package/commands/install-local.ts +0 -52
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { Buffer } from 'node:buffer';
|
|
5
|
+
import { createLogUpdate } from 'log-update';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { deleteSync } from 'del';
|
|
8
|
+
import { checkConfigFile, formatDir, progressBar, readConfig } from '../../mops.js';
|
|
9
|
+
import { getHighestVersion } from '../../api/getHighestVersion.js';
|
|
10
|
+
import { storageActor } from '../../api/actors.js';
|
|
11
|
+
import { parallel } from '../../parallel.js';
|
|
12
|
+
import { getDepCacheDir, getMopsDepCacheName, isDepCached } from '../../cache.js';
|
|
13
|
+
import { downloadFile, getPackageFilesInfo } from '../../api/downloadPackageFiles.js';
|
|
14
|
+
import { installDeps } from './install-deps.js';
|
|
15
|
+
export async function installMopsDep(pkg, version = '', { verbose, silent, dep, threads } = {}) {
|
|
16
|
+
threads = threads || 12;
|
|
17
|
+
if (!checkConfigFile()) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
let logUpdate = createLogUpdate(process.stdout, { showCursor: true });
|
|
21
|
+
// progress
|
|
22
|
+
let total = Infinity;
|
|
23
|
+
let step = 0;
|
|
24
|
+
let progress = () => {
|
|
25
|
+
step++;
|
|
26
|
+
silent || logUpdate(`${dep ? 'Dependency' : 'Installing'} ${pkg}@${version} ${progressBar(step, total)}`);
|
|
27
|
+
};
|
|
28
|
+
progress();
|
|
29
|
+
if (!version) {
|
|
30
|
+
let versionRes = await getHighestVersion(pkg);
|
|
31
|
+
if ('err' in versionRes) {
|
|
32
|
+
console.log(chalk.red('Error: ') + versionRes.err);
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
version = versionRes.ok;
|
|
36
|
+
}
|
|
37
|
+
let dir = formatDir(pkg, version);
|
|
38
|
+
let cacheName = getMopsDepCacheName(pkg, version);
|
|
39
|
+
let cacheDir = getDepCacheDir(cacheName);
|
|
40
|
+
let alreadyInstalled = false;
|
|
41
|
+
// already installed
|
|
42
|
+
if (fs.existsSync(dir)) {
|
|
43
|
+
silent || logUpdate(`${dep ? 'Dependency' : 'Installing'} ${pkg}@${version} (local cache)`);
|
|
44
|
+
alreadyInstalled = true;
|
|
45
|
+
}
|
|
46
|
+
// copy from cache
|
|
47
|
+
else if (isDepCached(cacheName)) {
|
|
48
|
+
silent || logUpdate(`${dep ? 'Dependency' : 'Installing'} ${pkg}@${version} (global cache)`);
|
|
49
|
+
}
|
|
50
|
+
// download
|
|
51
|
+
else {
|
|
52
|
+
// GitHub Actions fails with "fetch failed" if there are multiple concurrent actions
|
|
53
|
+
if (process.env.GITHUB_ENV) {
|
|
54
|
+
threads = 4;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
let { storageId, fileIds } = await getPackageFilesInfo(pkg, version);
|
|
58
|
+
total = fileIds.length + 2;
|
|
59
|
+
let filesData = new Map;
|
|
60
|
+
let storage = await storageActor(storageId);
|
|
61
|
+
await parallel(threads, fileIds, async (fileId) => {
|
|
62
|
+
let { path, data } = await downloadFile(storage, fileId);
|
|
63
|
+
filesData.set(path, data);
|
|
64
|
+
progress();
|
|
65
|
+
});
|
|
66
|
+
// write files to global cache
|
|
67
|
+
try {
|
|
68
|
+
for (let [filePath, data] of filesData.entries()) {
|
|
69
|
+
fs.mkdirSync(path.join(cacheDir, path.dirname(filePath)), { recursive: true });
|
|
70
|
+
fs.writeFileSync(path.join(cacheDir, filePath), Buffer.from(data));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
console.error(chalk.red('Error: ') + err);
|
|
75
|
+
deleteSync([cacheDir], { force: true });
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
console.error(chalk.red('Error: ') + err);
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
progress();
|
|
84
|
+
}
|
|
85
|
+
if (verbose) {
|
|
86
|
+
silent || logUpdate.done();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
logUpdate.clear();
|
|
90
|
+
}
|
|
91
|
+
// install dependencies
|
|
92
|
+
let config = readConfig(path.join(cacheDir, 'mops.toml'));
|
|
93
|
+
let res = await installDeps(Object.values(config.dependencies || {}), { silent, verbose });
|
|
94
|
+
if (!res) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
let installedDeps = res;
|
|
98
|
+
// add self to installed deps
|
|
99
|
+
if (!alreadyInstalled) {
|
|
100
|
+
installedDeps = { ...installedDeps, [pkg]: version };
|
|
101
|
+
}
|
|
102
|
+
return installedDeps;
|
|
103
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { copyCache, getDepCacheName } from '../../cache.js';
|
|
4
|
+
import { getDependencyType, getRootDir } from '../../mops.js';
|
|
5
|
+
import { resolvePackages } from '../../resolve-packages.js';
|
|
6
|
+
export async function syncLocalCache({ verbose = false } = {}) {
|
|
7
|
+
let resolvedPackages = await resolvePackages();
|
|
8
|
+
let rootDir = getRootDir();
|
|
9
|
+
verbose && console.log('Syncing local cache...');
|
|
10
|
+
let installedDeps = {};
|
|
11
|
+
await Promise.all(Object.entries(resolvedPackages).map(([name, value]) => {
|
|
12
|
+
let depType = getDependencyType(value);
|
|
13
|
+
if (depType === 'mops' || depType === 'github') {
|
|
14
|
+
let cacheName = getDepCacheName(name, value);
|
|
15
|
+
let dest = path.join(rootDir, '.mops', cacheName);
|
|
16
|
+
if (!fs.existsSync(dest)) {
|
|
17
|
+
if (depType === 'mops') {
|
|
18
|
+
installedDeps[name] = value;
|
|
19
|
+
}
|
|
20
|
+
return copyCache(cacheName, path.join(rootDir, '.mops', cacheName));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return Promise.resolve();
|
|
24
|
+
}));
|
|
25
|
+
return installedDeps;
|
|
26
|
+
}
|
|
@@ -7,6 +7,7 @@ import { installFromGithub } from '../vessel.js';
|
|
|
7
7
|
import { notifyInstalls } from '../notify-installs.js';
|
|
8
8
|
import { checkIntegrity } from '../integrity.js';
|
|
9
9
|
import { installLocal } from './install-local.js';
|
|
10
|
+
import { checkRequirements } from '../check-requirements.js';
|
|
10
11
|
export async function installAll({ verbose = false, silent = false, lock } = {}) {
|
|
11
12
|
if (!checkConfigFile()) {
|
|
12
13
|
return;
|
|
@@ -38,6 +39,7 @@ export async function installAll({ verbose = false, silent = false, lock } = {})
|
|
|
38
39
|
]);
|
|
39
40
|
if (!silent) {
|
|
40
41
|
logUpdate.clear();
|
|
42
|
+
await checkRequirements();
|
|
41
43
|
console.log(chalk.green('Packages installed'));
|
|
42
44
|
}
|
|
43
45
|
}
|
package/dist/commands/publish.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
1
2
|
import fs from 'node:fs';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import chalk from 'chalk';
|
|
@@ -22,7 +23,7 @@ export async function publish(options = {}) {
|
|
|
22
23
|
console.log(`Publishing ${config.package?.name}@${config.package?.version}`);
|
|
23
24
|
// validate
|
|
24
25
|
for (let key of Object.keys(config)) {
|
|
25
|
-
if (!['package', 'dependencies', 'dev-dependencies', 'toolchain'].includes(key)) {
|
|
26
|
+
if (!['package', 'dependencies', 'dev-dependencies', 'toolchain', 'requirements'].includes(key)) {
|
|
26
27
|
console.log(chalk.red('Error: ') + `Unknown config section [${key}]`);
|
|
27
28
|
process.exit(1);
|
|
28
29
|
}
|
|
@@ -141,6 +142,14 @@ export async function publish(options = {}) {
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
}
|
|
145
|
+
if (config.requirements) {
|
|
146
|
+
Object.keys(config.requirements).forEach((name) => {
|
|
147
|
+
if (name !== 'moc') {
|
|
148
|
+
console.log(chalk.red('Error: ') + `Unknown requirement "${name}"`);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
144
153
|
let toBackendDep = (dep) => {
|
|
145
154
|
return {
|
|
146
155
|
...dep,
|
|
@@ -148,6 +157,9 @@ export async function publish(options = {}) {
|
|
|
148
157
|
repo: dep.repo || '',
|
|
149
158
|
};
|
|
150
159
|
};
|
|
160
|
+
let toBackendReq = ([name, value]) => {
|
|
161
|
+
return { name, value };
|
|
162
|
+
};
|
|
151
163
|
// map fields
|
|
152
164
|
let backendPkgConfig = {
|
|
153
165
|
name: config.package.name,
|
|
@@ -166,6 +178,7 @@ export async function publish(options = {}) {
|
|
|
166
178
|
dependencies: Object.values(config.dependencies || {}).map(toBackendDep),
|
|
167
179
|
devDependencies: Object.values(config['dev-dependencies'] || {}).map(toBackendDep),
|
|
168
180
|
scripts: [],
|
|
181
|
+
requirements: [Object.entries(config.requirements || {}).map((req) => toBackendReq(req))],
|
|
169
182
|
};
|
|
170
183
|
let defaultFiles = [
|
|
171
184
|
'mops.toml',
|
package/dist/commands/remove.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import { deleteSync } from 'del';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import {
|
|
4
|
+
import { checkConfigFile, getRootDir, readConfig, writeConfig } from '../mops.js';
|
|
5
5
|
import { checkIntegrity } from '../integrity.js';
|
|
6
|
-
|
|
6
|
+
import { getDepCacheDir, getDepCacheName } from '../cache.js';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { syncLocalCache } from './install/sync-local-cache.js';
|
|
7
9
|
export async function remove(name, { dev = false, verbose = false, dryRun = false, lock } = {}) {
|
|
8
10
|
if (!checkConfigFile()) {
|
|
9
11
|
return;
|
|
@@ -20,13 +22,12 @@ export async function remove(name, { dev = false, verbose = false, dryRun = fals
|
|
|
20
22
|
}).flat();
|
|
21
23
|
}
|
|
22
24
|
function getTransitiveDependenciesOf(name, version, repo) {
|
|
23
|
-
let
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
else if (version) {
|
|
28
|
-
pkgDir = formatDir(name, version);
|
|
25
|
+
let value = version || repo;
|
|
26
|
+
if (!value) {
|
|
27
|
+
return [];
|
|
29
28
|
}
|
|
29
|
+
let cacheName = getDepCacheName(name, value);
|
|
30
|
+
let pkgDir = getDepCacheDir(cacheName);
|
|
30
31
|
let configFile = pkgDir + '/mops.toml';
|
|
31
32
|
if (!fs.existsSync(configFile)) {
|
|
32
33
|
verbose && console.log('no config', configFile);
|
|
@@ -61,16 +62,11 @@ export async function remove(name, { dev = false, verbose = false, dryRun = fals
|
|
|
61
62
|
verbose && console.log(`Ignored transitive dependency ${depId} (other deps depend on it)`);
|
|
62
63
|
continue;
|
|
63
64
|
}
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
pkgDir = formatDir(dep.name, dep.version);
|
|
70
|
-
}
|
|
71
|
-
if (pkgDir && fs.existsSync(pkgDir)) {
|
|
72
|
-
dryRun || deleteSync([`${pkgDir}`], { force: true });
|
|
73
|
-
verbose && console.log(`Removed local cache ${pkgDir}`);
|
|
65
|
+
let cacheName = getDepCacheName(dep.name, dep.version || dep.repo || '');
|
|
66
|
+
let localCacheDir = path.join(getRootDir(), '.mops', cacheName);
|
|
67
|
+
if (localCacheDir && fs.existsSync(localCacheDir)) {
|
|
68
|
+
dryRun || deleteSync([localCacheDir], { force: true });
|
|
69
|
+
verbose && console.log(`Removed local cache ${localCacheDir}`);
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
// remove from config
|
|
@@ -81,6 +77,7 @@ export async function remove(name, { dev = false, verbose = false, dryRun = fals
|
|
|
81
77
|
delete config['dev-dependencies'][name];
|
|
82
78
|
}
|
|
83
79
|
dryRun || writeConfig(config);
|
|
80
|
+
await syncLocalCache();
|
|
84
81
|
await checkIntegrity(lock);
|
|
85
82
|
console.log(chalk.green('Package removed ') + `${name} = "${version}"`);
|
|
86
83
|
}
|
package/dist/commands/search.js
CHANGED
package/dist/commands/self.js
CHANGED
package/dist/commands/sources.js
CHANGED
package/dist/commands/sync.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import fs from 'node:fs';
|
|
3
4
|
import os from 'node:os';
|
|
@@ -6,6 +7,7 @@ import chalk from 'chalk';
|
|
|
6
7
|
import prompts from 'prompts';
|
|
7
8
|
import { createLogUpdate } from 'log-update';
|
|
8
9
|
import { checkConfigFile, getClosestConfigFile, getRootDir, globalCacheDir, readConfig, writeConfig } from '../../mops.js';
|
|
10
|
+
import { checkRequirements } from '../../check-requirements.js';
|
|
9
11
|
import * as moc from './moc.js';
|
|
10
12
|
import * as pocketIc from './pocket-ic.js';
|
|
11
13
|
import * as wasmtime from './wasmtime.js';
|
|
@@ -204,6 +206,7 @@ async function use(tool, version) {
|
|
|
204
206
|
let oldVersion = config.toolchain[tool];
|
|
205
207
|
config.toolchain[tool] = version;
|
|
206
208
|
writeConfig(config);
|
|
209
|
+
await checkRequirements();
|
|
207
210
|
if (oldVersion === version) {
|
|
208
211
|
console.log((`${tool} ${version} is already installed`));
|
|
209
212
|
}
|
|
@@ -230,6 +233,9 @@ async function update(tool) {
|
|
|
230
233
|
let oldVersion = config.toolchain[tool];
|
|
231
234
|
config.toolchain[tool] = version;
|
|
232
235
|
writeConfig(config);
|
|
236
|
+
if (tool === 'moc') {
|
|
237
|
+
await checkRequirements();
|
|
238
|
+
}
|
|
233
239
|
if (oldVersion === version) {
|
|
234
240
|
console.log((`Latest ${tool} ${version} is already installed`));
|
|
235
241
|
}
|
package/dist/commands/user.js
CHANGED
|
@@ -26,4 +26,4 @@ export interface anon_class_10_1 {
|
|
|
26
26
|
}
|
|
27
27
|
export interface _SERVICE extends anon_class_10_1 {}
|
|
28
28
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
29
|
-
export declare const init: (
|
|
29
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -4,15 +4,6 @@ import { Actor, HttpAgent } from "@dfinity/agent";
|
|
|
4
4
|
import { idlFactory } from "./bench.did.js";
|
|
5
5
|
export { idlFactory } from "./bench.did.js";
|
|
6
6
|
|
|
7
|
-
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
-
* Note: canister environment variable will be standardized as
|
|
9
|
-
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
-
* beginning in dfx 0.15.0
|
|
11
|
-
*/
|
|
12
|
-
export const canisterId =
|
|
13
|
-
process.env.CANISTER_ID_BENCH ||
|
|
14
|
-
process.env.BENCH_CANISTER_ID;
|
|
15
|
-
|
|
16
7
|
export const createActor = (canisterId, options = {}) => {
|
|
17
8
|
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
|
|
18
9
|
|
|
@@ -10,8 +10,7 @@ export { idlFactory } from "./main.did.js";
|
|
|
10
10
|
* beginning in dfx 0.15.0
|
|
11
11
|
*/
|
|
12
12
|
export const canisterId =
|
|
13
|
-
process.env.CANISTER_ID_MAIN
|
|
14
|
-
process.env.MAIN_CANISTER_ID;
|
|
13
|
+
process.env.CANISTER_ID_MAIN;
|
|
15
14
|
|
|
16
15
|
export const createActor = (canisterId, options = {}) => {
|
|
17
16
|
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
|
|
@@ -132,6 +132,11 @@ type Response =
|
|
|
132
132
|
streaming_strategy: opt StreamingStrategy;
|
|
133
133
|
upgrade: opt bool;
|
|
134
134
|
};
|
|
135
|
+
type Requirement =
|
|
136
|
+
record {
|
|
137
|
+
name: text;
|
|
138
|
+
value: text;
|
|
139
|
+
};
|
|
135
140
|
type Request =
|
|
136
141
|
record {
|
|
137
142
|
body: blob;
|
|
@@ -145,7 +150,7 @@ type PageCount = nat;
|
|
|
145
150
|
type PackageVersion = text;
|
|
146
151
|
type PackageSummary__1 =
|
|
147
152
|
record {
|
|
148
|
-
config:
|
|
153
|
+
config: PackageConfigV3;
|
|
149
154
|
downloadsInLast30Days: nat;
|
|
150
155
|
downloadsInLast7Days: nat;
|
|
151
156
|
downloadsTotal: nat;
|
|
@@ -157,7 +162,7 @@ type PackageSummary__1 =
|
|
|
157
162
|
type PackageSummaryWithChanges__1 =
|
|
158
163
|
record {
|
|
159
164
|
changes: PackageChanges;
|
|
160
|
-
config:
|
|
165
|
+
config: PackageConfigV3;
|
|
161
166
|
downloadsInLast30Days: nat;
|
|
162
167
|
downloadsInLast7Days: nat;
|
|
163
168
|
downloadsTotal: nat;
|
|
@@ -169,7 +174,7 @@ type PackageSummaryWithChanges__1 =
|
|
|
169
174
|
type PackageSummaryWithChanges =
|
|
170
175
|
record {
|
|
171
176
|
changes: PackageChanges;
|
|
172
|
-
config:
|
|
177
|
+
config: PackageConfigV3;
|
|
173
178
|
downloadsInLast30Days: nat;
|
|
174
179
|
downloadsInLast7Days: nat;
|
|
175
180
|
downloadsTotal: nat;
|
|
@@ -180,7 +185,7 @@ type PackageSummaryWithChanges =
|
|
|
180
185
|
};
|
|
181
186
|
type PackageSummary =
|
|
182
187
|
record {
|
|
183
|
-
config:
|
|
188
|
+
config: PackageConfigV3;
|
|
184
189
|
downloadsInLast30Days: nat;
|
|
185
190
|
downloadsInLast7Days: nat;
|
|
186
191
|
downloadsTotal: nat;
|
|
@@ -218,7 +223,7 @@ type PackageDetails =
|
|
|
218
223
|
record {
|
|
219
224
|
benchmarks: Benchmarks__1;
|
|
220
225
|
changes: PackageChanges;
|
|
221
|
-
config:
|
|
226
|
+
config: PackageConfigV3;
|
|
222
227
|
dependents: vec PackageSummary__1;
|
|
223
228
|
deps: vec PackageSummary__1;
|
|
224
229
|
devDeps: vec PackageSummary__1;
|
|
@@ -234,7 +239,7 @@ type PackageDetails =
|
|
|
234
239
|
testStats: TestStats__1;
|
|
235
240
|
versionHistory: vec PackageSummaryWithChanges__1;
|
|
236
241
|
};
|
|
237
|
-
type
|
|
242
|
+
type PackageConfigV3_Publishing =
|
|
238
243
|
record {
|
|
239
244
|
baseDir: text;
|
|
240
245
|
dependencies: vec DependencyV2;
|
|
@@ -250,10 +255,11 @@ type PackageConfigV2__1 =
|
|
|
250
255
|
name: PackageName__1;
|
|
251
256
|
readme: text;
|
|
252
257
|
repository: text;
|
|
258
|
+
requirements: opt vec Requirement;
|
|
253
259
|
scripts: vec Script;
|
|
254
260
|
version: text;
|
|
255
261
|
};
|
|
256
|
-
type
|
|
262
|
+
type PackageConfigV3 =
|
|
257
263
|
record {
|
|
258
264
|
baseDir: text;
|
|
259
265
|
dependencies: vec DependencyV2;
|
|
@@ -269,6 +275,7 @@ type PackageConfigV2 =
|
|
|
269
275
|
name: PackageName__1;
|
|
270
276
|
readme: text;
|
|
271
277
|
repository: text;
|
|
278
|
+
requirements: vec Requirement;
|
|
272
279
|
scripts: vec Script;
|
|
273
280
|
version: text;
|
|
274
281
|
};
|
|
@@ -341,7 +348,7 @@ type Main =
|
|
|
341
348
|
search: (Text, opt nat, opt nat) -> (vec PackageSummary, PageCount) query;
|
|
342
349
|
setUserProp: (text, text) -> (Result_1);
|
|
343
350
|
startFileUpload: (PublishingId, Text, nat, blob) -> (Result_3);
|
|
344
|
-
startPublish: (
|
|
351
|
+
startPublish: (PackageConfigV3_Publishing) -> (Result_2);
|
|
345
352
|
transferOwnership: (PackageName, principal) -> (Result_1);
|
|
346
353
|
transformRequest: (HttpTransformArg) -> (HttpResponse) query;
|
|
347
354
|
uploadBenchmarks: (PublishingId, Benchmarks) -> (Result);
|
|
@@ -117,7 +117,7 @@ export interface Main {
|
|
|
117
117
|
[PublishingId, Text, bigint, Uint8Array | number[]],
|
|
118
118
|
Result_3
|
|
119
119
|
>,
|
|
120
|
-
'startPublish' : ActorMethod<[
|
|
120
|
+
'startPublish' : ActorMethod<[PackageConfigV3_Publishing], Result_2>,
|
|
121
121
|
'transferOwnership' : ActorMethod<[PackageName, Principal], Result_1>,
|
|
122
122
|
'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>,
|
|
123
123
|
'uploadBenchmarks' : ActorMethod<[PublishingId, Benchmarks], Result>,
|
|
@@ -136,7 +136,7 @@ export interface PackageChanges {
|
|
|
136
136
|
'notes' : string,
|
|
137
137
|
'devDeps' : Array<DepChange>,
|
|
138
138
|
}
|
|
139
|
-
export interface
|
|
139
|
+
export interface PackageConfigV3 {
|
|
140
140
|
'dfx' : string,
|
|
141
141
|
'moc' : string,
|
|
142
142
|
'scripts' : Array<Script>,
|
|
@@ -151,10 +151,11 @@ export interface PackageConfigV2 {
|
|
|
151
151
|
'devDependencies' : Array<DependencyV2>,
|
|
152
152
|
'repository' : string,
|
|
153
153
|
'dependencies' : Array<DependencyV2>,
|
|
154
|
+
'requirements' : Array<Requirement>,
|
|
154
155
|
'license' : string,
|
|
155
156
|
'readme' : string,
|
|
156
157
|
}
|
|
157
|
-
export interface
|
|
158
|
+
export interface PackageConfigV3_Publishing {
|
|
158
159
|
'dfx' : string,
|
|
159
160
|
'moc' : string,
|
|
160
161
|
'scripts' : Array<Script>,
|
|
@@ -169,6 +170,7 @@ export interface PackageConfigV2__1 {
|
|
|
169
170
|
'devDependencies' : Array<DependencyV2>,
|
|
170
171
|
'repository' : string,
|
|
171
172
|
'dependencies' : Array<DependencyV2>,
|
|
173
|
+
'requirements' : [] | [Array<Requirement>],
|
|
172
174
|
'license' : string,
|
|
173
175
|
'readme' : string,
|
|
174
176
|
}
|
|
@@ -187,7 +189,7 @@ export interface PackageDetails {
|
|
|
187
189
|
'dependents' : Array<PackageSummary__1>,
|
|
188
190
|
'devDeps' : Array<PackageSummary__1>,
|
|
189
191
|
'downloadsInLast7Days' : bigint,
|
|
190
|
-
'config' :
|
|
192
|
+
'config' : PackageConfigV3,
|
|
191
193
|
'changes' : PackageChanges,
|
|
192
194
|
'publication' : PackagePublication,
|
|
193
195
|
}
|
|
@@ -220,7 +222,7 @@ export interface PackageSummary {
|
|
|
220
222
|
'downloadsTotal' : bigint,
|
|
221
223
|
'downloadsInLast30Days' : bigint,
|
|
222
224
|
'downloadsInLast7Days' : bigint,
|
|
223
|
-
'config' :
|
|
225
|
+
'config' : PackageConfigV3,
|
|
224
226
|
'publication' : PackagePublication,
|
|
225
227
|
}
|
|
226
228
|
export interface PackageSummaryWithChanges {
|
|
@@ -230,7 +232,7 @@ export interface PackageSummaryWithChanges {
|
|
|
230
232
|
'downloadsTotal' : bigint,
|
|
231
233
|
'downloadsInLast30Days' : bigint,
|
|
232
234
|
'downloadsInLast7Days' : bigint,
|
|
233
|
-
'config' :
|
|
235
|
+
'config' : PackageConfigV3,
|
|
234
236
|
'changes' : PackageChanges,
|
|
235
237
|
'publication' : PackagePublication,
|
|
236
238
|
}
|
|
@@ -241,7 +243,7 @@ export interface PackageSummaryWithChanges__1 {
|
|
|
241
243
|
'downloadsTotal' : bigint,
|
|
242
244
|
'downloadsInLast30Days' : bigint,
|
|
243
245
|
'downloadsInLast7Days' : bigint,
|
|
244
|
-
'config' :
|
|
246
|
+
'config' : PackageConfigV3,
|
|
245
247
|
'changes' : PackageChanges,
|
|
246
248
|
'publication' : PackagePublication,
|
|
247
249
|
}
|
|
@@ -252,7 +254,7 @@ export interface PackageSummary__1 {
|
|
|
252
254
|
'downloadsTotal' : bigint,
|
|
253
255
|
'downloadsInLast30Days' : bigint,
|
|
254
256
|
'downloadsInLast7Days' : bigint,
|
|
255
|
-
'config' :
|
|
257
|
+
'config' : PackageConfigV3,
|
|
256
258
|
'publication' : PackagePublication,
|
|
257
259
|
}
|
|
258
260
|
export type PackageVersion = string;
|
|
@@ -265,6 +267,7 @@ export interface Request {
|
|
|
265
267
|
'headers' : Array<Header>,
|
|
266
268
|
'certificate_version' : [] | [number],
|
|
267
269
|
}
|
|
270
|
+
export interface Requirement { 'value' : string, 'name' : string }
|
|
268
271
|
export interface Response {
|
|
269
272
|
'body' : Uint8Array | number[],
|
|
270
273
|
'headers' : Array<Header>,
|
|
@@ -349,4 +352,4 @@ export interface User__1 {
|
|
|
349
352
|
}
|
|
350
353
|
export interface _SERVICE extends Main {}
|
|
351
354
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
352
|
-
export declare const init: (
|
|
355
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|