import { ConfigService } from '@nestjs/config'; import { LabFilesFile, LabFilesFolder } from 'itlab-functions'; import { AuthenticationModuleOptions } from '../../../authentication'; import { BaseHttpService } from '../../base-http.service'; import { CropImageOptionsDtoV1 } from './crop-image-options.dto.v1.type'; import { FetchFileOptionsDtoV1 } from './fetch-file-options.dto.v1.type'; import { FetchFolderOptionsDtoV1 } from './fetch-folder-options.dto.v1.type'; /** * FilesService * * Service client responsible for interacting with the Files microservice. * Extends `BaseHttpService` to inherit: * - Environment-sensitive URL resolution (internal vs. external). * - Secure inter-service authentication. * - Structured logging for traceability of outbound requests. * * Why this pattern? * - Ensures all outbound calls follow a unified configuration and logging structure. * - Promotes strong typing and maintainable HTTP logic. * - Makes service interactions predictable and debuggable across environments. */ export declare class FilesService extends BaseHttpService { /** * Constructs an Files service client instance. * * @param {AuthenticationModuleOptions} authenticationOptions - Injected authentication configuration. * @param {ConfigService} configService - NestJS ConfigService for environment detection. */ constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService); /** * Retrieves a single file entry by its MongoDB identifier. * * This method gracefully handles downstream failures by logging * and returning `undefined` instead of throwing. * * @param {string} fileId - Unique MongoDB identifier of the file. * @param {FetchFileOptionsDtoV1} [options] - Optional query parameters for filtering or projection. * @returns {Promise} Resolves to an File or `undefined` on failure. */ fetchFileV1(fileId: string, options?: FetchFileOptionsDtoV1): Promise; /** * Retrieves a collection of file ids. * * Useful for batch lookups or paginated listings. * Returns an empty array if the downstream service call fails. * * @param {FetchFileOptionsDtoV1} [options] - Optional filter options for narrowing results. * @returns {Promise} Resolves to a list of file ids, or an empty array if none found. */ fetchFileIdsV1(options?: FetchFileOptionsDtoV1): Promise; /** * Retrieves a collection of file entries. * * Useful for batch lookups or paginated listings. * Returns an empty array if the downstream service call fails. * * @param {FetchFileOptionsDtoV1} [options] - Optional filter options for narrowing results. * @returns {Promise} Resolves to a list of files, or an empty array if none found. */ fetchFileCollectionV1(options?: FetchFileOptionsDtoV1): Promise; /** * Retrieves a single folder entry by its MongoDB identifier. * * This method gracefully handles downstream failures by logging * and returning `undefined` instead of throwing. * * @param {string} folderId - Unique MongoDB identifier of the folder. * @param {FetchFolderOptionsDtoV1} [options] - Optional query parameters for filtering or projection. * @returns {Promise} Resolves to an Folder or `undefined` on failure. */ fetchFolderV1(folderId: string, options?: FetchFolderOptionsDtoV1): Promise; /** * Retrieves a collection of folder entries. * * Useful for batch lookups or paginated listings. * Returns an empty array if the downstream service call fails. * * @param {FetchFolderOptionsDtoV1} [options] - Optional filter options for narrowing results. * @returns {Promise} Resolves to a list of folders, or an empty array if none found. */ fetchFolderCollectionV1(options?: FetchFolderOptionsDtoV1): Promise; uploadAvatarV1(accountId: string, avatar: File): Promise; deleteAvatarV1(accountId: string): Promise; cropImageV1(image: File, options?: CropImageOptionsDtoV1): Promise; }