@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.
Files changed (57) hide show
  1. package/LICENSE +674 -201
  2. package/README.md +9 -3
  3. package/assets/environments.json +0 -1
  4. package/dist/auth/index.d.ts +2 -3
  5. package/dist/auth/index.js +1 -1
  6. package/dist/auth/vendor/index.d.ts +2 -3
  7. package/dist/auth/vendor/index.js +1 -1
  8. package/dist/auth/vendor/ui/index.d.ts +1 -2
  9. package/dist/auth-C-Pel0AT.d.ts +235 -0
  10. package/dist/auth-config.d.ts +30 -8
  11. package/dist/auth-config.js +14 -6
  12. package/dist/bug-report.js +4 -4
  13. package/dist/{chunk-XM5MFMMX.js → chunk-2SR5D4CP.js} +19 -15
  14. package/dist/{chunk-HK3B5MKA.js → chunk-6NW5M3F5.js} +9 -20
  15. package/dist/{chunk-2OZVKA3D.js → chunk-DHY2ZXVZ.js} +36 -28
  16. package/dist/chunk-G56VYTUD.js +75 -0
  17. package/dist/{chunk-5K3RI5C2.js → chunk-GL3U7K2B.js} +0 -1
  18. package/dist/{chunk-YUSHBZBX.js → chunk-H4LWILH4.js} +32 -6
  19. package/dist/chunk-J7CYVTAW.js +43 -0
  20. package/dist/{chunk-WF2XKCEZ.js → chunk-LCKLYFAZ.js} +1 -1
  21. package/dist/{chunk-3LNKPUZ7.js → chunk-NP4SLURL.js} +1 -1
  22. package/dist/{chunk-LRRQP7DH.js → chunk-O2NWQLYB.js} +2 -2
  23. package/dist/{chunk-DKGCOGRT.js → chunk-RD2QHYTL.js} +144 -37
  24. package/dist/{chunk-S7S7WENB.js → chunk-WZBAQCA5.js} +2 -2
  25. package/dist/{chunk-JMHX3M4C.js → chunk-YIKGVALU.js} +3 -3
  26. package/dist/chunk-probe.js +3 -3
  27. package/dist/commands/login.d.ts +34 -9
  28. package/dist/commands/login.js +171 -68
  29. package/dist/commands/logout.d.ts +1 -2
  30. package/dist/commands/logout.js +5 -3
  31. package/dist/commands/whoami.d.ts +1 -2
  32. package/dist/commands/whoami.js +7 -4
  33. package/dist/deploy.d.ts +7 -1
  34. package/dist/deploy.js +12 -9
  35. package/dist/dotns.js +4 -4
  36. package/dist/environments.js +1 -1
  37. package/dist/index.js +11 -10
  38. package/dist/manifest/publish.js +11 -10
  39. package/dist/manifest/types.d.ts +1 -1
  40. package/dist/memory-report.js +2 -2
  41. package/dist/merkle.js +10 -9
  42. package/dist/personhood/bootstrap.js +10 -10
  43. package/dist/personhood/people-client.js +4 -4
  44. package/dist/run-state.js +1 -1
  45. package/dist/{signer-CriGqahj.d.ts → signer-vR6KKC7V.d.ts} +1 -1
  46. package/dist/spinner.d.ts +21 -0
  47. package/dist/spinner.js +6 -0
  48. package/dist/sss-allowance.d.ts +29 -0
  49. package/dist/sss-allowance.js +8 -0
  50. package/dist/storage-signer.d.ts +94 -2
  51. package/dist/storage-signer.js +18 -9
  52. package/dist/telemetry.js +2 -2
  53. package/dist/version-check.d.ts +0 -3
  54. package/dist/version-check.js +3 -3
  55. package/package.json +19 -15
  56. package/dist/allocations-B65Is4Md.d.ts +0 -97
  57. package/dist/auth-DkRZBK-T.d.ts +0 -122
