bulletin-deploy 0.20.0-rc.1 → 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/bin/bulletin-deploy +4 -0
- 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-IJ3ONWE7.js → chunk-26ZYMWSC.js} +4 -1
- package/dist/chunk-2C6SLLBI.js +57 -0
- package/dist/{chunk-QKEZK2M6.js → chunk-3BSPX4JN.js} +3 -3
- package/dist/chunk-6GHDPDZN.js +59 -0
- package/dist/chunk-7SXO544V.js +40 -0
- package/dist/{chunk-567ZRMI6.js → chunk-BXDMEOLH.js} +1 -1
- package/dist/chunk-DBDOISNQ.js +120 -0
- package/dist/chunk-DFKEG3WY.js +0 -0
- package/dist/{chunk-JYVJRJ7H.js → chunk-DHHHYZTR.js} +1 -1
- package/dist/{chunk-JBMBQFCO.js → chunk-DT6ABL3J.js} +8 -8
- package/dist/{chunk-FR73P4GO.js → chunk-EBYWI7FI.js} +31 -30
- package/dist/{chunk-H44NO63C.js → chunk-G7EH3XIW.js} +8 -185
- package/dist/{chunk-KACRAHSV.js → chunk-IF3SANQR.js} +6 -4
- package/dist/{chunk-JYJQNITR.js → chunk-IHC2QG2L.js} +12 -122
- package/dist/{chunk-NGVCDMLS.js → chunk-LRRFXOLE.js} +3 -3
- package/dist/{chunk-IUPVNIVY.js → chunk-MTXFJTX6.js} +1 -1
- package/dist/chunk-NJKXXDDK.js +0 -0
- package/dist/{chunk-4GDRFJER.js → chunk-QBHUCTVT.js} +1 -1
- package/dist/chunk-RHCXBXBW.js +17 -0
- package/dist/chunk-RPBMNTGZ.js +6 -0
- package/dist/chunk-S6CPT2TU.js +94 -0
- package/dist/{chunk-SKL6ULZN.js → chunk-YIVCOJAB.js} +109 -79
- package/dist/{chunk-A3VWIJKO.js → chunk-YLLTQM5Z.js} +2 -2
- package/dist/{chunk-RIRDBSBG.js → chunk-YP3LINCF.js} +0 -4
- 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 +27 -19
- 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 +1 -1
- package/dist/deploy.js +25 -17
- package/dist/dotns.d.ts +40 -27
- package/dist/dotns.js +8 -6
- package/dist/index.d.ts +3 -48
- package/dist/index.js +32 -22
- package/dist/manifest/product-preflight.d.ts +46 -0
- package/dist/manifest/product-preflight.js +17 -0
- package/dist/manifest/publish.js +27 -18
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +25 -17
- package/dist/personhood/bootstrap.js +19 -16
- package/dist/personhood/people-client.js +10 -7
- package/dist/pool.js +6 -1
- package/dist/run-state.js +1 -1
- package/dist/sss-allowance-cache.js +5 -5
- package/dist/storage-signer.js +25 -17
- 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
|
@@ -13,9 +13,13 @@ import { setDeployContext, installLogCapture, buildCliFlagsSummary } from "../di
|
|
|
13
13
|
import { loadRunState, writeRunState, shouldSkipStaleWarning, shouldShowOomHint, probablyOomRssMb } from "../dist/run-state.js";
|
|
14
14
|
import { loadEnvironments, listEnvironments, formatEnvironmentTable, resolveEndpoints, DEFAULT_ENV_ID } from "../dist/environments.js";
|
|
15
15
|
import { DEFAULT_TLD } from "../dist/dotns.js";
|
|
16
|
+
import { GuardedWebSocket } from "../dist/ws.js";
|
|
16
17
|
import * as fs from "fs";
|
|
17
18
|
import * as readline from "readline";
|
|
18
19
|
|
|
20
|
+
// The SSO SDKs build their own papi providers from the global WebSocket.
|
|
21
|
+
globalThis.WebSocket = GuardedWebSocket;
|
|
22
|
+
|
|
19
23
|
// Install early so anything printed during flag parsing / preflight is
|
|
20
24
|
// available to the bug-report log tail.
|
|
21
25
|
installLogCapture();
|
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-IF3SANQR.js";
|
|
14
14
|
import "./chunk-3NR3T7US.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-YLLTQM5Z.js";
|
|
16
|
+
import "./chunk-3BSPX4JN.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-LRRFXOLE.js";
|
|
14
|
+
import "./chunk-BXDMEOLH.js";
|
|
15
|
+
import "./chunk-YLLTQM5Z.js";
|
|
16
|
+
import "./chunk-3BSPX4JN.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-MTXFJTX6.js";
|
|
7
|
+
import "./chunk-YLLTQM5Z.js";
|
|
8
|
+
import "./chunk-3BSPX4JN.js";
|
|
9
9
|
import "./chunk-SH2LG52Z.js";
|
|
10
10
|
export {
|
|
11
11
|
ChainHealthSampler,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getWsProvider
|
|
3
|
+
} from "./chunk-6GHDPDZN.js";
|
|
4
|
+
|
|
1
5
|
// src/pool.ts
|
|
2
6
|
import { sr25519CreateDerive } from "@polkadot-labs/hdkd";
|
|
3
7
|
import { DEV_PHRASE, entropyToMiniSecret, mnemonicToEntropy } from "@polkadot-labs/hdkd-helpers";
|
|
4
8
|
import { createClient, Enum } from "polkadot-api";
|
|
5
9
|
import { getPolkadotSigner } from "polkadot-api/signer";
|
|
6
|
-
import { getWsProvider } from "polkadot-api/ws";
|
|
7
10
|
import { Keyring } from "@polkadot/keyring";
|
|
8
11
|
import { cryptoWaitReady } from "@polkadot/util-crypto";
|
|
9
12
|
var PAS_DECIMALS_DIVISOR = 1e10;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/auth/vendor/signer.ts
|
|
2
|
+
import { ss58Encode } from "@parity/product-sdk-address";
|
|
3
|
+
import { createDevSigner, getDevPublicKey } from "@parity/product-sdk-tx";
|
|
4
|
+
import { seedToAccount } from "@parity/product-sdk-keys";
|
|
5
|
+
var SignerNotAvailableError = class extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super('No signer available. Run "login" to sign in, or pass --suri //Alice for dev.');
|
|
8
|
+
this.name = "SignerNotAvailableError";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var DEV_NAMES = ["Alice", "Bob", "Charlie", "Dave", "Eve", "Ferdie"];
|
|
12
|
+
function parseDevAccountName(suri) {
|
|
13
|
+
const name = suri.replace(/^\/\//, "");
|
|
14
|
+
return DEV_NAMES.find((n) => n.toLowerCase() === name.toLowerCase()) ?? null;
|
|
15
|
+
}
|
|
16
|
+
async function resolveSigner(authClient, options) {
|
|
17
|
+
if (options?.suri) {
|
|
18
|
+
const devName = parseDevAccountName(options.suri);
|
|
19
|
+
if (devName) {
|
|
20
|
+
return {
|
|
21
|
+
signer: createDevSigner(devName),
|
|
22
|
+
address: ss58Encode(getDevPublicKey(devName)),
|
|
23
|
+
source: "dev",
|
|
24
|
+
destroy() {
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const sepIdx = options.suri.indexOf("//");
|
|
29
|
+
const mnemonic = (sepIdx === -1 ? options.suri : options.suri.slice(0, sepIdx)).trim();
|
|
30
|
+
const path = sepIdx === -1 ? "" : options.suri.slice(sepIdx);
|
|
31
|
+
try {
|
|
32
|
+
const account = seedToAccount(mnemonic, path);
|
|
33
|
+
return {
|
|
34
|
+
signer: account.signer,
|
|
35
|
+
address: ss58Encode(account.publicKey),
|
|
36
|
+
source: "dev",
|
|
37
|
+
destroy() {
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
} catch {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Unrecognized SURI "${options.suri}". Expected a dev name (${DEV_NAMES.join(", ")}) or a BIP-39 mnemonic.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const session = await authClient.getSessionSigner();
|
|
47
|
+
if (session) {
|
|
48
|
+
return { ...session, source: "session" };
|
|
49
|
+
}
|
|
50
|
+
throw new SignerNotAvailableError();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
SignerNotAvailableError,
|
|
55
|
+
parseDevAccountName,
|
|
56
|
+
resolveSigner
|
|
57
|
+
};
|
|
@@ -6,7 +6,7 @@ import * as path from "path";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "bulletin-deploy",
|
|
9
|
-
version: "0.20.0
|
|
9
|
+
version: "0.20.0",
|
|
10
10
|
private: false,
|
|
11
11
|
repository: {
|
|
12
12
|
type: "git",
|
|
@@ -52,11 +52,11 @@ var package_default = {
|
|
|
52
52
|
"tools/verify-baked-dsn.mjs"
|
|
53
53
|
],
|
|
54
54
|
scripts: {
|
|
55
|
-
build: "tsup
|
|
55
|
+
build: "tsup",
|
|
56
56
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
57
57
|
postinstall: "patch-package || true",
|
|
58
58
|
prepare: "npm run build",
|
|
59
|
-
test: "npm run build && node
|
|
59
|
+
test: "npm run build && node scripts/run-unit-tests.mjs && npm run test:vendor",
|
|
60
60
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
61
61
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
62
62
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|