@parity/product-deploy 0.8.3 → 0.9.0-rc.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/LICENSE +674 -201
- package/README.md +9 -3
- package/assets/environments.json +0 -1
- package/dist/auth/index.d.ts +2 -3
- package/dist/auth/index.js +1 -1
- package/dist/auth/vendor/index.d.ts +2 -3
- package/dist/auth/vendor/index.js +1 -1
- package/dist/auth/vendor/ui/index.d.ts +1 -2
- package/dist/auth-C-Pel0AT.d.ts +235 -0
- package/dist/auth-config.d.ts +30 -8
- package/dist/auth-config.js +14 -6
- package/dist/bug-report.js +4 -4
- package/dist/{chunk-XM5MFMMX.js → chunk-2SR5D4CP.js} +19 -15
- package/dist/{chunk-HK3B5MKA.js → chunk-6NW5M3F5.js} +9 -20
- package/dist/{chunk-2OZVKA3D.js → chunk-DHY2ZXVZ.js} +36 -28
- package/dist/chunk-G56VYTUD.js +75 -0
- package/dist/{chunk-5K3RI5C2.js → chunk-GL3U7K2B.js} +0 -1
- package/dist/{chunk-YUSHBZBX.js → chunk-H4LWILH4.js} +32 -6
- package/dist/chunk-J7CYVTAW.js +43 -0
- package/dist/{chunk-WF2XKCEZ.js → chunk-LCKLYFAZ.js} +1 -1
- package/dist/{chunk-3LNKPUZ7.js → chunk-NP4SLURL.js} +1 -1
- package/dist/{chunk-LRRQP7DH.js → chunk-O2NWQLYB.js} +2 -2
- package/dist/{chunk-DKGCOGRT.js → chunk-RD2QHYTL.js} +144 -37
- package/dist/{chunk-S7S7WENB.js → chunk-WZBAQCA5.js} +2 -2
- package/dist/{chunk-JMHX3M4C.js → chunk-YIKGVALU.js} +3 -3
- package/dist/chunk-probe.js +3 -3
- package/dist/commands/login.d.ts +34 -9
- package/dist/commands/login.js +171 -68
- package/dist/commands/logout.d.ts +1 -2
- package/dist/commands/logout.js +5 -3
- package/dist/commands/whoami.d.ts +1 -2
- package/dist/commands/whoami.js +7 -4
- package/dist/deploy.d.ts +7 -1
- package/dist/deploy.js +12 -9
- package/dist/dotns.js +4 -4
- package/dist/environments.js +1 -1
- package/dist/index.js +11 -10
- package/dist/manifest/publish.js +11 -10
- package/dist/manifest/types.d.ts +1 -1
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +10 -9
- package/dist/personhood/bootstrap.js +10 -10
- package/dist/personhood/people-client.js +4 -4
- package/dist/run-state.js +1 -1
- package/dist/{signer-CriGqahj.d.ts → signer-vR6KKC7V.d.ts} +1 -1
- package/dist/spinner.d.ts +21 -0
- package/dist/spinner.js +6 -0
- package/dist/sss-allowance.d.ts +29 -0
- package/dist/sss-allowance.js +8 -0
- package/dist/storage-signer.d.ts +94 -2
- package/dist/storage-signer.js +18 -9
- package/dist/telemetry.js +2 -2
- package/dist/version-check.d.ts +0 -3
- package/dist/version-check.js +3 -3
- package/package.json +19 -15
- package/dist/allocations-B65Is4Md.d.ts +0 -97
- package/dist/auth-DkRZBK-T.d.ts +0 -122
package/dist/merkle.js
CHANGED
|
@@ -6,22 +6,23 @@ import {
|
|
|
6
6
|
merkleizeKuboBackend,
|
|
7
7
|
merkleizeWithStableOrder,
|
|
8
8
|
rebuildOrderedCarFromBytes
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RD2QHYTL.js";
|
|
10
|
+
import "./chunk-G56VYTUD.js";
|
|
10
11
|
import "./chunk-HOTQDYHD.js";
|
|
11
12
|
import "./chunk-IW3X2MJF.js";
|
|
12
13
|
import "./chunk-KOSF5FDO.js";
|
|
13
14
|
import "./chunk-J3NIXHZZ.js";
|
|
14
15
|
import "./chunk-S7EM5VMW.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-H4LWILH4.js";
|
|
17
|
+
import "./chunk-O2NWQLYB.js";
|
|
18
|
+
import "./chunk-6NW5M3F5.js";
|
|
19
|
+
import "./chunk-NP4SLURL.js";
|
|
19
20
|
import "./chunk-C2TS5MER.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-WZBAQCA5.js";
|
|
21
22
|
import "./chunk-QS7YU76C.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-LCKLYFAZ.js";
|
|
24
|
+
import "./chunk-2SR5D4CP.js";
|
|
25
|
+
import "./chunk-GL3U7K2B.js";
|
|
25
26
|
import "./chunk-ZOC4GITL.js";
|
|
26
27
|
export {
|
|
27
28
|
buildOrderedCar,
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
bindPersonalIdToAccount
|
|
3
|
-
} from "../chunk-7URNKK6J.js";
|
|
4
|
-
import {
|
|
5
|
-
runChainPrereqProbes
|
|
6
|
-
} from "../chunk-XAB7WM3S.js";
|
|
7
1
|
import {
|
|
8
2
|
claimPgas
|
|
9
3
|
} from "../chunk-EATOPQFR.js";
|
|
@@ -16,9 +10,15 @@ import {
|
|
|
16
10
|
bindPaidAliasToAccount
|
|
17
11
|
} from "../chunk-OCKCB72S.js";
|
|
18
12
|
import "../chunk-EJI3MX4G.js";
|
|
13
|
+
import {
|
|
14
|
+
bindPersonalIdToAccount
|
|
15
|
+
} from "../chunk-7URNKK6J.js";
|
|
19
16
|
import {
|
|
20
17
|
bytesToHex
|
|
21
18
|
} from "../chunk-ZYVGHDMU.js";
|
|
19
|
+
import {
|
|
20
|
+
runChainPrereqProbes
|
|
21
|
+
} from "../chunk-XAB7WM3S.js";
|
|
22
22
|
import {
|
|
23
23
|
DOTNS_CONTEXT_BYTES,
|
|
24
24
|
PEOPLE_MEMBER_IDENTIFIER_HEX,
|
|
@@ -26,13 +26,13 @@ import {
|
|
|
26
26
|
} from "../chunk-SI2ZUOYD.js";
|
|
27
27
|
import {
|
|
28
28
|
WS_HEARTBEAT_TIMEOUT_MS
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-WZBAQCA5.js";
|
|
30
30
|
import "../chunk-QS7YU76C.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-LCKLYFAZ.js";
|
|
32
|
+
import "../chunk-2SR5D4CP.js";
|
|
33
33
|
import {
|
|
34
34
|
loadEnvironments
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-GL3U7K2B.js";
|
|
36
36
|
import "../chunk-ZOC4GITL.js";
|
|
37
37
|
|
|
38
38
|
// src/personhood/bootstrap.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WS_HEARTBEAT_TIMEOUT_MS
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-WZBAQCA5.js";
|
|
4
4
|
import "../chunk-QS7YU76C.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-LCKLYFAZ.js";
|
|
6
|
+
import "../chunk-2SR5D4CP.js";
|
|
7
7
|
import {
|
|
8
8
|
loadEnvironments
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-GL3U7K2B.js";
|
|
10
10
|
import "../chunk-ZOC4GITL.js";
|
|
11
11
|
|
|
12
12
|
// src/personhood/people-client.ts
|
package/dist/run-state.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DevAccountName } from '@parity/product-sdk-tx';
|
|
2
2
|
import { PolkadotSigner } from 'polkadot-api';
|
|
3
|
-
import {
|
|
3
|
+
import { h as SessionHandle, S as SessionAddresses, c as AuthClient } from './auth-C-Pel0AT.js';
|
|
4
4
|
|
|
5
5
|
type SignerSource = "dev" | "session";
|
|
6
6
|
interface ResolvedSigner {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal terminal spinner with an elapsed-time readout.
|
|
3
|
+
*
|
|
4
|
+
* Renders `⠙ <label>… (3s)` on a single line via carriage-return redraw, in the
|
|
5
|
+
* style of Claude Code's live status. Built for awaiting a single async op
|
|
6
|
+
* (e.g. polling on-chain authorization during login).
|
|
7
|
+
*
|
|
8
|
+
* Footgun-safe by design:
|
|
9
|
+
* - the redraw interval is .unref()'d, so it never keeps the Node event loop
|
|
10
|
+
* alive — callers that process.exit() still exit cleanly.
|
|
11
|
+
* - stop() is idempotent and always clears the interval.
|
|
12
|
+
* - in a non-TTY (CI / piped output) it prints one static line and no \r
|
|
13
|
+
* animation, so logs stay clean.
|
|
14
|
+
*/
|
|
15
|
+
interface Spinner {
|
|
16
|
+
/** Stop the spinner, clear the line, and optionally print a final line. */
|
|
17
|
+
stop(finalLine?: string): void;
|
|
18
|
+
}
|
|
19
|
+
declare function startSpinner(label: string, stream?: NodeJS.WriteStream): Spinner;
|
|
20
|
+
|
|
21
|
+
export { type Spinner, startSpinner };
|
package/dist/spinner.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statement Store (SSS) allowance preflight — pure storage read, no signing.
|
|
3
|
+
*
|
|
4
|
+
* The People chain stores SSS allowances under a deterministic key:
|
|
5
|
+
* b":statement_allowance:" ++ raw_32_byte_account_pubkey
|
|
6
|
+
*
|
|
7
|
+
* We can check this via a single `state_getStorage` RPC call — no transaction,
|
|
8
|
+
* no phone dialog. Non-null, non-"0x" result means the allowance is present.
|
|
9
|
+
*
|
|
10
|
+
* Reference: substrate/primitives/statement-store/src/lib.rs
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build the hex-encoded storage key for an SSS allowance check.
|
|
14
|
+
*
|
|
15
|
+
* Format: 0x + hex(":statement_allowance:" + pubkey_32_bytes)
|
|
16
|
+
* No twox/blake2 hashing — the key is the raw concatenation.
|
|
17
|
+
*/
|
|
18
|
+
declare function sssStorageKey(pubkey: Uint8Array): string;
|
|
19
|
+
/**
|
|
20
|
+
* Check whether a Statement Store allowance is present on the People chain.
|
|
21
|
+
*
|
|
22
|
+
* @returns
|
|
23
|
+
* - `true` — allowance present (continue)
|
|
24
|
+
* - `false` — allowance absent / expired (user must re-login)
|
|
25
|
+
* - `null` — could not determine (network error or timeout; caller decides whether to block)
|
|
26
|
+
*/
|
|
27
|
+
declare function checkSSSAllowance(pubkey: Uint8Array, peopleEndpoints: string[], timeoutMs?: number): Promise<boolean | null>;
|
|
28
|
+
|
|
29
|
+
export { checkSSSAllowance, sssStorageKey };
|
package/dist/storage-signer.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import { PolkadotSigner } from 'polkadot-api';
|
|
|
5
5
|
* Returns null when not cached. storageDir defaults to os.homedir().
|
|
6
6
|
*
|
|
7
7
|
* Cache format: @parity/product-sdk-terminal host-cache.ts v1.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: reads the pre-0.8.6 plaintext cache format (_AllowanceKeys.json). On host-papp 0.8.6+
|
|
10
|
+
* the cache is AES-encrypted and keyed by sessionId (_AllowanceKeys_<sessionId>.json), so
|
|
11
|
+
* this function returns null on 0.8.6+ installations. Use adapter.allowance.getBulletinSigner()
|
|
12
|
+
* for runtime checks instead.
|
|
8
13
|
*/
|
|
9
14
|
declare function readBulletinSlotSigner(appId: string, storageDir?: string): Promise<{
|
|
10
15
|
signer: PolkadotSigner;
|
|
@@ -24,9 +29,96 @@ declare function extractBulletinSlotKey(outcomes: {
|
|
|
24
29
|
tag: string;
|
|
25
30
|
value: unknown;
|
|
26
31
|
}[]): `0x${string}` | null;
|
|
32
|
+
/**
|
|
33
|
+
* Typed error thrown by getSlotSignerProvider when the slot account is not
|
|
34
|
+
* usably authorized on-chain. The `reason` field lets callers produce
|
|
35
|
+
* targeted messages without string-matching.
|
|
36
|
+
*
|
|
37
|
+
* "missing" — no Authorizations entry found for the slot account.
|
|
38
|
+
* "expired" — entry exists but expiration ≤ current finalized block.
|
|
39
|
+
*/
|
|
40
|
+
declare class BulletinSlotAuthError extends Error {
|
|
41
|
+
readonly reason: "missing" | "expired";
|
|
42
|
+
/** The on-chain expiration block (only set when reason === "expired"). */
|
|
43
|
+
readonly expiration?: number;
|
|
44
|
+
constructor(reason: "missing" | "expired", ss58: string, expiration?: number);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Pure active-test for a Bulletin Authorizations entry.
|
|
48
|
+
* Shared by getSlotSignerProvider (single probe) and the poll loop in
|
|
49
|
+
* waitForBulletinAuthorization (repeated probes).
|
|
50
|
+
*
|
|
51
|
+
* @param auth Raw value from TransactionStorage.Authorizations.getValue — null when absent.
|
|
52
|
+
* @param blockNumber Current finalized block number.
|
|
53
|
+
*/
|
|
54
|
+
declare function isBulletinAuthActive(auth: {
|
|
55
|
+
expiration?: bigint | number;
|
|
56
|
+
} | null | undefined, blockNumber: number): {
|
|
57
|
+
active: true;
|
|
58
|
+
expiration: number;
|
|
59
|
+
} | {
|
|
60
|
+
active: false;
|
|
61
|
+
reason: "missing" | "expired";
|
|
62
|
+
expiration?: number;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Internal poll loop for waitForBulletinAuthorization.
|
|
66
|
+
* Injecting the query function keeps the loop unit-testable without a real WS connection.
|
|
67
|
+
*
|
|
68
|
+
* @param queryFn Async function that returns {auth, blockNumber} — mock in tests.
|
|
69
|
+
* @param opts pollMs (default 2000), timeoutMs (default 90000).
|
|
70
|
+
*
|
|
71
|
+
* Transient query errors (thrown by queryFn) are retried until the deadline — a
|
|
72
|
+
* flaky WS read is NOT treated as "unauthorized". Only a clean active-check
|
|
73
|
+
* returning false advances toward timeout.
|
|
74
|
+
*/
|
|
75
|
+
declare function pollUntilBulletinAuthorized(queryFn: () => Promise<{
|
|
76
|
+
auth: {
|
|
77
|
+
expiration?: bigint | number;
|
|
78
|
+
} | null | undefined;
|
|
79
|
+
blockNumber: number;
|
|
80
|
+
}>, opts?: {
|
|
81
|
+
timeoutMs?: number;
|
|
82
|
+
pollMs?: number;
|
|
83
|
+
}): Promise<{
|
|
84
|
+
authorized: true;
|
|
85
|
+
expiration: number;
|
|
86
|
+
} | {
|
|
87
|
+
authorized: false;
|
|
88
|
+
reason: "timeout";
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Open a Bulletin WS connection, poll Authorizations until the slot account's
|
|
92
|
+
* authorization lands on-chain, then destroy the connection and return.
|
|
93
|
+
*
|
|
94
|
+
* Intended for the fresh-login path in src/commands/login.ts to gate the
|
|
95
|
+
* success summary until the authorization is finalized (avoids the first-run
|
|
96
|
+
* race where deploy checks immediately after phone approval but before the
|
|
97
|
+
* on-chain tx is included).
|
|
98
|
+
*
|
|
99
|
+
* Does NOT print any progress — the caller (login.ts) owns the output via a
|
|
100
|
+
* spinner. Pass `quiet: true` to suppress connection status chatter so the
|
|
101
|
+
* caller's spinner owns the line.
|
|
102
|
+
*
|
|
103
|
+
* @returns `{ authorized: true, expiration }` on success;
|
|
104
|
+
* `{ authorized: false, reason: "timeout" }` after the configured timeout.
|
|
105
|
+
*/
|
|
106
|
+
declare function waitForBulletinAuthorization(ss58: string, opts?: {
|
|
107
|
+
timeoutMs?: number;
|
|
108
|
+
pollMs?: number;
|
|
109
|
+
quiet?: boolean;
|
|
110
|
+
endpoints?: string[];
|
|
111
|
+
}): Promise<{
|
|
112
|
+
authorized: true;
|
|
113
|
+
expiration: number;
|
|
114
|
+
} | {
|
|
115
|
+
authorized: false;
|
|
116
|
+
reason: "timeout";
|
|
117
|
+
}>;
|
|
27
118
|
/**
|
|
28
119
|
* Create a Bulletin WS connection for the slot-account signer.
|
|
29
|
-
*
|
|
120
|
+
* Checks on-chain authorization (single probe — no poll). Throws BulletinSlotAuthError
|
|
121
|
+
* with reason "missing" | "expired" so callers can distinguish and produce targeted messages.
|
|
30
122
|
*/
|
|
31
123
|
declare function getSlotSignerProvider(signer: PolkadotSigner, ss58: string): Promise<{
|
|
32
124
|
client: any;
|
|
@@ -35,4 +127,4 @@ declare function getSlotSignerProvider(signer: PolkadotSigner, ss58: string): Pr
|
|
|
35
127
|
ss58: string;
|
|
36
128
|
}>;
|
|
37
129
|
|
|
38
|
-
export { extractBulletinSlotKey, getSlotSignerProvider, readBulletinSlotSigner, writeBulletinSlotKey };
|
|
130
|
+
export { BulletinSlotAuthError, extractBulletinSlotKey, getSlotSignerProvider, isBulletinAuthActive, pollUntilBulletinAuthorized, readBulletinSlotSigner, waitForBulletinAuthorization, writeBulletinSlotKey };
|
package/dist/storage-signer.js
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BulletinSlotAuthError,
|
|
2
3
|
extractBulletinSlotKey,
|
|
3
4
|
getSlotSignerProvider,
|
|
5
|
+
isBulletinAuthActive,
|
|
6
|
+
pollUntilBulletinAuthorized,
|
|
4
7
|
readBulletinSlotSigner,
|
|
8
|
+
waitForBulletinAuthorization,
|
|
5
9
|
writeBulletinSlotKey
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RD2QHYTL.js";
|
|
11
|
+
import "./chunk-G56VYTUD.js";
|
|
7
12
|
import "./chunk-HOTQDYHD.js";
|
|
8
13
|
import "./chunk-IW3X2MJF.js";
|
|
9
14
|
import "./chunk-KOSF5FDO.js";
|
|
10
15
|
import "./chunk-J3NIXHZZ.js";
|
|
11
16
|
import "./chunk-S7EM5VMW.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-H4LWILH4.js";
|
|
18
|
+
import "./chunk-O2NWQLYB.js";
|
|
19
|
+
import "./chunk-6NW5M3F5.js";
|
|
20
|
+
import "./chunk-NP4SLURL.js";
|
|
16
21
|
import "./chunk-C2TS5MER.js";
|
|
17
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-WZBAQCA5.js";
|
|
18
23
|
import "./chunk-QS7YU76C.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-LCKLYFAZ.js";
|
|
25
|
+
import "./chunk-2SR5D4CP.js";
|
|
26
|
+
import "./chunk-GL3U7K2B.js";
|
|
22
27
|
import "./chunk-ZOC4GITL.js";
|
|
23
28
|
export {
|
|
29
|
+
BulletinSlotAuthError,
|
|
24
30
|
extractBulletinSlotKey,
|
|
25
31
|
getSlotSignerProvider,
|
|
32
|
+
isBulletinAuthActive,
|
|
33
|
+
pollUntilBulletinAuthorized,
|
|
26
34
|
readBulletinSlotSigner,
|
|
35
|
+
waitForBulletinAuthorization,
|
|
27
36
|
writeBulletinSlotKey
|
|
28
37
|
};
|
package/dist/telemetry.js
CHANGED
package/dist/version-check.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { Readable } from 'node:stream';
|
|
|
3
3
|
interface VersionInfo {
|
|
4
4
|
latest: string;
|
|
5
5
|
minimumFromRegistry: string | null;
|
|
6
|
-
minimumFromKillSwitch: string | null;
|
|
7
|
-
killSwitchMessage: string | null;
|
|
8
6
|
}
|
|
9
7
|
declare function checkNodeVersion(enginesNode: string, currentVersion: string): string | null;
|
|
10
8
|
declare function compareSemver(a: string, b: string): number;
|
|
@@ -20,7 +18,6 @@ type VersionVerdict = {
|
|
|
20
18
|
action: "forced_update";
|
|
21
19
|
currentVersion: string;
|
|
22
20
|
minimumVersion: string;
|
|
23
|
-
message: string | null;
|
|
24
21
|
} | {
|
|
25
22
|
action: "suggest_update";
|
|
26
23
|
currentVersion: string;
|
package/dist/version-check.js
CHANGED
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
isPreReleaseVersion,
|
|
12
12
|
preReleaseWarning,
|
|
13
13
|
promptYesNo
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-6NW5M3F5.js";
|
|
15
|
+
import "./chunk-LCKLYFAZ.js";
|
|
16
|
+
import "./chunk-2SR5D4CP.js";
|
|
17
17
|
export {
|
|
18
18
|
assessVersion,
|
|
19
19
|
checkNodeVersion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parity/product-deploy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-rc.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,15 +43,17 @@
|
|
|
43
43
|
"tools/release-retry-wrapper.mjs"
|
|
44
44
|
],
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "tsup src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts src/environments.ts src/errors.ts src/manifest.ts src/chunk-probe.ts src/manifest-embed.ts src/manifest-fetch.ts src/manifest-roundtrip.ts src/incremental-stats.ts src/chunker.ts src/personhood/encoding.ts src/personhood/hashing.ts src/personhood/constants.ts src/personhood/member-key.ts src/personhood/people-client.ts src/personhood/proof-validity.ts src/personhood/reprove.ts src/personhood/bind-personal-id.ts src/personhood/claim-pgas.ts src/personhood/bind-paid-alias.ts src/personhood/bootstrap.ts src/personhood/chain-prereqs.ts src/manifest/types.ts src/manifest/schema.ts src/manifest/byte-budget.ts src/manifest/config-load.ts src/manifest/publish.ts src/auth/index.ts src/auth/vendor/index.ts src/auth/vendor/ui/index.ts src/auth-config.ts src/commands/login.ts src/commands/logout.ts src/commands/whoami.ts src/storage-signer.ts --format esm --dts --clean --target node22",
|
|
46
|
+
"build": "tsup src/index.ts src/deploy.ts src/dotns.ts src/pool.ts src/telemetry.ts src/memory-report.ts src/merkle.ts src/gh-pages-mirror.ts src/version-check.ts src/bug-report.ts src/run-state.ts src/environments.ts src/errors.ts src/manifest.ts src/chunk-probe.ts src/manifest-embed.ts src/manifest-fetch.ts src/manifest-roundtrip.ts src/incremental-stats.ts src/chunker.ts src/personhood/encoding.ts src/personhood/hashing.ts src/personhood/constants.ts src/personhood/member-key.ts src/personhood/people-client.ts src/personhood/proof-validity.ts src/personhood/reprove.ts src/personhood/bind-personal-id.ts src/personhood/claim-pgas.ts src/personhood/bind-paid-alias.ts src/personhood/bootstrap.ts src/personhood/chain-prereqs.ts src/manifest/types.ts src/manifest/schema.ts src/manifest/byte-budget.ts src/manifest/config-load.ts src/manifest/publish.ts src/auth/index.ts src/auth/vendor/index.ts src/auth/vendor/ui/index.ts src/auth-config.ts src/commands/login.ts src/commands/logout.ts src/commands/whoami.ts src/storage-signer.ts src/spinner.ts src/sss-allowance.ts --format esm --dts --clean --target node22",
|
|
47
47
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
48
|
+
"postinstall": "patch-package",
|
|
48
49
|
"prepare": "npm run build",
|
|
49
|
-
"test": "npm run build && node --test test/test.js test/cli-help.test.js test/helpers/e2e-helpers.test.js test/environments.test.js test/refresh-environments.test.js test/chunk-sharing-report.test.js test/product-manifest.test.js test/cache-savings-totals.test.js test/error-pattern-signature.test.js test/exit-codes.test.js test/probe-env-health.test.js test/e2e-chain-calls.test.js test/auth-config.test.js test/whoami.test.js test/login.test.js test/logout.test.js test/auth-resolve.test.js",
|
|
50
|
+
"test": "npm run build && node --test test/test.js test/cli-help.test.js test/helpers/e2e-helpers.test.js test/environments.test.js test/refresh-environments.test.js test/chunk-sharing-report.test.js test/product-manifest.test.js test/cache-savings-totals.test.js test/error-pattern-signature.test.js test/exit-codes.test.js test/probe-env-health.test.js test/e2e-chain-calls.test.js test/auth-config.test.js test/whoami.test.js test/login.test.js test/logout.test.js test/auth-resolve.test.js test/storage-signer.test.js test/spinner.test.js test/sss-allowance.test.js && npm run test:vendor",
|
|
50
51
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
51
52
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
52
53
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
|
53
54
|
"test:e2e:nightly": "bash scripts/e2e-pass.sh nightly",
|
|
54
|
-
"benchmark": "npm run build && node benchmark.js"
|
|
55
|
+
"benchmark": "npm run build && node benchmark.js",
|
|
56
|
+
"test:vendor": "vitest run src/auth/vendor"
|
|
55
57
|
},
|
|
56
58
|
"dependencies": {
|
|
57
59
|
"@ipld/car": "^5.4.3",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"@noble/hashes": "^1.7.2",
|
|
60
62
|
"@parity/product-sdk-address": "^0.1.1",
|
|
61
63
|
"@parity/product-sdk-keys": "^0.3.0",
|
|
62
|
-
"@parity/product-sdk-terminal": "^0.
|
|
64
|
+
"@parity/product-sdk-terminal": "^0.3.1",
|
|
63
65
|
"@parity/product-sdk-tx": "^0.2.4",
|
|
64
66
|
"@polkadot-api/metadata-builders": "^0.14.2",
|
|
65
67
|
"@polkadot-api/substrate-bindings": "^0.20.2",
|
|
@@ -74,26 +76,28 @@
|
|
|
74
76
|
"multiformats": "^13.4.1",
|
|
75
77
|
"polkadot-api": "^2.1.3",
|
|
76
78
|
"verifiablejs": "1.3.0-beta.4",
|
|
77
|
-
"viem": "^2.30.5"
|
|
79
|
+
"viem": "^2.30.5",
|
|
80
|
+
"ws": "^8.20.1"
|
|
78
81
|
},
|
|
79
82
|
"devDependencies": {
|
|
80
83
|
"@types/node": "^22.0.0",
|
|
84
|
+
"@types/ws": "^8.18.1",
|
|
85
|
+
"patch-package": "^8.0.1",
|
|
81
86
|
"tsup": "^8.5.0",
|
|
82
87
|
"typescript": "^5.9.3",
|
|
83
|
-
"vitest": "^
|
|
84
|
-
"ws": "^8.20.1"
|
|
88
|
+
"vitest": "^4.1.0"
|
|
85
89
|
},
|
|
86
90
|
"overrides": {
|
|
87
91
|
"@polkadot-api/json-rpc-provider": "^0.2.0",
|
|
88
|
-
"@novasamatech/host-api": "0.
|
|
89
|
-
"@novasamatech/host-papp": "0.
|
|
90
|
-
"@novasamatech/
|
|
91
|
-
"@novasamatech/
|
|
92
|
-
"@novasamatech/
|
|
93
|
-
"@novasamatech/storage-adapter": "0.7.9-4"
|
|
92
|
+
"@novasamatech/host-api": "0.8.6",
|
|
93
|
+
"@novasamatech/host-papp": "0.8.6",
|
|
94
|
+
"@novasamatech/scale": "0.8.6",
|
|
95
|
+
"@novasamatech/statement-store": "0.8.6",
|
|
96
|
+
"@novasamatech/storage-adapter": "0.8.6"
|
|
94
97
|
},
|
|
95
98
|
"minimumVersion": "0.5.6",
|
|
96
99
|
"engines": {
|
|
97
100
|
"node": ">=22"
|
|
98
|
-
}
|
|
101
|
+
},
|
|
102
|
+
"license": "GPL-3.0-or-later"
|
|
99
103
|
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { UserSession } from '@parity/product-sdk-terminal';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Thin wrapper over the RFC-0010 `host_request_resource_allocation` call.
|
|
5
|
-
* Lifted from playground-cli `src/utils/allowances/host.ts` (issue #411).
|
|
6
|
-
*
|
|
7
|
-
* `@parity/product-sdk-terminal` does not yet re-export this API at its
|
|
8
|
-
* package root, but the underlying `UserSession` (from `@novasamatech/host-papp`)
|
|
9
|
-
* exposes `requestResourceAllocation()`. We call it directly here and gate the
|
|
10
|
-
* shape locally so consumers stay decoupled from the deep import path. Replace
|
|
11
|
-
* this whole module with a `product-sdk-terminal` re-export once the SDK
|
|
12
|
-
* surfaces the same call.
|
|
13
|
-
*
|
|
14
|
-
* Wire format (SCALE-derived, mirrors host-papp's
|
|
15
|
-
* `dist/sso/sessionManager/scale/resourceAllocation.d.ts`):
|
|
16
|
-
* request → { callingProductId, resources: AllocatableResource[], onExisting }
|
|
17
|
-
* response → AllocationOutcome[] (one per resource, in order)
|
|
18
|
-
*
|
|
19
|
-
* The mobile app handles `hostRequestResourceAllocation` in
|
|
20
|
-
* `AllowanceHostCalls.kt` and routes the user through an approval UI.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Structural mirror of host-papp's `ApAllocatableResource` codec type. We
|
|
25
|
-
* declare it locally because host-papp's package root doesn't re-export the
|
|
26
|
-
* codec types yet — when it does (and product-sdk-terminal threads them
|
|
27
|
-
* through) this can be replaced with a direct import.
|
|
28
|
-
*
|
|
29
|
-
* StatementStoreAllowance — write to the SSS (host_chat, allowance ring).
|
|
30
|
-
* BulletInAllowance — write to Bulletin (TransactionStorage.store).
|
|
31
|
-
* SmartContractAllowance — PGAS sponsoring for Revive contract calls.
|
|
32
|
-
* The `value` is the derivation index of the
|
|
33
|
-
* product account (0 for the default account).
|
|
34
|
-
* AutoSigning — surrender the product-account signing key to
|
|
35
|
-
* the host so it can sign on the user's behalf
|
|
36
|
-
* without per-call prompts. Not used today.
|
|
37
|
-
*/
|
|
38
|
-
type AllocatableResource = {
|
|
39
|
-
tag: "StatementStoreAllowance";
|
|
40
|
-
value: undefined;
|
|
41
|
-
} | {
|
|
42
|
-
tag: "BulletInAllowance";
|
|
43
|
-
value: undefined;
|
|
44
|
-
} | {
|
|
45
|
-
tag: "SmartContractAllowance";
|
|
46
|
-
value: number;
|
|
47
|
-
} | {
|
|
48
|
-
tag: "AutoSigning";
|
|
49
|
-
value: undefined;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Outcome of one allocation. We don't read the inner `Allocated` payload
|
|
53
|
-
* (allowance slot keys, derivation secrets) — the host stores them and uses
|
|
54
|
-
* them transparently on subsequent calls. We just need the tag to know
|
|
55
|
-
* whether the allocation succeeded.
|
|
56
|
-
*/
|
|
57
|
-
type AllocationOutcome = {
|
|
58
|
-
tag: "Allocated";
|
|
59
|
-
value: unknown;
|
|
60
|
-
} | {
|
|
61
|
-
tag: "Rejected";
|
|
62
|
-
value: undefined;
|
|
63
|
-
} | {
|
|
64
|
-
tag: "NotAvailable";
|
|
65
|
-
value: undefined;
|
|
66
|
-
};
|
|
67
|
-
/** Tag-only view, handy for downstream code that doesn't care about payloads. */
|
|
68
|
-
type ResourceTag = AllocatableResource["tag"];
|
|
69
|
-
type OnExistingAllowancePolicy = "Ignore" | "Increase";
|
|
70
|
-
/**
|
|
71
|
-
* Default mobile-granted resource set for a CLI product account: write access
|
|
72
|
-
* to the statement store + Bulletin, plus PGAS sponsoring for the default
|
|
73
|
-
* (index 0) product account.
|
|
74
|
-
*/
|
|
75
|
-
declare const DEFAULT_RESOURCES: AllocatableResource[];
|
|
76
|
-
/**
|
|
77
|
-
* Send a `host_request_resource_allocation` request over the user's active
|
|
78
|
-
* session. The host (mobile wallet) prompts the user to approve and returns
|
|
79
|
-
* one outcome per requested resource in order.
|
|
80
|
-
*
|
|
81
|
-
* Throws on transport-level failures (Statement Store unreachable, encryption
|
|
82
|
-
* error, etc.). Per-resource refusals are reported as `Rejected`/`NotAvailable`
|
|
83
|
-
* outcomes — callers inspect the array to decide whether to proceed.
|
|
84
|
-
*/
|
|
85
|
-
declare function requestResourceAllocation(session: UserSession, productId: string, resources?: AllocatableResource[], onExisting?: OnExistingAllowancePolicy): Promise<AllocationOutcome[]>;
|
|
86
|
-
interface AllocationSummary {
|
|
87
|
-
granted: AllocatableResource[];
|
|
88
|
-
rejected: AllocatableResource[];
|
|
89
|
-
unavailable: AllocatableResource[];
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Bucket allocation outcomes by tag. Order-sensitive: `outcomes[i]` maps to
|
|
93
|
-
* `resources[i]`. Outcomes without a matching resource are silently dropped.
|
|
94
|
-
*/
|
|
95
|
-
declare function summarizeOutcomes(outcomes: AllocationOutcome[], resources: AllocatableResource[]): AllocationSummary;
|
|
96
|
-
|
|
97
|
-
export { type AllocatableResource as A, DEFAULT_RESOURCES as D, type OnExistingAllowancePolicy as O, type ResourceTag as R, type AllocationOutcome as a, type AllocationSummary as b, requestResourceAllocation as r, summarizeOutcomes as s };
|