@devtion/devcli 0.0.0-7e983e3 → 0.0.0-bfc9ee4

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/dist/index.js CHANGED
@@ -2113,8 +2113,9 @@ const onVerification = async (verification) => {
2113
2113
  clipboard.writeSync(verification.user_code);
2114
2114
  clipboard.readSync();
2115
2115
  // Display data.
2116
- console.log(`${theme.symbols.warning} Visit ${theme.text.bold(theme.text.underlined(verification.verification_uri))} on this device to generate a new token and authenticate`);
2117
- console.log(`${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} (${theme.emojis.clipboard} ${theme.symbols.success})\n`);
2116
+ console.log(`${theme.symbols.warning} Visit ${theme.text.bold(theme.text.underlined(verification.verification_uri))} on this device to generate a new token and authenticate\n`);
2117
+ console.log(theme.colors.magenta(figlet.textSync(verification.user_code, { font: "ANSI Shadow" })), '\n');
2118
+ console.log(`${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} has been copied to your clipboard (${theme.emojis.clipboard} ${theme.symbols.success})\n`);
2118
2119
  const spinner = customSpinner(`Redirecting to Github...`, `clock`);
2119
2120
  spinner.start();
2120
2121
  await sleep(10000); // ~10s to make users able to read the CLI.
@@ -2407,7 +2408,6 @@ const listenToCeremonyCircuitDocumentChanges = (firestoreDatabase, ceremonyId, p
2407
2408
  const { avgTimings, waitingQueue } = changedCircuit.data();
2408
2409
  const { fullContribution, verifyCloudFunction } = avgTimings;
2409
2410
  const { currentContributor } = waitingQueue;
2410
- // Get circuit current contributor participant document.
2411
2411
  const circuitCurrentContributor = await getDocumentById(firestoreDatabase, getParticipantsCollectionPath(ceremonyId), currentContributor);
2412
2412
  // Check data.
2413
2413
  if (!circuitCurrentContributor.data())
@@ -2616,7 +2616,7 @@ const listenToParticipantDocumentChanges = async (firestoreDatabase, cloudFuncti
2616
2616
  // Get latest contribution verification result.
2617
2617
  await getLatestVerificationResult(firestoreDatabase, ceremony.id, circuit.id, participant.id);
2618
2618
  // Get next circuit for contribution.
2619
- const nextCircuit = getCircuitBySequencePosition(circuits, changedContributionProgress + 1);
2619
+ const nextCircuit = timeoutExpired ? getCircuitBySequencePosition(circuits, changedContributionProgress) : getCircuitBySequencePosition(circuits, changedContributionProgress + 1);
2620
2620
  // Check disk space requirements for participant.
2621
2621
  const wannaGenerateAttestation = await handleDiskSpaceRequirementForNextContribution(cloudFunctions, ceremony.id, nextCircuit.data.sequencePosition, nextCircuit.data.zKeySizeInBytes, timeoutExpired, providerUserId);
2622
2622
  // Check if the participant would like to generate a new attestation.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devtion/devcli",
3
3
  "type": "module",
4
- "version": "0.0.0-7e983e3",
4
+ "version": "0.0.0-bfc9ee4",
5
5
  "description": "All-in-one interactive command-line for interfacing with zkSNARK Phase 2 Trusted Setup ceremonies",
6
6
  "repository": "git@github.com:privacy-scaling-explorations/p0tion.git",
7
7
  "homepage": "https://github.com/privacy-scaling-explorations/p0tion",
@@ -96,5 +96,5 @@
96
96
  "publishConfig": {
97
97
  "access": "public"
98
98
  },
99
- "gitHead": "afae72061a3b366b05508de53fe91e9b254cc3d5"
99
+ "gitHead": "b2a3be0c3d0ad2a94270d7a256b5b5acf3b1c47f"
100
100
  }
@@ -4,6 +4,7 @@ import { Verification } from "@octokit/auth-oauth-device/dist-types/types.js"
4
4
  import clipboard from "clipboardy"
5
5
  import dotenv from "dotenv"
6
6
  import open from "open"
7
+ import figlet from "figlet"
7
8
  import { fileURLToPath } from "url"
8
9
  import { dirname } from "path"
9
10
  import { GENERIC_ERRORS, showError } from "../lib/errors.js"
@@ -69,10 +70,13 @@ export const onVerification = async (verification: Verification): Promise<void>
69
70
  console.log(
70
71
  `${theme.symbols.warning} Visit ${theme.text.bold(
71
72
  theme.text.underlined(verification.verification_uri)
72
- )} on this device to generate a new token and authenticate`
73
+ )} on this device to generate a new token and authenticate\n`
73
74
  )
75
+
76
+ console.log(theme.colors.magenta(figlet.textSync(verification.user_code, { font: "ANSI Shadow" })), '\n')
77
+
74
78
  console.log(
75
- `${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} (${theme.emojis.clipboard} ${
79
+ `${theme.symbols.info} Your auth code: ${theme.text.bold(verification.user_code)} has been copied to your clipboard (${theme.emojis.clipboard} ${
76
80
  theme.symbols.success
77
81
  })\n`
78
82
  )
@@ -464,7 +464,6 @@ export const listenToCeremonyCircuitDocumentChanges = (
464
464
  const { fullContribution, verifyCloudFunction } = avgTimings
465
465
  const { currentContributor } = waitingQueue
466
466
 
467
- // Get circuit current contributor participant document.
468
467
  const circuitCurrentContributor = await getDocumentById(
469
468
  firestoreDatabase,
470
469
  getParticipantsCollectionPath(ceremonyId),
@@ -811,7 +810,7 @@ export const listenToParticipantDocumentChanges = async (
811
810
  await getLatestVerificationResult(firestoreDatabase, ceremony.id, circuit.id, participant.id)
812
811
 
813
812
  // Get next circuit for contribution.
814
- const nextCircuit = getCircuitBySequencePosition(circuits, changedContributionProgress + 1)
813
+ const nextCircuit = timeoutExpired ? getCircuitBySequencePosition(circuits, changedContributionProgress) : getCircuitBySequencePosition(circuits, changedContributionProgress + 1)
815
814
 
816
815
  // Check disk space requirements for participant.
817
816
  const wannaGenerateAttestation = await handleDiskSpaceRequirementForNextContribution(