import { Functions } from "firebase/functions"; import { CeremonyInputData, CircuitDocument, ETagWithPartNumber, FirebaseDocumentInfo } from "../types/index"; /** * Setup a new ceremony by calling the related cloud function. * @param functions - the Firebase cloud functions object instance. * @param ceremonyInputData - the input data of the ceremony. * @param ceremonyPrefix - the prefix of the ceremony. * @param circuits - the circuits data. * @returns Promise - the unique identifier of the created ceremony. */ export declare const setupCeremony: (functions: Functions, ceremonyInputData: CeremonyInputData, ceremonyPrefix: string, circuits: CircuitDocument[]) => Promise; /** * Check the user's current participant status for the ceremony * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @returns - true when participant is able to contribute; otherwise false. */ export declare const checkParticipantForCeremony: (functions: Functions, ceremonyId: string) => Promise; /** * Progress the participant to the next circuit preparing for the next contribution. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. */ export declare const progressToNextCircuitForContribution: (functions: Functions, ceremonyId: string) => Promise; /** * Resume the contributor circuit contribution from scratch after the timeout expiration. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. */ export declare const resumeContributionAfterTimeoutExpiration: (functions: Functions, ceremonyId: string) => Promise; /** * Make a request to create a new AWS S3 bucket for a ceremony. * @param functions - the Firebase cloud functions object instance. * @param bucketName - the name of the ceremony bucket. */ export declare const createS3Bucket: (functions: Functions, bucketName: string) => Promise; /** * Return a pre-signed url for a given object contained inside the provided AWS S3 bucket in order to perform a GET request. * @param functions - the Firebase cloud functions object instance. * @param bucketName - the name of the ceremony bucket. * @param objectKey - the storage path that locates the artifact to be downloaded in the bucket. * @returns > - the pre-signed url w/ GET request permissions for specified object key. */ export declare const generateGetObjectPreSignedUrl: (functions: Functions, bucketName: string, objectKey: string) => Promise; /** * Progress the participant to the next circuit preparing for the next contribution. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. */ export declare const progressToNextContributionStep: (functions: Functions, ceremonyId: string) => Promise; /** * Write the information about current contribution hash and computation time for the current contributor. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @param contributionComputationTime - the time when it was computed * @param contributingHash - the hash of the contribution */ export declare const permanentlyStoreCurrentContributionTimeAndHash: (functions: Functions, ceremonyId: string, contributionComputationTime: number, contributionHash: string) => Promise; /** * Start a new multi-part upload for a specific object in the given AWS S3 bucket. * @param functions - the Firebase cloud functions object instance. * @param bucketName - the name of the ceremony bucket. * @param objectKey - the storage path that locates the artifact to be downloaded in the bucket. * @param ceremonyId - the unique identifier of the ceremony. * @returns Promise - the multi-part upload id. */ export declare const openMultiPartUpload: (functions: Functions, bucketName: string, objectKey: string, ceremonyId?: string) => Promise; /** * Write temporary information about the unique identifier about the opened multi-part upload to eventually resume the contribution. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @param uploadId - the unique identifier of the multi-part upload. */ export declare const temporaryStoreCurrentContributionMultiPartUploadId: (functions: Functions, ceremonyId: string, uploadId: string) => Promise; /** * Write temporary information about the etags and part numbers for each uploaded chunk in order to make the upload resumable from last chunk. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @param chunk - the information about the already uploaded chunk. */ export declare const temporaryStoreCurrentContributionUploadedChunkData: (functions: Functions, ceremonyId: string, chunk: ETagWithPartNumber) => Promise; /** * Generate a new pre-signed url for each chunk related to a started multi-part upload. * @param functions - the Firebase cloud functions object instance. * @param bucketName - the name of the ceremony bucket. * @param objectKey - the storage path that locates the artifact to be downloaded in the bucket. * @param uploadId - the unique identifier of the multi-part upload. * @param numberOfChunks - the number of pre-signed urls to be generated. * @param ceremonyId - the unique identifier of the ceremony. * @returns Promise> - the set of pre-signed urls (one for each chunk). */ export declare const generatePreSignedUrlsParts: (functions: Functions, bucketName: string, objectKey: string, uploadId: string, numberOfParts: number, ceremonyId?: string) => Promise>; /** * Complete a multi-part upload for a specific object in the given AWS S3 bucket. * @param functions - the Firebase cloud functions object instance. * @param bucketName - the name of the ceremony bucket. * @param objectKey - the storage path that locates the artifact to be downloaded in the bucket. * @param uploadId - the unique identifier of the multi-part upload. * @param parts Array - the completed . * @param ceremonyId - the unique identifier of the ceremony. * @returns Promise - the location of the uploaded ceremony artifact. */ export declare const completeMultiPartUpload: (functions: Functions, bucketName: string, objectKey: string, uploadId: string, parts: Array, ceremonyId?: string) => Promise; /** * Check if a specified object exist in a given AWS S3 bucket. * @param functions - the Firebase cloud functions object instance. * @param bucketName - the name of the ceremony bucket. * @param objectKey - the storage path that locates the artifact to be downloaded in the bucket. * @returns > - true if and only if the object exists, otherwise false. */ export declare const checkIfObjectExist: (functions: Functions, bucketName: string, objectKey: string) => Promise; /** * Request to verify the newest contribution for the circuit. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @param circuit - the document info about the circuit. * @param bucketName - the name of the ceremony bucket. * @param contributorOrCoordinatorIdentifier - the identifier of the contributor or coordinator (only when finalizing). * @param verifyContributionCloudFunctionEndpoint - the endpoint (direct url) necessary to call the V2 Cloud Function. * @returns > - */ export declare const verifyContribution: (functions: Functions, ceremonyId: string, circuit: FirebaseDocumentInfo, bucketName: string, contributorOrCoordinatorIdentifier: string, verifyContributionCloudFunctionEndpoint: string) => Promise; /** * Prepare the coordinator for the finalization of the ceremony. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @returns > - true when the coordinator is ready for finalization; otherwise false. */ export declare const checkAndPrepareCoordinatorForFinalization: (functions: Functions, ceremonyId: string) => Promise; /** * Finalize the ceremony circuit. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. * @param circuitId - the unique identifier of the circuit. * @param bucketName - the name of the ceremony bucket. * @param beacon - the value used to compute the final contribution while finalizing the ceremony. */ export declare const finalizeCircuit: (functions: Functions, ceremonyId: string, circuitId: any, bucketName: string, beacon: string) => Promise; /** * Conclude the finalization of the ceremony. * @param functions - the Firebase cloud functions object instance. * @param ceremonyId - the unique identifier of the ceremony. */ export declare const finalizeCeremony: (functions: Functions, ceremonyId: string) => Promise; export declare const useInviteEmail: (functions: Functions, data: { inviteEmail: string; }) => Promise; //# sourceMappingURL=functions.d.ts.map