@aiot-nexus/plugin-sdk 1.0.1 → 1.1.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/README.md +33 -5
- package/dev-host/host.html +82 -15
- package/dev-host/main.js +98 -8
- package/dist/dev-host-metadata.json +3 -0
- package/dist/src/cli/run.d.ts +1 -1
- package/dist/src/cli/run.js +197 -3
- package/dist/src/cli.js +10 -1
- package/dist/src/dev.d.ts +21 -9
- package/dist/src/dev.js +100 -19
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/nexus-dev-control.d.ts +42 -0
- package/dist/src/nexus-dev-control.js +401 -0
- package/dist/src/nexus-dev-deployment.d.ts +9 -0
- package/dist/src/nexus-dev-deployment.js +195 -0
- package/dist/src/nexus-dev.d.ts +21 -0
- package/dist/src/nexus-dev.js +569 -0
- package/dist/src/scaffold.js +3 -0
- package/dist/src/validation.d.ts +4 -1
- package/dist/src/validation.js +8 -6
- package/dist/src/web-dev.d.ts +11 -0
- package/dist/src/web-dev.js +379 -0
- package/package.json +6 -3
- package/templates/minimal/README.md.tmpl +8 -2
- package/templates/minimal/scripts/build.js.tmpl +21 -4
- package/templates/minimal/src/renderer/app.ts.tmpl +37 -4
- package/templates/minimal/src/renderer/index.html +2 -2
- package/templates/minimal/src/renderer/plugin.css +34 -27
- package/templates/sqlite/README.md.tmpl +8 -2
- package/templates/sqlite/scripts/build.js.tmpl +28 -7
- package/templates/sqlite/src/renderer/app.ts.tmpl +37 -4
- package/templates/sqlite/src/renderer/index.html +2 -2
- package/templates/sqlite/src/renderer/plugin.css +52 -38
package/dist/src/cli.js
CHANGED
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const run_1 = require("./cli/run");
|
|
5
|
-
|
|
5
|
+
const result = (0, run_1.runCli)(process.argv.slice(2), {
|
|
6
6
|
cwd: () => process.cwd(),
|
|
7
7
|
stdout: (message) => process.stdout.write(message + "\n"),
|
|
8
8
|
stderr: (message) => process.stderr.write(message + "\n")
|
|
9
9
|
});
|
|
10
|
+
if (typeof result === "number") {
|
|
11
|
+
process.exitCode = result;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
result.then((exitCode) => { process.exitCode = exitCode; }, (error) => {
|
|
15
|
+
process.stderr.write("nexus-plugin failed: " + (error instanceof Error ? error.message : String(error)) + "\n");
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
});
|
|
18
|
+
}
|
package/dist/src/dev.d.ts
CHANGED
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
import type { PluginManifest, PluginRendererSurface, ThemeMode } from "./types";
|
|
2
2
|
export type PluginMainInspectorMode = "inspect" | "inspect-brk";
|
|
3
|
-
export interface
|
|
3
|
+
export interface PluginDebugSelection {
|
|
4
4
|
projectDirectory: string;
|
|
5
|
-
build: boolean;
|
|
6
|
-
openDevTools: boolean;
|
|
7
|
-
inspectorMode?: PluginMainInspectorMode;
|
|
8
|
-
inspectorPort?: number;
|
|
9
5
|
language?: string;
|
|
10
6
|
themeMode?: ThemeMode;
|
|
11
7
|
surface?: PluginRendererSurface;
|
|
12
8
|
contributionId?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PluginDevOptions extends PluginDebugSelection {
|
|
11
|
+
build: boolean;
|
|
12
|
+
openDevTools: boolean;
|
|
13
|
+
hostVersion?: string;
|
|
14
|
+
inspectorMode?: PluginMainInspectorMode;
|
|
15
|
+
inspectorPort?: number;
|
|
13
16
|
smoke?: boolean;
|
|
14
17
|
}
|
|
15
18
|
export interface PluginDevIo {
|
|
16
19
|
stdout(message: string): void;
|
|
17
20
|
stderr(message: string): void;
|
|
18
21
|
}
|
|
19
|
-
export interface
|
|
22
|
+
export interface PluginDebugTarget {
|
|
20
23
|
projectDirectory: string;
|
|
21
24
|
packageDirectory: string;
|
|
22
25
|
pluginId: string;
|
|
23
|
-
manifest: PluginManifest
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
manifest: PluginManifest & {
|
|
27
|
+
rendererEntry: string;
|
|
28
|
+
};
|
|
26
29
|
surface: PluginRendererSurface;
|
|
27
30
|
contributionId: string;
|
|
28
31
|
language: string;
|
|
29
32
|
themeMode: ThemeMode;
|
|
30
33
|
}
|
|
34
|
+
export interface PluginDevTarget extends PluginDebugTarget {
|
|
35
|
+
electronExecutable: string;
|
|
36
|
+
devHostMainPath: string;
|
|
37
|
+
hostVersion: string;
|
|
38
|
+
}
|
|
31
39
|
export declare class PluginDevError extends Error {
|
|
32
40
|
readonly exitCode: 1;
|
|
33
41
|
constructor(message: string);
|
|
34
42
|
}
|
|
35
43
|
export declare function runPluginDev(options: PluginDevOptions, io: PluginDevIo): number;
|
|
36
44
|
export declare function preparePluginDev(options: PluginDevOptions): PluginDevTarget;
|
|
45
|
+
export declare function preparePluginDebugTarget(options: PluginDebugSelection): PluginDebugTarget;
|
|
46
|
+
export declare function preparePluginBrowserDebugTarget(options: PluginDebugSelection, packageKind?: "auto" | "web" | "package"): PluginDebugTarget;
|
|
47
|
+
export declare function buildPluginForDevelopment(projectDirectory: string): void;
|
|
48
|
+
export declare function buildPluginRendererForDevelopment(projectDirectory: string): "web" | "package";
|
package/dist/src/dev.js
CHANGED
|
@@ -23,11 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.preparePluginDev = exports.runPluginDev = exports.PluginDevError = void 0;
|
|
26
|
+
exports.buildPluginRendererForDevelopment = exports.buildPluginForDevelopment = exports.preparePluginBrowserDebugTarget = exports.preparePluginDebugTarget = exports.preparePluginDev = exports.runPluginDev = exports.PluginDevError = void 0;
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
28
|
const fs = __importStar(require("fs"));
|
|
29
29
|
const module_1 = require("module");
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
|
+
const plugin_framework_version_1 = require("../.generated/plugin-framework-version");
|
|
31
32
|
const validation_1 = require("./validation");
|
|
32
33
|
class PluginDevError extends Error {
|
|
33
34
|
constructor(message) {
|
|
@@ -43,12 +44,13 @@ function runPluginDev(options, io) {
|
|
|
43
44
|
assertPluginProject(projectDirectory);
|
|
44
45
|
if (options.build) {
|
|
45
46
|
io.stdout("Building plugin with development source maps: " + projectDirectory);
|
|
46
|
-
|
|
47
|
+
buildPluginForDevelopment(projectDirectory);
|
|
47
48
|
}
|
|
48
49
|
const target = preparePluginDev({ ...options, projectDirectory });
|
|
49
50
|
io.stdout("Starting plugin dev host: " + target.pluginId
|
|
50
51
|
+ "\nPlugin package: " + target.packageDirectory
|
|
51
|
-
+ "\nContribution: " + target.surface + ":" + target.contributionId
|
|
52
|
+
+ "\nContribution: " + target.surface + ":" + target.contributionId
|
|
53
|
+
+ "\nSimulated Nexus application version: " + target.hostVersion);
|
|
52
54
|
if (options.inspectorMode) {
|
|
53
55
|
io.stdout("Main process debugger: " + options.inspectorMode
|
|
54
56
|
+ " on 127.0.0.1:" + String(options.inspectorPort || 9229));
|
|
@@ -57,7 +59,7 @@ function runPluginDev(options, io) {
|
|
|
57
59
|
if (options.inspectorMode) {
|
|
58
60
|
electronArgs.push("--" + options.inspectorMode + "=" + String(options.inspectorPort || 9229));
|
|
59
61
|
}
|
|
60
|
-
electronArgs.push(target.devHostMainPath, "--plugin-package=" + target.packageDirectory, "--project-directory=" + target.projectDirectory, "--surface=" + target.surface, "--contribution-id=" + target.contributionId, "--language=" + target.language, "--theme=" + target.themeMode);
|
|
62
|
+
electronArgs.push(target.devHostMainPath, "--plugin-package=" + target.packageDirectory, "--project-directory=" + target.projectDirectory, "--surface=" + target.surface, "--contribution-id=" + target.contributionId, "--language=" + target.language, "--theme=" + target.themeMode, "--host-version=" + target.hostVersion);
|
|
61
63
|
if (!options.openDevTools) {
|
|
62
64
|
electronArgs.push("--no-devtools");
|
|
63
65
|
}
|
|
@@ -79,39 +81,76 @@ function runPluginDev(options, io) {
|
|
|
79
81
|
}
|
|
80
82
|
exports.runPluginDev = runPluginDev;
|
|
81
83
|
function preparePluginDev(options) {
|
|
84
|
+
const target = preparePluginDebugTarget(options);
|
|
85
|
+
const hostVersion = normalizeHostVersion(options.hostVersion || readDefaultHostVersion());
|
|
86
|
+
const hostVersionComparison = (0, plugin_framework_version_1.comparePluginVersions)(target.manifest.minHostVersion, hostVersion);
|
|
87
|
+
if (hostVersionComparison === undefined) {
|
|
88
|
+
throw new PluginDevError("Plugin or simulated Nexus application version is invalid.");
|
|
89
|
+
}
|
|
90
|
+
if (hostVersionComparison > 0) {
|
|
91
|
+
throw new PluginDevError("Plugin requires Nexus " + target.manifest.minHostVersion
|
|
92
|
+
+ " or newer; simulated host version is " + hostVersion + ".");
|
|
93
|
+
}
|
|
94
|
+
const electronExecutable = resolveElectronExecutable(target.projectDirectory);
|
|
95
|
+
const devHostMainPath = path.join(resolvePackageRoot(), "dev-host", "main.js");
|
|
96
|
+
if (!fs.existsSync(devHostMainPath) || !fs.statSync(devHostMainPath).isFile()) {
|
|
97
|
+
throw new PluginDevError("Plugin SDK dev host is missing: " + devHostMainPath);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
...target,
|
|
101
|
+
electronExecutable,
|
|
102
|
+
devHostMainPath,
|
|
103
|
+
hostVersion
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
exports.preparePluginDev = preparePluginDev;
|
|
107
|
+
function preparePluginDebugTarget(options) {
|
|
82
108
|
const projectDirectory = path.resolve(options.projectDirectory);
|
|
83
109
|
assertPluginProject(projectDirectory);
|
|
84
110
|
const sourceManifest = readManifest(path.join(projectDirectory, "src", "manifest.json"), "Plugin source manifest");
|
|
85
111
|
const packageDirectory = path.join(projectDirectory, "dist", sourceManifest.pluginId);
|
|
86
|
-
|
|
112
|
+
return preparePluginDebugTargetFromPackage(options, projectDirectory, packageDirectory, sourceManifest, "package");
|
|
113
|
+
}
|
|
114
|
+
exports.preparePluginDebugTarget = preparePluginDebugTarget;
|
|
115
|
+
function preparePluginBrowserDebugTarget(options, packageKind = "auto") {
|
|
116
|
+
const projectDirectory = path.resolve(options.projectDirectory);
|
|
117
|
+
assertPluginProject(projectDirectory);
|
|
118
|
+
const sourceManifest = readManifest(path.join(projectDirectory, "src", "manifest.json"), "Plugin source manifest");
|
|
119
|
+
const webPackageDirectory = path.join(projectDirectory, ".nexus-plugin-dev", "web-package", sourceManifest.pluginId);
|
|
120
|
+
const packageDirectory = packageKind === "package"
|
|
121
|
+
? path.join(projectDirectory, "dist", sourceManifest.pluginId)
|
|
122
|
+
: packageKind === "web" || fs.existsSync(webPackageDirectory)
|
|
123
|
+
? webPackageDirectory
|
|
124
|
+
: path.join(projectDirectory, "dist", sourceManifest.pluginId);
|
|
125
|
+
return preparePluginDebugTargetFromPackage(options, projectDirectory, packageDirectory, sourceManifest, "renderer");
|
|
126
|
+
}
|
|
127
|
+
exports.preparePluginBrowserDebugTarget = preparePluginBrowserDebugTarget;
|
|
128
|
+
function preparePluginDebugTargetFromPackage(options, projectDirectory, packageDirectory, sourceManifest, validationTarget) {
|
|
129
|
+
const validation = (0, validation_1.validatePluginPackage)(packageDirectory, { target: validationTarget });
|
|
87
130
|
if (!validation.valid) {
|
|
88
131
|
throw new PluginDevError("Plugin package is not ready for debugging: " + packageDirectory
|
|
89
132
|
+ "\n" + validation.errors.map((error) => " - " + error).join("\n"));
|
|
90
133
|
}
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
134
|
+
const manifestValue = readManifest(path.join(packageDirectory, "manifest.json"), "Built plugin manifest");
|
|
135
|
+
if (manifestValue.pluginId !== sourceManifest.pluginId) {
|
|
93
136
|
throw new PluginDevError("Built plugin id does not match src/manifest.json.");
|
|
94
137
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const devHostMainPath = path.join(resolvePackageRoot(), "dev-host", "main.js");
|
|
98
|
-
if (!fs.existsSync(devHostMainPath) || !fs.statSync(devHostMainPath).isFile()) {
|
|
99
|
-
throw new PluginDevError("Plugin SDK dev host is missing: " + devHostMainPath);
|
|
138
|
+
if (!manifestValue.rendererEntry) {
|
|
139
|
+
throw new PluginDevError("Built plugin rendererEntry is required for independent debugging.");
|
|
100
140
|
}
|
|
141
|
+
const manifest = manifestValue;
|
|
142
|
+
const contribution = resolveContribution(manifest, options.surface, options.contributionId);
|
|
101
143
|
return {
|
|
102
144
|
projectDirectory,
|
|
103
145
|
packageDirectory,
|
|
104
146
|
pluginId: manifest.pluginId,
|
|
105
147
|
manifest,
|
|
106
|
-
electronExecutable,
|
|
107
|
-
devHostMainPath,
|
|
108
148
|
surface: contribution.surface,
|
|
109
149
|
contributionId: contribution.contributionId,
|
|
110
150
|
language: normalizeLanguage(options.language, manifest),
|
|
111
151
|
themeMode: options.themeMode || "system"
|
|
112
152
|
};
|
|
113
153
|
}
|
|
114
|
-
exports.preparePluginDev = preparePluginDev;
|
|
115
154
|
function assertPluginProject(projectDirectory) {
|
|
116
155
|
if (!fs.existsSync(projectDirectory) || !fs.statSync(projectDirectory).isDirectory()) {
|
|
117
156
|
throw new PluginDevError("Plugin project directory does not exist: " + projectDirectory);
|
|
@@ -121,19 +160,61 @@ function assertPluginProject(projectDirectory) {
|
|
|
121
160
|
throw new PluginDevError("Plugin project package.json is missing: " + packageJsonPath);
|
|
122
161
|
}
|
|
123
162
|
}
|
|
124
|
-
function
|
|
163
|
+
function buildPluginForDevelopment(projectDirectory) {
|
|
164
|
+
runPluginBuildScript(projectDirectory, "build", "Plugin development build");
|
|
165
|
+
}
|
|
166
|
+
exports.buildPluginForDevelopment = buildPluginForDevelopment;
|
|
167
|
+
function buildPluginRendererForDevelopment(projectDirectory) {
|
|
168
|
+
if (hasPluginBuildScript(projectDirectory, "build:web")) {
|
|
169
|
+
runPluginBuildScript(projectDirectory, "build:web", "Plugin browser UI development build");
|
|
170
|
+
return "web";
|
|
171
|
+
}
|
|
172
|
+
buildPluginForDevelopment(projectDirectory);
|
|
173
|
+
return "package";
|
|
174
|
+
}
|
|
175
|
+
exports.buildPluginRendererForDevelopment = buildPluginRendererForDevelopment;
|
|
176
|
+
function runPluginBuildScript(projectDirectory, scriptName, label) {
|
|
177
|
+
assertPluginProject(projectDirectory);
|
|
178
|
+
if (!hasPluginBuildScript(projectDirectory, scriptName)) {
|
|
179
|
+
throw new PluginDevError("Plugin project is missing the npm script required for debugging: " + scriptName + ".");
|
|
180
|
+
}
|
|
125
181
|
const command = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
126
|
-
const result = (0, child_process_1.spawnSync)(command, ["run",
|
|
182
|
+
const result = (0, child_process_1.spawnSync)(command, ["run", scriptName], {
|
|
127
183
|
cwd: projectDirectory,
|
|
128
184
|
env: { ...process.env, NEXUS_PLUGIN_DEV: "1" },
|
|
129
185
|
stdio: "inherit"
|
|
130
186
|
});
|
|
131
187
|
if (result.error) {
|
|
132
|
-
throw new PluginDevError(
|
|
188
|
+
throw new PluginDevError(label + " could not start: " + result.error.message);
|
|
133
189
|
}
|
|
134
190
|
if (result.status !== 0) {
|
|
135
|
-
throw new PluginDevError(
|
|
191
|
+
throw new PluginDevError(label + " failed with exit code " + String(result.status === null ? 1 : result.status) + ".");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function hasPluginBuildScript(projectDirectory, scriptName) {
|
|
195
|
+
assertPluginProject(projectDirectory);
|
|
196
|
+
const packageJson = readJsonRecord(path.join(projectDirectory, "package.json"), "Plugin project package metadata");
|
|
197
|
+
const scripts = packageJson.scripts;
|
|
198
|
+
return Boolean(scripts
|
|
199
|
+
&& typeof scripts === "object"
|
|
200
|
+
&& !Array.isArray(scripts)
|
|
201
|
+
&& typeof scripts[scriptName] === "string");
|
|
202
|
+
}
|
|
203
|
+
function readDefaultHostVersion() {
|
|
204
|
+
const metadataPath = path.join(resolvePackageRoot(), "dist", "dev-host-metadata.json");
|
|
205
|
+
const metadata = readJsonRecord(metadataPath, "Plugin SDK dev host metadata");
|
|
206
|
+
if (typeof metadata.nexusApplicationVersion !== "string") {
|
|
207
|
+
throw new PluginDevError("Plugin SDK dev host metadata does not contain a Nexus application version.");
|
|
208
|
+
}
|
|
209
|
+
return metadata.nexusApplicationVersion;
|
|
210
|
+
}
|
|
211
|
+
function normalizeHostVersion(value) {
|
|
212
|
+
const normalized = value.trim();
|
|
213
|
+
const match = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.exec(normalized);
|
|
214
|
+
if (!match || [match[1], match[2], match[3]].some((segment) => !Number.isSafeInteger(Number(segment)))) {
|
|
215
|
+
throw new PluginDevError("Simulated Nexus host version must use X.Y.Z format: " + value);
|
|
136
216
|
}
|
|
217
|
+
return normalized;
|
|
137
218
|
}
|
|
138
219
|
function readManifest(filePath, label) {
|
|
139
220
|
if (!fs.existsSync(filePath) || !fs.statSync(filePath).isFile()) {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import pluginManifestSchema from "../.generated/plugin-manifest.schema.json";
|
|
2
|
-
export declare const PLUGIN_SDK_VERSION = "1.0
|
|
2
|
+
export declare const PLUGIN_SDK_VERSION = "1.1.0";
|
|
3
3
|
export { pluginManifestSchema };
|
|
4
4
|
export * from "../.generated/plugin-framework-version";
|
|
5
5
|
export * from "./types";
|
package/dist/src/index.js
CHANGED
|
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
exports.pluginManifestSchema = exports.PLUGIN_SDK_VERSION = void 0;
|
|
21
21
|
const plugin_manifest_schema_json_1 = __importDefault(require("../.generated/plugin-manifest.schema.json"));
|
|
22
22
|
exports.pluginManifestSchema = plugin_manifest_schema_json_1.default;
|
|
23
|
-
exports.PLUGIN_SDK_VERSION = "1.0
|
|
23
|
+
exports.PLUGIN_SDK_VERSION = "1.1.0";
|
|
24
24
|
__exportStar(require("../.generated/plugin-framework-version"), exports);
|
|
25
25
|
__exportStar(require("./types"), exports);
|
|
26
26
|
__exportStar(require("./browser/frame-client"), exports);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type NexusDevUpdateType = "rendererUpdated" | "manifestUpdated";
|
|
2
|
+
export interface NexusDevUpdateResult {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
requiresRestart?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class NexusDevControlServer {
|
|
8
|
+
readonly token: string;
|
|
9
|
+
readonly pipePath: string;
|
|
10
|
+
private server;
|
|
11
|
+
private socket;
|
|
12
|
+
private receiveBuffer;
|
|
13
|
+
private helloAccepted;
|
|
14
|
+
private authenticated;
|
|
15
|
+
private authenticationResolve;
|
|
16
|
+
private authenticationReject;
|
|
17
|
+
private authenticationPromise;
|
|
18
|
+
private disconnectionPromise;
|
|
19
|
+
private disconnectionResolve;
|
|
20
|
+
private disconnectHandler;
|
|
21
|
+
private readonly pendingUpdates;
|
|
22
|
+
private readonly pendingShutdowns;
|
|
23
|
+
private nextRequestId;
|
|
24
|
+
start(): Promise<void>;
|
|
25
|
+
waitForAuthentication(timeoutMs?: number): Promise<void>;
|
|
26
|
+
sendUpdate(type: NexusDevUpdateType, pluginId: string): Promise<NexusDevUpdateResult>;
|
|
27
|
+
requestShutdown(): Promise<void>;
|
|
28
|
+
waitForDisconnection(timeoutMs?: number): Promise<void>;
|
|
29
|
+
setDisconnectHandler(handler: (error: Error) => void): () => void;
|
|
30
|
+
isConnected(): boolean;
|
|
31
|
+
close(): Promise<void>;
|
|
32
|
+
private handleConnection;
|
|
33
|
+
private handleData;
|
|
34
|
+
private handleMessage;
|
|
35
|
+
private handleDisconnect;
|
|
36
|
+
private rejectPending;
|
|
37
|
+
private rejectPendingShutdowns;
|
|
38
|
+
private ensureAuthenticationPromise;
|
|
39
|
+
private ensureDisconnectionPromise;
|
|
40
|
+
private rejectAuthentication;
|
|
41
|
+
}
|
|
42
|
+
export declare function helloProofPayload(version: number, pid: number, nonce: string): string;
|