@devtion/backend 0.0.0-7e983e3
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 +21 -0
- package/README.md +151 -0
- package/dist/src/functions/index.js +2644 -0
- package/dist/src/functions/index.mjs +2596 -0
- package/dist/types/functions/ceremony.d.ts +33 -0
- package/dist/types/functions/ceremony.d.ts.map +1 -0
- package/dist/types/functions/circuit.d.ts +63 -0
- package/dist/types/functions/circuit.d.ts.map +1 -0
- package/dist/types/functions/index.d.ts +7 -0
- package/dist/types/functions/index.d.ts.map +1 -0
- package/dist/types/functions/participant.d.ts +58 -0
- package/dist/types/functions/participant.d.ts.map +1 -0
- package/dist/types/functions/storage.d.ts +37 -0
- package/dist/types/functions/storage.d.ts.map +1 -0
- package/dist/types/functions/timeout.d.ts +26 -0
- package/dist/types/functions/timeout.d.ts.map +1 -0
- package/dist/types/functions/user.d.ts +15 -0
- package/dist/types/functions/user.d.ts.map +1 -0
- package/dist/types/lib/errors.d.ts +75 -0
- package/dist/types/lib/errors.d.ts.map +1 -0
- package/dist/types/lib/services.d.ts +9 -0
- package/dist/types/lib/services.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +141 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/dist/types/types/enums.d.ts +13 -0
- package/dist/types/types/enums.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +130 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +89 -0
- package/src/functions/ceremony.ts +333 -0
- package/src/functions/circuit.ts +1092 -0
- package/src/functions/index.ts +36 -0
- package/src/functions/participant.ts +526 -0
- package/src/functions/storage.ts +548 -0
- package/src/functions/timeout.ts +294 -0
- package/src/functions/user.ts +142 -0
- package/src/lib/errors.ts +237 -0
- package/src/lib/services.ts +28 -0
- package/src/lib/utils.ts +472 -0
- package/src/types/enums.ts +12 -0
- package/src/types/index.ts +140 -0
- package/test/index.test.ts +62 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as functions from "firebase-functions";
|
|
2
|
+
/**
|
|
3
|
+
* Make a scheduled ceremony open.
|
|
4
|
+
* @dev this function automatically runs every 30 minutes.
|
|
5
|
+
* @todo this methodology for transitioning a ceremony from `scheduled` to `opened` state will be replaced with one
|
|
6
|
+
* that resolves the issues presented in the issue #192 (https://github.com/quadratic-funding/mpc-phase2-suite/issues/192).
|
|
7
|
+
*/
|
|
8
|
+
export declare const startCeremony: functions.CloudFunction<unknown>;
|
|
9
|
+
/**
|
|
10
|
+
* Make a scheduled ceremony close.
|
|
11
|
+
* @dev this function automatically runs every 30 minutes.
|
|
12
|
+
* @todo this methodology for transitioning a ceremony from `opened` to `closed` state will be replaced with one
|
|
13
|
+
* that resolves the issues presented in the issue #192 (https://github.com/quadratic-funding/mpc-phase2-suite/issues/192).
|
|
14
|
+
*/
|
|
15
|
+
export declare const stopCeremony: functions.CloudFunction<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Register all ceremony setup-related documents on the Firestore database.
|
|
18
|
+
* @dev this function will create a new document in the `ceremonies` collection and as needed `circuit`
|
|
19
|
+
* documents in the sub-collection.
|
|
20
|
+
*/
|
|
21
|
+
export declare const setupCeremony: functions.HttpsFunction & functions.Runnable<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Prepare all the necessary information needed for initializing the waiting queue of a circuit.
|
|
24
|
+
* @dev this function will add a new field `waitingQueue` in the newly created circuit document.
|
|
25
|
+
*/
|
|
26
|
+
export declare const initEmptyWaitingQueueForCircuit: functions.CloudFunction<functions.firestore.QueryDocumentSnapshot>;
|
|
27
|
+
/**
|
|
28
|
+
* Conclude the finalization of the ceremony.
|
|
29
|
+
* @dev checks that the ceremony is closed (= CLOSED), the coordinator is finalizing and has already
|
|
30
|
+
* provided the final contribution for each ceremony circuit.
|
|
31
|
+
*/
|
|
32
|
+
export declare const finalizeCeremony: functions.HttpsFunction & functions.Runnable<any>;
|
|
33
|
+
//# sourceMappingURL=ceremony.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceremony.d.ts","sourceRoot":"","sources":["../../../src/functions/ceremony.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAuC/C;;;;;GAKG;AACH,eAAO,MAAM,aAAa,kCAiBpB,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,YAAY,kCAkBnB,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,aAAa,mDAyHpB,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,+BAA+B,oEAsCtC,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mDAiEvB,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as functionsV1 from "firebase-functions/v1";
|
|
2
|
+
import * as functionsV2 from "firebase-functions/v2";
|
|
3
|
+
import { VerifyContributionData } from "../types/index";
|
|
4
|
+
/**
|
|
5
|
+
* This method is used to coordinate the waiting queues of ceremony circuits.
|
|
6
|
+
* @dev this cloud function is triggered whenever an update of a document related to a participant of a ceremony occurs.
|
|
7
|
+
* The function verifies that such update is preparatory towards a waiting queue update for one or more circuits in the ceremony.
|
|
8
|
+
* If that's the case, this cloud functions proceeds with the "coordination" of the waiting queues, leading to three different scenarios:
|
|
9
|
+
* A) The participant becomes the current contributor of circuit X (single participant).
|
|
10
|
+
* B) The participant is placed in the contribution waiting queue because someone else is currently contributing to circuit X (single participant)
|
|
11
|
+
* C) The participant is removed as current contributor from Circuit X and gets coordinated for Circuit X + 1 (multi-participant).
|
|
12
|
+
* C.1) The first participant in the waiting queue for Circuit X (if any), becomes the new contributor for circuit X.
|
|
13
|
+
* Before triggering the above scenarios, the cloud functions verifies that suitable pre-conditions are met.
|
|
14
|
+
* @notice The cloud function performs the subsequent steps:
|
|
15
|
+
* 0) Prepares the participant's previous and current data (after/before document change).
|
|
16
|
+
* 1) Retrieve the ceremony from the participant's document path.
|
|
17
|
+
* 2) Verifies that the participant has changed to a state for which it is ready for contribution.
|
|
18
|
+
* 2.A) If ready, verifies whether the participant is ready to:
|
|
19
|
+
* - Contribute for the first time or for the next circuit (other than the first) or contribute after a timeout has expired. If yes, coordinate (single participant scenario).
|
|
20
|
+
* 2.B) Otherwise, check whether the participant has:
|
|
21
|
+
* - Just completed a contribution or all contributions for each circuit. If yes, coordinate (multi-participant scenario).
|
|
22
|
+
*/
|
|
23
|
+
export declare const coordinateCeremonyParticipant: functionsV1.CloudFunction<functionsV1.Change<functionsV1.firestore.QueryDocumentSnapshot>>;
|
|
24
|
+
/**
|
|
25
|
+
* Verify the contribution of a participant computed while contributing to a specific circuit of a ceremony.
|
|
26
|
+
* @dev a huge amount of resources (memory, CPU, and execution time) is required for the contribution verification task.
|
|
27
|
+
* For this reason, we are using a V2 Cloud Function (more memory, more CPU, and longer timeout).
|
|
28
|
+
* Through the current configuration (16GiB memory and 4 vCPUs) we are able to support verification of contributions for 3.8M constraints circuit size.
|
|
29
|
+
@notice The cloud function performs the subsequent steps:
|
|
30
|
+
* 0) Prepare documents and extract necessary data.
|
|
31
|
+
* 1) Check if the participant is the current contributor to the circuit or is the ceremony coordinator
|
|
32
|
+
* 1.A) If either condition is true:
|
|
33
|
+
* 1.A.1) Prepare verification transcript logger, storage, and temporary paths.
|
|
34
|
+
* 1.A.2) Download necessary AWS S3 ceremony bucket artifacts.
|
|
35
|
+
* 1.A.3) Execute contribution verification.
|
|
36
|
+
* 1.A.3.0) Check if is using VM or CF approach for verification.
|
|
37
|
+
* 1.A.3.1) Start the instance and wait until the instance is up.
|
|
38
|
+
* 1.A.3.2) Prepare and run contribution verification command.
|
|
39
|
+
* 1.A.3.3) Wait until command complete.
|
|
40
|
+
* 1.A.4) Check contribution validity:
|
|
41
|
+
* 1.A.4.A) If valid:
|
|
42
|
+
* 1.A.4.A.1) Upload verification transcript to AWS S3 storage.
|
|
43
|
+
* 1.A.4.A.2) Creates a new valid contribution document on Firestore.
|
|
44
|
+
* 1.A.4.B) If not valid:
|
|
45
|
+
* 1.A.4.B.1) Creates a new invalid contribution document on Firestore.
|
|
46
|
+
* 1.A.4.C) Check if not finalizing:
|
|
47
|
+
* 1.A.4.C.1) If true, update circuit waiting for queue and average timings accordingly to contribution verification results;
|
|
48
|
+
* 2) Send all updates atomically to the Firestore database.
|
|
49
|
+
*/
|
|
50
|
+
export declare const verifycontribution: functionsV2.https.CallableFunction<VerifyContributionData, Promise<any>>;
|
|
51
|
+
/**
|
|
52
|
+
* Update the related participant's document after verification of its last contribution.
|
|
53
|
+
* @dev this cloud functions is responsible for preparing the participant for the contribution toward the next circuit.
|
|
54
|
+
* this does not happen if the participant is actually the coordinator who is finalizing the ceremony.
|
|
55
|
+
*/
|
|
56
|
+
export declare const refreshParticipantAfterContributionVerification: functionsV1.CloudFunction<functionsV1.firestore.QueryDocumentSnapshot>;
|
|
57
|
+
/**
|
|
58
|
+
* Finalize the ceremony circuit.
|
|
59
|
+
* @dev this cloud function stores the hashes and storage references of the Verifier smart contract
|
|
60
|
+
* and verification key extracted from the circuit final contribution (as part of the ceremony finalization process).
|
|
61
|
+
*/
|
|
62
|
+
export declare const finalizeCircuit: functionsV1.HttpsFunction & functionsV1.Runnable<any>;
|
|
63
|
+
//# sourceMappingURL=circuit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit.d.ts","sourceRoot":"","sources":["../../../src/functions/circuit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AACpD,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AAyCpD,OAAO,EAAuB,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAyR5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,4FAoGpC,CAAA;AA8BN;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,kBAAkB,0EAya9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,+CAA+C,wEA4EtD,CAAA;AAEN;;;;GAIG;AACH,eAAO,MAAM,eAAe,uDA8EtB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { registerAuthUser, processSignUpWithCustomClaims } from "./user";
|
|
2
|
+
export { startCeremony, stopCeremony, setupCeremony, initEmptyWaitingQueueForCircuit, finalizeCeremony } from "./ceremony";
|
|
3
|
+
export { checkParticipantForCeremony, progressToNextContributionStep, permanentlyStoreCurrentContributionTimeAndHash, temporaryStoreCurrentContributionMultiPartUploadId, temporaryStoreCurrentContributionUploadedChunkData, progressToNextCircuitForContribution, checkAndPrepareCoordinatorForFinalization } from "./participant";
|
|
4
|
+
export { coordinateCeremonyParticipant, verifycontribution, refreshParticipantAfterContributionVerification, finalizeCircuit } from "./circuit";
|
|
5
|
+
export { createBucket, checkIfObjectExist, generateGetObjectPreSignedUrl, startMultiPartUpload, generatePreSignedUrlsParts, completeMultiPartUpload } from "./storage";
|
|
6
|
+
export { checkAndRemoveBlockingContributor, resumeContributionAfterTimeoutExpiration } from "./timeout";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,QAAQ,CAAA;AACxE,OAAO,EACH,aAAa,EACb,YAAY,EACZ,aAAa,EACb,+BAA+B,EAC/B,gBAAgB,EACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EACH,2BAA2B,EAC3B,8BAA8B,EAC9B,8CAA8C,EAC9C,kDAAkD,EAClD,kDAAkD,EAClD,oCAAoC,EACpC,yCAAyC,EAC5C,MAAM,eAAe,CAAA;AACtB,OAAO,EACH,6BAA6B,EAC7B,kBAAkB,EAClB,+CAA+C,EAC/C,eAAe,EAClB,MAAM,WAAW,CAAA;AAClB,OAAO,EACH,YAAY,EACZ,kBAAkB,EAClB,6BAA6B,EAC7B,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EAC1B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,iCAAiC,EAAE,wCAAwC,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as functions from "firebase-functions";
|
|
2
|
+
/**
|
|
3
|
+
* Check the user's current participant status for the ceremony.
|
|
4
|
+
* @notice this cloud function has several tasks:
|
|
5
|
+
* 1) Check if the authenticated user is a participant
|
|
6
|
+
* 1.A) If not, register it has new participant for the ceremony.
|
|
7
|
+
* 1.B) Otherwise:
|
|
8
|
+
* 2.A) Check if already contributed to all circuits or,
|
|
9
|
+
* 3.A) If already contributed, return false
|
|
10
|
+
* 2.B) Check if it has a timeout in progress
|
|
11
|
+
* 3.B) If timeout expired, allows the participant to resume the contribution and remove stale/outdated
|
|
12
|
+
* temporary data.
|
|
13
|
+
* 3.C) Otherwise, return false.
|
|
14
|
+
* 2.C) Check if there are temporary stale contribution data if the contributor has interrupted the contribution
|
|
15
|
+
* while completing the `COMPUTING` step and, if any, delete them.
|
|
16
|
+
* 1.D) If no timeout / participant already exist, just return true.
|
|
17
|
+
* @dev true when the participant can participate (1.A, 3.B, 1.D); otherwise false.
|
|
18
|
+
*/
|
|
19
|
+
export declare const checkParticipantForCeremony: functions.HttpsFunction & functions.Runnable<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Progress the participant to the next circuit preparing for the next contribution.
|
|
22
|
+
* @dev The participant can progress if and only if:
|
|
23
|
+
* 1) the participant has just been registered and is waiting to be queued for the first contribution (contributionProgress = 0 && status = WAITING).
|
|
24
|
+
* 2) the participant has just finished the contribution for a circuit (contributionProgress != 0 && status = CONTRIBUTED && contributionStep = COMPLETED).
|
|
25
|
+
*/
|
|
26
|
+
export declare const progressToNextCircuitForContribution: functions.HttpsFunction & functions.Runnable<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Progress the participant to the next contribution step while contributing to a circuit.
|
|
29
|
+
* @dev this cloud function must enforce the order among the contribution steps:
|
|
30
|
+
* 1) Downloading the last contribution.
|
|
31
|
+
* 2) Computing the next contribution.
|
|
32
|
+
* 3) Uploading the next contribution.
|
|
33
|
+
* 4) Requesting the verification to the cloud function `verifycontribution`.
|
|
34
|
+
* 5) Completed contribution computation and verification.
|
|
35
|
+
*/
|
|
36
|
+
export declare const progressToNextContributionStep: functions.HttpsFunction & functions.Runnable<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Write the information about current contribution hash and computation time for the current contributor.
|
|
39
|
+
* @dev enable the current contributor to resume a contribution from where it had left off.
|
|
40
|
+
*/
|
|
41
|
+
export declare const permanentlyStoreCurrentContributionTimeAndHash: functions.HttpsFunction & functions.Runnable<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Write temporary information about the unique identifier about the opened multi-part upload to eventually resume the contribution.
|
|
44
|
+
* @dev enable the current contributor to resume a multi-part upload from where it had left off.
|
|
45
|
+
*/
|
|
46
|
+
export declare const temporaryStoreCurrentContributionMultiPartUploadId: functions.HttpsFunction & functions.Runnable<any>;
|
|
47
|
+
/**
|
|
48
|
+
* Write temporary information about the etags and part numbers for each uploaded chunk in order to make the upload resumable from last chunk.
|
|
49
|
+
* @dev enable the current contributor to resume a multi-part upload from where it had left off.
|
|
50
|
+
*/
|
|
51
|
+
export declare const temporaryStoreCurrentContributionUploadedChunkData: functions.HttpsFunction & functions.Runnable<any>;
|
|
52
|
+
/**
|
|
53
|
+
* Prepare the coordinator for the finalization of the ceremony.
|
|
54
|
+
* @dev checks that the ceremony is closed (= CLOSED) and that the coordinator has already +
|
|
55
|
+
* contributed to every selected ceremony circuits (= DONE).
|
|
56
|
+
*/
|
|
57
|
+
export declare const checkAndPrepareCoordinatorForFinalization: functions.HttpsFunction & functions.Runnable<any>;
|
|
58
|
+
//# sourceMappingURL=participant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../src/functions/participant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AA4B/C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,2BAA2B,mDA2HlC,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,mDA+C3C,CAAA;AAEN;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,mDAyDrC,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,8CAA8C,mDAqDtD,CAAA;AAEL;;;GAGG;AACH,eAAO,MAAM,kDAAkD,mDAgD1D,CAAA;AAEL;;;GAGG;AACH,eAAO,MAAM,kDAAkD,mDAqD1D,CAAA;AAEL;;;;GAIG;AACH,eAAO,MAAM,yCAAyC,mDAuDhD,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as functions from "firebase-functions";
|
|
2
|
+
/**
|
|
3
|
+
* Create a new AWS S3 bucket for a particular ceremony.
|
|
4
|
+
* @notice the S3 bucket is used to store all the ceremony artifacts and contributions.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createBucket: functions.HttpsFunction & functions.Runnable<any>;
|
|
7
|
+
/**
|
|
8
|
+
* Check if a specified object exist in a given AWS S3 bucket.
|
|
9
|
+
* @returns <Promise<boolean>> - true if the object exist in the given bucket; otherwise false.
|
|
10
|
+
*/
|
|
11
|
+
export declare const checkIfObjectExist: functions.HttpsFunction & functions.Runnable<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Return a pre-signed url for a given object contained inside the provided AWS S3 bucket in order to perform a GET request.
|
|
14
|
+
* @notice the pre-signed url has a predefined expiration expressed in seconds inside the environment
|
|
15
|
+
* configuration of the `backend` package. The value should match the configuration of `phase2cli` package
|
|
16
|
+
* environment to avoid inconsistency between client request and CF.
|
|
17
|
+
*/
|
|
18
|
+
export declare const generateGetObjectPreSignedUrl: functions.HttpsFunction & functions.Runnable<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Start a new multi-part upload for a specific object in the given AWS S3 bucket.
|
|
21
|
+
* @notice this operation can be performed by either an authenticated participant or a coordinator.
|
|
22
|
+
*/
|
|
23
|
+
export declare const startMultiPartUpload: functions.HttpsFunction & functions.Runnable<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Generate a new pre-signed url for each chunk related to a started multi-part upload.
|
|
26
|
+
* @notice this operation can be performed by either an authenticated participant or a coordinator.
|
|
27
|
+
* the pre-signed url has a predefined expiration expressed in seconds inside the environment
|
|
28
|
+
* configuration of the `backend` package. The value should match the configuration of `phase2cli` package
|
|
29
|
+
* environment to avoid inconsistency between client request and CF.
|
|
30
|
+
*/
|
|
31
|
+
export declare const generatePreSignedUrlsParts: functions.HttpsFunction & functions.Runnable<any>;
|
|
32
|
+
/**
|
|
33
|
+
* Complete a multi-part upload for a specific object in the given AWS S3 bucket.
|
|
34
|
+
* @notice this operation can be performed by either an authenticated participant or a coordinator.
|
|
35
|
+
*/
|
|
36
|
+
export declare const completeMultiPartUpload: functions.HttpsFunction & functions.Runnable<any>;
|
|
37
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/functions/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAiI/C;;;GAGG;AACH,eAAO,MAAM,YAAY,mDAgGnB,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,kBAAkB,mDAgDzB,CAAA;AAEN;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,mDAyCpC,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mDA2D3B,CAAA;AAEN;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,mDAuElC,CAAA;AAEL;;;GAGG;AACH,eAAO,MAAM,uBAAuB,mDAgE9B,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as functions from "firebase-functions";
|
|
2
|
+
/**
|
|
3
|
+
* Check and remove the current contributor if it doesn't complete the contribution on the specified amount of time.
|
|
4
|
+
* @dev since this cloud function is executed every minute, delay problems may occur. See issue #192 (https://github.com/quadratic-funding/mpc-phase2-suite/issues/192).
|
|
5
|
+
* @notice the reasons why a contributor may be considered blocking are many.
|
|
6
|
+
* for example due to network latency, disk availability issues, un/intentional crashes, limited hardware capabilities.
|
|
7
|
+
* the timeout mechanism (fixed/dynamic) could also influence this decision.
|
|
8
|
+
* this cloud function should check each circuit and:
|
|
9
|
+
* A) avoid timeout if there's no current contributor for the circuit.
|
|
10
|
+
* B) avoid timeout if the current contributor is the first for the circuit
|
|
11
|
+
* and timeout mechanism type is dynamic (suggestion: coordinator should be the first contributor).
|
|
12
|
+
* C) check if the current contributor is a potential blocking contributor for the circuit.
|
|
13
|
+
* D) discriminate between blocking contributor (= when downloading, computing, uploading contribution steps)
|
|
14
|
+
* or verification (= verifying contribution step) timeout types.
|
|
15
|
+
* E) execute timeout.
|
|
16
|
+
* E.1) prepare next contributor (if any).
|
|
17
|
+
* E.2) update circuit contributors waiting queue removing the current contributor.
|
|
18
|
+
* E.3) assign timeout to blocking contributor (participant doc update + timeout doc).
|
|
19
|
+
*/
|
|
20
|
+
export declare const checkAndRemoveBlockingContributor: functions.CloudFunction<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Resume the contributor circuit contribution from scratch after the timeout expiration.
|
|
23
|
+
* @dev The participant can resume the contribution if and only if the last timeout in progress was verified as expired (status == EXHUMED).
|
|
24
|
+
*/
|
|
25
|
+
export declare const resumeContributionAfterTimeoutExpiration: functions.HttpsFunction & functions.Runnable<any>;
|
|
26
|
+
//# sourceMappingURL=timeout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout.d.ts","sourceRoot":"","sources":["../../../src/functions/timeout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAuB/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iCAAiC,kCA6MxC,CAAA;AAEN;;;GAGG;AACH,eAAO,MAAM,wCAAwC,mDAyC/C,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as functions from "firebase-functions";
|
|
2
|
+
/**
|
|
3
|
+
* Record the authenticated user information inside the Firestore DB upon authentication.
|
|
4
|
+
* @dev the data is recorded in a new document in the `users` collection.
|
|
5
|
+
* @notice this method is automatically triggered upon user authentication in the Firebase app
|
|
6
|
+
* which uses the Firebase Authentication service.
|
|
7
|
+
*/
|
|
8
|
+
export declare const registerAuthUser: functions.CloudFunction<import("firebase-admin/auth").UserRecord>;
|
|
9
|
+
/**
|
|
10
|
+
* Set custom claims for role-based access control on the newly created user.
|
|
11
|
+
* @notice this method is automatically triggered upon user authentication in the Firebase app
|
|
12
|
+
* which uses the Firebase Authentication service.
|
|
13
|
+
*/
|
|
14
|
+
export declare const processSignUpWithCustomClaims: functions.CloudFunction<import("firebase-admin/auth").UserRecord>;
|
|
15
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/functions/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAA;AAW/C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,mEAuFvB,CAAA;AACN;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,mEA+BpC,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as functions from "firebase-functions";
|
|
2
|
+
import { FunctionsErrorCode, HttpsError } from "firebase-functions/v1/https";
|
|
3
|
+
import { LogLevel } from "../types/enums";
|
|
4
|
+
/**
|
|
5
|
+
* Create a new custom HTTPs error for cloud functions.
|
|
6
|
+
* @notice the set of Firebase Functions status codes. The codes are the same at the
|
|
7
|
+
* ones exposed by {@link https://github.com/grpc/grpc/blob/master/doc/statuscodes.md | gRPC}.
|
|
8
|
+
* @param errorCode <FunctionsErrorCode> - the set of possible error codes.
|
|
9
|
+
* @param message <string> - the error messge.
|
|
10
|
+
* @param [details] <string> - the details of the error (optional).
|
|
11
|
+
* @returns <HttpsError>
|
|
12
|
+
*/
|
|
13
|
+
export declare const makeError: (errorCode: FunctionsErrorCode, message: string, details?: string) => HttpsError;
|
|
14
|
+
/**
|
|
15
|
+
* Log a custom message on console using a specific level.
|
|
16
|
+
* @param message <string> - the message to be shown.
|
|
17
|
+
* @param logLevel <LogLevel> - the level of the log to be used to show the message (e.g., debug, error).
|
|
18
|
+
*/
|
|
19
|
+
export declare const printLog: (message: string, logLevel: LogLevel) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Log and throw an HTTPs error.
|
|
22
|
+
* @param error <HttpsError> - the error to be logged and thrown.
|
|
23
|
+
*/
|
|
24
|
+
export declare const logAndThrowError: (error: HttpsError) => never;
|
|
25
|
+
/**
|
|
26
|
+
* A set of Cloud Function specific errors.
|
|
27
|
+
* @notice these are errors that happen only on specific cloud functions.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SPECIFIC_ERRORS: {
|
|
30
|
+
SE_AUTH_NO_CURRENT_AUTH_USER: functions.auth.HttpsError;
|
|
31
|
+
SE_AUTH_SET_CUSTOM_USER_CLAIMS_FAIL: functions.auth.HttpsError;
|
|
32
|
+
SE_AUTH_USER_NOT_REPUTABLE: functions.auth.HttpsError;
|
|
33
|
+
SE_STORAGE_INVALID_BUCKET_NAME: functions.auth.HttpsError;
|
|
34
|
+
SE_STORAGE_TOO_MANY_BUCKETS: functions.auth.HttpsError;
|
|
35
|
+
SE_STORAGE_MISSING_PERMISSIONS: functions.auth.HttpsError;
|
|
36
|
+
SE_STORAGE_BUCKET_NOT_CONNECTED_TO_CEREMONY: functions.auth.HttpsError;
|
|
37
|
+
SE_STORAGE_WRONG_OBJECT_KEY: functions.auth.HttpsError;
|
|
38
|
+
SE_STORAGE_CANNOT_INTERACT_WITH_MULTI_PART_UPLOAD: functions.auth.HttpsError;
|
|
39
|
+
SE_STORAGE_DOWNLOAD_FAILED: functions.auth.HttpsError;
|
|
40
|
+
SE_STORAGE_UPLOAD_FAILED: functions.auth.HttpsError;
|
|
41
|
+
SE_STORAGE_DELETE_FAILED: functions.auth.HttpsError;
|
|
42
|
+
SE_CONTRIBUTE_NO_CEREMONY_CIRCUITS: functions.auth.HttpsError;
|
|
43
|
+
SE_CONTRIBUTE_NO_OPENED_CEREMONIES: functions.auth.HttpsError;
|
|
44
|
+
SE_CONTRIBUTE_CANNOT_PROGRESS_TO_NEXT_CIRCUIT: functions.auth.HttpsError;
|
|
45
|
+
SE_PARTICIPANT_CEREMONY_NOT_OPENED: functions.auth.HttpsError;
|
|
46
|
+
SE_PARTICIPANT_NOT_CONTRIBUTING: functions.auth.HttpsError;
|
|
47
|
+
SE_PARTICIPANT_CANNOT_STORE_PERMANENT_DATA: functions.auth.HttpsError;
|
|
48
|
+
SE_PARTICIPANT_CANNOT_STORE_TEMPORARY_DATA: functions.auth.HttpsError;
|
|
49
|
+
SE_VERIFICATION_NO_PARTICIPANT_CONTRIBUTION_DATA: functions.auth.HttpsError;
|
|
50
|
+
SE_CEREMONY_CANNOT_FINALIZE_CEREMONY: functions.auth.HttpsError;
|
|
51
|
+
SE_FINALIZE_NO_CEREMONY_CONTRIBUTIONS: functions.auth.HttpsError;
|
|
52
|
+
SE_FINALIZE_NO_FINAL_CONTRIBUTION: functions.auth.HttpsError;
|
|
53
|
+
SE_VM_NOT_RUNNING: functions.auth.HttpsError;
|
|
54
|
+
SE_VM_FAILED_COMMAND_EXECUTION: functions.auth.HttpsError;
|
|
55
|
+
SE_VM_TIMEDOUT_COMMAND_EXECUTION: functions.auth.HttpsError;
|
|
56
|
+
SE_VM_CANCELLED_COMMAND_EXECUTION: functions.auth.HttpsError;
|
|
57
|
+
SE_VM_DELAYED_COMMAND_EXECUTION: functions.auth.HttpsError;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* A set of common errors.
|
|
61
|
+
* @notice these are errors that happen on multiple cloud functions (e.g., auth, missing data).
|
|
62
|
+
*/
|
|
63
|
+
export declare const COMMON_ERRORS: {
|
|
64
|
+
CM_NOT_COORDINATOR_ROLE: functions.auth.HttpsError;
|
|
65
|
+
CM_MISSING_OR_WRONG_INPUT_DATA: functions.auth.HttpsError;
|
|
66
|
+
CM_WRONG_CONFIGURATION: functions.auth.HttpsError;
|
|
67
|
+
CM_NOT_AUTHENTICATED: functions.auth.HttpsError;
|
|
68
|
+
CM_INEXISTENT_DOCUMENT: functions.auth.HttpsError;
|
|
69
|
+
CM_INEXISTENT_DOCUMENT_DATA: functions.auth.HttpsError;
|
|
70
|
+
CM_INVALID_CEREMONY_FOR_PARTICIPANT: functions.auth.HttpsError;
|
|
71
|
+
CM_NO_CIRCUIT_FOR_GIVEN_SEQUENCE_POSITION: functions.auth.HttpsError;
|
|
72
|
+
CM_INVALID_REQUEST: functions.auth.HttpsError;
|
|
73
|
+
CM_INVALID_COMMAND_EXECUTION: functions.auth.HttpsError;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkI3B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;CA2CzB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
2
|
+
/**
|
|
3
|
+
* Return a configured and connected instance of the AWS S3 client.
|
|
4
|
+
* @dev this method check and utilize the environment variables to configure the connection
|
|
5
|
+
* w/ the S3 client.
|
|
6
|
+
* @returns <Promise<S3Client>> - the instance of the connected S3 Client instance.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getS3Client: () => Promise<S3Client>;
|
|
9
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../src/lib/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,QAAa,QAAQ,QAAQ,CAkBpD,CAAA"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { DocumentData, QuerySnapshot, DocumentSnapshot, QueryDocumentSnapshot, WhereFilterOp } from "firebase-admin/firestore";
|
|
2
|
+
import admin from "firebase-admin";
|
|
3
|
+
import { CircuitDocument } from "@p0tion/actions";
|
|
4
|
+
import { SSMClient } from "@aws-sdk/client-ssm";
|
|
5
|
+
import { EC2Client } from "@aws-sdk/client-ec2";
|
|
6
|
+
/**
|
|
7
|
+
* Get a specific document from database.
|
|
8
|
+
* @dev this method differs from the one in the `actions` package because we need to use
|
|
9
|
+
* the admin SDK here; therefore the Firestore instances are not interchangeable between admin
|
|
10
|
+
* and user instance.
|
|
11
|
+
* @param collection <string> - the name of the collection.
|
|
12
|
+
* @param documentId <string> - the unique identifier of the document in the collection.
|
|
13
|
+
* @returns <Promise<DocumentSnapshot<DocumentData>>> - the requested document w/ relative data.
|
|
14
|
+
*/
|
|
15
|
+
export declare const getDocumentById: (collection: string, documentId: string) => Promise<DocumentSnapshot<DocumentData>>;
|
|
16
|
+
/**
|
|
17
|
+
* Get the current server timestamp.
|
|
18
|
+
* @dev the value is in milliseconds.
|
|
19
|
+
* @returns <number> - the timestamp of the server (ms).
|
|
20
|
+
*/
|
|
21
|
+
export declare const getCurrentServerTimestampInMillis: () => number;
|
|
22
|
+
/**
|
|
23
|
+
* Interrupt the current execution for a specified amount of time.
|
|
24
|
+
* @param ms <number> - the amount of time expressed in milliseconds.
|
|
25
|
+
*/
|
|
26
|
+
export declare const sleep: (ms: number) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Query for ceremony circuits.
|
|
29
|
+
* @notice the order by sequence position is fundamental to maintain parallelism among contributions for different circuits.
|
|
30
|
+
* @param ceremonyId <string> - the unique identifier of the ceremony.
|
|
31
|
+
* @returns Promise<Array<FirebaseDocumentInfo>> - the ceremony' circuits documents ordered by sequence position.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getCeremonyCircuits: (ceremonyId: string) => Promise<Array<QueryDocumentSnapshot<DocumentData>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Query for ceremony circuit contributions.
|
|
36
|
+
* @param ceremonyId <string> - the unique identifier of the ceremony.
|
|
37
|
+
* @param circuitId <string> - the unique identifier of the circuitId.
|
|
38
|
+
* @returns Promise<Array<FirebaseDocumentInfo>> - the contributions of the ceremony circuit.
|
|
39
|
+
*/
|
|
40
|
+
export declare const getCeremonyCircuitContributions: (ceremonyId: string, circuitId: string) => Promise<Array<QueryDocumentSnapshot<DocumentData>>>;
|
|
41
|
+
/**
|
|
42
|
+
* Query not expired timeouts.
|
|
43
|
+
* @notice a timeout is considered valid (aka not expired) if and only if the timeout end date
|
|
44
|
+
* value is less than current timestamp.
|
|
45
|
+
* @param ceremonyId <string> - the unique identifier of the ceremony.
|
|
46
|
+
* @param participantId <string> - the unique identifier of the participant.
|
|
47
|
+
* @returns <Promise<QuerySnapshot<DocumentData>>>
|
|
48
|
+
*/
|
|
49
|
+
export declare const queryNotExpiredTimeouts: (ceremonyId: string, participantId: string) => Promise<QuerySnapshot<DocumentData>>;
|
|
50
|
+
/**
|
|
51
|
+
* Query for opened ceremonies.
|
|
52
|
+
* @param firestoreDatabase <Firestore> - the Firestore service instance associated to the current Firebase application.
|
|
53
|
+
* @returns <Promise<Array<FirebaseDocumentInfo>>>
|
|
54
|
+
*/
|
|
55
|
+
export declare const queryOpenedCeremonies: () => Promise<Array<QueryDocumentSnapshot<DocumentData>>>;
|
|
56
|
+
/**
|
|
57
|
+
* Get ceremony circuit document by sequence position.
|
|
58
|
+
* @param ceremonyId <string> - the unique identifier of the ceremony.
|
|
59
|
+
* @param sequencePosition <number> - the sequence position of the circuit.
|
|
60
|
+
* @returns Promise<QueryDocumentSnapshot<DocumentData>>
|
|
61
|
+
*/
|
|
62
|
+
export declare const getCircuitDocumentByPosition: (ceremonyId: string, sequencePosition: number) => Promise<QueryDocumentSnapshot<DocumentData>>;
|
|
63
|
+
/**
|
|
64
|
+
* Create a temporary file path in the virtual memory of the cloud function.
|
|
65
|
+
* @dev useful when downloading files from AWS S3 buckets for processing within cloud functions.
|
|
66
|
+
* @param completeFilename <string> - the complete file name (name + ext).
|
|
67
|
+
* @returns <string> - the path to the local temporary location.
|
|
68
|
+
*/
|
|
69
|
+
export declare const createTemporaryLocalPath: (completeFilename: string) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Download an artifact from the AWS S3 bucket.
|
|
72
|
+
* @dev this method uses streams.
|
|
73
|
+
* @param bucketName <string> - the name of the bucket.
|
|
74
|
+
* @param objectKey <string> - the unique key to identify the object inside the given AWS S3 bucket.
|
|
75
|
+
* @param localFilePath <string> - the local path where the file will be stored.
|
|
76
|
+
*/
|
|
77
|
+
export declare const downloadArtifactFromS3Bucket: (bucketName: string, objectKey: string, localFilePath: string) => Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Upload a new artifact to the AWS S3 bucket.
|
|
80
|
+
* @dev this method uses streams.
|
|
81
|
+
* @param bucketName <string> - the name of the bucket.
|
|
82
|
+
* @param objectKey <string> - the unique key to identify the object inside the given AWS S3 bucket.
|
|
83
|
+
* @param localFilePath <string> - the local path where the file to be uploaded is stored.
|
|
84
|
+
*/
|
|
85
|
+
export declare const uploadFileToBucket: (bucketName: string, objectKey: string, localFilePath: string, isPublic?: boolean) => Promise<void>;
|
|
86
|
+
export declare const uploadFileToBucketNoFile: (bucketName: string, objectKey: string, data: string, isPublic?: boolean) => Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Upload an artifact from the AWS S3 bucket.
|
|
89
|
+
* @param bucketName <string> - the name of the bucket.
|
|
90
|
+
* @param objectKey <string> - the unique key to identify the object inside the given AWS S3 bucket.
|
|
91
|
+
*/
|
|
92
|
+
export declare const deleteObject: (bucketName: string, objectKey: string) => Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Query ceremonies by state and (start/end) date value.
|
|
95
|
+
* @param state <string> - the state of the ceremony.
|
|
96
|
+
* @param needToCheckStartDate <boolean> - flag to discriminate when to check startDate (true) or endDate (false).
|
|
97
|
+
* @param check <WhereFilerOp> - the type of filter (query check - e.g., '<' or '>').
|
|
98
|
+
* @returns <Promise<admin.firestore.QuerySnapshot<admin.firestore.DocumentData>>> - the queried ceremonies after filtering operation.
|
|
99
|
+
*/
|
|
100
|
+
export declare const queryCeremoniesByStateAndDate: (state: string, needToCheckStartDate: boolean, check: WhereFilterOp) => Promise<admin.firestore.QuerySnapshot<admin.firestore.DocumentData>>;
|
|
101
|
+
/**
|
|
102
|
+
* Return the document associated with the final contribution for a ceremony circuit.
|
|
103
|
+
* @dev this method is useful during ceremony finalization.
|
|
104
|
+
* @param ceremonyId <string> -
|
|
105
|
+
* @param circuitId <string> -
|
|
106
|
+
* @returns Promise<QueryDocumentSnapshot<DocumentData>> - the final contribution for the ceremony circuit.
|
|
107
|
+
*/
|
|
108
|
+
export declare const getFinalContribution: (ceremonyId: string, circuitId: string) => Promise<QueryDocumentSnapshot<DocumentData>>;
|
|
109
|
+
/**
|
|
110
|
+
* Helper function to HTML encode circuit data.
|
|
111
|
+
* @param circuitDocument <CircuitDocument> - the circuit document to be encoded.
|
|
112
|
+
* @returns <CircuitDocument> - the circuit document encoded.
|
|
113
|
+
*/
|
|
114
|
+
export declare const htmlEncodeCircuitData: (circuitDocument: CircuitDocument) => CircuitDocument;
|
|
115
|
+
/**
|
|
116
|
+
* Fetch the variables related to GitHub anti-sybil checks
|
|
117
|
+
* @returns <any> - the GitHub variables.
|
|
118
|
+
*/
|
|
119
|
+
export declare const getGitHubVariables: () => any;
|
|
120
|
+
/**
|
|
121
|
+
* Fetch the variables related to EC2 verification
|
|
122
|
+
* @returns <any> - the AWS EC2 variables.
|
|
123
|
+
*/
|
|
124
|
+
export declare const getAWSVariables: () => any;
|
|
125
|
+
/**
|
|
126
|
+
* Create an EC2 client object
|
|
127
|
+
* @returns <Promise<EC2Client>> an EC2 client
|
|
128
|
+
*/
|
|
129
|
+
export declare const createEC2Client: () => Promise<EC2Client>;
|
|
130
|
+
/**
|
|
131
|
+
* Create an SSM client object
|
|
132
|
+
* @returns <Promise<SSMClient>> an SSM client
|
|
133
|
+
*/
|
|
134
|
+
export declare const createSSMClient: () => Promise<SSMClient>;
|
|
135
|
+
/**
|
|
136
|
+
* Get the instance id of the EC2 instance associated with the circuit
|
|
137
|
+
* @param circuitId <string> - the circuit id
|
|
138
|
+
* @returns <Promise<string>> - the EC2 instance id
|
|
139
|
+
*/
|
|
140
|
+
export declare const getEC2InstanceId: (circuitId: string) => Promise<string>;
|
|
141
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AACH,eAAO,MAAM,eAAe,eACZ,MAAM,cACN,MAAM,KACnB,QAAQ,iBAAiB,YAAY,CAAC,CASxC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,QAAO,MAAoC,CAAA;AAEzF;;;GAGG;AACH,eAAO,MAAM,KAAK,OAAc,MAAM,KAAG,QAAQ,IAAI,CAAmB,CAAA;AAExE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,eAAsB,MAAM,KAAG,QAAQ,MAAM,sBAAsB,YAAY,CAAC,CAAC,CAYhH,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,eAC5B,MAAM,aACP,MAAM,KAClB,QAAQ,MAAM,sBAAsB,YAAY,CAAC,CAAC,CAUpD,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,eACpB,MAAM,iBACH,MAAM,KACtB,QAAQ,cAAc,YAAY,CAAC,CASrC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,QAAQ,MAAM,sBAAsB,YAAY,CAAC,CAAC,CAWhG,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,eACzB,MAAM,oBACA,MAAM,KACzB,QAAQ,sBAAsB,YAAY,CAAC,CAY7C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,qBAAsB,MAAM,KAAG,MAAkD,CAAA;AAEtH;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,eAAsB,MAAM,aAAa,MAAM,iBAAiB,MAAM,kBA6B9G,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,eACf,MAAM,aACP,MAAM,iBACF,MAAM,aACX,OAAO,kBA4BpB,CAAA;AAED,eAAO,MAAM,wBAAwB,eACrB,MAAM,aACP,MAAM,QACX,MAAM,aACF,OAAO,kBAyBpB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAsB,MAAM,aAAa,MAAM,kBAWvE,CAAA;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,GAarC,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log levels.
|
|
3
|
+
* @notice useful to discriminate the log level for message printing.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export declare enum LogLevel {
|
|
7
|
+
INFO = "INFO",
|
|
8
|
+
DEBUG = "DEBUG",
|
|
9
|
+
WARN = "WARN",
|
|
10
|
+
ERROR = "ERROR",
|
|
11
|
+
LOG = "LOG"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,QAAQ;IAChB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;CACd"}
|