clodynix
Version:
Clodynix is a modern, efficient, and developer-friendly CDN package offering seamless content delivery with an intuitive dashboard and comprehensive documentation. Simplify your content delivery with Clodynix's powerful and scalable platform.
54 lines (51 loc) • 1.44 kB
text/typescript
type cdnToken = {
token: string;
name: string;
extention: string;
size: number;
totalChunks: number;
id: string;
createdAt: Date;
uses: Date[];
finished: boolean;
};
type cdnFileType = {
uploadToken: cdnToken;
id: string;
registerdAt: Date | null;
uploadedAt: number | undefined;
createdAt: number;
name: string | null;
extension: string | null;
updatedAt: number;
size: number | null;
};
declare class Clodynix {
private apiKey;
private origin;
private secret;
constructor({ apiKey, origin, secret, }: {
apiKey: string;
origin: string;
secret: string;
});
private getAuthToken;
private getOriginLink;
private getSecret;
checkFileInfo(fileId?: string, token?: string): Promise<cdnFileType | null>;
registerFile(token: string): Promise<cdnFileType | null>;
uploadByLink(link: string): Promise<cdnFileType | null>;
createUploadToken(totalChunks: number, fileData: {
name: string;
size: number;
extension: string;
}): Promise<cdnToken>;
deleteFile(fileId: string): Promise<string>;
generateLink(fileId: string): Promise<string>;
generateLinksBatch(fileIds: string[]): Promise<{
id: string;
link: string;
}[]>;
uploadDirect(formdata: FormData): Promise<cdnFileType | null>;
}
export { Clodynix, type cdnFileType, type cdnToken };