@parity/product-deploy 0.9.0 → 0.10.0-rc.1
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/DEPLOYMENT.md +124 -0
- package/README.md +73 -6
- package/assets/environments.json +41 -0
- package/bin/bulletin-deploy +49 -21
- package/dist/allocations-CEPeZr6T.d.ts +111 -0
- package/dist/auth/index.d.ts +3 -2
- package/dist/auth/index.js +5 -1
- package/dist/auth/vendor/index.d.ts +3 -2
- package/dist/auth/vendor/index.js +5 -1
- package/dist/auth/vendor/ui/index.d.ts +2 -1
- package/dist/auth-CA_YKtM2.d.ts +128 -0
- package/dist/auth-config.d.ts +13 -8
- package/dist/auth-config.js +4 -4
- package/dist/bug-report.js +4 -4
- package/dist/{chunk-56QBW25C.js → chunk-2GDPXSW3.js} +5 -5
- package/dist/{chunk-GCKWJS2T.js → chunk-4ADUQDYJ.js} +140 -32
- package/dist/{chunk-DHY2ZXVZ.js → chunk-5OKB3TEB.js} +8 -1
- package/dist/{chunk-C7UJ6WZR.js → chunk-64RSUZN4.js} +10 -2
- package/dist/{chunk-D7KZZDU7.js → chunk-HA7BNUK3.js} +1 -1
- package/dist/{chunk-5UE2IWNB.js → chunk-HEUKYXEZ.js} +1 -1
- package/dist/{chunk-UC2AYO2P.js → chunk-HOO5NKN3.js} +1 -1
- package/dist/{chunk-GL3U7K2B.js → chunk-QRKI6MMK.js} +41 -0
- package/dist/{chunk-A3O7TLCS.js → chunk-RX3ZUVVS.js} +4 -3
- package/dist/{chunk-FNCBSJ6R.js → chunk-S42FFXAR.js} +2 -2
- package/dist/{chunk-AQHBKIFF.js → chunk-VHAKRWRH.js} +3 -3
- package/dist/{chunk-WAKSNE7F.js → chunk-ZF2SEY7S.js} +115 -29
- package/dist/chunk-probe.js +3 -3
- package/dist/commands/login.d.ts +42 -6
- package/dist/commands/login.js +89 -37
- package/dist/commands/logout.d.ts +2 -1
- package/dist/commands/logout.js +6 -6
- package/dist/commands/transfer.d.ts +14 -0
- package/dist/commands/transfer.js +67 -0
- package/dist/commands/whoami.d.ts +2 -1
- package/dist/commands/whoami.js +4 -4
- package/dist/deploy-actors.d.ts +24 -0
- package/dist/deploy-actors.js +44 -0
- package/dist/deploy.d.ts +20 -1
- package/dist/deploy.js +15 -10
- package/dist/dotns.d.ts +42 -7
- package/dist/dotns.js +15 -6
- package/dist/environments.js +1 -1
- package/dist/index.js +16 -15
- package/dist/manifest/publish.js +12 -11
- package/dist/memory-report.js +2 -2
- package/dist/merkle.js +11 -10
- package/dist/personhood/bootstrap.js +11 -11
- package/dist/personhood/people-client.js +5 -4
- package/dist/run-state.js +1 -1
- package/dist/{signer-vR6KKC7V.d.ts → signer-Duup0hgQ.d.ts} +1 -1
- package/dist/sss-allowance-cache.js +5 -5
- package/dist/storage-signer.js +11 -10
- package/dist/telemetry.d.ts +17 -1
- package/dist/telemetry.js +4 -2
- package/dist/version-check.js +3 -3
- package/docs/bootstrap.md +1 -1
- package/docs/e2e-bootstrap.md +34 -12
- package/docs/telemetry.md +10 -11
- package/docs/testing.md +2 -0
- package/package.json +4 -3
- package/dist/auth-C-Pel0AT.d.ts +0 -235
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parity/product-deploy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,14 +41,15 @@
|
|
|
41
41
|
"docs",
|
|
42
42
|
"assets",
|
|
43
43
|
"patches",
|
|
44
|
+
"DEPLOYMENT.md",
|
|
44
45
|
"tools/release-retry-wrapper.mjs"
|
|
45
46
|
],
|
|
46
47
|
"scripts": {
|
|
47
|
-
"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 src/sss-allowance-cache.ts --format esm --dts --clean --target node22",
|
|
48
|
+
"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/commands/transfer.ts src/storage-signer.ts src/spinner.ts src/sss-allowance.ts src/sss-allowance-cache.ts src/deploy-actors.ts --format esm --dts --clean --target node22",
|
|
48
49
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
49
50
|
"postinstall": "patch-package || true",
|
|
50
51
|
"prepare": "npm run build",
|
|
51
|
-
"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 test/sss-allowance-cache.test.js && npm run test:vendor",
|
|
52
|
+
"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 test/sss-allowance-cache.test.js test/dotns-transfer.test.js test/deploy-actors.test.js test/transfer-command.test.js test/dotns-register-fee.test.js test/deploy-label-ordering.test.js test/benign-teardown.test.js && npm run test:vendor",
|
|
52
53
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
53
54
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
54
55
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
package/dist/auth-C-Pel0AT.d.ts
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
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 };
|