@devtion/actions 0.0.0-8bb9489 → 0.0.0-9239207

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 (34) hide show
  1. package/dist/index.mjs +322 -262
  2. package/dist/index.node.js +323 -261
  3. package/dist/types/src/helpers/constants.d.ts +5 -2
  4. package/dist/types/src/helpers/constants.d.ts.map +1 -1
  5. package/dist/types/src/helpers/contracts.d.ts.map +1 -1
  6. package/dist/types/src/helpers/crypto.d.ts +1 -0
  7. package/dist/types/src/helpers/crypto.d.ts.map +1 -1
  8. package/dist/types/src/helpers/database.d.ts +8 -0
  9. package/dist/types/src/helpers/database.d.ts.map +1 -1
  10. package/dist/types/src/helpers/security.d.ts +1 -1
  11. package/dist/types/src/helpers/security.d.ts.map +1 -1
  12. package/dist/types/src/helpers/storage.d.ts +1 -1
  13. package/dist/types/src/helpers/storage.d.ts.map +1 -1
  14. package/dist/types/src/helpers/utils.d.ts +34 -20
  15. package/dist/types/src/helpers/utils.d.ts.map +1 -1
  16. package/dist/types/src/helpers/verification.d.ts +3 -2
  17. package/dist/types/src/helpers/verification.d.ts.map +1 -1
  18. package/dist/types/src/helpers/vm.d.ts.map +1 -1
  19. package/dist/types/src/index.d.ts +2 -2
  20. package/dist/types/src/index.d.ts.map +1 -1
  21. package/dist/types/src/types/index.d.ts +9 -3
  22. package/dist/types/src/types/index.d.ts.map +1 -1
  23. package/package.json +3 -4
  24. package/src/helpers/constants.ts +40 -32
  25. package/src/helpers/contracts.ts +3 -3
  26. package/src/helpers/database.ts +13 -0
  27. package/src/helpers/security.ts +8 -5
  28. package/src/helpers/services.ts +2 -2
  29. package/src/helpers/storage.ts +3 -3
  30. package/src/helpers/utils.ts +299 -254
  31. package/src/helpers/verification.ts +6 -6
  32. package/src/helpers/vm.ts +9 -4
  33. package/src/index.ts +3 -1
  34. package/src/types/index.ts +23 -3
package/src/helpers/vm.ts CHANGED
@@ -5,7 +5,8 @@ import {
5
5
  StopInstancesCommand,
6
6
  TerminateInstancesCommand,
7
7
  EC2Client,
8
- RunInstancesCommandInput
8
+ RunInstancesCommandInput,
9
+ _InstanceType
9
10
  } from "@aws-sdk/client-ec2"
10
11
  import {
11
12
  GetCommandInvocationCommand,
@@ -159,17 +160,17 @@ export const createEC2Instance = async (
159
160
  diskType: DiskTypeForVM
160
161
  ): Promise<EC2Instance> => {
161
162
  // Get the AWS variables.
162
- const { amiId, roleArn } = getAWSVariables()
163
+ const { amiId, instanceProfileArn } = getAWSVariables()
163
164
 
164
165
  // Parametrize the VM EC2 instance.
165
166
  const params: RunInstancesCommandInput = {
166
167
  ImageId: amiId,
167
- InstanceType: instanceType,
168
+ InstanceType: instanceType as _InstanceType,
168
169
  MaxCount: 1,
169
170
  MinCount: 1,
170
171
  // nb. to find this: iam -> roles -> role_name.
171
172
  IamInstanceProfile: {
172
- Arn: roleArn
173
+ Arn: instanceProfileArn
173
174
  },
174
175
  // nb. for running commands at the startup.
175
176
  UserData: Buffer.from(commands.join("\n")).toString("base64"),
@@ -195,6 +196,10 @@ export const createEC2Instance = async (
195
196
  {
196
197
  Key: "Initialized",
197
198
  Value: "false"
199
+ },
200
+ {
201
+ Key: "ProjectName",
202
+ Value: process.env.AWS_TAG_VALUE
198
203
  }
199
204
  ]
200
205
  }
package/src/index.ts CHANGED
@@ -23,6 +23,7 @@ export {
23
23
  getContributionsCollectionPath,
24
24
  getTimeoutsCollectionPath,
25
25
  getOpenedCeremonies,
26
+ getAllCeremonies,
26
27
  getCeremonyCircuits
27
28
  } from "./helpers/database"
28
29
  export {
@@ -51,7 +52,8 @@ export {
51
52
  ec2InstanceTag,
52
53
  vmConfigurationTypes,
53
54
  vmBootstrapScriptFilename,
54
- powersOfTauFiles
55
+ powersOfTauFiles,
56
+ contribHashRegex
55
57
  } from "./helpers/constants"
56
58
  export {
57
59
  extractPrefix,
@@ -17,14 +17,14 @@ import {
17
17
  * @property {string} accessKeyId - the key identifier related to S3 APIs.
18
18
  * @property {string} secretAccessKey - the secret access key related to S3 APIs.
19
19
  * @property {string} region - the region where your buckets are located.
20
- * @property {string} roleArn - the EC2 instance role to access S3.
20
+ * @property {string} instanceProfileArn - the EC2 instance profile the VM should use to access S3.
21
21
  * @property {string} amiId - the AWS AMI ID (default to Amazon Linux 2).
22
22
  */
23
23
  export type AWSVariables = {
24
24
  accessKeyId: string
25
25
  secretAccessKey: string
26
26
  region: string
27
- roleArn: string
27
+ instanceProfileArn: string
28
28
  amiId: string
29
29
  }
30
30
 
@@ -190,7 +190,7 @@ export type VMConfiguration = {
190
190
  /**
191
191
  * Group information about the circuit contribution verification mechanism.
192
192
  * @typedef {Object} CircuitContributionVerification
193
- * @property {CircuitContributionVerificationMechanism} cfOrVm - the mechanism choosen by the coordinator.
193
+ * @property {CircuitContributionVerificationMechanism} cfOrVm - the mechanism chosen by the coordinator.
194
194
  * @property {VMConfiguration} [vm] - the VM configuration specs.
195
195
  */
196
196
  export type CircuitContributionVerification = {
@@ -652,3 +652,23 @@ export type CeremonySetupTemplate = {
652
652
  CeremonySetupTemplateCircuitName
653
653
  >
654
654
  }
655
+
656
+ export type StringifiedBigInts =
657
+ | StringifiedBigInts[]
658
+ | string
659
+ | string[]
660
+ | string[][]
661
+ | string[][][]
662
+ | { [key: string]: StringifiedBigInts }
663
+ | null
664
+
665
+ export type BigIntVariants =
666
+ | BigIntVariants[]
667
+ | StringifiedBigInts
668
+ | bigint
669
+ | bigint[]
670
+ | bigint[][]
671
+ | bigint[][][]
672
+ | { [key: string]: BigIntVariants }
673
+ | Uint8Array
674
+ | null