@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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bulletin-deploy
|
|
2
2
|
|
|
3
|
-
CLI tool for deploying web apps to the [Polkadot Bulletin Chain](https://github.com/paritytech/polkadot-bulletin-chain) via
|
|
3
|
+
CLI tool for deploying web apps to the [Polkadot Bulletin Chain](https://github.com/paritytech/polkadot-bulletin-chain) via DotNS, Polkadot's on-chain naming system.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -49,8 +49,14 @@ bulletin-deploy ships with built-in environment presets (RPC endpoints, contract
|
|
|
49
49
|
|
|
50
50
|
## Telemetry
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Deploy telemetry (Sentry) is **off by default**. It activates only if you explicitly opt in with `BULLETIN_DEPLOY_TELEMETRY=1`, or when the CLI detects it is running in Parity's own CI. Set `BULLETIN_DEPLOY_TELEMETRY=0` to force it off in any context. The Sentry DSN baked into the package is a public project identifier, not a secret — it grants no access to collected data.
|
|
53
|
+
|
|
54
|
+
Separately from telemetry, the CLI checks the npm registry for the minimum supported version. Set `BULLETIN_DEPLOY_UPDATE_CHECK=0` to disable that check.
|
|
53
55
|
|
|
54
56
|
## Contributing
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
Issues and pull requests are welcome on the GitHub repository. Releases are cut by the maintainers. (Parity-internal design notes and investigation logs live in `docs-internal/`, which is not published to npm.)
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
[GPL-3.0-or-later](LICENSE). Versions up to and including 0.8.3 were published under Apache-2.0; the license changed to GPL-3.0-or-later ahead of the project being open-sourced.
|
package/assets/environments.json
CHANGED
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
"e2eEligible": true,
|
|
100
100
|
"backend": "https://identity-backend-next.parity-testnet.parity.io",
|
|
101
101
|
"ipfs": "https://paseo-bulletin-next-ipfs.polkadot.io",
|
|
102
|
-
"docsUrl": "https://sre.teleport.parity.io/environments/paseo-next/",
|
|
103
102
|
"autoAccountMapping": true,
|
|
104
103
|
"nativeToEthRatio": 100000000,
|
|
105
104
|
"registerStorageDeposit": 2000000000000,
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { A as
|
|
1
|
+
export { A as AllocatableResource, a as AllocationOutcome, b as AllocationSummary, c as AuthClient, d as AuthConfig, C as ConnectResult, D as DEFAULT_RESOURCES, L as LoginHandle, e as LoginStatus, f as LogoutHandle, g as LogoutStatus, S as SessionAddresses, h as SessionHandle, i as createAuthClient, r as requestResourceAllocation, s as summarizeOutcomes } from '../auth-C-Pel0AT.js';
|
|
2
2
|
export { renderQrCode } from '@parity/product-sdk-terminal';
|
|
3
|
-
export { R as ResolvedSigner, S as SignerNotAvailableError, r as resolveSigner } from '../signer-
|
|
4
|
-
export { A as AllocatableResource, a as AllocationOutcome, b as AllocationSummary, D as DEFAULT_RESOURCES, r as requestResourceAllocation, s as summarizeOutcomes } from '../allocations-B65Is4Md.js';
|
|
3
|
+
export { R as ResolvedSigner, S as SignerNotAvailableError, r as resolveSigner } from '../signer-vR6KKC7V.js';
|
|
5
4
|
export { renderLoginStatus, renderLogoutStatus } from './vendor/ui/index.js';
|
|
6
5
|
import 'polkadot-api';
|
|
7
6
|
import '@parity/product-sdk-tx';
|
package/dist/auth/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { A as
|
|
1
|
+
export { A as AllocatableResource, a as AllocationOutcome, b as AllocationSummary, c as AuthClient, d as AuthConfig, C as ConnectResult, D as DEFAULT_RESOURCES, L as LoginHandle, e as LoginStatus, f as LogoutHandle, g as LogoutStatus, O as OnExistingAllowancePolicy, R as ResourceTag, S as SessionAddresses, h as SessionHandle, i as createAuthClient, r as requestResourceAllocation, s as summarizeOutcomes } from '../../auth-C-Pel0AT.js';
|
|
2
2
|
import { UserSession } from '@parity/product-sdk-terminal';
|
|
3
3
|
import { PolkadotSigner } from 'polkadot-api';
|
|
4
|
-
export { R as ResolvedSigner, S as SignerNotAvailableError, a as SignerOptions, b as SignerSource, p as parseDevAccountName, r as resolveSigner } from '../../signer-
|
|
5
|
-
export { A as AllocatableResource, a as AllocationOutcome, b as AllocationSummary, D as DEFAULT_RESOURCES, O as OnExistingAllowancePolicy, R as ResourceTag, r as requestResourceAllocation, s as summarizeOutcomes } from '../../allocations-B65Is4Md.js';
|
|
4
|
+
export { R as ResolvedSigner, S as SignerNotAvailableError, a as SignerOptions, b as SignerSource, p as parseDevAccountName, r as resolveSigner } from '../../signer-vR6KKC7V.js';
|
|
6
5
|
import '@parity/product-sdk-tx';
|
|
7
6
|
|
|
8
7
|
interface ProductAccountRef {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { renderQrCode } from '@parity/product-sdk-terminal';
|
|
2
|
-
import {
|
|
2
|
+
import { e as LoginStatus, g as LogoutStatus } from '../../../auth-C-Pel0AT.js';
|
|
3
3
|
import 'polkadot-api';
|
|
4
|
-
import '../../../allocations-B65Is4Md.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Pure formatters that map the `LoginStatus` / `LogoutStatus` streams to
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { UserSession, TerminalAdapter } from '@parity/product-sdk-terminal';
|
|
2
|
+
import { PolkadotSigner } from 'polkadot-api';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* RFC-0010 resource allocation — thin wrapper over product-sdk-terminal's
|
|
6
|
+
* host-runner facet. Lifted from playground-cli `src/utils/allowances/host.ts`
|
|
7
|
+
* (issue #411).
|
|
8
|
+
*
|
|
9
|
+
* `@parity/product-sdk-terminal/host` exports `requestResourceAllocation(session,
|
|
10
|
+
* adapter, resources, options?)` which handles:
|
|
11
|
+
* - sending the AP request to the paired mobile wallet
|
|
12
|
+
* - the `onExisting` policy (default auto-picks "Ignore" unless all requested
|
|
13
|
+
* resources are already slot-table cached, then "Increase")
|
|
14
|
+
* - caching granted key material to disk as `{appId}_AllowanceKeys.json`
|
|
15
|
+
* (the same file our storage-signer reads — verified compat-stable in PR #855)
|
|
16
|
+
*
|
|
17
|
+
* Wire format (SCALE-derived, mirrors host-papp's
|
|
18
|
+
* `dist/sso/sessionManager/scale/resourceAllocation.d.ts`):
|
|
19
|
+
* request → { callingProductId, resources: AllocatableResource[], onExisting }
|
|
20
|
+
* response → AllocationOutcome[] (one per resource, in order)
|
|
21
|
+
*
|
|
22
|
+
* The mobile app handles `hostRequestResourceAllocation` in
|
|
23
|
+
* `AllowanceHostCalls.kt` and routes the user through an approval UI.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Structural mirror of host-papp's `ApAllocatableResource` codec type. We
|
|
28
|
+
* declare it locally because host-papp's package root doesn't re-export the
|
|
29
|
+
* codec types yet — when it does (and product-sdk-terminal threads them
|
|
30
|
+
* through) this can be replaced with a direct import.
|
|
31
|
+
*
|
|
32
|
+
* StatementStoreAllowance — write to the SSS (host_chat, allowance ring).
|
|
33
|
+
* BulletInAllowance — write to Bulletin (TransactionStorage.store).
|
|
34
|
+
* SmartContractAllowance — PGAS sponsoring for Revive contract calls.
|
|
35
|
+
* The `value` is the derivation index of the
|
|
36
|
+
* product account (0 for the default account).
|
|
37
|
+
* AutoSigning — surrender the product-account signing key to
|
|
38
|
+
* the host so it can sign on the user's behalf
|
|
39
|
+
* without per-call prompts. Not used today.
|
|
40
|
+
*
|
|
41
|
+
* NOTE: host-api v0.8 renamed this variant to 'BulletinAllowance', but the
|
|
42
|
+
* SSO resource-allocation codec (host-papp, which this path reaches via
|
|
43
|
+
* product-sdk-terminal) retains the old 'BulletInAllowance' spelling as of
|
|
44
|
+
* host-papp 0.8.5 / terminal 0.3.1. Ours must match the SSO codec — the
|
|
45
|
+
* _SDK_COMPAT_PIN below fails the build if the SDK's spelling ever changes.
|
|
46
|
+
*/
|
|
47
|
+
type AllocatableResource = {
|
|
48
|
+
tag: "StatementStoreAllowance";
|
|
49
|
+
value: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
tag: "BulletInAllowance";
|
|
52
|
+
value: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
tag: "SmartContractAllowance";
|
|
55
|
+
value: number;
|
|
56
|
+
} | {
|
|
57
|
+
tag: "AutoSigning";
|
|
58
|
+
value: undefined;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Outcome of one allocation. We don't read the inner `Allocated` payload
|
|
62
|
+
* (allowance slot keys, derivation secrets) — the host stores them and uses
|
|
63
|
+
* them transparently on subsequent calls. We just need the tag to know
|
|
64
|
+
* whether the allocation succeeded.
|
|
65
|
+
*/
|
|
66
|
+
type AllocationOutcome = {
|
|
67
|
+
tag: "Allocated";
|
|
68
|
+
value: unknown;
|
|
69
|
+
} | {
|
|
70
|
+
tag: "Rejected";
|
|
71
|
+
value: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
tag: "NotAvailable";
|
|
74
|
+
value: undefined;
|
|
75
|
+
};
|
|
76
|
+
/** Tag-only view, handy for downstream code that doesn't care about payloads. */
|
|
77
|
+
type ResourceTag = AllocatableResource["tag"];
|
|
78
|
+
type OnExistingAllowancePolicy = "Ignore" | "Increase";
|
|
79
|
+
/**
|
|
80
|
+
* Default mobile-granted resource set for a CLI product account: write access
|
|
81
|
+
* to the statement store + Bulletin, plus PGAS sponsoring for the default
|
|
82
|
+
* (index 0) product account.
|
|
83
|
+
*/
|
|
84
|
+
declare const DEFAULT_RESOURCES: AllocatableResource[];
|
|
85
|
+
/**
|
|
86
|
+
* Send a `host_request_resource_allocation` request over the user's active
|
|
87
|
+
* session. The host (mobile wallet) prompts the user to approve and returns
|
|
88
|
+
* one outcome per requested resource in order. Granted key material is cached
|
|
89
|
+
* to disk by the terminal facet (`{appId}_AllowanceKeys.json`) so subsequent
|
|
90
|
+
* calls (and the storage-signer reader) find it without a second wallet prompt.
|
|
91
|
+
*
|
|
92
|
+
* Throws on transport-level failures (Statement Store unreachable, encryption
|
|
93
|
+
* error, etc.). Per-resource refusals are reported as `Rejected`/`NotAvailable`
|
|
94
|
+
* outcomes — callers inspect the array to decide whether to proceed.
|
|
95
|
+
*
|
|
96
|
+
* `onExisting` is pinned to "Ignore": return existing cached keys if any, else
|
|
97
|
+
* allocate a new slot. Auto-pick would give "Increase" when all slot-table
|
|
98
|
+
* resources are already cached, which re-prompts the user unnecessarily.
|
|
99
|
+
*/
|
|
100
|
+
declare function requestResourceAllocation(session: UserSession, adapter: TerminalAdapter, resources?: AllocatableResource[], onExisting?: OnExistingAllowancePolicy): Promise<AllocationOutcome[]>;
|
|
101
|
+
interface AllocationSummary {
|
|
102
|
+
granted: AllocatableResource[];
|
|
103
|
+
rejected: AllocatableResource[];
|
|
104
|
+
unavailable: AllocatableResource[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Bucket allocation outcomes by tag. Order-sensitive: `outcomes[i]` maps to
|
|
108
|
+
* `resources[i]`. Outcomes without a matching resource are silently dropped.
|
|
109
|
+
*/
|
|
110
|
+
declare function summarizeOutcomes(outcomes: AllocationOutcome[], resources: AllocatableResource[]): AllocationSummary;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Per-product configuration injected into `createAuthClient`. Lifting the
|
|
114
|
+
* sign-in glue out of playground-cli (issue #411) means the env-specific
|
|
115
|
+
* constants playground hard-coded in its `config.ts` (DAPP_ID, product id,
|
|
116
|
+
* metadata URL, People-chain endpoints) become consumer-supplied so the same
|
|
117
|
+
* package serves `playground` and `dot` (and future products) unchanged.
|
|
118
|
+
*/
|
|
119
|
+
interface AuthConfig {
|
|
120
|
+
/** The dApp identity string. Scopes the on-disk session namespace
|
|
121
|
+
* (`~/.polkadot-apps/${dappId}_*`) and the SSO pairing — each product
|
|
122
|
+
* gets its own, independently-revocable session. */
|
|
123
|
+
dappId: string;
|
|
124
|
+
/** Product id used to derive the product account (`/product/{productId}/{index}`). */
|
|
125
|
+
productId: string;
|
|
126
|
+
/** Derivation index of the product account (0 = default). */
|
|
127
|
+
derivationIndex: number;
|
|
128
|
+
/** Wallet-facing app name shown on the Sign-In screen (sent inline at pairing). */
|
|
129
|
+
hostName: string;
|
|
130
|
+
/** Host app version sent inline at pairing. */
|
|
131
|
+
hostVersion: string;
|
|
132
|
+
/** People-parachain RPC endpoints the terminal adapter connects to. */
|
|
133
|
+
peopleEndpoints: string[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The three addresses we surface from a paired session.
|
|
138
|
+
*
|
|
139
|
+
* - `rootAddress` — SS58 of `session.rootAccountId`, the `rootUserAccountId`
|
|
140
|
+
* the mobile app sent over the SSO handshake (bare-mnemonic sr25519 root on
|
|
141
|
+
* current mobile builds). Keyed by `Resources.Consumers` on the People
|
|
142
|
+
* parachain, so it's the right input for `lookupUsername`.
|
|
143
|
+
* - `productAddress` — SS58 of the product account derived via
|
|
144
|
+
* `product/{productId}/{index}` from `rootAccountId`. This is what actually
|
|
145
|
+
* signs on-chain transactions from the CLI.
|
|
146
|
+
* - `productH160` — the same product pubkey as a 20-byte EVM address (Revive /
|
|
147
|
+
* contracts view). Derived from the SAME pubkey as `productAddress`.
|
|
148
|
+
*/
|
|
149
|
+
interface SessionAddresses {
|
|
150
|
+
rootAddress: string;
|
|
151
|
+
productAddress: string;
|
|
152
|
+
productH160: `0x${string}`;
|
|
153
|
+
}
|
|
154
|
+
type ConnectResult = {
|
|
155
|
+
kind: "existing";
|
|
156
|
+
address: string;
|
|
157
|
+
addresses: SessionAddresses;
|
|
158
|
+
} | {
|
|
159
|
+
kind: "qr";
|
|
160
|
+
qrCode: string;
|
|
161
|
+
login: LoginHandle;
|
|
162
|
+
};
|
|
163
|
+
type LoginStatus = {
|
|
164
|
+
step: "waiting";
|
|
165
|
+
} | {
|
|
166
|
+
step: "paired";
|
|
167
|
+
} | {
|
|
168
|
+
step: "pending";
|
|
169
|
+
stage: string;
|
|
170
|
+
} | {
|
|
171
|
+
step: "success";
|
|
172
|
+
address: string;
|
|
173
|
+
addresses: SessionAddresses;
|
|
174
|
+
} | {
|
|
175
|
+
step: "error";
|
|
176
|
+
message: string;
|
|
177
|
+
};
|
|
178
|
+
interface LoginHandle {
|
|
179
|
+
adapter: TerminalAdapter;
|
|
180
|
+
/** The authenticate() promise — already running since connect(). */
|
|
181
|
+
authPromise: ReturnType<TerminalAdapter["sso"]["authenticate"]>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* A session signer bundle — the signer plus an explicit `destroy()` that tears
|
|
185
|
+
* down the long-lived adapter the signer depends on. Callers MUST invoke
|
|
186
|
+
* `destroy()` once done — the WebSocket keeps the event loop alive.
|
|
187
|
+
*
|
|
188
|
+
* `adapter` is exposed so callers that need to send a host request (e.g.
|
|
189
|
+
* `requestResourceAllocation`) can pass it without creating a second WebSocket.
|
|
190
|
+
*/
|
|
191
|
+
interface SessionHandle {
|
|
192
|
+
address: string;
|
|
193
|
+
addresses: SessionAddresses;
|
|
194
|
+
signer: PolkadotSigner;
|
|
195
|
+
userSession: UserSession;
|
|
196
|
+
adapter: TerminalAdapter;
|
|
197
|
+
destroy(): void;
|
|
198
|
+
}
|
|
199
|
+
type LogoutStatus = {
|
|
200
|
+
step: "disconnecting";
|
|
201
|
+
address: string;
|
|
202
|
+
} | {
|
|
203
|
+
step: "success";
|
|
204
|
+
address: string;
|
|
205
|
+
} | {
|
|
206
|
+
step: "partial";
|
|
207
|
+
address: string;
|
|
208
|
+
reason: string;
|
|
209
|
+
} | {
|
|
210
|
+
step: "error";
|
|
211
|
+
message: string;
|
|
212
|
+
};
|
|
213
|
+
interface LogoutHandle {
|
|
214
|
+
adapter: TerminalAdapter;
|
|
215
|
+
address: string;
|
|
216
|
+
session: UserSession;
|
|
217
|
+
}
|
|
218
|
+
/** The product-bound auth surface returned by `createAuthClient`. */
|
|
219
|
+
interface AuthClient {
|
|
220
|
+
connect(): Promise<ConnectResult>;
|
|
221
|
+
waitForLogin(handle: LoginHandle, onStatus: (status: LoginStatus) => void): Promise<SessionHandle | null>;
|
|
222
|
+
getSessionSigner(): Promise<SessionHandle | null>;
|
|
223
|
+
findSession(): Promise<LogoutHandle | null>;
|
|
224
|
+
waitForLogout(handle: LogoutHandle, onStatus: (status: LogoutStatus) => void): Promise<void>;
|
|
225
|
+
requestAllocation(session: UserSession, adapter: TerminalAdapter, resources?: AllocatableResource[], onExisting?: OnExistingAllowancePolicy): Promise<AllocationOutcome[]>;
|
|
226
|
+
clearLocalAppStorage(dir?: string): Promise<void>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Build an auth client bound to a product's `AuthConfig`. All adapter creation,
|
|
230
|
+
* address derivation, and session-storage scoping read from `config`, so the
|
|
231
|
+
* same code serves any product.
|
|
232
|
+
*/
|
|
233
|
+
declare function createAuthClient(config: AuthConfig): AuthClient;
|
|
234
|
+
|
|
235
|
+
export { type AllocatableResource as A, type ConnectResult as C, DEFAULT_RESOURCES as D, type LoginHandle as L, type OnExistingAllowancePolicy as O, type ResourceTag as R, type SessionAddresses as S, type AllocationOutcome as a, type AllocationSummary as b, type AuthClient as c, type AuthConfig as d, type LoginStatus as e, type LogoutHandle as f, type LogoutStatus as g, type SessionHandle as h, createAuthClient as i, requestResourceAllocation as r, summarizeOutcomes as s };
|
package/dist/auth-config.d.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as AuthConfig, c as AuthClient } from './auth-C-Pel0AT.js';
|
|
2
2
|
import { EnvironmentsDoc } from './environments.js';
|
|
3
3
|
import '@parity/product-sdk-terminal';
|
|
4
4
|
import 'polkadot-api';
|
|
5
|
-
import './allocations-B65Is4Md.js';
|
|
6
5
|
|
|
7
6
|
/** dApp identity that scopes the SSO session namespace on disk. Currently reuses
|
|
8
|
-
* playground's identity for dev; swap to e.g. "dot-deploy" when
|
|
9
|
-
* hosted metadata document. */
|
|
7
|
+
* playground's identity for dev; swap to e.g. "dot-deploy" when the package is renamed. */
|
|
10
8
|
declare const DOT_DAPP_ID = "dot-cli";
|
|
11
9
|
/** Product id used for product-account derivation (`/product/{productId}/{index}`).
|
|
12
10
|
* Reuses playground's product id so dev sessions are shared. */
|
|
13
11
|
declare const DOT_PRODUCT_ID = "playground.dot";
|
|
14
12
|
/** Derivation index (0 = default product account). */
|
|
15
13
|
declare const DOT_DERIVATION_INDEX = 0;
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
/** Wallet-facing app name shown on the Sign-In screen; #850 flips this at the package rename. */
|
|
15
|
+
declare const DOT_HOST_NAME = "bulletin-deploy";
|
|
16
|
+
/**
|
|
17
|
+
* Shown when a persisted session file exists but the V2 codec cannot decode it —
|
|
18
|
+
* typically a v0.7 SCALE blob that is structurally incompatible with the V2 wire format.
|
|
19
|
+
* The adapter silently returns [] in this case; we surface the cause and recovery steps.
|
|
20
|
+
*/
|
|
21
|
+
declare const STALE_SESSION_MESSAGE: string;
|
|
19
22
|
/**
|
|
20
23
|
* Returns true if there is a persisted SSO session file on disk.
|
|
21
24
|
* Does NOT load the SSO stack — uses only node fs/os/path.
|
|
@@ -30,10 +33,29 @@ declare function hasPersistedSession(): boolean;
|
|
|
30
33
|
* its endpoint for `envId` is absent.
|
|
31
34
|
*/
|
|
32
35
|
declare function buildAuthConfig(doc: EnvironmentsDoc, envId: string): AuthConfig;
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the Bulletin chain WS endpoint(s) for an environment from the
|
|
38
|
+
* environments doc. Mirrors buildAuthConfig's people-chain resolution.
|
|
39
|
+
*
|
|
40
|
+
* Login needs this because src/deploy.ts only reassigns its module-level
|
|
41
|
+
* BULLETIN_ENDPOINTS (initialized to DEFAULT_BULLETIN_RPC = the paseo-next
|
|
42
|
+
* chain) to the selected env's endpoint inside the deploy flow. The login path
|
|
43
|
+
* never runs that, so without resolving here it would poll the default chain
|
|
44
|
+
* instead of the selected env's (e.g. paseo-next-v2 on paseo-bulletin-next-rpc)
|
|
45
|
+
* and never observe an authorization that lives on the selected chain.
|
|
46
|
+
*
|
|
47
|
+
* Returns null if the bulletin chain or its endpoint for envId is absent.
|
|
48
|
+
*/
|
|
49
|
+
declare function resolveBulletinEndpoints(doc: EnvironmentsDoc, envId: string): string[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Return the People chain WSS endpoints for the given environment.
|
|
52
|
+
* Used by the SSS allowance preflight check — no SSO deps loaded.
|
|
53
|
+
*/
|
|
54
|
+
declare function getPeopleChainEndpoints(envId: string): Promise<string[]>;
|
|
33
55
|
/**
|
|
34
56
|
* Lazily create an auth client for the given environment. Imports the facade
|
|
35
57
|
* only when called so the SSO deps don't load in headless/mnemonic paths.
|
|
36
58
|
*/
|
|
37
59
|
declare function getAuthClient(envId: string): Promise<AuthClient>;
|
|
38
60
|
|
|
39
|
-
export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_PRODUCT_ID,
|
|
61
|
+
export { DOT_DAPP_ID, DOT_DERIVATION_INDEX, DOT_HOST_NAME, DOT_PRODUCT_ID, STALE_SESSION_MESSAGE, buildAuthConfig, getAuthClient, getPeopleChainEndpoints, hasPersistedSession, resolveBulletinEndpoints };
|
package/dist/auth-config.js
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DOT_DAPP_ID,
|
|
3
3
|
DOT_DERIVATION_INDEX,
|
|
4
|
+
DOT_HOST_NAME,
|
|
4
5
|
DOT_PRODUCT_ID,
|
|
5
|
-
|
|
6
|
+
STALE_SESSION_MESSAGE,
|
|
6
7
|
buildAuthConfig,
|
|
7
8
|
getAuthClient,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
getPeopleChainEndpoints,
|
|
10
|
+
hasPersistedSession,
|
|
11
|
+
resolveBulletinEndpoints
|
|
12
|
+
} from "./chunk-H4LWILH4.js";
|
|
13
|
+
import "./chunk-LCKLYFAZ.js";
|
|
14
|
+
import "./chunk-2SR5D4CP.js";
|
|
15
|
+
import "./chunk-GL3U7K2B.js";
|
|
11
16
|
import "./chunk-ZOC4GITL.js";
|
|
12
17
|
export {
|
|
13
18
|
DOT_DAPP_ID,
|
|
14
19
|
DOT_DERIVATION_INDEX,
|
|
20
|
+
DOT_HOST_NAME,
|
|
15
21
|
DOT_PRODUCT_ID,
|
|
16
|
-
|
|
22
|
+
STALE_SESSION_MESSAGE,
|
|
17
23
|
buildAuthConfig,
|
|
18
24
|
getAuthClient,
|
|
19
|
-
|
|
25
|
+
getPeopleChainEndpoints,
|
|
26
|
+
hasPersistedSession,
|
|
27
|
+
resolveBulletinEndpoints
|
|
20
28
|
};
|
package/dist/bug-report.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
offerBugReport,
|
|
10
10
|
scrubSecrets,
|
|
11
11
|
setDeployContext
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-O2NWQLYB.js";
|
|
13
|
+
import "./chunk-6NW5M3F5.js";
|
|
14
|
+
import "./chunk-LCKLYFAZ.js";
|
|
15
|
+
import "./chunk-2SR5D4CP.js";
|
|
16
16
|
export {
|
|
17
17
|
buildCliFlagsSummary,
|
|
18
18
|
buildLabels,
|
|
@@ -6,7 +6,7 @@ import * as path from "path";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@parity/product-deploy",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.9.0-rc.0",
|
|
10
10
|
private: false,
|
|
11
11
|
repository: {
|
|
12
12
|
type: "git",
|
|
@@ -49,15 +49,17 @@ var package_default = {
|
|
|
49
49
|
"tools/release-retry-wrapper.mjs"
|
|
50
50
|
],
|
|
51
51
|
scripts: {
|
|
52
|
-
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",
|
|
52
|
+
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",
|
|
53
53
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
54
|
+
postinstall: "patch-package",
|
|
54
55
|
prepare: "npm run build",
|
|
55
|
-
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",
|
|
56
|
+
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",
|
|
56
57
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
57
58
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
58
59
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
|
59
60
|
"test:e2e:nightly": "bash scripts/e2e-pass.sh nightly",
|
|
60
|
-
benchmark: "npm run build && node benchmark.js"
|
|
61
|
+
benchmark: "npm run build && node benchmark.js",
|
|
62
|
+
"test:vendor": "vitest run src/auth/vendor"
|
|
61
63
|
},
|
|
62
64
|
dependencies: {
|
|
63
65
|
"@ipld/car": "^5.4.3",
|
|
@@ -65,7 +67,7 @@ var package_default = {
|
|
|
65
67
|
"@noble/hashes": "^1.7.2",
|
|
66
68
|
"@parity/product-sdk-address": "^0.1.1",
|
|
67
69
|
"@parity/product-sdk-keys": "^0.3.0",
|
|
68
|
-
"@parity/product-sdk-terminal": "^0.
|
|
70
|
+
"@parity/product-sdk-terminal": "^0.3.1",
|
|
69
71
|
"@parity/product-sdk-tx": "^0.2.4",
|
|
70
72
|
"@polkadot-api/metadata-builders": "^0.14.2",
|
|
71
73
|
"@polkadot-api/substrate-bindings": "^0.20.2",
|
|
@@ -80,28 +82,30 @@ var package_default = {
|
|
|
80
82
|
multiformats: "^13.4.1",
|
|
81
83
|
"polkadot-api": "^2.1.3",
|
|
82
84
|
verifiablejs: "1.3.0-beta.4",
|
|
83
|
-
viem: "^2.30.5"
|
|
85
|
+
viem: "^2.30.5",
|
|
86
|
+
ws: "^8.20.1"
|
|
84
87
|
},
|
|
85
88
|
devDependencies: {
|
|
86
89
|
"@types/node": "^22.0.0",
|
|
90
|
+
"@types/ws": "^8.18.1",
|
|
91
|
+
"patch-package": "^8.0.1",
|
|
87
92
|
tsup: "^8.5.0",
|
|
88
93
|
typescript: "^5.9.3",
|
|
89
|
-
vitest: "^
|
|
90
|
-
ws: "^8.20.1"
|
|
94
|
+
vitest: "^4.1.0"
|
|
91
95
|
},
|
|
92
96
|
overrides: {
|
|
93
97
|
"@polkadot-api/json-rpc-provider": "^0.2.0",
|
|
94
|
-
"@novasamatech/host-api": "0.
|
|
95
|
-
"@novasamatech/host-papp": "0.
|
|
96
|
-
"@novasamatech/
|
|
97
|
-
"@novasamatech/
|
|
98
|
-
"@novasamatech/
|
|
99
|
-
"@novasamatech/storage-adapter": "0.7.9-4"
|
|
98
|
+
"@novasamatech/host-api": "0.8.6",
|
|
99
|
+
"@novasamatech/host-papp": "0.8.6",
|
|
100
|
+
"@novasamatech/scale": "0.8.6",
|
|
101
|
+
"@novasamatech/statement-store": "0.8.6",
|
|
102
|
+
"@novasamatech/storage-adapter": "0.8.6"
|
|
100
103
|
},
|
|
101
104
|
minimumVersion: "0.5.6",
|
|
102
105
|
engines: {
|
|
103
106
|
node: ">=22"
|
|
104
|
-
}
|
|
107
|
+
},
|
|
108
|
+
license: "GPL-3.0-or-later"
|
|
105
109
|
};
|
|
106
110
|
|
|
107
111
|
// src/run-state.ts
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LCKLYFAZ.js";
|
|
4
4
|
|
|
5
5
|
// src/version-check.ts
|
|
6
6
|
import { execSync, execFileSync } from "child_process";
|
|
7
7
|
import { createInterface } from "readline";
|
|
8
8
|
var REGISTRY_URL = "https://registry.npmjs.org/bulletin-deploy/latest";
|
|
9
|
-
var KILL_SWITCH_URL = "https://raw.githubusercontent.com/paritytech/triangle-deploy/main/min-version.json";
|
|
10
9
|
var FETCH_TIMEOUT = 3e3;
|
|
11
10
|
function checkNodeVersion(enginesNode, currentVersion) {
|
|
12
11
|
const match = enginesNode.match(/(\d+)/);
|
|
@@ -58,26 +57,18 @@ async function fetchJson(url) {
|
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
async function fetchVersionInfo() {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
fetchJson(KILL_SWITCH_URL)
|
|
64
|
-
]);
|
|
65
|
-
if (!registry && !killSwitch) return null;
|
|
60
|
+
const registry = await fetchJson(REGISTRY_URL);
|
|
61
|
+
if (!registry) return null;
|
|
66
62
|
return {
|
|
67
|
-
latest: registry
|
|
68
|
-
minimumFromRegistry: registry
|
|
69
|
-
minimumFromKillSwitch: killSwitch?.minimumVersion ?? null,
|
|
70
|
-
killSwitchMessage: killSwitch?.message ?? null
|
|
63
|
+
latest: registry.version ?? VERSION,
|
|
64
|
+
minimumFromRegistry: registry.minimumVersion ?? null
|
|
71
65
|
};
|
|
72
66
|
}
|
|
73
67
|
function handlePreflightVersionCheck(info) {
|
|
74
68
|
if (!info) return "ok";
|
|
75
|
-
|
|
76
|
-
if (effectiveMinimum && compareSemver(VERSION, effectiveMinimum) < 0) {
|
|
69
|
+
if (info.minimumFromRegistry && compareSemver(VERSION, info.minimumFromRegistry) < 0) {
|
|
77
70
|
console.error(`
|
|
78
|
-
bulletin-deploy ${VERSION} is no longer supported (minimum: ${
|
|
79
|
-
const ks = info.killSwitchMessage;
|
|
80
|
-
if (ks) console.error(` Reason: ${ks}`);
|
|
71
|
+
bulletin-deploy ${VERSION} is no longer supported (minimum: ${info.minimumFromRegistry}).`);
|
|
81
72
|
console.error(` Please update: npm install -g bulletin-deploy@latest
|
|
82
73
|
`);
|
|
83
74
|
return "abort";
|
|
@@ -165,9 +156,8 @@ function classifyErrorArea(msg) {
|
|
|
165
156
|
return null;
|
|
166
157
|
}
|
|
167
158
|
function assessVersion(currentVersion, info, internal) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return { action: "forced_update", currentVersion, minimumVersion: effectiveMinimum, message: info.killSwitchMessage };
|
|
159
|
+
if (info.minimumFromRegistry && compareSemver(currentVersion, info.minimumFromRegistry) < 0) {
|
|
160
|
+
return { action: "forced_update", currentVersion, minimumVersion: info.minimumFromRegistry };
|
|
171
161
|
}
|
|
172
162
|
if (compareSemver(currentVersion, info.latest) < 0) {
|
|
173
163
|
return { action: "suggest_update", currentVersion, latestVersion: info.latest, internal };
|
|
@@ -190,7 +180,6 @@ async function handleFailedDeploy(error) {
|
|
|
190
180
|
case "forced_update":
|
|
191
181
|
console.error(`
|
|
192
182
|
bulletin-deploy ${verdict.currentVersion} is no longer supported (minimum: ${verdict.minimumVersion}).`);
|
|
193
|
-
if (verdict.message) console.error(` Reason: ${verdict.message}`);
|
|
194
183
|
console.error(` Please update: npm install -g bulletin-deploy@latest
|
|
195
184
|
`);
|
|
196
185
|
break;
|