type SmartlingJobDetails = Readonly<{ translationJobUid: string; jobName: string; jobNumber: string; targetLocaleIds: string[]; description: string; dueDate: string; referenceNumber: string; callbackUrl: string | null; callbackMethod: string | null; createdDate: string; modifiedDate: string; createdByUserUid: string; modifiedByUserUid: string | null; firstCompletedDate: string; lastCompletedDate: string; firstAuthorizedDate: string; lastAuthorizedDate: string; jobStatus: SmartlingJobStatus; issues: { sourceIssuesCount: number; translationIssuesCount: number; }; customFields: unknown[]; sourceFiles: SmartlingSourceFile[]; priority: string | null; rushRequest: boolean; }>; type SmartlingSourceFile = Readonly<{ fileUid: string; uri: string; name: string; }>; export declare const enum SmartlingJobStatus { DRAFT = "DRAFT", AWAITING_AUTHORIZATION = "AWAITING_AUTHORIZATION", IN_PROGRESS = "IN_PROGRESS", COMPLETED = "COMPLETED", CANCELLED = "CANCELLED", CLOSED = "CLOSED", DELETED = "DELETED" } type SmartlingJobInfo = Readonly<{ translationJobUid: string; jobName: string; jobNumber: string; dueDate: string; targetLocaleIds: string[]; createdDate: string; jobStatus: SmartlingJobStatus; referenceNumber: string; description: string; rushRequest: boolean; }>; export declare function forcePullAllPublishedTranslations(): Promise; /** * * This function pulls the translations from Smartling API * and saves them to the local file system. * */ export declare function pullTranslationsFromSmartling(): Promise; /** * * This function fetches the list of CSV files from Smartling * based on the project ID and returns the list of items * */ export declare function getJobList(token: string): Promise; /** * * This function extracts the locale name from the file path * e.g. 'en-US.csv' -> 'en-US' or '/localization/en-US.csv' -> 'en-US' * */ export declare function parseLocaleName(fileName: string): string; export declare function convertCSVToFTLFromString(csvContent: string): string; /** * * This function saves the FTL files to the local file system * */ export declare function saveFile(fileName: string, rawFileContent: string, outputDir: string): void; /** * Cleans the FTL content by removing any messages which have a placeholder as * their only element. This is a workaround for a Smartling bug that * does not allow just attributes and no value for a given key * * @param {string} ftlContent - The FTL content to be cleaned * * @returns {string} The cleaned FTL content */ export declare function cleanFTLContent(ftlContent: string): string; /** * * This function returns the relative path of the FTL file * e.g. 'en-US' into something like -> '/localization/en-US.ftl' * */ export declare function getRelativePath(fileName: string, outputDir: string): string; /** * This function fetches the content of the file from Smartling API * based on the file URI and token */ export declare function getFileContent(localeId: string, fileUri: string, token: string): Promise; /** * This function checks if a PR should be created * based on the local files and the Smartling API * */ export declare function shouldCreatePR(): Promise; /** * Retrieves a list of locales that need updates, along with their corresponding source files. * * This function uses the provided authentication token to retrieve a list of Smartling job details. * It then filters this list to obtain only the jobs that have local files that need updates. * Finally, it returns a list of objects containing the IDs of the locales that need updates and their corresponding source files. * * @param token Authentication token for accessing the Smartling API * @returns A list of objects containing the IDs of the locales that need updates and their corresponding source files */ export declare function getLocalesThatNeedUpdates(token: string): Promise<{ locales: string[]; sourceFiles: SmartlingSourceFile[]; }[]>; /** * Retrieves a list of promises to Smartling job details. * * This function first retrieves a list of Smartling job details and then maps * each job to a promise of its corresponding job details. * * @param token Authentication token for accessing the Smartling API * @returns A list of promises to Smartling job details */ export declare function getAllJobDetails(token: string): Promise[]>; export declare function getJobDetails(jobId: string, token: string): Promise; /** * Determines if any local file associated with the given job details needs an update. * * This function checks if the job status is 'COMPLETED' and evaluates each source file * in the job details to determine if a local file update is needed based on the git last modified date and * the last completed date of the Smartling job. * * @param jobDetails The details of the Smartling job, including its status and source files. * @returns A boolean indicating whether any local file needs an update. */ export declare function anyLocalFileNeedsUpdate(jobDetails: SmartlingJobDetails): boolean; /** * Checks if a local file needs an update by comparing the last modification date on * the local git repository with the last completed date of the Smartling job, or if the file does not exist. * * @param fileUri The uri of the file to check. * @param lastCompletedDate The last completed date of the Smartling job in ISO 8601 format. * @returns A boolean indicating whether a local file update is needed. */ export declare function localFileNeedsUpdate(fileUri: string, lastCompletedDate: string): boolean; export {};