@devtion/backend 0.0.0-004e6ad → 0.0.0-08cd76b
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/src/functions/index.js +426 -392
- package/dist/src/functions/index.mjs +427 -393
- package/dist/{types → src/functions/types}/functions/bandada.d.ts.map +1 -1
- package/dist/{types → src/functions/types}/functions/ceremony.d.ts.map +1 -1
- package/dist/{types → src/functions/types}/functions/circuit.d.ts.map +1 -1
- package/dist/{types → src/functions/types}/functions/storage.d.ts.map +1 -1
- package/dist/{types → src/functions/types}/lib/errors.d.ts +1 -0
- package/dist/src/functions/types/lib/errors.d.ts.map +1 -0
- package/dist/{types → src/functions/types}/lib/services.d.ts.map +1 -1
- package/dist/src/functions/types/lib/utils.d.ts.map +1 -0
- package/package.json +6 -6
- package/src/functions/bandada.ts +96 -97
- package/src/functions/ceremony.ts +7 -3
- package/src/functions/circuit.ts +408 -377
- package/src/functions/storage.ts +1 -0
- package/src/functions/timeout.ts +9 -9
- package/src/lib/errors.ts +5 -0
- package/dist/types/lib/errors.d.ts.map +0 -1
- package/dist/types/lib/utils.d.ts.map +0 -1
- /package/dist/{types → src/functions/types}/functions/bandada.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/ceremony.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/circuit.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/index.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/index.d.ts.map +0 -0
- /package/dist/{types → src/functions/types}/functions/participant.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/participant.d.ts.map +0 -0
- /package/dist/{types → src/functions/types}/functions/siwe.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/siwe.d.ts.map +0 -0
- /package/dist/{types → src/functions/types}/functions/storage.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/timeout.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/timeout.d.ts.map +0 -0
- /package/dist/{types → src/functions/types}/functions/user.d.ts +0 -0
- /package/dist/{types → src/functions/types}/functions/user.d.ts.map +0 -0
- /package/dist/{types → src/functions/types}/lib/services.d.ts +0 -0
- /package/dist/{types → src/functions/types}/lib/utils.d.ts +0 -0
- /package/dist/{types → src/functions/types}/types/enums.d.ts +0 -0
- /package/dist/{types → src/functions/types}/types/enums.d.ts.map +0 -0
- /package/dist/{types → src/functions/types}/types/index.d.ts +0 -0
- /package/dist/{types → src/functions/types}/types/index.d.ts.map +0 -0
package/src/functions/storage.ts
CHANGED
|
@@ -146,6 +146,7 @@ export const createBucket = functions
|
|
|
146
146
|
const S3 = await getS3Client()
|
|
147
147
|
|
|
148
148
|
try {
|
|
149
|
+
printLog(`Creating AWS S3 bucket ${data.bucketName} ...`, LogLevel.LOG)
|
|
149
150
|
// Try to get information about the bucket.
|
|
150
151
|
await S3.send(new HeadBucketCommand({ Bucket: data.bucketName }))
|
|
151
152
|
// If the command succeeded, the bucket exists, throw an error.
|
package/src/functions/timeout.ts
CHANGED
|
@@ -86,7 +86,7 @@ export const checkAndRemoveBlockingContributor = functions
|
|
|
86
86
|
// Do not use `logAndThrowError` method to avoid the function to exit before checking every ceremony.
|
|
87
87
|
printLog(
|
|
88
88
|
`No current contributor for circuit ${circuit.id} - ceremony ${ceremony.id}`,
|
|
89
|
-
LogLevel.
|
|
89
|
+
LogLevel.DEBUG
|
|
90
90
|
)
|
|
91
91
|
else if (
|
|
92
92
|
avgFullContribution === 0 &&
|
|
@@ -128,7 +128,7 @@ export const checkAndRemoveBlockingContributor = functions
|
|
|
128
128
|
? Number(contributionStartedAt) +
|
|
129
129
|
Number(avgFullContribution) +
|
|
130
130
|
Number(timeoutDynamicThreshold)
|
|
131
|
-
: Number(contributionStartedAt) + Number(fixedTimeWindow) * 60000 // * 60000 = convert minutes to millis.
|
|
131
|
+
: (Number(contributionStartedAt) + Number(fixedTimeWindow)) * 60000 // * 60000 = convert minutes to millis.
|
|
132
132
|
|
|
133
133
|
// Case (D).
|
|
134
134
|
const timeoutExpirationDateInMsForVerificationCloudFunction =
|
|
@@ -156,18 +156,18 @@ export const checkAndRemoveBlockingContributor = functions
|
|
|
156
156
|
)
|
|
157
157
|
timeoutType = TimeoutType.BLOCKING_CLOUD_FUNCTION
|
|
158
158
|
|
|
159
|
-
printLog(
|
|
160
|
-
`${timeoutType} detected for circuit ${circuit.id} - ceremony ${ceremony.id}`,
|
|
161
|
-
LogLevel.DEBUG
|
|
162
|
-
)
|
|
163
|
-
|
|
164
159
|
if (!timeoutType)
|
|
165
160
|
// Do not use `logAndThrowError` method to avoid the function to exit before checking every ceremony.
|
|
166
161
|
printLog(
|
|
167
162
|
`No timeout for circuit ${circuit.id} - ceremony ${ceremony.id}`,
|
|
168
|
-
LogLevel.
|
|
163
|
+
LogLevel.DEBUG
|
|
169
164
|
)
|
|
170
165
|
else {
|
|
166
|
+
printLog(
|
|
167
|
+
`${timeoutType} detected for circuit ${circuit.id} - ceremony ${ceremony.id}`,
|
|
168
|
+
LogLevel.WARN
|
|
169
|
+
)
|
|
170
|
+
|
|
171
171
|
// Case (E).
|
|
172
172
|
let nextCurrentContributorId = ""
|
|
173
173
|
|
|
@@ -236,7 +236,7 @@ export const checkAndRemoveBlockingContributor = functions
|
|
|
236
236
|
|
|
237
237
|
printLog(
|
|
238
238
|
`The contributor ${participant.id} has been identified as potential blocking contributor. A timeout of type ${timeoutType} has been triggered w/ a penalty of ${timeoutPenaltyInMs} ms`,
|
|
239
|
-
LogLevel.
|
|
239
|
+
LogLevel.WARN
|
|
240
240
|
)
|
|
241
241
|
}
|
|
242
242
|
}
|
package/src/lib/errors.ts
CHANGED
|
@@ -189,6 +189,11 @@ export const SPECIFIC_ERRORS = {
|
|
|
189
189
|
"unavailable",
|
|
190
190
|
"VM command execution has failed due to an unknown status code",
|
|
191
191
|
"Please, contact the coordinator if this error persists."
|
|
192
|
+
),
|
|
193
|
+
WRONG_BUCKET_NAME: makeError(
|
|
194
|
+
"invalid-argument",
|
|
195
|
+
"The provided bucket name is not valid.",
|
|
196
|
+
"Bucket names must be between 3 and 63 characters long, can only contain lowercase letters, numbers, and hyphens, and must start and end with a letter or number."
|
|
192
197
|
)
|
|
193
198
|
}
|
|
194
199
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/lib/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,cAAe,kBAAkB,WAAW,MAAM,YAAY,MAAM,KAAG,UAC9B,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,YAAa,MAAM,YAAY,QAAQ,SAqB3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,UAAU,UAGjD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuI3B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;CA2CzB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EAErB,aAAa,EAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAWlC,OAAO,EAOH,eAAe,EAClB,MAAM,iBAAiB,CAAA;AAIxB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAM/C;;;;;;;;GAQG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;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,UAC/B,MAAM,wBACS,OAAO,SACtB,aAAa,KACrB,QAAQ,MAAM,SAAS,cAAc,CAAC,MAAM,SAAS,aAAa,CAAC,CAYxD,CAAA;AAEd;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,eACjB,MAAM,aACP,MAAM,KAClB,QAAQ,sBAAsB,YAAY,CAAC,CAgB7C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,oBAAqB,eAAe,KAAG,eAKvE,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,GAerC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,GAkBlC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAa,QAAQ,SAAS,CAYzD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAa,QAAQ,SAAS,CAYzD,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAAqB,MAAM,KAAG,QAAQ,MAAM,CAQxE,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|