bulletin-deploy 0.19.4 → 0.20.0-rc.2
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/bin/bulletin-deploy +65 -13
- package/dist/auth/index.d.ts +5 -4
- package/dist/auth/index.js +17 -8
- package/dist/{allocations-CEPeZr6T.d.ts → auth/vendor/allocations.d.ts} +1 -1
- package/dist/auth/vendor/allocations.js +14 -0
- package/dist/{auth-CA_YKtM2.d.ts → auth/vendor/auth.d.ts} +3 -26
- package/dist/auth/vendor/auth.js +10 -0
- package/dist/auth/vendor/index.d.ts +7 -31
- package/dist/auth/vendor/index.js +16 -9
- package/dist/auth/vendor/sessionSigner.d.ts +28 -0
- package/dist/auth/vendor/sessionSigner.js +14 -0
- package/dist/{signer-Duup0hgQ.d.ts → auth/vendor/signer.d.ts} +5 -2
- package/dist/auth/vendor/signer.js +10 -0
- package/dist/auth/vendor/types.d.ts +25 -0
- package/dist/auth/vendor/types.js +0 -0
- package/dist/auth/vendor/ui/index.d.ts +4 -13
- package/dist/auth/vendor/ui/index.js +6 -3
- package/dist/auth/vendor/ui/qr.d.ts +1 -0
- package/dist/auth/vendor/ui/qr.js +6 -0
- package/dist/auth/vendor/ui/status.d.ts +16 -0
- package/dist/auth/vendor/ui/status.js +8 -0
- package/dist/auth-config.d.ts +12 -3
- package/dist/auth-config.js +6 -4
- package/dist/bug-report.js +4 -4
- package/dist/chain-health.js +3 -3
- package/dist/chunk-2C6SLLBI.js +57 -0
- package/dist/{chunk-2P4EZOFF.js → chunk-3PJ36POL.js} +1 -1
- package/dist/{chunk-FWJQAIVO.js → chunk-3QJZWZ2N.js} +61 -19
- package/dist/chunk-7SXO544V.js +40 -0
- package/dist/{chunk-D3YME2EG.js → chunk-CI4MX3LD.js} +8 -4
- package/dist/{chunk-OONQPYHM.js → chunk-DDSBHHGU.js} +111 -25
- package/dist/chunk-DFKEG3WY.js +0 -0
- package/dist/chunk-EHAL4CJM.js +120 -0
- package/dist/{chunk-H44NO63C.js → chunk-G7EH3XIW.js} +8 -185
- package/dist/chunk-HEMKSKGG.js +59 -0
- package/dist/{chunk-ZZIOS4RG.js → chunk-IAS32V73.js} +449 -135
- package/dist/{chunk-F24S4EV5.js → chunk-IJIU2WZU.js} +3 -2
- package/dist/{chunk-JTH3ISLR.js → chunk-K3W5WDNY.js} +8 -8
- package/dist/{chunk-R3BXRRKE.js → chunk-KHASCR2I.js} +1 -1
- package/dist/{chunk-BFK5UCUJ.js → chunk-KJGXS3AY.js} +30 -3
- package/dist/{chunk-6J4WRFRL.js → chunk-N2NOZWSH.js} +1 -1
- package/dist/chunk-NJKXXDDK.js +0 -0
- package/dist/{chunk-U2QO5G35.js → chunk-PH65V5GG.js} +6 -4
- package/dist/chunk-RHCXBXBW.js +17 -0
- package/dist/chunk-RPBMNTGZ.js +6 -0
- package/dist/chunk-S6CPT2TU.js +94 -0
- package/dist/{chunk-C437RTTU.js → chunk-TBTAJZUS.js} +48 -142
- package/dist/{chunk-UFP2XWZ4.js → chunk-UEAWWSKI.js} +3 -3
- package/dist/{chunk-D6BE3RAU.js → chunk-V6IS3YFE.js} +177 -77
- package/dist/{chunk-RIRDBSBG.js → chunk-YP3LINCF.js} +0 -4
- package/dist/{chunk-CCIBF55X.js → chunk-ZN7PPHMX.js} +1 -1
- package/dist/chunk-probe.js +3 -3
- package/dist/cli-name.d.ts +3 -0
- package/dist/cli-name.js +6 -0
- package/dist/code-paths.d.ts +24 -0
- package/dist/code-paths.js +6 -0
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +28 -20
- package/dist/commands/logout.d.ts +3 -2
- package/dist/commands/logout.js +13 -7
- package/dist/commands/transfer.js +11 -9
- package/dist/commands/whoami.d.ts +3 -2
- package/dist/commands/whoami.js +6 -6
- package/dist/deploy-actors.d.ts +4 -3
- package/dist/deploy-actors.js +19 -11
- package/dist/deploy.d.ts +75 -3
- package/dist/deploy.js +44 -20
- package/dist/dotns.d.ts +111 -47
- package/dist/dotns.js +12 -6
- package/dist/incremental-stats.js +1 -1
- package/dist/index.d.ts +5 -50
- package/dist/index.js +54 -32
- package/dist/manifest/product-preflight.d.ts +46 -0
- package/dist/manifest/product-preflight.js +17 -0
- package/dist/manifest/publish.d.ts +31 -1
- package/dist/manifest/publish.js +32 -21
- package/dist/manifest-fetch.d.ts +10 -0
- package/dist/manifest-fetch.js +1 -1
- package/dist/manifest-roundtrip.js +1 -1
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +26 -18
- package/dist/personhood/bootstrap.js +19 -16
- package/dist/personhood/people-client.js +10 -7
- package/dist/pool.d.ts +18 -2
- package/dist/pool.js +12 -1
- package/dist/run-state.d.ts +19 -1
- package/dist/run-state.js +11 -1
- package/dist/sss-allowance-cache.js +5 -5
- package/dist/storage-signer.js +26 -18
- package/dist/telemetry.d.ts +1 -23
- package/dist/telemetry.js +2 -2
- package/dist/version-check.js +3 -3
- package/dist/ws.d.ts +12 -0
- package/dist/ws.js +16 -0
- package/package.json +3 -3
- /package/dist/{chunk-TSPERKUS.js → chunk-DNXE3Q5D.js} +0 -0
package/bin/bulletin-deploy
CHANGED
|
@@ -6,15 +6,20 @@
|
|
|
6
6
|
// SDK modules that trigger the "@parity/product-sdk-logger" localStorage warning.
|
|
7
7
|
import "../dist/suppress-localstorage-warning.js";
|
|
8
8
|
|
|
9
|
-
import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, NonRetryableError, EXIT_CODE_NO_RETRY, isConnectionError, isBenignTeardownError, resolveEffectiveMnemonic, mnemonicConflictNotice, resolveEnvId, shouldPublishManifest, nonInteractivePhoneConfirmationError } from "../dist/deploy.js";
|
|
9
|
+
import { deploy, DEFAULT_BULLETIN_RPC, DEFAULT_POOL_SIZE, NonRetryableError, EXIT_CODE_NO_RETRY, isConnectionError, isBenignTeardownError, resolveEffectiveMnemonic, mnemonicConflictNotice, resolveEnvId, shouldPublishManifest, nonInteractivePhoneConfirmationError, printDeploymentCompleteBanner } from "../dist/deploy.js";
|
|
10
10
|
import { VERSION, setDeployAttribute, captureWarning, closeTelemetry, setRunStateActive, markRelaunchOomHintShown, setVersionFreshness } from "../dist/telemetry.js";
|
|
11
11
|
import { handleFailedDeploy, handlePreflightVersionCheck, fetchVersionInfo, preReleaseWarning, checkNodeVersion, classifyVersionFreshness, isInteractive } from "../dist/version-check.js";
|
|
12
12
|
import { setDeployContext, installLogCapture, buildCliFlagsSummary } from "../dist/bug-report.js";
|
|
13
13
|
import { loadRunState, writeRunState, shouldSkipStaleWarning, shouldShowOomHint, probablyOomRssMb } from "../dist/run-state.js";
|
|
14
|
-
import { loadEnvironments, listEnvironments, formatEnvironmentTable, DEFAULT_ENV_ID } from "../dist/environments.js";
|
|
14
|
+
import { loadEnvironments, listEnvironments, formatEnvironmentTable, resolveEndpoints, DEFAULT_ENV_ID } from "../dist/environments.js";
|
|
15
|
+
import { DEFAULT_TLD } from "../dist/dotns.js";
|
|
16
|
+
import { GuardedWebSocket } from "../dist/ws.js";
|
|
15
17
|
import * as fs from "fs";
|
|
16
18
|
import * as readline from "readline";
|
|
17
19
|
|
|
20
|
+
// The SSO SDKs build their own papi providers from the global WebSocket.
|
|
21
|
+
globalThis.WebSocket = GuardedWebSocket;
|
|
22
|
+
|
|
18
23
|
// Install early so anything printed during flag parsing / preflight is
|
|
19
24
|
// available to the bug-report log tail.
|
|
20
25
|
installLogCapture();
|
|
@@ -454,25 +459,68 @@ try {
|
|
|
454
459
|
// #1163: --no-manifest (--content-only) skips this entirely — the deploy is
|
|
455
460
|
// content-only regardless of any discoverable config, so there's nothing to
|
|
456
461
|
// preflight.
|
|
462
|
+
//
|
|
463
|
+
// #1164: hoisted so the SAME loaded config (one filesystem walk-up + parse)
|
|
464
|
+
// can drive both the manifestPending banner decision below and the actual
|
|
465
|
+
// publishManifest() call further down — previously each of those three call
|
|
466
|
+
// sites (this preflight, the banner decision, the publish block) reloaded
|
|
467
|
+
// the config independently. resolveConfigPath resolves `cwd` via
|
|
468
|
+
// `path.resolve(options.cwd ?? process.cwd())` (src/manifest/config-load.ts),
|
|
469
|
+
// which is idempotent, so reusing this result (loaded with the raw
|
|
470
|
+
// `buildDir`) is identical to the publish block's old `buildDirAbs`-based
|
|
471
|
+
// reload.
|
|
472
|
+
let preflightedConfig = null;
|
|
457
473
|
if (!flags.noManifest) {
|
|
458
474
|
try {
|
|
459
|
-
const { preflightProductConfig } = await import("../dist/index.js");
|
|
475
|
+
const { preflightProductConfig, reconcileManifestDomain } = await import("../dist/index.js");
|
|
460
476
|
// config-load resolves a relative cwd internally, so no node:path here
|
|
461
477
|
// (it's only dynamically imported later, in the publish block).
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
478
|
+
// #1156: preflightProductConfig (config discovery/parse + icon/executable
|
|
479
|
+
// file checks) and loadEnvironments (a local environments.json read)
|
|
480
|
+
// have no data dependency on each other — run them concurrently rather
|
|
481
|
+
// than paying their I/O sequentially.
|
|
482
|
+
const [loadedConfig, { doc }] = await Promise.all([
|
|
483
|
+
preflightProductConfig(
|
|
484
|
+
flags.config ? { path: flags.config } : { cwd: buildDir, walkUp: true },
|
|
485
|
+
),
|
|
486
|
+
// No options: flags.environmentFile was already copied into
|
|
487
|
+
// process.env.BULLETIN_DEPLOY_ENV_FILE above, which loadEnvironments
|
|
488
|
+
// reads as its own default — passing it again here would just be
|
|
489
|
+
// recomputing that same fallback.
|
|
490
|
+
loadEnvironments(),
|
|
491
|
+
]);
|
|
492
|
+
preflightedConfig = loadedConfig;
|
|
493
|
+
// Reconcile the config's domain against the ACTUAL deploy target
|
|
494
|
+
// BEFORE deploy() runs at all — this is the real "nothing uploaded
|
|
495
|
+
// yet" gate; src/manifest/publish.ts's own call to the same helper
|
|
496
|
+
// (inside publishManifest) is only a backstop for a library caller
|
|
497
|
+
// that skips this CLI entirely. Same env/TLD resolution publishManifest
|
|
498
|
+
// itself uses (loadEnvironments + resolveEndpoints), so this sees the
|
|
499
|
+
// identical environment the deploy will target — no RPC call, both are
|
|
500
|
+
// local config reads.
|
|
501
|
+
if (loadedConfig) {
|
|
502
|
+
const resolved = resolveEndpoints(doc, effectiveEnvId ?? DEFAULT_ENV_ID);
|
|
503
|
+
const envTld = resolved.tld ?? DEFAULT_TLD;
|
|
504
|
+
reconcileManifestDomain(loadedConfig.config.domain, domain, envTld, loadedConfig.sourcePath);
|
|
505
|
+
}
|
|
465
506
|
} catch (err) {
|
|
466
507
|
console.error(`Error: ${err?.message ?? err}`);
|
|
467
508
|
process.exit(err instanceof NonRetryableError ? EXIT_CODE_NO_RETRY : 1);
|
|
468
509
|
}
|
|
469
510
|
}
|
|
470
511
|
|
|
512
|
+
// #1164: determine up front whether a manifest publish will follow, so
|
|
513
|
+
// deploy() can defer the "DEPLOYMENT COMPLETE" banner until publishManifest
|
|
514
|
+
// actually succeeds. Reuses the SAME preflightedConfig loaded just above —
|
|
515
|
+
// no second config load.
|
|
516
|
+
const manifestWillPublish = shouldPublishManifest({ configFound: !!preflightedConfig, noManifest: !!flags.noManifest });
|
|
517
|
+
|
|
471
518
|
const result = await deploy(buildDir, domain, {
|
|
472
519
|
mnemonic: effectiveMnemonic,
|
|
473
520
|
derivationPath: flags.derivationPath,
|
|
474
521
|
productName: flags.productName,
|
|
475
522
|
suri: flags.suri,
|
|
523
|
+
manifestPending: manifestWillPublish,
|
|
476
524
|
rpc: flags.rpc,
|
|
477
525
|
env: effectiveEnvId,
|
|
478
526
|
poolSize: flags.poolSize,
|
|
@@ -569,16 +617,15 @@ try {
|
|
|
569
617
|
//
|
|
570
618
|
// #1163: --no-manifest (--content-only) skips manifest publishing even when
|
|
571
619
|
// a config is present. shouldPublishManifest() is the single source of
|
|
572
|
-
// truth for that decision
|
|
573
|
-
//
|
|
574
|
-
//
|
|
620
|
+
// truth for that decision.
|
|
621
|
+
//
|
|
622
|
+
// #1164: reuses `preflightedConfig` (loaded once, above) instead of a third
|
|
623
|
+
// independent tryLoadProductConfig call.
|
|
575
624
|
{
|
|
576
|
-
const {
|
|
625
|
+
const { publishManifest } = await import("../dist/index.js");
|
|
577
626
|
const path = await import("node:path");
|
|
578
627
|
const buildDirAbs = path.resolve(buildDir);
|
|
579
|
-
const loaded =
|
|
580
|
-
flags.config ? { path: flags.config } : { cwd: buildDirAbs, walkUp: true },
|
|
581
|
-
);
|
|
628
|
+
const loaded = preflightedConfig;
|
|
582
629
|
if (shouldPublishManifest({ configFound: !!loaded, noManifest: !!flags.noManifest })) {
|
|
583
630
|
try {
|
|
584
631
|
await publishManifest({
|
|
@@ -596,6 +643,11 @@ try {
|
|
|
596
643
|
storageSigner: result.storageSigner,
|
|
597
644
|
storageSignerAddress: result.storageSignerAddress,
|
|
598
645
|
});
|
|
646
|
+
// #1164: deploy() deferred the real completion banner (manifestPending
|
|
647
|
+
// was set above) — print it now that the manifest phase actually
|
|
648
|
+
// succeeded, so a manifest publish failure never leaves a false
|
|
649
|
+
// "DEPLOYMENT COMPLETE!" on screen.
|
|
650
|
+
printDeploymentCompleteBanner(result.fullDomain, result.browserUrl);
|
|
599
651
|
} catch (err) {
|
|
600
652
|
console.error(`Manifest publish failed: ${err?.message ?? err}`);
|
|
601
653
|
process.exit(err instanceof NonRetryableError ? EXIT_CODE_NO_RETRY : 1);
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './vendor/auth.js';
|
|
2
2
|
export { renderQrCode } from '@parity/product-sdk-terminal';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
3
|
+
export { ResolvedSigner, SignerNotAvailableError, resolveSigner } from './vendor/signer.js';
|
|
4
|
+
export { AllocatableResource, AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './vendor/allocations.js';
|
|
5
|
+
export { AuthConfig } from './vendor/types.js';
|
|
6
|
+
export { renderLoginStatus, renderLogoutStatus } from './vendor/ui/status.js';
|
|
6
7
|
import 'polkadot-api';
|
|
7
8
|
import '@parity/product-sdk-tx';
|
package/dist/auth/index.js
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import "../chunk-JQKKMUCT.js";
|
|
2
|
+
import "../chunk-DFKEG3WY.js";
|
|
2
3
|
import {
|
|
3
|
-
renderLoginStatus,
|
|
4
|
-
renderLogoutStatus,
|
|
5
4
|
renderQrCode
|
|
6
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-RPBMNTGZ.js";
|
|
6
|
+
import {
|
|
7
|
+
renderLoginStatus,
|
|
8
|
+
renderLogoutStatus
|
|
9
|
+
} from "../chunk-YP3LINCF.js";
|
|
10
|
+
import "../chunk-NJKXXDDK.js";
|
|
11
|
+
import {
|
|
12
|
+
createAuthClient
|
|
13
|
+
} from "../chunk-G7EH3XIW.js";
|
|
7
14
|
import {
|
|
8
15
|
BULLETIN_RESOURCE,
|
|
9
16
|
DEFAULT_RESOURCES,
|
|
10
|
-
SignerNotAvailableError,
|
|
11
|
-
createAuthClient,
|
|
12
17
|
createSlotAccountSigner,
|
|
13
18
|
requestResourceAllocation,
|
|
14
|
-
resolveSigner,
|
|
15
19
|
summarizeOutcomes
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-7SXO544V.js";
|
|
21
|
+
import "../chunk-S6CPT2TU.js";
|
|
22
|
+
import {
|
|
23
|
+
SignerNotAvailableError,
|
|
24
|
+
resolveSigner
|
|
25
|
+
} from "../chunk-2C6SLLBI.js";
|
|
18
26
|
import "../chunk-SH2LG52Z.js";
|
|
27
|
+
import "../chunk-DNXE3Q5D.js";
|
|
19
28
|
export {
|
|
20
29
|
BULLETIN_RESOURCE,
|
|
21
30
|
DEFAULT_RESOURCES,
|
|
@@ -108,4 +108,4 @@ declare function summarizeOutcomes(outcomes: AllocationOutcome[], resources: All
|
|
|
108
108
|
*/
|
|
109
109
|
declare function createSlotAccountSigner(adapter: TerminalAdapter, resource: AllocatableResource): Promise<polkadot_api.PolkadotSigner | null>;
|
|
110
110
|
|
|
111
|
-
export { type AllocatableResource
|
|
111
|
+
export { type AllocatableResource, type AllocationOutcome, type AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, type OnExistingAllowancePolicy, type ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BULLETIN_RESOURCE,
|
|
3
|
+
DEFAULT_RESOURCES,
|
|
4
|
+
createSlotAccountSigner,
|
|
5
|
+
requestResourceAllocation,
|
|
6
|
+
summarizeOutcomes
|
|
7
|
+
} from "../../chunk-7SXO544V.js";
|
|
8
|
+
export {
|
|
9
|
+
BULLETIN_RESOURCE,
|
|
10
|
+
DEFAULT_RESOURCES,
|
|
11
|
+
createSlotAccountSigner,
|
|
12
|
+
requestResourceAllocation,
|
|
13
|
+
summarizeOutcomes
|
|
14
|
+
};
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
import { TerminalAdapter, UserSession } from '@parity/product-sdk-terminal';
|
|
2
2
|
import { PolkadotSigner } from 'polkadot-api';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Per-product configuration injected into `createAuthClient`. Lifting the
|
|
7
|
-
* sign-in glue out of playground-cli (issue #411) means the env-specific
|
|
8
|
-
* constants playground hard-coded in its `config.ts` (DAPP_ID, product id,
|
|
9
|
-
* metadata URL, People-chain endpoints) become consumer-supplied so the same
|
|
10
|
-
* package serves `playground` and `dot` (and future products) unchanged.
|
|
11
|
-
*/
|
|
12
|
-
interface AuthConfig {
|
|
13
|
-
/** The dApp identity string. Scopes the on-disk session namespace
|
|
14
|
-
* (`~/.polkadot-apps/${dappId}_*`) and the SSO pairing — each product
|
|
15
|
-
* gets its own, independently-revocable session. */
|
|
16
|
-
dappId: string;
|
|
17
|
-
/** Product id used to derive the product account (`/product/{productId}/{index}`). */
|
|
18
|
-
productId: string;
|
|
19
|
-
/** Derivation index of the product account (0 = default). */
|
|
20
|
-
derivationIndex: number;
|
|
21
|
-
/** Wallet-facing app name shown on the Sign-In screen (sent inline at pairing). */
|
|
22
|
-
hostName: string;
|
|
23
|
-
/** Host app version sent inline at pairing. */
|
|
24
|
-
hostVersion: string;
|
|
25
|
-
/** People-parachain RPC endpoints the terminal adapter connects to. */
|
|
26
|
-
peopleEndpoints: string[];
|
|
27
|
-
}
|
|
3
|
+
import { AllocatableResource, OnExistingAllowancePolicy, AllocationOutcome } from './allocations.js';
|
|
4
|
+
import { AuthConfig } from './types.js';
|
|
28
5
|
|
|
29
6
|
/**
|
|
30
7
|
* The three addresses we surface from a paired session.
|
|
@@ -125,4 +102,4 @@ interface AuthClient {
|
|
|
125
102
|
*/
|
|
126
103
|
declare function createAuthClient(config: AuthConfig): AuthClient;
|
|
127
104
|
|
|
128
|
-
export { type AuthClient
|
|
105
|
+
export { type AuthClient, type ConnectResult, type LoginHandle, type LoginStatus, type LogoutHandle, type LogoutStatus, type SessionAddresses, type SessionHandle, createAuthClient };
|
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { AuthClient, ConnectResult, LoginHandle, LoginStatus, LogoutHandle, LogoutStatus, SessionAddresses, SessionHandle, createAuthClient } from './auth.js';
|
|
2
|
+
export { INCOMPLETE_SESSION_MESSAGE, ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey } from './sessionSigner.js';
|
|
3
|
+
export { ResolvedSigner, SignerNotAvailableError, SignerOptions, SignerSource, parseDevAccountName, resolveSigner } from './signer.js';
|
|
4
|
+
export { AllocatableResource, AllocationOutcome, AllocationSummary, BULLETIN_RESOURCE, DEFAULT_RESOURCES, OnExistingAllowancePolicy, ResourceTag, createSlotAccountSigner, requestResourceAllocation, summarizeOutcomes } from './allocations.js';
|
|
5
|
+
export { AuthConfig } from './types.js';
|
|
6
|
+
import '@parity/product-sdk-terminal';
|
|
7
|
+
import 'polkadot-api';
|
|
6
8
|
import '@parity/product-sdk-tx';
|
|
7
|
-
|
|
8
|
-
interface ProductAccountRef {
|
|
9
|
-
productId: string;
|
|
10
|
-
derivationIndex: number;
|
|
11
|
-
}
|
|
12
|
-
declare const INCOMPLETE_SESSION_MESSAGE = "Stored login session is missing the root account public key. Run \"logout\" and then \"login\" to pair again.";
|
|
13
|
-
declare function sessionRootPublicKey(session: UserSession): Uint8Array;
|
|
14
|
-
/**
|
|
15
|
-
* Soft-derive the product account public key off a wallet root.
|
|
16
|
-
*
|
|
17
|
-
* This is the single source of truth for product-account math. Both
|
|
18
|
-
* `createSessionSigner` (which builds the signer used to actually sign
|
|
19
|
-
* on-chain) and `deriveSessionAddresses` (which builds the display triple)
|
|
20
|
-
* go through here so a future change to derivation params can't silently
|
|
21
|
-
* desync the signer from what we print.
|
|
22
|
-
*
|
|
23
|
-
* sr25519 soft derivation is composable on public keys alone, so deriving
|
|
24
|
-
* from `rootAccountId` locally produces the SAME public key the mobile
|
|
25
|
-
* derives privately via `mnemonic + "/product/...{idx}"`. Algorithm parity
|
|
26
|
-
* with mobile/desktop is locked by the frozen vectors in
|
|
27
|
-
* `@parity/product-sdk-keys`'s `product-account.test.ts`.
|
|
28
|
-
*/
|
|
29
|
-
declare function deriveProductPublicKey(rootAccountId: Uint8Array, ref: ProductAccountRef): Uint8Array;
|
|
30
|
-
declare function createSessionSigner(session: UserSession, ref: ProductAccountRef): PolkadotSigner;
|
|
31
|
-
|
|
32
|
-
export { INCOMPLETE_SESSION_MESSAGE, type ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey };
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
import "../../chunk-NJKXXDDK.js";
|
|
2
|
+
import {
|
|
3
|
+
createAuthClient
|
|
4
|
+
} from "../../chunk-G7EH3XIW.js";
|
|
1
5
|
import {
|
|
2
6
|
BULLETIN_RESOURCE,
|
|
3
7
|
DEFAULT_RESOURCES,
|
|
8
|
+
createSlotAccountSigner,
|
|
9
|
+
requestResourceAllocation,
|
|
10
|
+
summarizeOutcomes
|
|
11
|
+
} from "../../chunk-7SXO544V.js";
|
|
12
|
+
import {
|
|
4
13
|
INCOMPLETE_SESSION_MESSAGE,
|
|
5
|
-
SignerNotAvailableError,
|
|
6
|
-
createAuthClient,
|
|
7
14
|
createSessionSigner,
|
|
8
|
-
createSlotAccountSigner,
|
|
9
15
|
deriveProductPublicKey,
|
|
16
|
+
sessionRootPublicKey
|
|
17
|
+
} from "../../chunk-S6CPT2TU.js";
|
|
18
|
+
import {
|
|
19
|
+
SignerNotAvailableError,
|
|
10
20
|
parseDevAccountName,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
sessionRootPublicKey,
|
|
14
|
-
summarizeOutcomes
|
|
15
|
-
} from "../../chunk-H44NO63C.js";
|
|
16
|
-
import "../../chunk-TSPERKUS.js";
|
|
21
|
+
resolveSigner
|
|
22
|
+
} from "../../chunk-2C6SLLBI.js";
|
|
17
23
|
import "../../chunk-SH2LG52Z.js";
|
|
24
|
+
import "../../chunk-DNXE3Q5D.js";
|
|
18
25
|
export {
|
|
19
26
|
BULLETIN_RESOURCE,
|
|
20
27
|
DEFAULT_RESOURCES,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UserSession } from '@parity/product-sdk-terminal';
|
|
2
|
+
import { PolkadotSigner } from 'polkadot-api';
|
|
3
|
+
|
|
4
|
+
interface ProductAccountRef {
|
|
5
|
+
productId: string;
|
|
6
|
+
derivationIndex: number;
|
|
7
|
+
}
|
|
8
|
+
declare const INCOMPLETE_SESSION_MESSAGE = "Stored login session is missing the root account public key. Run \"logout\" and then \"login\" to pair again.";
|
|
9
|
+
declare function sessionRootPublicKey(session: UserSession): Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* Soft-derive the product account public key off a wallet root.
|
|
12
|
+
*
|
|
13
|
+
* This is the single source of truth for product-account math. Both
|
|
14
|
+
* `createSessionSigner` (which builds the signer used to actually sign
|
|
15
|
+
* on-chain) and `deriveSessionAddresses` (which builds the display triple)
|
|
16
|
+
* go through here so a future change to derivation params can't silently
|
|
17
|
+
* desync the signer from what we print.
|
|
18
|
+
*
|
|
19
|
+
* sr25519 soft derivation is composable on public keys alone, so deriving
|
|
20
|
+
* from `rootAccountId` locally produces the SAME public key the mobile
|
|
21
|
+
* derives privately via `mnemonic + "/product/...{idx}"`. Algorithm parity
|
|
22
|
+
* with mobile/desktop is locked by the frozen vectors in
|
|
23
|
+
* `@parity/product-sdk-keys`'s `product-account.test.ts`.
|
|
24
|
+
*/
|
|
25
|
+
declare function deriveProductPublicKey(rootAccountId: Uint8Array, ref: ProductAccountRef): Uint8Array;
|
|
26
|
+
declare function createSessionSigner(session: UserSession, ref: ProductAccountRef): PolkadotSigner;
|
|
27
|
+
|
|
28
|
+
export { INCOMPLETE_SESSION_MESSAGE, type ProductAccountRef, createSessionSigner, deriveProductPublicKey, sessionRootPublicKey };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INCOMPLETE_SESSION_MESSAGE,
|
|
3
|
+
createSessionSigner,
|
|
4
|
+
deriveProductPublicKey,
|
|
5
|
+
sessionRootPublicKey
|
|
6
|
+
} from "../../chunk-S6CPT2TU.js";
|
|
7
|
+
import "../../chunk-SH2LG52Z.js";
|
|
8
|
+
import "../../chunk-DNXE3Q5D.js";
|
|
9
|
+
export {
|
|
10
|
+
INCOMPLETE_SESSION_MESSAGE,
|
|
11
|
+
createSessionSigner,
|
|
12
|
+
deriveProductPublicKey,
|
|
13
|
+
sessionRootPublicKey
|
|
14
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DevAccountName } from '@parity/product-sdk-tx';
|
|
2
2
|
import { PolkadotSigner } from 'polkadot-api';
|
|
3
|
-
import {
|
|
3
|
+
import { SessionHandle, SessionAddresses, AuthClient } from './auth.js';
|
|
4
|
+
import '@parity/product-sdk-terminal';
|
|
5
|
+
import './allocations.js';
|
|
6
|
+
import './types.js';
|
|
4
7
|
|
|
5
8
|
type SignerSource = "dev" | "session";
|
|
6
9
|
interface ResolvedSigner {
|
|
@@ -32,4 +35,4 @@ declare function parseDevAccountName(suri: string): DevAccountName | null;
|
|
|
32
35
|
*/
|
|
33
36
|
declare function resolveSigner(authClient: AuthClient, options?: SignerOptions): Promise<ResolvedSigner>;
|
|
34
37
|
|
|
35
|
-
export { type ResolvedSigner
|
|
38
|
+
export { type ResolvedSigner, SignerNotAvailableError, type SignerOptions, type SignerSource, parseDevAccountName, resolveSigner };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-product configuration injected into `createAuthClient`. Lifting the
|
|
3
|
+
* sign-in glue out of playground-cli (issue #411) means the env-specific
|
|
4
|
+
* constants playground hard-coded in its `config.ts` (DAPP_ID, product id,
|
|
5
|
+
* metadata URL, People-chain endpoints) become consumer-supplied so the same
|
|
6
|
+
* package serves `playground` and `dot` (and future products) unchanged.
|
|
7
|
+
*/
|
|
8
|
+
interface AuthConfig {
|
|
9
|
+
/** The dApp identity string. Scopes the on-disk session namespace
|
|
10
|
+
* (`~/.polkadot-apps/${dappId}_*`) and the SSO pairing — each product
|
|
11
|
+
* gets its own, independently-revocable session. */
|
|
12
|
+
dappId: string;
|
|
13
|
+
/** Product id used to derive the product account (`/product/{productId}/{index}`). */
|
|
14
|
+
productId: string;
|
|
15
|
+
/** Derivation index of the product account (0 = default). */
|
|
16
|
+
derivationIndex: number;
|
|
17
|
+
/** Wallet-facing app name shown on the Sign-In screen (sent inline at pairing). */
|
|
18
|
+
hostName: string;
|
|
19
|
+
/** Host app version sent inline at pairing. */
|
|
20
|
+
hostVersion: string;
|
|
21
|
+
/** People-parachain RPC endpoints the terminal adapter connects to. */
|
|
22
|
+
peopleEndpoints: string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type { AuthConfig };
|
|
File without changes
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
export { renderQrCode } from '@parity/product-sdk-terminal';
|
|
2
|
-
|
|
2
|
+
export { renderLoginStatus, renderLogoutStatus } from './status.js';
|
|
3
|
+
import '../auth.js';
|
|
3
4
|
import 'polkadot-api';
|
|
4
|
-
import '
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Pure formatters that map the `LoginStatus` / `LogoutStatus` streams to
|
|
8
|
-
* one-line terminal messages. No I/O, no terminal deps — `import type` only,
|
|
9
|
-
* so this module stays unit-testable without the SSO stack.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
declare function renderLoginStatus(status: LoginStatus): string;
|
|
13
|
-
declare function renderLogoutStatus(status: LogoutStatus): string;
|
|
14
|
-
|
|
15
|
-
export { renderLoginStatus, renderLogoutStatus };
|
|
5
|
+
import '../allocations.js';
|
|
6
|
+
import '../types.js';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import "../../../chunk-DFKEG3WY.js";
|
|
1
2
|
import {
|
|
2
|
-
renderLoginStatus,
|
|
3
|
-
renderLogoutStatus,
|
|
4
3
|
renderQrCode
|
|
5
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-RPBMNTGZ.js";
|
|
5
|
+
import {
|
|
6
|
+
renderLoginStatus,
|
|
7
|
+
renderLogoutStatus
|
|
8
|
+
} from "../../../chunk-YP3LINCF.js";
|
|
6
9
|
export {
|
|
7
10
|
renderLoginStatus,
|
|
8
11
|
renderLogoutStatus,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { renderQrCode } from '@parity/product-sdk-terminal';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '@parity/product-sdk-terminal';
|
|
2
|
+
import { LoginStatus, LogoutStatus } from '../auth.js';
|
|
3
|
+
import 'polkadot-api';
|
|
4
|
+
import '../allocations.js';
|
|
5
|
+
import '../types.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Pure formatters that map the `LoginStatus` / `LogoutStatus` streams to
|
|
9
|
+
* one-line terminal messages. No I/O, no terminal deps — `import type` only,
|
|
10
|
+
* so this module stays unit-testable without the SSO stack.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
declare function renderLoginStatus(status: LoginStatus): string;
|
|
14
|
+
declare function renderLogoutStatus(status: LogoutStatus): string;
|
|
15
|
+
|
|
16
|
+
export { renderLoginStatus, renderLogoutStatus };
|
package/dist/auth-config.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthClient } from './auth/vendor/auth.js';
|
|
2
|
+
import { AuthConfig } from './auth/vendor/types.js';
|
|
2
3
|
import { EnvironmentsDoc } from './environments.js';
|
|
3
4
|
import '@parity/product-sdk-terminal';
|
|
4
5
|
import 'polkadot-api';
|
|
5
|
-
import './allocations
|
|
6
|
+
import './auth/vendor/allocations.js';
|
|
6
7
|
|
|
7
8
|
/** dApp identity: scopes the SSO session namespace + terminal allowance cache on disk
|
|
8
9
|
* and the wallet pairing product. Aligned to the app's dedicated id "polkadot-app-deploy". */
|
|
@@ -24,6 +25,14 @@ declare const DOT_HOST_NAME = "polkadot-app-deploy";
|
|
|
24
25
|
* The adapter silently returns [] in this case; we surface the cause and recovery steps.
|
|
25
26
|
*/
|
|
26
27
|
declare const STALE_SESSION_MESSAGE: string;
|
|
28
|
+
/**
|
|
29
|
+
* Deploy-specific variant of STALE_SESSION_MESSAGE. See src/deploy-actors.ts's
|
|
30
|
+
* resolveDeployActors for the full rationale (issue #234) — in short, `deploy`
|
|
31
|
+
* has a remedy `whoami` doesn't: an explicit `--mnemonic` / `MNEMONIC` signer,
|
|
32
|
+
* which wins even when the persisted session can't be read. Naming it here
|
|
33
|
+
* means the fail-fast error doesn't just point at re-pairing.
|
|
34
|
+
*/
|
|
35
|
+
declare const STALE_SESSION_DEPLOY_MESSAGE = "Stored login session could not be read \u2014 it may have been written by an older version. Run \"bulletin-deploy logout\", then \"bulletin-deploy login\" to pair again. Or pass --mnemonic explicitly to sign with a different key.";
|
|
27
36
|
/**
|
|
28
37
|
* Returns true if there is a persisted SSO session file on disk.
|
|
29
38
|
* Does NOT load the SSO stack — uses only node fs/os/path.
|
|
@@ -63,4 +72,4 @@ declare function getPeopleChainEndpoints(envId: string): Promise<string[]>;
|
|
|
63
72
|
*/
|
|
64
73
|
declare function getAuthClient(envId: string): Promise<AuthClient>;
|
|
65
74
|
|
|
66
|
-
export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, DOT_PRODUCT_ID, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, resolveBulletinEndpoints };
|
|
75
|
+
export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, DOT_PRODUCT_ID, STALE_SESSION_DEPLOY_MESSAGE, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, resolveBulletinEndpoints };
|
package/dist/auth-config.js
CHANGED
|
@@ -3,23 +3,25 @@ import {
|
|
|
3
3
|
DOT_DERIVATION_INDEX,
|
|
4
4
|
DOT_HOST_NAME,
|
|
5
5
|
DOT_PRODUCT_ID,
|
|
6
|
+
STALE_SESSION_DEPLOY_MESSAGE,
|
|
6
7
|
STALE_SESSION_MESSAGE,
|
|
7
8
|
buildAuthConfig,
|
|
8
9
|
getAuthClient,
|
|
9
10
|
getPeopleChainEndpoints,
|
|
10
11
|
hasPersistedSession,
|
|
11
12
|
resolveBulletinEndpoints
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-TSPERKUS.js";
|
|
13
|
+
} from "./chunk-PH65V5GG.js";
|
|
14
14
|
import "./chunk-3NR3T7US.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-KJGXS3AY.js";
|
|
16
|
+
import "./chunk-DDSBHHGU.js";
|
|
17
17
|
import "./chunk-SH2LG52Z.js";
|
|
18
|
+
import "./chunk-DNXE3Q5D.js";
|
|
18
19
|
export {
|
|
19
20
|
DOT_DAPP_ID,
|
|
20
21
|
DOT_DERIVATION_INDEX,
|
|
21
22
|
DOT_HOST_NAME,
|
|
22
23
|
DOT_PRODUCT_ID,
|
|
24
|
+
STALE_SESSION_DEPLOY_MESSAGE,
|
|
23
25
|
STALE_SESSION_MESSAGE,
|
|
24
26
|
buildAuthConfig,
|
|
25
27
|
getAuthClient,
|
package/dist/bug-report.js
CHANGED
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
offerBugReport,
|
|
11
11
|
scrubSecrets,
|
|
12
12
|
setDeployContext
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-UEAWWSKI.js";
|
|
14
|
+
import "./chunk-KHASCR2I.js";
|
|
15
|
+
import "./chunk-KJGXS3AY.js";
|
|
16
|
+
import "./chunk-DDSBHHGU.js";
|
|
17
17
|
import "./chunk-SH2LG52Z.js";
|
|
18
18
|
export {
|
|
19
19
|
buildCliFlagsSummary,
|
package/dist/chain-health.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
DEFAULT_WINDOW_BLOCKS,
|
|
4
4
|
MAX_SPANS_PER_SAMPLER,
|
|
5
5
|
endpointHost
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ZN7PPHMX.js";
|
|
7
|
+
import "./chunk-KJGXS3AY.js";
|
|
8
|
+
import "./chunk-DDSBHHGU.js";
|
|
9
9
|
import "./chunk-SH2LG52Z.js";
|
|
10
10
|
export {
|
|
11
11
|
ChainHealthSampler,
|