32 lines
2.0 KiB
TypeScript
32 lines
2.0 KiB
TypeScript
|
|
import { IExecuteFunctions } from 'n8n-workflow';
|
||
|
|
import { IFileDownloadResponse, IFileUploadResponse } from './Interfaces/FileStorageInterfaces';
|
||
|
|
import { IProtectWithExternalRefIdRequest, IProtectWithExternalRefIdResponse, IProtectWithFileIdRequest, IProtectWithFileIdResponse, IProtectWithHotFolderRequest, IProtectWithHotFolderResponse } from './Interfaces/ProtectInterfaces';
|
||
|
|
import { IUnprotectRequest, IUnprotectResponse } from './Interfaces/UnprotectInterfaces';
|
||
|
|
export declare class SecloreDRMFileService {
|
||
|
|
private defaultRetryCount;
|
||
|
|
private apiService;
|
||
|
|
private tenantId;
|
||
|
|
private tenantSecret;
|
||
|
|
private accessToken?;
|
||
|
|
private refreshToken?;
|
||
|
|
private tokenExpiry?;
|
||
|
|
private refreshPromise?;
|
||
|
|
private loginPromise?;
|
||
|
|
constructor(context: IExecuteFunctions, baseUrl: string, tenantId: string, tenantSecret: string, defaultRetryCount?: number);
|
||
|
|
private ensureAuthenticated;
|
||
|
|
private login;
|
||
|
|
private refreshAccessToken;
|
||
|
|
private performTokenRefresh;
|
||
|
|
private clearTokens;
|
||
|
|
private executeWithRetry;
|
||
|
|
protectWithExternalRefId(protectRequest: IProtectWithExternalRefIdRequest, correlationId?: string, retryCount?: number): Promise<IProtectWithExternalRefIdResponse>;
|
||
|
|
protectWithFileId(protectRequest: IProtectWithFileIdRequest, correlationId?: string, retryCount?: number): Promise<IProtectWithFileIdResponse>;
|
||
|
|
protectWithHotFolder(protectRequest: IProtectWithHotFolderRequest, correlationId?: string, retryCount?: number): Promise<IProtectWithHotFolderResponse>;
|
||
|
|
unprotect(unprotectRequest: IUnprotectRequest, correlationId?: string, retryCount?: number): Promise<IUnprotectResponse>;
|
||
|
|
uploadFile(fileBuffer: Uint8Array, fileName: string, correlationId?: string, retryCount?: number): Promise<IFileUploadResponse>;
|
||
|
|
downloadFile(fileStorageId: string, correlationId?: string, retryCount?: number): Promise<IFileDownloadResponse>;
|
||
|
|
deleteFile(fileStorageId: string, correlationId?: string, retryCount?: number): Promise<void>;
|
||
|
|
getAccessToken(): string | undefined;
|
||
|
|
isAuthenticated(): boolean;
|
||
|
|
}
|