UNPKG

@mentaport/certificates-projects

Version:

Mentaport certificate-projects SDK, for certificate admins.

72 lines (71 loc) 3.41 kB
import { Base, IResults, ICertificateProject } from '@mentaport/common'; import { IUpdateCertProject, IUpdateCertProjectStatus, ICreateCertProject, IContractProject } from "./types"; export declare class ProjectsSDK extends Base { /** * Function to create a new project for certificates for a user * * @param {project.contractId} ContractId of contract where adding projcect * @param {project.projectName} Name of project * @param {project.ownerName} Name of project user * @param {project.email} Email of project user (optional) * @param {project.ownerWallet} Owner wallet of user (optional) * @param {project.projectBaseURI} projectBaseURI of contract (optional) * @param {customerId} CustomerId (optional if have more than one customer) * * @returns {IResults<ICertificateProject>} Returns if succeded the contract created */ createNewCertificateProject(newProject: ICreateCertProject): Promise<IResults<ICertificateProject>>; /** * Function to activate a project in a contract * * @param {contractId} ContractId * @param {projectId} ProjectId * * @returns {IResults<boolean>} Returns contract activated status */ activateProject(contractId: string, projectId: string): Promise<IResults<boolean>>; /** * Function to retrieve projects from customer in contracts * - most of users only have one contract with multiple projects * @param {contractId} ContractId (optional to get project just from one contract) * @param {customerId} CustomerId (optional if have more than one customer) * * @returns {IResults<T>} Returns all contract */ getProjects<T = ICertificateProject[]>(contractId?: string, customerId?: string): Promise<IResults<T>>; /** * Function to retrieve project by its Id * @param {contractId} ContractId * @param {projectId} ProjectId * @param {customerId} CustomerId (optional if have more than one customer) * * @returns {IResults<ICertificateProject>} Returns contract */ getProjectById<T = ICertificateProject>(contractId: string, projectId: string, customerId?: string): Promise<IResults<T>>; /** * Function to update project before it is activated. * * @param {updateProject} Information to update * @param {customerId} CustomerId (optional if have more than one customer) * * @returns {IResults<ICertificateProject>} Returns updated contract */ updateProjectById<T = ICertificateProject>(updateProject: IUpdateCertProject): Promise<IResults<T>>; /** * Function to update project status after being activated * * @param {updateProjectStatus} Status to update * @param {customerId} CustomerId (optional if have more than one customer) * * @returns {IResults<ICertificateProject>} Returns updated contract */ updateProjectStatusById<T = ICertificateProject>(updateProjectStatus: IUpdateCertProjectStatus): Promise<IResults<T>>; /** * Function to retrieve contracts from customer * All contracts will be return if all is true (active and non active) * @param {allContracts} Boolean to get all contracts, not just active * * @returns {IResults<T>} Returns contract */ getContracts<T = IContractProject[]>(allContracts: boolean): Promise<IResults<T>>; }