@parity/product-deploy 0.7.28-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 +201 -0
- package/README.md +233 -0
- package/assets/environments.json +313 -0
- package/bin/bulletin-bootstrap +84 -0
- package/bin/bulletin-deploy +429 -0
- package/dist/bug-report.d.ts +29 -0
- package/dist/bug-report.js +27 -0
- package/dist/chunk-2VAUMZB2.js +284 -0
- package/dist/chunk-43HLT335.js +232 -0
- package/dist/chunk-5VZQ2KSU.js +231 -0
- package/dist/chunk-ADNBLFDP.js +225 -0
- package/dist/chunk-BMAEWZYV.js +24 -0
- package/dist/chunk-C2TS5MER.js +64 -0
- package/dist/chunk-DNXH4QTI.js +2336 -0
- package/dist/chunk-FZWJV5AD.js +231 -0
- package/dist/chunk-GZD2UFLR.js +8 -0
- package/dist/chunk-HOTQDYHD.js +219 -0
- package/dist/chunk-IDYGYIMH.js +207 -0
- package/dist/chunk-KHVTYIIX.js +146 -0
- package/dist/chunk-KJH2T5TQ.js +172 -0
- package/dist/chunk-KOSF5FDO.js +49 -0
- package/dist/chunk-LZJMVPYW.js +156 -0
- package/dist/chunk-MFTODIIT.js +725 -0
- package/dist/chunk-MMAZFJDG.js +91 -0
- package/dist/chunk-NF2FL4ZO.js +164 -0
- package/dist/chunk-OITUIM2E.js +524 -0
- package/dist/chunk-P6CHOMN3.js +2368 -0
- package/dist/chunk-QMYW3D6E.js +316 -0
- package/dist/chunk-QTZNULSH.js +185 -0
- package/dist/chunk-RI3ZLNPN.js +71 -0
- package/dist/chunk-S7EM5VMW.js +108 -0
- package/dist/chunk-T7EEVWNU.js +32 -0
- package/dist/chunk-UPWEOGLQ.js +37 -0
- package/dist/chunk-ZOC4GITL.js +13 -0
- package/dist/chunk-ZYVGHDMU.js +117 -0
- package/dist/chunk-probe.d.ts +37 -0
- package/dist/chunk-probe.js +18 -0
- package/dist/chunker.d.ts +8 -0
- package/dist/chunker.js +10 -0
- package/dist/deploy.d.ts +299 -0
- package/dist/deploy.js +96 -0
- package/dist/dotns.d.ts +506 -0
- package/dist/dotns.js +101 -0
- package/dist/environments.d.ts +104 -0
- package/dist/environments.js +23 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +8 -0
- package/dist/gh-pages-mirror.d.ts +76 -0
- package/dist/gh-pages-mirror.js +30 -0
- package/dist/incremental-stats.d.ts +69 -0
- package/dist/incremental-stats.js +10 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +146 -0
- package/dist/manifest/byte-budget.d.ts +46 -0
- package/dist/manifest/byte-budget.js +14 -0
- package/dist/manifest/config-load.d.ts +36 -0
- package/dist/manifest/config-load.js +10 -0
- package/dist/manifest/publish.d.ts +54 -0
- package/dist/manifest/publish.js +23 -0
- package/dist/manifest/schema.d.ts +29 -0
- package/dist/manifest/schema.js +10 -0
- package/dist/manifest/types.d.ts +90 -0
- package/dist/manifest/types.js +6 -0
- package/dist/manifest-embed.d.ts +18 -0
- package/dist/manifest-embed.js +9 -0
- package/dist/manifest-fetch.d.ts +32 -0
- package/dist/manifest-fetch.js +21 -0
- package/dist/manifest-roundtrip.d.ts +15 -0
- package/dist/manifest-roundtrip.js +55 -0
- package/dist/manifest.d.ts +44 -0
- package/dist/manifest.js +20 -0
- package/dist/memory-report.d.ts +95 -0
- package/dist/memory-report.js +17 -0
- package/dist/merkle.d.ts +50 -0
- package/dist/merkle.js +33 -0
- package/dist/personhood/bind-paid-alias.d.ts +43 -0
- package/dist/personhood/bind-paid-alias.js +10 -0
- package/dist/personhood/bind-personal-id.d.ts +55 -0
- package/dist/personhood/bind-personal-id.js +12 -0
- package/dist/personhood/bootstrap.d.ts +85 -0
- package/dist/personhood/bootstrap.js +245 -0
- package/dist/personhood/claim-pgas.d.ts +61 -0
- package/dist/personhood/claim-pgas.js +12 -0
- package/dist/personhood/constants.d.ts +23 -0
- package/dist/personhood/constants.js +22 -0
- package/dist/personhood/encoding.d.ts +49 -0
- package/dist/personhood/encoding.js +24 -0
- package/dist/personhood/hashing.d.ts +4 -0
- package/dist/personhood/hashing.js +8 -0
- package/dist/personhood/member-key.d.ts +12 -0
- package/dist/personhood/member-key.js +10 -0
- package/dist/personhood/people-client.d.ts +14 -0
- package/dist/personhood/people-client.js +48 -0
- package/dist/personhood/reprove.d.ts +43 -0
- package/dist/personhood/reprove.js +225 -0
- package/dist/pool.d.ts +51 -0
- package/dist/pool.js +30 -0
- package/dist/run-state.d.ts +22 -0
- package/dist/run-state.js +20 -0
- package/dist/telemetry.d.ts +56 -0
- package/dist/telemetry.js +71 -0
- package/dist/version-check.d.ts +38 -0
- package/dist/version-check.js +30 -0
- package/docs/bootstrap.md +49 -0
- package/docs/e2e-bootstrap.md +154 -0
- package/docs/telemetry.md +62 -0
- package/docs/testing.md +44 -0
- package/package.json +82 -0
- package/tools/release-retry-wrapper.mjs +74 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
declare const DEFAULT_ENV_ID = "paseo-next-v2";
|
|
2
|
+
interface PopSelfServeConfig {
|
|
3
|
+
/** The label users select in the sudo.personhood.dev env dropdown — e.g. "Next V2". */
|
|
4
|
+
sudoEnvLabel: string;
|
|
5
|
+
/** Faucet URL for funding the service account on this env. */
|
|
6
|
+
faucetUrl: string;
|
|
7
|
+
/** Personhood recognition flow URL on the sudo app. */
|
|
8
|
+
personhoodFaucetUrl: string;
|
|
9
|
+
/** Asset-Hub alias-binding flow URL on the sudo app. */
|
|
10
|
+
dotnsBootstrapUrl: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether state-aware remediation messages (not-bound / bound-likely-stale / wrong-context)
|
|
13
|
+
* can be offered for this env. Requires the reprove tooling to know the env and the user
|
|
14
|
+
* to have access to the dotns-bootstrap UI. Defaults to false; opt in per-env.
|
|
15
|
+
*/
|
|
16
|
+
stateAwareGuidance?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Environment {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
network: "testnet" | "mainnet";
|
|
22
|
+
description?: string;
|
|
23
|
+
badge?: string;
|
|
24
|
+
backend?: string;
|
|
25
|
+
ipfs?: string;
|
|
26
|
+
uptimeUrl?: string;
|
|
27
|
+
autoAccountMapping?: boolean;
|
|
28
|
+
bulletinAuthorizeV2?: boolean;
|
|
29
|
+
nativeToEthRatio?: number;
|
|
30
|
+
registerStorageDeposit?: number;
|
|
31
|
+
contracts?: Record<string, string>;
|
|
32
|
+
popSelfServe?: PopSelfServeConfig;
|
|
33
|
+
}
|
|
34
|
+
interface ChainEndpoint {
|
|
35
|
+
wss: string | string[];
|
|
36
|
+
parachainId?: number;
|
|
37
|
+
uptimeUrl?: string;
|
|
38
|
+
}
|
|
39
|
+
interface Chain {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
endpoints: Record<string, ChainEndpoint>;
|
|
43
|
+
}
|
|
44
|
+
interface EnvironmentsDoc {
|
|
45
|
+
environments: Environment[];
|
|
46
|
+
chains: Chain[];
|
|
47
|
+
}
|
|
48
|
+
type EnvironmentsSource = "bundled" | "hardcoded-fallback";
|
|
49
|
+
interface LoadResult {
|
|
50
|
+
doc: EnvironmentsDoc;
|
|
51
|
+
source: EnvironmentsSource;
|
|
52
|
+
}
|
|
53
|
+
interface LoadOptions {
|
|
54
|
+
bundledPath?: string;
|
|
55
|
+
warn?: (msg: string) => void;
|
|
56
|
+
capture?: (err: unknown) => void;
|
|
57
|
+
}
|
|
58
|
+
interface ResolvedEndpoints {
|
|
59
|
+
bulletin: string[];
|
|
60
|
+
assetHub: string[];
|
|
61
|
+
network: "testnet" | "mainnet";
|
|
62
|
+
envName: string;
|
|
63
|
+
ipfs?: string;
|
|
64
|
+
autoAccountMapping: boolean;
|
|
65
|
+
bulletinAuthorizeV2: boolean;
|
|
66
|
+
contracts: Record<string, string>;
|
|
67
|
+
nativeToEthRatio: bigint;
|
|
68
|
+
registerStorageDeposit?: bigint;
|
|
69
|
+
}
|
|
70
|
+
declare function defaultBundledPath(): string;
|
|
71
|
+
/**
|
|
72
|
+
* Returns true for a well-formed, non-zero EVM address:
|
|
73
|
+
* - 0x-prefixed, exactly 42 characters (0x + 40 hex digits)
|
|
74
|
+
* - not the all-zeros address
|
|
75
|
+
*
|
|
76
|
+
* Does NOT require EIP-55 checksum — addresses in environments.json may be
|
|
77
|
+
* stored in any casing and the validation goal is structural correctness.
|
|
78
|
+
*/
|
|
79
|
+
declare function isValidContractAddress(addr: unknown): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Validates all contract addresses in the given contracts map.
|
|
82
|
+
*
|
|
83
|
+
* Throws a clear error for the first invalid address found.
|
|
84
|
+
* Does NOT throw when the map is empty or a key is absent — the map is sparse
|
|
85
|
+
* by design (not all environments have contracts configured).
|
|
86
|
+
*
|
|
87
|
+
* @param contracts The `contracts` record from an environment entry.
|
|
88
|
+
* @param envId The environment ID, used in the error message.
|
|
89
|
+
*/
|
|
90
|
+
declare function validateContractAddresses(contracts: Record<string, string>, envId: string): void;
|
|
91
|
+
declare function loadEnvironments(opts?: LoadOptions): Promise<LoadResult>;
|
|
92
|
+
declare function resolveEndpoints(doc: EnvironmentsDoc, envId: string): ResolvedEndpoints;
|
|
93
|
+
declare function getPopSelfServeConfig(doc: EnvironmentsDoc, envId: string): PopSelfServeConfig | null;
|
|
94
|
+
interface EnvironmentListing {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
network: string;
|
|
98
|
+
hasBulletin: boolean;
|
|
99
|
+
description: string;
|
|
100
|
+
}
|
|
101
|
+
declare function listEnvironments(doc: EnvironmentsDoc): EnvironmentListing[];
|
|
102
|
+
declare function formatEnvironmentTable(rows: EnvironmentListing[]): string;
|
|
103
|
+
|
|
104
|
+
export { type Chain, type ChainEndpoint, DEFAULT_ENV_ID, type Environment, type EnvironmentListing, type EnvironmentsDoc, type EnvironmentsSource, type LoadOptions, type LoadResult, type PopSelfServeConfig, type ResolvedEndpoints, defaultBundledPath, formatEnvironmentTable, getPopSelfServeConfig, isValidContractAddress, listEnvironments, loadEnvironments, resolveEndpoints, validateContractAddresses };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_ENV_ID,
|
|
3
|
+
defaultBundledPath,
|
|
4
|
+
formatEnvironmentTable,
|
|
5
|
+
getPopSelfServeConfig,
|
|
6
|
+
isValidContractAddress,
|
|
7
|
+
listEnvironments,
|
|
8
|
+
loadEnvironments,
|
|
9
|
+
resolveEndpoints,
|
|
10
|
+
validateContractAddresses
|
|
11
|
+
} from "./chunk-OITUIM2E.js";
|
|
12
|
+
import "./chunk-ZOC4GITL.js";
|
|
13
|
+
export {
|
|
14
|
+
DEFAULT_ENV_ID,
|
|
15
|
+
defaultBundledPath,
|
|
16
|
+
formatEnvironmentTable,
|
|
17
|
+
getPopSelfServeConfig,
|
|
18
|
+
isValidContractAddress,
|
|
19
|
+
listEnvironments,
|
|
20
|
+
loadEnvironments,
|
|
21
|
+
resolveEndpoints,
|
|
22
|
+
validateContractAddresses
|
|
23
|
+
};
|
package/dist/errors.d.ts
ADDED
package/dist/errors.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
declare const GH_PAGES_MIRROR_MAX_BYTES: number;
|
|
2
|
+
declare const GH_PAGES_MIRROR_DIR = "bulletin";
|
|
3
|
+
declare const GH_PAGES_MIRROR_BRANCH = "gh-pages";
|
|
4
|
+
interface MirrorInput {
|
|
5
|
+
domain: string;
|
|
6
|
+
carBytes: Uint8Array;
|
|
7
|
+
cid: string;
|
|
8
|
+
toolVersion: string;
|
|
9
|
+
bulletinRpc: string;
|
|
10
|
+
encrypted: boolean;
|
|
11
|
+
deployedAt?: string;
|
|
12
|
+
sourceCommit?: string;
|
|
13
|
+
sourceRepo?: string;
|
|
14
|
+
repoPath?: string;
|
|
15
|
+
githubToken?: string;
|
|
16
|
+
}
|
|
17
|
+
interface MirrorResult {
|
|
18
|
+
url: string;
|
|
19
|
+
owner: string;
|
|
20
|
+
repo: string;
|
|
21
|
+
carPath: string;
|
|
22
|
+
manifestPath: string;
|
|
23
|
+
}
|
|
24
|
+
interface MirrorManifest {
|
|
25
|
+
domain: string;
|
|
26
|
+
cid: string;
|
|
27
|
+
toolVersion: string;
|
|
28
|
+
deployedAt: string;
|
|
29
|
+
encrypted: boolean;
|
|
30
|
+
bulletinRpc: string;
|
|
31
|
+
sourceRepo?: string;
|
|
32
|
+
sourceCommit?: string;
|
|
33
|
+
}
|
|
34
|
+
declare class MirrorSkipped extends Error {
|
|
35
|
+
constructor(reason: string);
|
|
36
|
+
}
|
|
37
|
+
interface FreshnessPollResult {
|
|
38
|
+
verified: boolean;
|
|
39
|
+
attempts: number;
|
|
40
|
+
durationMs: number;
|
|
41
|
+
lastCid: string | null;
|
|
42
|
+
lastStatus: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Poll the mirror's manifest URL until its `cid` field equals the expected
|
|
46
|
+
* value. Pages is CDN-backed — a fresh commit may return HTTP 200 for
|
|
47
|
+
* several seconds to a few minutes while Fastly still serves stale bytes,
|
|
48
|
+
* so we can't just 200-check. Matching the manifest CID proves the edge
|
|
49
|
+
* has picked up the current deploy; the sibling .car URL is then guaranteed
|
|
50
|
+
* fresh for the same commit.
|
|
51
|
+
*
|
|
52
|
+
* Non-fatal to the deploy — returns `{ verified: false }` if the poll times
|
|
53
|
+
* out so the caller can log a warning without aborting a deploy whose
|
|
54
|
+
* on-chain state is already good.
|
|
55
|
+
*/
|
|
56
|
+
declare function pollMirrorFreshness(mirrorUrl: string, expectedCid: string, opts?: {
|
|
57
|
+
timeoutMs?: number;
|
|
58
|
+
intervalMs?: number;
|
|
59
|
+
fetchFn?: typeof fetch;
|
|
60
|
+
}): Promise<FreshnessPollResult>;
|
|
61
|
+
declare function parseGitRemoteUrl(url: string): {
|
|
62
|
+
owner: string;
|
|
63
|
+
repo: string;
|
|
64
|
+
} | null;
|
|
65
|
+
declare function resolveOwnerRepo(repoPath: string): {
|
|
66
|
+
owner: string;
|
|
67
|
+
repo: string;
|
|
68
|
+
} | null;
|
|
69
|
+
declare function resolveSourceCommit(repoPath: string): string | undefined;
|
|
70
|
+
declare function normalizeDomainFilename(domain: string): string;
|
|
71
|
+
declare function mirrorUrl(owner: string, repo: string, domainFilename: string): string;
|
|
72
|
+
declare function buildManifest(input: Omit<MirrorInput, "carBytes" | "repoPath" | "githubToken">): MirrorManifest;
|
|
73
|
+
declare const MIRROR_BOT_GIT_OVERRIDES: readonly string[];
|
|
74
|
+
declare function mirrorToGitHubPages(input: MirrorInput): Promise<MirrorResult>;
|
|
75
|
+
|
|
76
|
+
export { type FreshnessPollResult, GH_PAGES_MIRROR_BRANCH, GH_PAGES_MIRROR_DIR, GH_PAGES_MIRROR_MAX_BYTES, MIRROR_BOT_GIT_OVERRIDES, type MirrorInput, type MirrorManifest, type MirrorResult, MirrorSkipped, buildManifest, mirrorToGitHubPages, mirrorUrl, normalizeDomainFilename, parseGitRemoteUrl, pollMirrorFreshness, resolveOwnerRepo, resolveSourceCommit };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GH_PAGES_MIRROR_BRANCH,
|
|
3
|
+
GH_PAGES_MIRROR_DIR,
|
|
4
|
+
GH_PAGES_MIRROR_MAX_BYTES,
|
|
5
|
+
MIRROR_BOT_GIT_OVERRIDES,
|
|
6
|
+
MirrorSkipped,
|
|
7
|
+
buildManifest,
|
|
8
|
+
mirrorToGitHubPages,
|
|
9
|
+
mirrorUrl,
|
|
10
|
+
normalizeDomainFilename,
|
|
11
|
+
parseGitRemoteUrl,
|
|
12
|
+
pollMirrorFreshness,
|
|
13
|
+
resolveOwnerRepo,
|
|
14
|
+
resolveSourceCommit
|
|
15
|
+
} from "./chunk-HOTQDYHD.js";
|
|
16
|
+
export {
|
|
17
|
+
GH_PAGES_MIRROR_BRANCH,
|
|
18
|
+
GH_PAGES_MIRROR_DIR,
|
|
19
|
+
GH_PAGES_MIRROR_MAX_BYTES,
|
|
20
|
+
MIRROR_BOT_GIT_OVERRIDES,
|
|
21
|
+
MirrorSkipped,
|
|
22
|
+
buildManifest,
|
|
23
|
+
mirrorToGitHubPages,
|
|
24
|
+
mirrorUrl,
|
|
25
|
+
normalizeDomainFilename,
|
|
26
|
+
parseGitRemoteUrl,
|
|
27
|
+
pollMirrorFreshness,
|
|
28
|
+
resolveOwnerRepo,
|
|
29
|
+
resolveSourceCommit
|
|
30
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ChunkProbeResult } from './chunk-probe.js';
|
|
2
|
+
import { ManifestChunkEntry } from './manifest.js';
|
|
3
|
+
|
|
4
|
+
interface IncrementalStats {
|
|
5
|
+
manifestSource: "embedded" | "heuristic_fallback" | "none";
|
|
6
|
+
manifestFetchAttempts: number;
|
|
7
|
+
manifestBytes: number;
|
|
8
|
+
framework: string | null;
|
|
9
|
+
filesTotal: number;
|
|
10
|
+
filesStable: number;
|
|
11
|
+
filesVolatile: number;
|
|
12
|
+
probedTotal: number;
|
|
13
|
+
probePresent: number;
|
|
14
|
+
probeAbsent: number;
|
|
15
|
+
probeFailed: number;
|
|
16
|
+
probeFailedRpc: number;
|
|
17
|
+
probeFailedDecode: number;
|
|
18
|
+
probeFailedMetadata: number;
|
|
19
|
+
recycledCids: number;
|
|
20
|
+
retentionPeriodBlocks: number;
|
|
21
|
+
bytesProbePresent: number;
|
|
22
|
+
bytesProbeAbsent: number;
|
|
23
|
+
bytesSkipped: number;
|
|
24
|
+
bytesUploaded: number;
|
|
25
|
+
chunksTotal: number;
|
|
26
|
+
chunksUploaded: number;
|
|
27
|
+
chunksSkipped: number;
|
|
28
|
+
carBytes: number;
|
|
29
|
+
section0Bytes: number;
|
|
30
|
+
section1Bytes: number;
|
|
31
|
+
section2Bytes: number;
|
|
32
|
+
estimatedSecondsSaved: number;
|
|
33
|
+
tier2VerifiedCount: number;
|
|
34
|
+
tier2InconclusiveCount: number;
|
|
35
|
+
tier2FallbackCount: number;
|
|
36
|
+
}
|
|
37
|
+
interface ComputeStatsInput {
|
|
38
|
+
manifestSource: IncrementalStats["manifestSource"];
|
|
39
|
+
manifestFetchAttempts: number;
|
|
40
|
+
manifestBytes?: number;
|
|
41
|
+
framework: string | null;
|
|
42
|
+
filesTotal: number;
|
|
43
|
+
filesStable: number;
|
|
44
|
+
filesVolatile: number;
|
|
45
|
+
probeResults: ChunkProbeResult[];
|
|
46
|
+
prevChunks: Record<string, ManifestChunkEntry>;
|
|
47
|
+
retentionPeriodBlocks: number;
|
|
48
|
+
bytesProbePresent: number;
|
|
49
|
+
bytesProbeAbsent?: number;
|
|
50
|
+
bytesSkipped: number;
|
|
51
|
+
bytesUploaded: number;
|
|
52
|
+
chunksTotal: number;
|
|
53
|
+
chunksUploaded: number;
|
|
54
|
+
chunksSkipped: number;
|
|
55
|
+
carBytes: number;
|
|
56
|
+
sectionSizes: {
|
|
57
|
+
section0: number;
|
|
58
|
+
section1: number;
|
|
59
|
+
section2: number;
|
|
60
|
+
};
|
|
61
|
+
tier2VerifiedCount: number;
|
|
62
|
+
tier2InconclusiveCount: number;
|
|
63
|
+
tier2FallbackCount: number;
|
|
64
|
+
}
|
|
65
|
+
declare function computeStats(input: ComputeStatsInput): IncrementalStats;
|
|
66
|
+
declare function telemetryAttributes(s: IncrementalStats): Record<string, string | number>;
|
|
67
|
+
declare function renderSummary(s: IncrementalStats): string;
|
|
68
|
+
|
|
69
|
+
export { type ComputeStatsInput, type IncrementalStats, computeStats, renderSummary, telemetryAttributes };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { DeployContent, DeployOptions, DeployResult, deploy } from './deploy.js';
|
|
2
|
+
export { PoolAccount, PoolAuthorization, bootstrapPool, derivePoolAccounts, ensureAuthorized, fetchPoolAuthorizations, selectAccount } from './pool.js';
|
|
3
|
+
export { DEFAULT_MNEMONIC, DotNS, DotNSConnectOptions, OwnershipResult, ParsedDomainName, PriceValidationResult, parseDomainName, sanitizeDomainLabel } from './dotns.js';
|
|
4
|
+
export { MerkleizeResult, MerkleizeStableResult, merkleizeJS, merkleizeWithStableOrder } from './merkle.js';
|
|
5
|
+
export { EmbeddedManifest, FileType, MANIFEST_DIR, MANIFEST_FILENAME, MANIFEST_PATH, MANIFEST_VERSION, ManifestFileEntry, ParseResult, classifyFile, isVolatilePath, parseManifest } from './manifest.js';
|
|
6
|
+
export { ChainProbeOptions, ChunkProbeResult, probeChunks } from './chunk-probe.js';
|
|
7
|
+
export { finaliseEmbeddedManifest, writeEmbeddedManifestPlaceholder } from './manifest-embed.js';
|
|
8
|
+
export { FetchOptions, FetchOutcome, fetchPreviousManifest } from './manifest-fetch.js';
|
|
9
|
+
export { ComputeStatsInput, IncrementalStats, computeStats, renderSummary, telemetryAttributes } from './incremental-stats.js';
|
|
10
|
+
export { Chain, ChainEndpoint, DEFAULT_ENV_ID, Environment, EnvironmentListing, EnvironmentsDoc, EnvironmentsSource, LoadOptions, LoadResult, ResolvedEndpoints, defaultBundledPath, formatEnvironmentTable, isValidContractAddress, listEnvironments, loadEnvironments, resolveEndpoints, validateContractAddresses } from './environments.js';
|
|
11
|
+
export { RunState, RunStatus, VERSION, loadRunState, probablyOomRssMb, resolveStateDir, shouldShowOomHint, shouldSkipStaleWarning, stateFilePath, writeRunState } from './run-state.js';
|
|
12
|
+
export { AppExecutableConfig, AppManifest, AppVersion, ExecutableConfig, ExecutableKind, ExecutableManifest, Icon, IconConfig, IconFormat, ProductConfig, RootManifest, WidgetDimensions, WidgetExecutableConfig, WidgetManifest, WorkerExecutableConfig, WorkerIncludes, WorkerManifest, defineConfig } from './manifest/types.js';
|
|
13
|
+
export { ValidationErr, ValidationOk, ValidationResult, validateExecutableManifest, validateProductConfig, validateRootManifest } from './manifest/schema.js';
|
|
14
|
+
export { BudgetCheck, DEFAULT_TEXT_RECORD_BUDGET_BYTES, PLACEHOLDER_CID, PessimisticSizeReport, assertWithinBudget, getTextRecordBudgetBytes, pessimisticSizePreflight } from './manifest/byte-budget.js';
|
|
15
|
+
export { LoadProductConfigOptions, LoadedProductConfig, loadProductConfig, tryLoadProductConfig } from './manifest/config-load.js';
|
|
16
|
+
export { PublishManifestOptions, PublishManifestResult, publishManifest } from './manifest/publish.js';
|
|
17
|
+
import 'multiformats/cid';
|
|
18
|
+
import 'polkadot-api';
|
|
19
|
+
import './errors.js';
|
|
20
|
+
import './personhood/bootstrap.js';
|
|
21
|
+
import './personhood/bind-personal-id.js';
|
|
22
|
+
import './personhood/claim-pgas.js';
|
|
23
|
+
import './personhood/bind-paid-alias.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineConfig
|
|
3
|
+
} from "./chunk-GZD2UFLR.js";
|
|
4
|
+
import {
|
|
5
|
+
loadProductConfig,
|
|
6
|
+
tryLoadProductConfig
|
|
7
|
+
} from "./chunk-MMAZFJDG.js";
|
|
8
|
+
import {
|
|
9
|
+
publishManifest
|
|
10
|
+
} from "./chunk-NF2FL4ZO.js";
|
|
11
|
+
import {
|
|
12
|
+
DEFAULT_TEXT_RECORD_BUDGET_BYTES,
|
|
13
|
+
PLACEHOLDER_CID,
|
|
14
|
+
assertWithinBudget,
|
|
15
|
+
getTextRecordBudgetBytes,
|
|
16
|
+
pessimisticSizePreflight
|
|
17
|
+
} from "./chunk-RI3ZLNPN.js";
|
|
18
|
+
import {
|
|
19
|
+
validateExecutableManifest,
|
|
20
|
+
validateProductConfig,
|
|
21
|
+
validateRootManifest
|
|
22
|
+
} from "./chunk-LZJMVPYW.js";
|
|
23
|
+
import {
|
|
24
|
+
deploy,
|
|
25
|
+
merkleizeJS,
|
|
26
|
+
merkleizeWithStableOrder
|
|
27
|
+
} from "./chunk-P6CHOMN3.js";
|
|
28
|
+
import {
|
|
29
|
+
computeStats,
|
|
30
|
+
renderSummary,
|
|
31
|
+
telemetryAttributes
|
|
32
|
+
} from "./chunk-KHVTYIIX.js";
|
|
33
|
+
import {
|
|
34
|
+
finaliseEmbeddedManifest,
|
|
35
|
+
writeEmbeddedManifestPlaceholder
|
|
36
|
+
} from "./chunk-KOSF5FDO.js";
|
|
37
|
+
import {
|
|
38
|
+
fetchPreviousManifest
|
|
39
|
+
} from "./chunk-FZWJV5AD.js";
|
|
40
|
+
import {
|
|
41
|
+
MANIFEST_DIR,
|
|
42
|
+
MANIFEST_FILENAME,
|
|
43
|
+
MANIFEST_PATH,
|
|
44
|
+
MANIFEST_VERSION,
|
|
45
|
+
classifyFile,
|
|
46
|
+
isVolatilePath,
|
|
47
|
+
parseManifest
|
|
48
|
+
} from "./chunk-S7EM5VMW.js";
|
|
49
|
+
import "./chunk-ADNBLFDP.js";
|
|
50
|
+
import "./chunk-43HLT335.js";
|
|
51
|
+
import {
|
|
52
|
+
probeChunks
|
|
53
|
+
} from "./chunk-QTZNULSH.js";
|
|
54
|
+
import "./chunk-C2TS5MER.js";
|
|
55
|
+
import {
|
|
56
|
+
DEFAULT_MNEMONIC,
|
|
57
|
+
DotNS,
|
|
58
|
+
parseDomainName,
|
|
59
|
+
sanitizeDomainLabel
|
|
60
|
+
} from "./chunk-DNXH4QTI.js";
|
|
61
|
+
import {
|
|
62
|
+
bootstrapPool,
|
|
63
|
+
derivePoolAccounts,
|
|
64
|
+
ensureAuthorized,
|
|
65
|
+
fetchPoolAuthorizations,
|
|
66
|
+
selectAccount
|
|
67
|
+
} from "./chunk-QMYW3D6E.js";
|
|
68
|
+
import "./chunk-MFTODIIT.js";
|
|
69
|
+
import {
|
|
70
|
+
VERSION,
|
|
71
|
+
loadRunState,
|
|
72
|
+
probablyOomRssMb,
|
|
73
|
+
resolveStateDir,
|
|
74
|
+
shouldShowOomHint,
|
|
75
|
+
shouldSkipStaleWarning,
|
|
76
|
+
stateFilePath,
|
|
77
|
+
writeRunState
|
|
78
|
+
} from "./chunk-KJH2T5TQ.js";
|
|
79
|
+
import {
|
|
80
|
+
DEFAULT_ENV_ID,
|
|
81
|
+
defaultBundledPath,
|
|
82
|
+
formatEnvironmentTable,
|
|
83
|
+
isValidContractAddress,
|
|
84
|
+
listEnvironments,
|
|
85
|
+
loadEnvironments,
|
|
86
|
+
resolveEndpoints,
|
|
87
|
+
validateContractAddresses
|
|
88
|
+
} from "./chunk-OITUIM2E.js";
|
|
89
|
+
import "./chunk-ZOC4GITL.js";
|
|
90
|
+
import "./chunk-HOTQDYHD.js";
|
|
91
|
+
export {
|
|
92
|
+
DEFAULT_ENV_ID,
|
|
93
|
+
DEFAULT_MNEMONIC,
|
|
94
|
+
DEFAULT_TEXT_RECORD_BUDGET_BYTES,
|
|
95
|
+
DotNS,
|
|
96
|
+
MANIFEST_DIR,
|
|
97
|
+
MANIFEST_FILENAME,
|
|
98
|
+
MANIFEST_PATH,
|
|
99
|
+
MANIFEST_VERSION,
|
|
100
|
+
PLACEHOLDER_CID,
|
|
101
|
+
VERSION,
|
|
102
|
+
assertWithinBudget,
|
|
103
|
+
bootstrapPool,
|
|
104
|
+
classifyFile,
|
|
105
|
+
computeStats,
|
|
106
|
+
defaultBundledPath,
|
|
107
|
+
defineConfig,
|
|
108
|
+
deploy,
|
|
109
|
+
derivePoolAccounts,
|
|
110
|
+
ensureAuthorized,
|
|
111
|
+
fetchPoolAuthorizations,
|
|
112
|
+
fetchPreviousManifest,
|
|
113
|
+
finaliseEmbeddedManifest,
|
|
114
|
+
formatEnvironmentTable,
|
|
115
|
+
getTextRecordBudgetBytes,
|
|
116
|
+
isValidContractAddress,
|
|
117
|
+
isVolatilePath,
|
|
118
|
+
listEnvironments,
|
|
119
|
+
loadEnvironments,
|
|
120
|
+
loadProductConfig,
|
|
121
|
+
loadRunState,
|
|
122
|
+
merkleizeJS,
|
|
123
|
+
merkleizeWithStableOrder,
|
|
124
|
+
parseDomainName,
|
|
125
|
+
parseManifest,
|
|
126
|
+
pessimisticSizePreflight,
|
|
127
|
+
probablyOomRssMb,
|
|
128
|
+
probeChunks,
|
|
129
|
+
publishManifest,
|
|
130
|
+
renderSummary,
|
|
131
|
+
resolveEndpoints,
|
|
132
|
+
resolveStateDir,
|
|
133
|
+
sanitizeDomainLabel,
|
|
134
|
+
selectAccount,
|
|
135
|
+
shouldShowOomHint,
|
|
136
|
+
shouldSkipStaleWarning,
|
|
137
|
+
stateFilePath,
|
|
138
|
+
telemetryAttributes,
|
|
139
|
+
tryLoadProductConfig,
|
|
140
|
+
validateContractAddresses,
|
|
141
|
+
validateExecutableManifest,
|
|
142
|
+
validateProductConfig,
|
|
143
|
+
validateRootManifest,
|
|
144
|
+
writeEmbeddedManifestPlaceholder,
|
|
145
|
+
writeRunState
|
|
146
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ProductConfig } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Byte-budget guards for dotNS text-record writes.
|
|
5
|
+
*
|
|
6
|
+
* This module ships a conservative default with a `BULLETIN_TEXT_BUDGET` env override so
|
|
7
|
+
* publishers can probe larger payloads when the on-chain cap is raised.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
declare const DEFAULT_TEXT_RECORD_BUDGET_BYTES = 1024;
|
|
11
|
+
/**
|
|
12
|
+
* Fixed-length stand-in for a Bulletin CID in the pre-upload size preflight.
|
|
13
|
+
*
|
|
14
|
+
* CIDv1(raw, sha256, 32B) base32-encodes to exactly 59 characters per the
|
|
15
|
+
* RFC §Constants table, so substituting any 59-char CID-like string lets us
|
|
16
|
+
* size manifests deterministically before the icon and executables have
|
|
17
|
+
* actually been uploaded.
|
|
18
|
+
*/
|
|
19
|
+
declare const PLACEHOLDER_CID = "bafkreigh2akiscaildc7zh3vznzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
|
20
|
+
/** Resolved text-record byte budget, from `BULLETIN_TEXT_BUDGET` or the default. */
|
|
21
|
+
declare function getTextRecordBudgetBytes(): number;
|
|
22
|
+
interface BudgetCheck {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
bytes: number;
|
|
26
|
+
budget: number;
|
|
27
|
+
}
|
|
28
|
+
/** Check a single serialised value against the budget, in UTF-8 bytes. */
|
|
29
|
+
declare function assertWithinBudget(key: string, serialized: string, budget: number): BudgetCheck;
|
|
30
|
+
interface PessimisticSizeReport {
|
|
31
|
+
ok: boolean;
|
|
32
|
+
budget: number;
|
|
33
|
+
checks: BudgetCheck[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Pre-upload size check for every text record the publish flow will write.
|
|
37
|
+
*
|
|
38
|
+
* Composes each manifest with `PLACEHOLDER_CID` substituted for the real
|
|
39
|
+
* Bulletin CIDs (which aren't known until Step 4 of the publish flow) and
|
|
40
|
+
* verifies the serialised JSON fits within `budget`. Lets the publisher
|
|
41
|
+
* abort cleanly before any chain writes when a config would otherwise
|
|
42
|
+
* trip the dotNS wire-level cap.
|
|
43
|
+
*/
|
|
44
|
+
declare function pessimisticSizePreflight(config: ProductConfig, budget?: number): PessimisticSizeReport;
|
|
45
|
+
|
|
46
|
+
export { type BudgetCheck, DEFAULT_TEXT_RECORD_BUDGET_BYTES, PLACEHOLDER_CID, type PessimisticSizeReport, assertWithinBudget, getTextRecordBudgetBytes, pessimisticSizePreflight };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_TEXT_RECORD_BUDGET_BYTES,
|
|
3
|
+
PLACEHOLDER_CID,
|
|
4
|
+
assertWithinBudget,
|
|
5
|
+
getTextRecordBudgetBytes,
|
|
6
|
+
pessimisticSizePreflight
|
|
7
|
+
} from "../chunk-RI3ZLNPN.js";
|
|
8
|
+
export {
|
|
9
|
+
DEFAULT_TEXT_RECORD_BUDGET_BYTES,
|
|
10
|
+
PLACEHOLDER_CID,
|
|
11
|
+
assertWithinBudget,
|
|
12
|
+
getTextRecordBudgetBytes,
|
|
13
|
+
pessimisticSizePreflight
|
|
14
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ProductConfig } from './types.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Load the developer-authored `bulletin-deploy.config.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Configs are TypeScript so authors get IntelliSense on the discriminated
|
|
7
|
+
* `kind` union. We evaluate them at runtime via [jiti](https://github.com/unjs/jiti)
|
|
8
|
+
* and route the default export through [`validateProductConfig`](./schema.ts).
|
|
9
|
+
* TS types are erased at runtime, so a literal like `"jpg"` where the type
|
|
10
|
+
* says `"jpeg" | "png"` still needs a runtime check.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface LoadProductConfigOptions {
|
|
14
|
+
/** Explicit path to a config file. Takes precedence over auto-discovery. */
|
|
15
|
+
path?: string;
|
|
16
|
+
/** Directory to search when no explicit path is supplied. Defaults to process.cwd(). */
|
|
17
|
+
cwd?: string;
|
|
18
|
+
/** When true, walks up parent directories from `cwd` until a config is found or the fs root is reached. */
|
|
19
|
+
walkUp?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface LoadedProductConfig {
|
|
22
|
+
config: ProductConfig;
|
|
23
|
+
sourcePath: string;
|
|
24
|
+
}
|
|
25
|
+
/** Load + validate a product config, throwing on missing-file or schema errors. */
|
|
26
|
+
declare function loadProductConfig(options?: LoadProductConfigOptions): Promise<LoadedProductConfig>;
|
|
27
|
+
/**
|
|
28
|
+
* Like [`loadProductConfig`](./config-load.ts) but returns `null` when no config is discoverable.
|
|
29
|
+
*
|
|
30
|
+
* Schema errors and explicit-path-not-found still throw. This is the opt-in
|
|
31
|
+
* shape the deploy CLI uses to enter manifest mode only when a config is
|
|
32
|
+
* present, without making the user pass a flag.
|
|
33
|
+
*/
|
|
34
|
+
declare function tryLoadProductConfig(options?: LoadProductConfigOptions): Promise<LoadedProductConfig | null>;
|
|
35
|
+
|
|
36
|
+
export { type LoadProductConfigOptions, type LoadedProductConfig, loadProductConfig, tryLoadProductConfig };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LoadedProductConfig } from './config-load.js';
|
|
2
|
+
import './types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Manifest publish orchestrator for RFC paritytech/triangle-js-sdks #0001 Steps 4 through 7.
|
|
6
|
+
*
|
|
7
|
+
* Wires [`storeFile`](../deploy.ts) and [`storeDirectory`](../deploy.ts) for
|
|
8
|
+
* Bulletin uploads with [`DotNS`](../dotns.ts) for the on-chain text-record
|
|
9
|
+
* writes. Phase 4/5 atomicity work (`Utility.batchAll`, snapshot/rollback,
|
|
10
|
+
* Step 8 round-trip verify) is deliberately deferred. Sequential
|
|
11
|
+
* best-effort writes keep this module small while the broader plan in
|
|
12
|
+
* `docs-internal/superpowers/plans/2026-05-20-product-manifest-support.md`
|
|
13
|
+
* tracks the follow-ups.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
interface PublishManifestOptions {
|
|
17
|
+
/** Loaded + validated product config (call loadProductConfig first). */
|
|
18
|
+
loaded: LoadedProductConfig;
|
|
19
|
+
/** Domain the legacy deploy targeted. Must match config.domain. */
|
|
20
|
+
domain: string;
|
|
21
|
+
/**
|
|
22
|
+
* Build-dir argument passed to the CLI plus the CID it produced. When the
|
|
23
|
+
* resolved path of an executable in the config matches buildDir, we reuse
|
|
24
|
+
* this CID instead of re-uploading the same bytes.
|
|
25
|
+
*/
|
|
26
|
+
buildDirCid?: {
|
|
27
|
+
absPath: string;
|
|
28
|
+
cid: string;
|
|
29
|
+
};
|
|
30
|
+
/** Env id (e.g. "paseo-next-v2"). Drives RPC + contract resolution. */
|
|
31
|
+
env?: string;
|
|
32
|
+
/** Optional bulletin RPC override. */
|
|
33
|
+
rpc?: string;
|
|
34
|
+
/** Required: signer mnemonic. */
|
|
35
|
+
mnemonic?: string;
|
|
36
|
+
/** Optional Substrate-style derivation path. */
|
|
37
|
+
derivationPath?: string;
|
|
38
|
+
}
|
|
39
|
+
interface PublishManifestResult {
|
|
40
|
+
iconCid: string;
|
|
41
|
+
executableCids: Record<string, string>;
|
|
42
|
+
textRecordsWritten: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Publish a product manifest on top of an already-completed legacy deploy.
|
|
46
|
+
*
|
|
47
|
+
* Uploads the icon and any executables that aren't covered by `buildDirCid`,
|
|
48
|
+
* then writes the root + per-executable text records on dotNS. Subnames
|
|
49
|
+
* (`app|widget|worker.<domain>`) are created on demand and pointed at the
|
|
50
|
+
* content resolver before any `setText`.
|
|
51
|
+
*/
|
|
52
|
+
declare function publishManifest(opts: PublishManifestOptions): Promise<PublishManifestResult>;
|
|
53
|
+
|
|
54
|
+
export { type PublishManifestOptions, type PublishManifestResult, publishManifest };
|