@parity/product-deploy 0.8.3-rc.8 → 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 +59 -2
- package/assets/environments.json +0 -1
- package/bin/bulletin-deploy +21 -1
- package/dist/auth/index.d.ts +2 -3
- package/dist/auth/index.js +2 -1
- package/dist/auth/vendor/index.d.ts +2 -3
- package/dist/auth/vendor/index.js +2 -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-YXGNQZZF.js → chunk-2SR5D4CP.js} +19 -15
- package/dist/{chunk-OFVBJOFB.js → chunk-6NW5M3F5.js} +9 -20
- package/dist/{chunk-7DGFJC6E.js → chunk-DHY2ZXVZ.js} +81 -42
- package/dist/chunk-G56VYTUD.js +75 -0
- package/dist/{chunk-5K3RI5C2.js → chunk-GL3U7K2B.js} +0 -1
- package/dist/{chunk-327NAPBD.js → chunk-H4LWILH4.js} +32 -6
- package/dist/chunk-J7CYVTAW.js +43 -0
- package/dist/{chunk-WHMNBSG7.js → chunk-LCKLYFAZ.js} +5 -4
- package/dist/{chunk-3OWKSL7K.js → chunk-NP4SLURL.js} +1 -1
- package/dist/{chunk-T4PAK4YK.js → chunk-O2NWQLYB.js} +2 -2
- package/dist/{chunk-RPU72Z4B.js → chunk-RD2QHYTL.js} +242 -36
- package/dist/{chunk-EGNMZHMR.js → chunk-WZBAQCA5.js} +15 -4
- package/dist/{chunk-YOQLRCQV.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 +186 -30
- 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 +19 -4
- package/dist/deploy.js +14 -9
- package/dist/dotns.d.ts +7 -0
- 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
|
@@ -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;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NonRetryableError
|
|
3
|
+
} from "./chunk-ZOC4GITL.js";
|
|
4
|
+
|
|
1
5
|
// src/auth/vendor/auth.ts
|
|
2
6
|
import { readdir, unlink } from "fs/promises";
|
|
3
|
-
import { homedir } from "os";
|
|
7
|
+
import { homedir, platform, release } from "os";
|
|
4
8
|
import { join } from "path";
|
|
5
9
|
import { deriveH160, ss58Encode } from "@parity/product-sdk-address";
|
|
6
10
|
import {
|
|
@@ -33,22 +37,49 @@ function createSessionSigner(session, ref) {
|
|
|
33
37
|
extra: value,
|
|
34
38
|
additionalSigned
|
|
35
39
|
}));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
extensions,
|
|
44
|
-
txExtVersion: 0
|
|
45
|
-
}
|
|
40
|
+
let noAllowanceMsg = null;
|
|
41
|
+
const origErr = console.error;
|
|
42
|
+
console.error = (...args) => {
|
|
43
|
+
const msg = args.map(String).join(" ");
|
|
44
|
+
if (msg.includes("NoAllowanceError") || msg.includes("no allowance set")) {
|
|
45
|
+
noAllowanceMsg = msg;
|
|
46
|
+
return;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
origErr(...args);
|
|
49
|
+
};
|
|
50
|
+
let clearPoll = null;
|
|
51
|
+
try {
|
|
52
|
+
const result = await Promise.race([
|
|
53
|
+
session.createTransaction({
|
|
54
|
+
payload: {
|
|
55
|
+
tag: "v1",
|
|
56
|
+
value: {
|
|
57
|
+
signer: productAccountId,
|
|
58
|
+
genesisHash,
|
|
59
|
+
callData,
|
|
60
|
+
extensions,
|
|
61
|
+
txExtVersion: 0
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
new Promise((_, reject) => {
|
|
66
|
+
clearPoll = setInterval(() => {
|
|
67
|
+
if (noAllowanceMsg) {
|
|
68
|
+
reject(new NonRetryableError(
|
|
69
|
+
"Session signing allowance has expired (~2-3 days after login). Run `bulletin-deploy login` to renew."
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
}, 200);
|
|
73
|
+
})
|
|
74
|
+
]);
|
|
75
|
+
if (result.isErr()) {
|
|
76
|
+
throw new Error(`Mobile signing rejected: ${result.error.message}`);
|
|
77
|
+
}
|
|
78
|
+
return result.value;
|
|
79
|
+
} finally {
|
|
80
|
+
if (clearPoll !== null) clearInterval(clearPoll);
|
|
81
|
+
console.error = origErr;
|
|
50
82
|
}
|
|
51
|
-
return result.value;
|
|
52
83
|
};
|
|
53
84
|
const signBytes = async (data) => {
|
|
54
85
|
const result = await session.signRaw({
|
|
@@ -64,22 +95,18 @@ function createSessionSigner(session, ref) {
|
|
|
64
95
|
}
|
|
65
96
|
|
|
66
97
|
// src/auth/vendor/allocations.ts
|
|
98
|
+
import {
|
|
99
|
+
requestResourceAllocation as terminalRequestResourceAllocation
|
|
100
|
+
} from "@parity/product-sdk-terminal/host";
|
|
67
101
|
var DEFAULT_RESOURCES = [
|
|
68
102
|
{ tag: "BulletInAllowance", value: void 0 },
|
|
69
103
|
{ tag: "StatementStoreAllowance", value: void 0 },
|
|
70
104
|
// derivation index 0 = the default product account.
|
|
71
105
|
{ tag: "SmartContractAllowance", value: 0 }
|
|
72
106
|
];
|
|
73
|
-
async function requestResourceAllocation(session,
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
resources,
|
|
77
|
-
onExisting
|
|
78
|
-
});
|
|
79
|
-
if (result.isErr()) {
|
|
80
|
-
throw new Error(`Resource allocation request failed: ${result.error.message}`);
|
|
81
|
-
}
|
|
82
|
-
return result.value;
|
|
107
|
+
async function requestResourceAllocation(session, adapter, resources = DEFAULT_RESOURCES, onExisting = "Ignore") {
|
|
108
|
+
const outcomes = await terminalRequestResourceAllocation(session, adapter, resources, { onExisting });
|
|
109
|
+
return outcomes;
|
|
83
110
|
}
|
|
84
111
|
function summarizeOutcomes(outcomes, resources) {
|
|
85
112
|
const granted = [];
|
|
@@ -102,8 +129,13 @@ function createAuthClient(config) {
|
|
|
102
129
|
function createAdapter() {
|
|
103
130
|
return createTerminalAdapter({
|
|
104
131
|
appId: config.dappId,
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
endpoints: config.peopleEndpoints,
|
|
133
|
+
hostMetadata: {
|
|
134
|
+
hostName: config.hostName,
|
|
135
|
+
hostVersion: config.hostVersion,
|
|
136
|
+
platformType: platform(),
|
|
137
|
+
platformVersion: release()
|
|
138
|
+
}
|
|
107
139
|
});
|
|
108
140
|
}
|
|
109
141
|
function deriveSessionAddresses(session) {
|
|
@@ -135,6 +167,8 @@ function createAuthClient(config) {
|
|
|
135
167
|
const sessions = await waitForSessions(adapter);
|
|
136
168
|
if (sessions.length > 0) {
|
|
137
169
|
const addresses = deriveSessionAddresses(sessions[0]);
|
|
170
|
+
adapter.destroy().catch(() => {
|
|
171
|
+
});
|
|
138
172
|
return { kind: "existing", address: addresses.productAddress, addresses };
|
|
139
173
|
}
|
|
140
174
|
const authPromise = adapter.sso.authenticate();
|
|
@@ -183,7 +217,7 @@ function createAuthClient(config) {
|
|
|
183
217
|
}
|
|
184
218
|
});
|
|
185
219
|
let authenticated = false;
|
|
186
|
-
let
|
|
220
|
+
let handle = null;
|
|
187
221
|
try {
|
|
188
222
|
const result = await authPromise;
|
|
189
223
|
result.match(
|
|
@@ -199,8 +233,8 @@ function createAuthClient(config) {
|
|
|
199
233
|
if (authenticated) {
|
|
200
234
|
const sessions = await waitForSessions(adapter, 3e3);
|
|
201
235
|
if (sessions.length > 0) {
|
|
202
|
-
|
|
203
|
-
address =
|
|
236
|
+
handle = buildSessionHandle(adapter, sessions[0]);
|
|
237
|
+
const { address, addresses } = handle;
|
|
204
238
|
onStatus({ step: "success", address, addresses });
|
|
205
239
|
} else {
|
|
206
240
|
onStatus({
|
|
@@ -212,17 +246,9 @@ function createAuthClient(config) {
|
|
|
212
246
|
} finally {
|
|
213
247
|
unsubPairing();
|
|
214
248
|
}
|
|
215
|
-
return
|
|
249
|
+
return handle;
|
|
216
250
|
}
|
|
217
|
-
|
|
218
|
-
const adapter = createAdapter();
|
|
219
|
-
const sessions = await waitForSessions(adapter, 3e3);
|
|
220
|
-
if (sessions.length === 0) {
|
|
221
|
-
adapter.destroy().catch(() => {
|
|
222
|
-
});
|
|
223
|
-
return null;
|
|
224
|
-
}
|
|
225
|
-
const session = sessions[0];
|
|
251
|
+
function buildSessionHandle(adapter, session) {
|
|
226
252
|
const signer = createSigner(session);
|
|
227
253
|
const addresses = deriveSessionAddresses(session);
|
|
228
254
|
let destroyed = false;
|
|
@@ -237,11 +263,22 @@ function createAuthClient(config) {
|
|
|
237
263
|
addresses,
|
|
238
264
|
signer,
|
|
239
265
|
userSession: session,
|
|
266
|
+
adapter,
|
|
240
267
|
destroy
|
|
241
268
|
};
|
|
242
269
|
}
|
|
243
|
-
async function
|
|
244
|
-
|
|
270
|
+
async function getSessionSigner() {
|
|
271
|
+
const adapter = createAdapter();
|
|
272
|
+
const sessions = await waitForSessions(adapter, 3e3);
|
|
273
|
+
if (sessions.length === 0) {
|
|
274
|
+
adapter.destroy().catch(() => {
|
|
275
|
+
});
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
return buildSessionHandle(adapter, sessions[0]);
|
|
279
|
+
}
|
|
280
|
+
async function requestAllocation(session, adapter, resources = DEFAULT_RESOURCES, onExisting = "Ignore") {
|
|
281
|
+
return requestResourceAllocation(session, adapter, resources, onExisting);
|
|
245
282
|
}
|
|
246
283
|
async function findSession() {
|
|
247
284
|
const adapter = createAdapter();
|
|
@@ -261,6 +298,8 @@ function createAuthClient(config) {
|
|
|
261
298
|
const { adapter, address, session } = handle;
|
|
262
299
|
try {
|
|
263
300
|
onStatus({ step: "disconnecting", address });
|
|
301
|
+
await Promise.resolve(session.abortPendingRequests()).catch(() => {
|
|
302
|
+
});
|
|
264
303
|
const result = await adapter.sessions.disconnect(session);
|
|
265
304
|
if (result.isOk()) {
|
|
266
305
|
await clearLocalAppStorage();
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// src/sss-allowance.ts
|
|
2
|
+
import WebSocket from "ws";
|
|
3
|
+
var SSS_PREFIX = new TextEncoder().encode(":statement_allowance:");
|
|
4
|
+
function sssStorageKey(pubkey) {
|
|
5
|
+
if (pubkey.length !== 32) {
|
|
6
|
+
throw new Error(`SSS storage key requires a 32-byte public key, got ${pubkey.length} bytes`);
|
|
7
|
+
}
|
|
8
|
+
const full = new Uint8Array(SSS_PREFIX.length + pubkey.length);
|
|
9
|
+
full.set(SSS_PREFIX, 0);
|
|
10
|
+
full.set(pubkey, SSS_PREFIX.length);
|
|
11
|
+
return "0x" + Buffer.from(full).toString("hex");
|
|
12
|
+
}
|
|
13
|
+
function checkSSSAllowance(pubkey, peopleEndpoints, timeoutMs = 5e3) {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
const endpoint = peopleEndpoints[0];
|
|
16
|
+
if (!endpoint) {
|
|
17
|
+
resolve(null);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
let settled = false;
|
|
21
|
+
let timer = null;
|
|
22
|
+
function done(value) {
|
|
23
|
+
if (settled) return;
|
|
24
|
+
settled = true;
|
|
25
|
+
if (timer !== null) clearTimeout(timer);
|
|
26
|
+
try {
|
|
27
|
+
ws.terminate();
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
resolve(value);
|
|
31
|
+
}
|
|
32
|
+
let ws;
|
|
33
|
+
try {
|
|
34
|
+
ws = new WebSocket(endpoint);
|
|
35
|
+
} catch {
|
|
36
|
+
resolve(null);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
timer = setTimeout(() => done(null), timeoutMs);
|
|
40
|
+
ws.on("error", () => done(null));
|
|
41
|
+
ws.on("open", () => {
|
|
42
|
+
let storageKey;
|
|
43
|
+
try {
|
|
44
|
+
storageKey = sssStorageKey(pubkey);
|
|
45
|
+
} catch {
|
|
46
|
+
done(null);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const request = JSON.stringify({
|
|
50
|
+
jsonrpc: "2.0",
|
|
51
|
+
id: 1,
|
|
52
|
+
method: "state_getStorage",
|
|
53
|
+
params: [storageKey]
|
|
54
|
+
});
|
|
55
|
+
ws.send(request, (err) => {
|
|
56
|
+
if (err) done(null);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
ws.on("message", (data) => {
|
|
60
|
+
try {
|
|
61
|
+
const msg = JSON.parse(data.toString());
|
|
62
|
+
const result = msg.result;
|
|
63
|
+
const present = result != null && result !== "0x";
|
|
64
|
+
done(present);
|
|
65
|
+
} catch {
|
|
66
|
+
done(null);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
sssStorageKey,
|
|
74
|
+
checkSSSAllowance
|
|
75
|
+
};
|
|
@@ -108,7 +108,6 @@ var environments_default = {
|
|
|
108
108
|
e2eEligible: true,
|
|
109
109
|
backend: "https://identity-backend-next.parity-testnet.parity.io",
|
|
110
110
|
ipfs: "https://paseo-bulletin-next-ipfs.polkadot.io",
|
|
111
|
-
docsUrl: "https://sre.teleport.parity.io/environments/paseo-next/",
|
|
112
111
|
autoAccountMapping: true,
|
|
113
112
|
nativeToEthRatio: 1e8,
|
|
114
113
|
registerStorageDeposit: 2e12,
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VERSION
|
|
3
|
+
} from "./chunk-LCKLYFAZ.js";
|
|
1
4
|
import {
|
|
2
5
|
loadEnvironments
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GL3U7K2B.js";
|
|
4
7
|
|
|
5
8
|
// src/auth-config.ts
|
|
6
|
-
import { existsSync } from "fs";
|
|
9
|
+
import { existsSync, readdirSync } from "fs";
|
|
7
10
|
import { homedir } from "os";
|
|
8
11
|
import { join } from "path";
|
|
9
12
|
var DOT_DAPP_ID = "dot-cli";
|
|
10
13
|
var DOT_PRODUCT_ID = "playground.dot";
|
|
11
14
|
var DOT_DERIVATION_INDEX = 0;
|
|
12
|
-
var
|
|
15
|
+
var DOT_HOST_NAME = "bulletin-deploy";
|
|
16
|
+
var STALE_SESSION_MESSAGE = 'Stored login session could not be read \u2014 it may have been written by an older version. Run "bulletin-deploy logout", then "bulletin-deploy login" to pair again.';
|
|
13
17
|
function hasPersistedSession() {
|
|
14
|
-
|
|
18
|
+
const dir = join(homedir(), ".polkadot-apps");
|
|
19
|
+
if (!existsSync(dir)) return false;
|
|
20
|
+
const prefix = `${DOT_DAPP_ID}_SsoSessions`;
|
|
21
|
+
try {
|
|
22
|
+
return readdirSync(dir).some((f) => f.startsWith(prefix) && f.endsWith(".json"));
|
|
23
|
+
} catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
15
26
|
}
|
|
16
27
|
function buildAuthConfig(doc, envId) {
|
|
17
28
|
const peopleChain = doc.chains.find((c) => c.id === "people");
|
|
@@ -31,10 +42,22 @@ function buildAuthConfig(doc, envId) {
|
|
|
31
42
|
dappId: DOT_DAPP_ID,
|
|
32
43
|
productId: DOT_PRODUCT_ID,
|
|
33
44
|
derivationIndex: DOT_DERIVATION_INDEX,
|
|
34
|
-
|
|
45
|
+
hostName: DOT_HOST_NAME,
|
|
46
|
+
hostVersion: VERSION,
|
|
35
47
|
peopleEndpoints
|
|
36
48
|
};
|
|
37
49
|
}
|
|
50
|
+
function resolveBulletinEndpoints(doc, envId) {
|
|
51
|
+
const bulletinChain = doc.chains.find((c) => c.id === "bulletin");
|
|
52
|
+
const endpoint = bulletinChain?.endpoints[envId];
|
|
53
|
+
if (!endpoint) return null;
|
|
54
|
+
return Array.isArray(endpoint.wss) ? endpoint.wss : [endpoint.wss];
|
|
55
|
+
}
|
|
56
|
+
async function getPeopleChainEndpoints(envId) {
|
|
57
|
+
const { doc } = await loadEnvironments();
|
|
58
|
+
const config = buildAuthConfig(doc, envId);
|
|
59
|
+
return config.peopleEndpoints;
|
|
60
|
+
}
|
|
38
61
|
async function getAuthClient(envId) {
|
|
39
62
|
const { createAuthClient } = await import("./auth/index.js");
|
|
40
63
|
const { doc } = await loadEnvironments();
|
|
@@ -45,8 +68,11 @@ export {
|
|
|
45
68
|
DOT_DAPP_ID,
|
|
46
69
|
DOT_PRODUCT_ID,
|
|
47
70
|
DOT_DERIVATION_INDEX,
|
|
48
|
-
|
|
71
|
+
DOT_HOST_NAME,
|
|
72
|
+
STALE_SESSION_MESSAGE,
|
|
49
73
|
hasPersistedSession,
|
|
50
74
|
buildAuthConfig,
|
|
75
|
+
resolveBulletinEndpoints,
|
|
76
|
+
getPeopleChainEndpoints,
|
|
51
77
|
getAuthClient
|
|
52
78
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/spinner.ts
|
|
2
|
+
var FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
3
|
+
var FRAME_MS = 120;
|
|
4
|
+
function startSpinner(label, stream = process.stdout) {
|
|
5
|
+
const start = Date.now();
|
|
6
|
+
if (!stream.isTTY) {
|
|
7
|
+
stream.write(` ${label}\u2026
|
|
8
|
+
`);
|
|
9
|
+
let stopped2 = false;
|
|
10
|
+
return {
|
|
11
|
+
stop(finalLine) {
|
|
12
|
+
if (stopped2) return;
|
|
13
|
+
stopped2 = true;
|
|
14
|
+
if (finalLine) stream.write(`${finalLine}
|
|
15
|
+
`);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
let frame = 0;
|
|
20
|
+
const render = () => {
|
|
21
|
+
const elapsed = Math.round((Date.now() - start) / 1e3);
|
|
22
|
+
stream.write(`\r ${FRAMES[frame % FRAMES.length]} ${label}\u2026 (${elapsed}s)\x1B[K`);
|
|
23
|
+
frame++;
|
|
24
|
+
};
|
|
25
|
+
render();
|
|
26
|
+
const interval = setInterval(render, FRAME_MS);
|
|
27
|
+
interval.unref();
|
|
28
|
+
let stopped = false;
|
|
29
|
+
return {
|
|
30
|
+
stop(finalLine) {
|
|
31
|
+
if (stopped) return;
|
|
32
|
+
stopped = true;
|
|
33
|
+
clearInterval(interval);
|
|
34
|
+
stream.write("\r\x1B[K");
|
|
35
|
+
if (finalLine) stream.write(`${finalLine}
|
|
36
|
+
`);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
startSpinner
|
|
43
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
package_default,
|
|
3
3
|
writeRunState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2SR5D4CP.js";
|
|
5
5
|
|
|
6
6
|
// src/memory-report.ts
|
|
7
7
|
import * as fs2 from "fs";
|
|
@@ -17,7 +17,6 @@ import * as path from "path";
|
|
|
17
17
|
var VERSION = package_default.version;
|
|
18
18
|
var DOTNS_BACKEND = "contract";
|
|
19
19
|
var DOTNS_POP_SOURCE = "personhood-precompile";
|
|
20
|
-
var DEFAULT_DSN = "https://e021c025d79c4c3ade2862a11f13c40b@o4511059872841728.ingest.de.sentry.io/4511093597405264";
|
|
21
20
|
var INTERNAL_ORG_RE = /^(paritytech|w3f|polkadot-fellows)\//i;
|
|
22
21
|
var PARITY_HOST_APPS = /* @__PURE__ */ new Set(["playground-cli"]);
|
|
23
22
|
function extractRepoSlug(url) {
|
|
@@ -45,7 +44,7 @@ function isInternalContext() {
|
|
|
45
44
|
hostApp: process.env.BULLETIN_DEPLOY_HOST_APP
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
|
-
var OPT_OUT = process.env.BULLETIN_DEPLOY_TELEMETRY === "0";
|
|
47
|
+
var OPT_OUT = process.env.BULLETIN_DEPLOY_TELEMETRY === "0" || process.env.BULLETIN_DEPLOY_TELEMETRY === "off";
|
|
49
48
|
var OPT_IN = process.env.BULLETIN_DEPLOY_TELEMETRY === "1";
|
|
50
49
|
var DISABLED = OPT_OUT || !OPT_IN && !isInternalContext();
|
|
51
50
|
var CONVENTIONAL_BRANCH_PREFIXES = /* @__PURE__ */ new Set([
|
|
@@ -117,8 +116,10 @@ function initTelemetry() {
|
|
|
117
116
|
if (process.env.BULLETIN_DEPLOY_USE_AMBIENT_SENTRY === "1") {
|
|
118
117
|
return;
|
|
119
118
|
}
|
|
119
|
+
const dsn = process.env.SENTRY_DSN || (true ? "" : "");
|
|
120
|
+
if (!dsn) return;
|
|
120
121
|
Sentry.init({
|
|
121
|
-
dsn
|
|
122
|
+
dsn,
|
|
122
123
|
release: `${package_default.name}@${VERSION}`,
|
|
123
124
|
tracesSampleRate: 1,
|
|
124
125
|
environment: process.env.CI ? "ci" : "local",
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
classifyErrorArea,
|
|
3
3
|
isInteractive,
|
|
4
4
|
promptYesNo
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6NW5M3F5.js";
|
|
6
6
|
import {
|
|
7
7
|
VERSION,
|
|
8
8
|
getCurrentSentryTraceId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LCKLYFAZ.js";
|
|
10
10
|
|
|
11
11
|
// src/bug-report.ts
|
|
12
12
|
import { execSync, execFileSync } from "child_process";
|