@parity/product-deploy 0.8.3 → 0.9.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/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-DKGCOGRT.js → chunk-6VYOUYMI.js} +144 -37
- package/dist/{chunk-3LNKPUZ7.js → chunk-AG37IM3H.js} +1 -1
- package/dist/{chunk-2OZVKA3D.js → chunk-DHY2ZXVZ.js} +36 -28
- package/dist/{chunk-WF2XKCEZ.js → chunk-EZ352IGD.js} +1 -1
- package/dist/chunk-G56VYTUD.js +75 -0
- package/dist/{chunk-5K3RI5C2.js → chunk-GL3U7K2B.js} +0 -1
- package/dist/{chunk-JMHX3M4C.js → chunk-J3WABBZ7.js} +3 -3
- package/dist/chunk-J7CYVTAW.js +43 -0
- package/dist/{chunk-OCKCB72S.js → chunk-L5Z3TJD7.js} +6 -6
- package/dist/{chunk-S7S7WENB.js → chunk-NO3BNQFL.js} +2 -2
- package/dist/{chunk-HK3B5MKA.js → chunk-ODIIC66I.js} +9 -20
- package/dist/{chunk-XM5MFMMX.js → chunk-UFQ4EZP3.js} +20 -15
- package/dist/{chunk-YUSHBZBX.js → chunk-VQB3JWK7.js} +32 -6
- package/dist/{chunk-LRRQP7DH.js → chunk-XKTAIQJ4.js} +2 -2
- 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 +14 -13
- 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/bind-paid-alias.js +3 -3
- package/dist/personhood/bind-personal-id.js +2 -2
- package/dist/personhood/bootstrap.js +17 -17
- package/dist/personhood/claim-pgas.js +2 -2
- package/dist/personhood/people-client.js +4 -4
- package/dist/personhood/proof-validity.js +2 -2
- package/dist/personhood/reprove.js +5 -5
- 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 +20 -15
- package/patches/@novasamatech+sdk-statement+0.6.0.patch +47 -0
- package/dist/allocations-B65Is4Md.d.ts +0 -97
- package/dist/auth-DkRZBK-T.d.ts +0 -122
- package/dist/{chunk-EATOPQFR.js → chunk-7Y7RDOGT.js} +5 -5
- package/dist/{chunk-7URNKK6J.js → chunk-LHLCPDGL.js} +3 -3
- package/dist/{chunk-EJI3MX4G.js → chunk-SLE4P6MO.js} +3 -3
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-6VYOUYMI.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-VQB3JWK7.js";
|
|
18
|
+
import "./chunk-XKTAIQJ4.js";
|
|
19
|
+
import "./chunk-ODIIC66I.js";
|
|
20
|
+
import "./chunk-AG37IM3H.js";
|
|
16
21
|
import "./chunk-C2TS5MER.js";
|
|
17
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-NO3BNQFL.js";
|
|
18
23
|
import "./chunk-QS7YU76C.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-EZ352IGD.js";
|
|
25
|
+
import "./chunk-UFQ4EZP3.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-ODIIC66I.js";
|
|
15
|
+
import "./chunk-EZ352IGD.js";
|
|
16
|
+
import "./chunk-UFQ4EZP3.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.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,18 +40,21 @@
|
|
|
40
40
|
"bin",
|
|
41
41
|
"docs",
|
|
42
42
|
"assets",
|
|
43
|
+
"patches",
|
|
43
44
|
"tools/release-retry-wrapper.mjs"
|
|
44
45
|
],
|
|
45
46
|
"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",
|
|
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 --format esm --dts --clean --target node22",
|
|
47
48
|
"refresh-environments": "node scripts/refresh-environments.mjs",
|
|
49
|
+
"postinstall": "patch-package",
|
|
48
50
|
"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",
|
|
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 && npm run test:vendor",
|
|
50
52
|
"test:e2e": "npm run build && node --test test/e2e.test.js",
|
|
51
53
|
"test:e2e:smoke": "bash scripts/e2e-pass.sh smoke",
|
|
52
54
|
"test:e2e:pr": "bash scripts/e2e-pass.sh pr",
|
|
53
55
|
"test:e2e:nightly": "bash scripts/e2e-pass.sh nightly",
|
|
54
|
-
"benchmark": "npm run build && node benchmark.js"
|
|
56
|
+
"benchmark": "npm run build && node benchmark.js",
|
|
57
|
+
"test:vendor": "vitest run src/auth/vendor"
|
|
55
58
|
},
|
|
56
59
|
"dependencies": {
|
|
57
60
|
"@ipld/car": "^5.4.3",
|
|
@@ -59,7 +62,7 @@
|
|
|
59
62
|
"@noble/hashes": "^1.7.2",
|
|
60
63
|
"@parity/product-sdk-address": "^0.1.1",
|
|
61
64
|
"@parity/product-sdk-keys": "^0.3.0",
|
|
62
|
-
"@parity/product-sdk-terminal": "^0.
|
|
65
|
+
"@parity/product-sdk-terminal": "^0.3.1",
|
|
63
66
|
"@parity/product-sdk-tx": "^0.2.4",
|
|
64
67
|
"@polkadot-api/metadata-builders": "^0.14.2",
|
|
65
68
|
"@polkadot-api/substrate-bindings": "^0.20.2",
|
|
@@ -72,28 +75,30 @@
|
|
|
72
75
|
"ipfs-unixfs-importer": "^16.1.4",
|
|
73
76
|
"jiti": "^2.4.2",
|
|
74
77
|
"multiformats": "^13.4.1",
|
|
78
|
+
"patch-package": "^8.0.1",
|
|
75
79
|
"polkadot-api": "^2.1.3",
|
|
76
80
|
"verifiablejs": "1.3.0-beta.4",
|
|
77
|
-
"viem": "^2.30.5"
|
|
81
|
+
"viem": "^2.30.5",
|
|
82
|
+
"ws": "^8.20.1"
|
|
78
83
|
},
|
|
79
84
|
"devDependencies": {
|
|
80
85
|
"@types/node": "^22.0.0",
|
|
86
|
+
"@types/ws": "^8.18.1",
|
|
81
87
|
"tsup": "^8.5.0",
|
|
82
88
|
"typescript": "^5.9.3",
|
|
83
|
-
"vitest": "^
|
|
84
|
-
"ws": "^8.20.1"
|
|
89
|
+
"vitest": "^4.1.0"
|
|
85
90
|
},
|
|
86
91
|
"overrides": {
|
|
87
92
|
"@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"
|
|
93
|
+
"@novasamatech/host-api": "0.8.6",
|
|
94
|
+
"@novasamatech/host-papp": "0.8.6",
|
|
95
|
+
"@novasamatech/scale": "0.8.6",
|
|
96
|
+
"@novasamatech/statement-store": "0.8.6",
|
|
97
|
+
"@novasamatech/storage-adapter": "0.8.6"
|
|
94
98
|
},
|
|
95
99
|
"minimumVersion": "0.5.6",
|
|
96
100
|
"engines": {
|
|
97
101
|
"node": ">=22"
|
|
98
|
-
}
|
|
102
|
+
},
|
|
103
|
+
"license": "GPL-3.0-or-later"
|
|
99
104
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
diff --git a/node_modules/@novasamatech/sdk-statement/dist/statement-sdk.js b/node_modules/@novasamatech/sdk-statement/dist/statement-sdk.js
|
|
2
|
+
index 3e6bcd2..5f17175 100644
|
|
3
|
+
--- a/node_modules/@novasamatech/sdk-statement/dist/statement-sdk.js
|
|
4
|
+
+++ b/node_modules/@novasamatech/sdk-statement/dist/statement-sdk.js
|
|
5
|
+
@@ -8,7 +8,19 @@ const createStatementSdk = (req, subscribe) => {
|
|
6
|
+
const api = getApi(req, subscribe);
|
|
7
|
+
const getStatements = (filter = ANY_FILTER) => new Promise((resolve, reject) => {
|
|
8
|
+
const statements = [];
|
|
9
|
+
- const unsubscribe = api.subscribeStatement(
|
|
10
|
+
+ // PATCH(bulletin-deploy): `unsubscribe` was a `const` initialized from
|
|
11
|
+
+ // api.subscribeStatement(...) while BOTH callbacks reference it. When the
|
|
12
|
+
+ // underlying observable settles synchronously at subscribe time (e.g. a
|
|
13
|
+
+ // poll fires after the websocket client was destroyed, so subscribe
|
|
14
|
+
+ // errors immediately), the callback runs before the const is assigned:
|
|
15
|
+
+ // "ReferenceError: Cannot access 'unsubscribe' before initialization",
|
|
16
|
+
+ // rethrown by rxjs as an uncaughtException. Hit on Ctrl+C / teardown
|
|
17
|
+
+ // during an active pairing poll. `let` + a settled flag covers both the
|
|
18
|
+
+ // sync-error and sync-completion shapes. Remove when fixed upstream.
|
|
19
|
+
+ // From playground-cli PR #281.
|
|
20
|
+
+ let settled = false;
|
|
21
|
+
+ let unsubscribe = null;
|
|
22
|
+
+ unsubscribe = api.subscribeStatement(
|
|
23
|
+
filter,
|
|
24
|
+
(event) => {
|
|
25
|
+
if (event.event === "newStatements") {
|
|
26
|
+
@@ -19,16 +31,19 @@ const createStatementSdk = (req, subscribe) => {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (event.data.remaining === 0 || event.data.remaining === void 0) {
|
|
30
|
+
- unsubscribe();
|
|
31
|
+
+ settled = true;
|
|
32
|
+
+ unsubscribe?.();
|
|
33
|
+
resolve(statements);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
(error) => {
|
|
38
|
+
- unsubscribe();
|
|
39
|
+
+ settled = true;
|
|
40
|
+
+ unsubscribe?.();
|
|
41
|
+
reject(error);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
+ if (settled) unsubscribe();
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
/**
|
|
@@ -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 };
|
package/dist/auth-DkRZBK-T.d.ts
DELETED
|
@@ -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 };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PEOPLE_MEMBER_IDENTIFIER_HEX,
|
|
3
|
+
PGAS_ASSET_ID,
|
|
4
|
+
PROOF_BYTES
|
|
5
|
+
} from "./chunk-SI2ZUOYD.js";
|
|
1
6
|
import {
|
|
2
7
|
buildImplicationMessage,
|
|
3
8
|
buildV5GeneralExtrinsic,
|
|
@@ -7,11 +12,6 @@ import {
|
|
|
7
12
|
readExtensionOrder,
|
|
8
13
|
toHex
|
|
9
14
|
} from "./chunk-ZYVGHDMU.js";
|
|
10
|
-
import {
|
|
11
|
-
PEOPLE_MEMBER_IDENTIFIER_HEX,
|
|
12
|
-
PGAS_ASSET_ID,
|
|
13
|
-
PROOF_BYTES
|
|
14
|
-
} from "./chunk-SI2ZUOYD.js";
|
|
15
15
|
|
|
16
16
|
// src/personhood/claim-pgas.ts
|
|
17
17
|
import * as verifiable from "verifiablejs/nodejs";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BANDERSNATCH_SIGNATURE_BYTES
|
|
3
|
+
} from "./chunk-SI2ZUOYD.js";
|
|
1
4
|
import {
|
|
2
5
|
buildImplicationMessage,
|
|
3
6
|
buildV5GeneralExtrinsic,
|
|
@@ -6,9 +9,6 @@ import {
|
|
|
6
9
|
readExtensionOrder,
|
|
7
10
|
toHex
|
|
8
11
|
} from "./chunk-ZYVGHDMU.js";
|
|
9
|
-
import {
|
|
10
|
-
BANDERSNATCH_SIGNATURE_BYTES
|
|
11
|
-
} from "./chunk-SI2ZUOYD.js";
|
|
12
12
|
|
|
13
13
|
// src/personhood/bind-personal-id.ts
|
|
14
14
|
import { Enum } from "polkadot-api";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALIAS_PROOF_TAG
|
|
3
|
+
} from "./chunk-SI2ZUOYD.js";
|
|
1
4
|
import {
|
|
2
5
|
blake2_256,
|
|
3
6
|
concatBytes
|
|
4
7
|
} from "./chunk-ZYVGHDMU.js";
|
|
5
|
-
import {
|
|
6
|
-
ALIAS_PROOF_TAG
|
|
7
|
-
} from "./chunk-SI2ZUOYD.js";
|
|
8
8
|
|
|
9
9
|
// src/personhood/proof-validity.ts
|
|
10
10
|
var u64LeBytes = (v) => {
|