@mentaport/certificates
Version:
Mentaport certificates SDK.
143 lines (142 loc) • 5.86 kB
TypeScript
import { IResults, ICertificate, ICertStatusResult, IVerify, ContentFormat, ICertificateAnalyticsArg, IReportContentArg, IReportNewContentArg, ICertificatesQuery, ICertificateArg, ICertificateUpdateArg, IScanMetrics, ICertificatesCount } from "./types";
import { ICertificateProject } from '@mentaport/common';
import { Core } from "./helpers/core";
export declare class CertificatesNFTs extends Core {
/**
* Function to create a watermark certificate
*
* @param {certificate} ICertificateArg
* @param {blobContent} Content
*
* @returns {IResults<ICertificate>} Returns create certificate
*/
createCertificate(certificate: ICertificateArg, blobContent: Blob): Promise<IResults<ICertificate>>;
private createCertificatePresignURL;
private createCertificateSmall;
/**
* Function to update a certificate that is NonActive or Pending
*
* @param {certificate} ICertificateUpdateArg
* @param {blobContent} Content
*
* @returns {IResults<ICertificate>} Returns create certificate
*/
updateCertificate(certificate: ICertificateUpdateArg, blobContent: Blob): Promise<IResults<ICertificate>>;
private updateCertificatePresignURL;
private updateCertificateSmall;
/**
* Function to approve / non-approve a certificate before it generates NFT
*
* @param {projectId} ProjectId
* @param {certId} CertId from init content call
* @param {approve} Approve boolean
*
* @returns {IResults<ICertificate>} Returns certificate
*/
approveCertificate(projectId: string, certId: string, approved: boolean): Promise<IResults<ICertificate>>;
/**
* Function to delete a NonActive or Pending certificate
*
* @param {projectId} ProjectId
* @param {certId} CertId from init content call
*
* @returns {IResults<null>} Returns status of deletion
*/
deleteCertificate(projectId: string, certId: string): Promise<IResults<null>>;
/**
* Get certificates based on specified criteria.
* @param {GetCertificatesOptions} options - The options for fetching certificates
* - ProjectId: Filter certificates by project ID
* - CertId: Get a specific certificate by ID (requires projectId)
* - Cursor: Pagination cursor for fetching next page of results
* - Limit: Maximum number of certificates to return
* @returns {Promise<IResults<ICertificatesQuery>>} Returns paginated certificates matching the criteria
*/
getCertificates(options?: {
projectId?: string;
certId?: string;
cursor?: string;
limit?: number;
}): Promise<IResults<ICertificatesQuery>>;
/**
* Get certificates count based on specified criteria.
* @param {projectId} projectId - The options for fetching certificates count
* - ProjectId: Filter certificates by project ID
* @returns {Promise<IResults<ICertificatesCount>>} Returns certificates count matching the criteria
*/
getTotalCertificates(projectId?: string): Promise<IResults<ICertificatesCount>>;
/**
* Function to get download url of certificate
* @param {projectId} ProjectId
* @param {certId} certId
*
* @returns {url} Returns url
*/
getDownloadUrl(projectId: string, certId: string): Promise<IResults<string>>;
/**
* Function to check certificate status
* @param {projectId} ProjectId
* @param {certId} certId
*
* @returns {ICertStatusResult} Returns certificate and status information.
*/
getCertificateStatus(projectId: string, certId: string): Promise<IResults<ICertStatusResult>>;
/**
* Function to get active projects of a user.
* All projects will be return if all is true (active and non active)
* @param {allProjects} Boolean to get all projects, not just active
*
* @returns {ICertificateProject[]} Returns projects of user
*/
getProjects(all?: boolean): Promise<IResults<ICertificateProject[]>>;
/**
* Function to verify if a piece of content has a certificate calling from a server
* @param {contentFormat} contentFormat
* @param {urlFound} URL of where it was found
* @param {blobContent} content blob
*
* @returns {IResults<IVerify>} Returns a certificate if found
*
*/
verifyContent(contentFormat: ContentFormat, urlFound: string, blobContent: Blob): Promise<IResults<IVerify>>;
private verifyContentSmall;
private verifyContentPresignURL;
/**
* Function to get verification progress status
* @param {verId} string
*
* @returns {IVerify} Returns IVerify
*/
getVerificationStatus(verId: string): Promise<IResults<IVerify>>;
/**
* Function to report a content
*
* @param {isOk} Status of report
* @param {certIds} certIds list to report
* @param {timestamp} timestamp of verification record
* @param {count} Number of verification in url to report
* @param {url} URL link (optional)
*
*/
reportContent(reportContent: IReportContentArg): Promise<IResults<null>>;
/**
* Function to report a content
*
* @param {id} id returned in verifyContent
* @param {source} Source (optional)
* @param {url} URL link (optional)
*
*/
reportNewContent(reportContent: IReportNewContentArg): Promise<IResults<null>>;
/**
* Function to get certificates analytics
* @param {queryDateStart} Query start date
* @param {queryDateEnd} Query end date
* @param {projectId} ProjectId
* @param {certId} CertId
*
* @returns {ICertificatesQuery} Returns all certificates per project.
* Each project certificate will be in its own array
*/
getCertificatesAnalytics(analytics: ICertificateAnalyticsArg): Promise<IResults<IScanMetrics>>;
}