@@ -1,122 +0,0 @@
1
- import { TerminalAdapter, UserSession } from '@parity/product-sdk-terminal';
2
- import { PolkadotSigner } from 'polkadot-api';
3
- import { A as AllocatableResource, O as OnExistingAllowancePolicy, a as AllocationOutcome } from './allocations-B65Is4Md.js';
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
- /** Hosted app-metadata doc (name/icon) the mobile wallet reads at pairing. */
22
- metadataUrl: string;
23
- /** People-parachain RPC endpoints the terminal adapter connects to. */
24
- peopleEndpoints: string[];
25
- }
26
-
27
- /**
28
- * The three addresses we surface from a paired session.
29
- *
30
- * - `rootAddress` — SS58 of `session.rootAccountId`, the `rootUserAccountId`
31
- * the mobile app sent over the SSO handshake (bare-mnemonic sr25519 root on
32
- * current mobile builds). Keyed by `Resources.Consumers` on the People
33
- * parachain, so it's the right input for `lookupUsername`.
34
- * - `productAddress` — SS58 of the product account derived via
35
- * `product/{productId}/{index}` from `rootAccountId`. This is what actually
36
- * signs on-chain transactions from the CLI.
37
- * - `productH160` — the same product pubkey as a 20-byte EVM address (Revive /
38
- * contracts view). Derived from the SAME pubkey as `productAddress`.
39
- */
40
- interface SessionAddresses {
41
- rootAddress: string;
42
- productAddress: string;
43
- productH160: `0x${string}`;
44
- }
45
- type ConnectResult = {
46
- kind: "existing";
47
- address: string;
48
- addresses: SessionAddresses;
49
- } | {
50
- kind: "qr";
51
- qrCode: string;
52
- login: LoginHandle;
53
- };
54
- type LoginStatus = {
55
- step: "waiting";
56
- } | {
57
- step: "paired";
58
- } | {
59
- step: "pending";
60
- stage: string;
61
- } | {
62
- step: "success";
63
- address: string;
64
- addresses: SessionAddresses;
65
- } | {
66
- step: "error";
67
- message: string;
68
- };
69
- interface LoginHandle {
70
- adapter: TerminalAdapter;
71
- /** The authenticate() promise — already running since connect(). */
72
- authPromise: ReturnType<TerminalAdapter["sso"]["authenticate"]>;
73
- }
74
- /**
75
- * A session signer bundle — the signer plus an explicit `destroy()` that tears
76
- * down the long-lived adapter the signer depends on. Callers MUST invoke
77
- * `destroy()` once done — the WebSocket keeps the event loop alive.
78
- */
79
- interface SessionHandle {
80
- address: string;
81
- addresses: SessionAddresses;
82
- signer: PolkadotSigner;
83
- userSession: UserSession;
84
- destroy(): void;
85
- }
86
- type LogoutStatus = {
87
- step: "disconnecting";
88
- address: string;
89
- } | {
90
- step: "success";
91
- address: string;
92
- } | {
93
- step: "partial";
94
- address: string;
95
- reason: string;
96
- } | {
97
- step: "error";
98
- message: string;
99
- };
100
- interface LogoutHandle {
101
- adapter: TerminalAdapter;
102
- address: string;
103
- session: UserSession;
104
- }
105
- /** The product-bound auth surface returned by `createAuthClient`. */
106
- interface AuthClient {
107
- connect(): Promise<ConnectResult>;
108
- waitForLogin(handle: LoginHandle, onStatus: (status: LoginStatus) => void): Promise<string | null>;
109
- getSessionSigner(): Promise<SessionHandle | null>;
110
- findSession(): Promise<LogoutHandle | null>;
111
- waitForLogout(handle: LogoutHandle, onStatus: (status: LogoutStatus) => void): Promise<void>;
112
- requestAllocation(session: UserSession, resources?: AllocatableResource[], onExisting?: OnExistingAllowancePolicy): Promise<AllocationOutcome[]>;
113
- clearLocalAppStorage(dir?: string): Promise<void>;
114
- }
115
- /**
116
- * Build an auth client bound to a product's `AuthConfig`. All adapter creation,
117
- * address derivation, and session-storage scoping read from `config`, so the
118
- * same code serves any product.
119
- */
120
- declare function createAuthClient(config: AuthConfig): AuthClient;
121
-
122
- export { type AuthClient as A, type ConnectResult as C, type LoginHandle as L, type SessionAddresses as S, type AuthConfig as a, type LoginStatus as b, type LogoutHandle as c, type LogoutStatus as d, type SessionHandle as e, createAuthClient as f };