import type { CancelablePromise } from '../core/CancelablePromise'; import type { BaseHttpRequest } from '../core/BaseHttpRequest'; export declare class KeysService { readonly httpRequest: BaseHttpRequest; constructor(httpRequest: BaseHttpRequest); /** * Get all keys * Get all keys, with pagination. Note, if you need to search/filter keys, use the search endpoint instead. * @param projectId The unique identifier of the project. * @param page * @param pageSize * @param simple * @returns any Success * @throws ApiError */ getAllKeys(projectId: string, page: number, pageSize: number, simple?: boolean): CancelablePromise<{ metadata: { fetched_at: string; total_count: number; total_pages: number; current_page: number; page_size: number; }; data: Array<{ /** * The unique identifier of the key */ id: string; /** * The code of the key, eg. headers.welcome */ code: string; /** * The detailed data of the key, included if simple-flag on the request is not set */ detailed_data: { /** * Explained context or usage of the key */ context: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Ids of screenshots associated with the key */ screenshot_ids: Array; /** * Email of the user who created the key */ created_by: string; /** * When the key was created */ created_at: string; /** * When the key was last updated */ updated_at: string; /** * When any of the translation values connected to this key was last updated */ translation_value_updated_at: string; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals: boolean; /** * Whether max length is used for the key */ use_max_length: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations associated with the key. Note that this is only included if the simple flag is not set and if translations for languages are requested */ translations: Array<{ /** * The unique identifier of the translation */ language_code: string; /** * Whether the translation has been reviewed */ reviewed: boolean; /** * Number of resolved and unresolved comments for the translation */ comments: { resolved: number; unresolved: number; }; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * The locale of the translation */ locale: string; /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ translation: string; /** * When the translation was last updated */ updated_at?: string; /** * Email of the user who updated the translation */ updated_by?: string; }>; }>; }; }>; }>; /** * Search keys * Search keys with advanced criteria. Note this is a POST request to allow complex search criteria. * @param projectId The unique identifier of the project. * @param requestBody * @returns any Success * @throws ApiError */ searchKeys(projectId: string, requestBody: { /** * Languages to search in. If this is not specified, all languages will be searched in. This is useful when you want to find all non reviewed translations in a specific language */ apply_search_in_languages?: Array; /** * Search string, will search in translations and keys. Searches in all languages or the ones specified in apply_search_in_languages */ search?: string; /** * Filter by review status. Will search in all languages or the ones specified in apply_search_in_languages */ reviewed?: boolean; /** * Filter by translation status. Will search in all languages or the ones specified in apply_search_in_languages */ translated?: boolean; /** * Filter by QA issues. Will search in all languages or the ones specified in apply_search_in_languages. If true, only keys where translations contains QA issues will be returned */ qa_issues?: boolean; /** * Filter by tag IDs. Will search for keys that have all of the specified tags */ tag_ids?: Array; /** * Order by field */ order_by?: 'not_translated' | 'created_at' | 'name' | 'not_reviewed' | 'translation_updated_at' | 'id'; /** * Order direction */ order_by_order?: 'asc' | 'desc'; /** * Use simple key response, if this is set to true, the response will contain only the id and key fields */ simple?: boolean; /** * If this is omitted or empty, no translations will be returned, otherwise the translations for the key will be included in the response. */ include_translations_for_languages?: Array; /** * Pagination: Page number */ page: number; /** * Pagination: Number of items per page */ page_size: number; }): CancelablePromise<{ metadata: { fetched_at: string; total_count: number; total_pages: number; current_page: number; page_size: number; }; data: Array<{ /** * The unique identifier of the key */ id: string; /** * The code of the key, eg. headers.welcome */ code: string; /** * The detailed data of the key, included if simple-flag on the request is not set */ detailed_data: { /** * Explained context or usage of the key */ context: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Ids of screenshots associated with the key */ screenshot_ids: Array; /** * Email of the user who created the key */ created_by: string; /** * When the key was created */ created_at: string; /** * When the key was last updated */ updated_at: string; /** * When any of the translation values connected to this key was last updated */ translation_value_updated_at: string; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals: boolean; /** * Whether max length is used for the key */ use_max_length: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations associated with the key. Note that this is only included if the simple flag is not set and if translations for languages are requested */ translations: Array<{ /** * The unique identifier of the translation */ language_code: string; /** * Whether the translation has been reviewed */ reviewed: boolean; /** * Number of resolved and unresolved comments for the translation */ comments: { resolved: number; unresolved: number; }; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * The locale of the translation */ locale: string; /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ translation: string; /** * When the translation was last updated */ updated_at?: string; /** * Email of the user who updated the translation */ updated_by?: string; }>; }>; }; }>; }>; /** * Get one key * @param projectId The unique identifier of the project. * @param codeId The unique identifier of the code/key. * @returns any Success * @throws ApiError */ getKey(projectId: string, codeId: string): CancelablePromise<{ /** * The unique identifier of the key */ id: string; /** * The code of the key, eg. headers.welcome */ code: string; /** * The detailed data of the key, included if simple-flag on the request is not set */ detailed_data: { /** * Explained context or usage of the key */ context: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Ids of screenshots associated with the key */ screenshot_ids: Array; /** * Email of the user who created the key */ created_by: string; /** * When the key was created */ created_at: string; /** * When the key was last updated */ updated_at: string; /** * When any of the translation values connected to this key was last updated */ translation_value_updated_at: string; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals: boolean; /** * Whether max length is used for the key */ use_max_length: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations associated with the key. Note that this is only included if the simple flag is not set and if translations for languages are requested */ translations: Array<{ /** * The unique identifier of the translation */ language_code: string; /** * Whether the translation has been reviewed */ reviewed: boolean; /** * Number of resolved and unresolved comments for the translation */ comments: { resolved: number; unresolved: number; }; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * The locale of the translation */ locale: string; /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ translation: string; /** * When the translation was last updated */ updated_at?: string; /** * Email of the user who updated the translation */ updated_by?: string; }>; }>; }; }>; /** * Update key * @param projectId The unique identifier of the project. * @param codeId The unique identifier of the code/key. * @param requestBody * @returns any Success * @throws ApiError */ updateKey(projectId: string, codeId: string, requestBody: { /** * The key, eg. headers.welcome */ code: string; /** * Explained context or usage of the key */ context: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals: boolean; /** * Whether max length is used for the key */ use_max_length: boolean; /** * The maximum length for translations of the key */ max_length?: number; }): CancelablePromise<{ /** * The unique identifier of the key */ id: string; /** * The code of the key, eg. headers.welcome */ code: string; /** * The detailed data of the key, included if simple-flag on the request is not set */ detailed_data: { /** * Explained context or usage of the key */ context: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Ids of screenshots associated with the key */ screenshot_ids: Array; /** * Email of the user who created the key */ created_by: string; /** * When the key was created */ created_at: string; /** * When the key was last updated */ updated_at: string; /** * When any of the translation values connected to this key was last updated */ translation_value_updated_at: string; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals: boolean; /** * Whether max length is used for the key */ use_max_length: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations associated with the key. Note that this is only included if the simple flag is not set and if translations for languages are requested */ translations: Array<{ /** * The unique identifier of the translation */ language_code: string; /** * Whether the translation has been reviewed */ reviewed: boolean; /** * Number of resolved and unresolved comments for the translation */ comments: { resolved: number; unresolved: number; }; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * The locale of the translation */ locale: string; /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ translation: string; /** * When the translation was last updated */ updated_at?: string; /** * Email of the user who updated the translation */ updated_by?: string; }>; }>; }; }>; /** * Delete key * @param projectId The unique identifier of the project. * @param codeId The unique identifier of the code/key. * @returns any Success * @throws ApiError */ deleteKey(projectId: string, codeId: string): CancelablePromise; /** * Create new key * @param projectId The unique identifier of the project. * @param requestBody * @returns any Success * @throws ApiError */ createKey(projectId: string, requestBody: { key: { /** * The code/key unique identifier */ code: string; /** * Explained context or usage of the key */ context?: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals?: boolean; /** * Whether max length is used for the key */ use_max_length?: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations for the key. Translations will be created for all the included locales and plural forms */ translations: Array<{ /** * The locale of the translation */ locale: string; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ value: string; }>; }>; /** * Optional namespace ID to add to the key */ namespace_id?: string; }; settings?: { /** * If true, AI will translate missing translations to all languages in the project after the upload is completed. */ ai_translate_to_all_missing_languages?: boolean; /** * If true, the server will overwrite existing translations with the same key by translations provided in the request. */ allow_overwrite?: boolean; /** * If true, no new keys will be created, only translations for existing keys will be updated. */ disable_create?: boolean; /** * If true, translations included in the upload will be marked as reviewed upon upload. */ source_select_as_reviewed?: boolean; }; }): CancelablePromise<{ /** * The unique identifier of the key */ id: string; /** * The code of the key, eg. headers.welcome */ code: string; /** * The detailed data of the key, included if simple-flag on the request is not set */ detailed_data: { /** * Explained context or usage of the key */ context: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Ids of screenshots associated with the key */ screenshot_ids: Array; /** * Email of the user who created the key */ created_by: string; /** * When the key was created */ created_at: string; /** * When the key was last updated */ updated_at: string; /** * When any of the translation values connected to this key was last updated */ translation_value_updated_at: string; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals: boolean; /** * Whether max length is used for the key */ use_max_length: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations associated with the key. Note that this is only included if the simple flag is not set and if translations for languages are requested */ translations: Array<{ /** * The unique identifier of the translation */ language_code: string; /** * Whether the translation has been reviewed */ reviewed: boolean; /** * Number of resolved and unresolved comments for the translation */ comments: { resolved: number; unresolved: number; }; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * The locale of the translation */ locale: string; /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ translation: string; /** * When the translation was last updated */ updated_at?: string; /** * Email of the user who updated the translation */ updated_by?: string; }>; }>; }; }>; /** * Create many new keys * Create many new keys in a single request. Will return an async event instead of the code * @param projectId The unique identifier of the project. * @param requestBody * @returns any Success * @throws ApiError */ createManyKeys(projectId: string, requestBody: { /** * List of keys to create */ keys: Array<{ /** * The code/key unique identifier */ code: string; /** * Explained context or usage of the key */ context?: string; /** * The IDs of tags associated with the key */ tag_ids: Array; /** * Whether the key allows plural forms. Plurals are used when a translation can have different forms based on quantity. Eg. one dog, 4 dogs */ allow_plurals?: boolean; /** * Whether max length is used for the key */ use_max_length?: boolean; /** * The maximum length for translations of the key */ max_length?: number; /** * The translations for the key. Translations will be created for all the included locales and plural forms */ translations: Array<{ /** * The locale of the translation */ locale: string; /** * The translation values for the translation, can be multiple if plural is used, or if multiple locales is used */ values: Array<{ /** * Plural form for the translation value. Note if not plural is used, default is 'other' */ plural_type: 'other' | 'zero' | 'one' | 'two' | 'few' | 'many'; /** * The translated text */ value: string; }>; }>; /** * Optional namespace ID to add to the key */ namespace_id?: string; }>; /** * Optional settings for the code creation request */ settings?: { /** * If true, AI will translate missing translations to all languages in the project after the upload is completed. */ ai_translate_to_all_missing_languages?: boolean; /** * If true, the server will overwrite existing translations with the same key by translations provided in the request. */ allow_overwrite?: boolean; /** * If true, no new keys will be created, only translations for existing keys will be updated. */ disable_create?: boolean; /** * If true, translations included in the upload will be marked as reviewed upon upload. */ source_select_as_reviewed?: boolean; }; }): CancelablePromise<{ /** * The unique identifier of the async task */ id: string; /** * The date and time when the async task was started */ started_at: string; /** * The number of completed events in the async task */ completed_events: number; /** * The total number of events in the async task that will complete */ total_events: number; /** * If the task failed, this will contain the error message */ error_msg?: string; /** * The date and time when the async task was completed */ completed_at?: string; /** * The current status of the async task */ status: 'pending' | 'running' | 'completed' | 'failed'; file_upload?: { /** * List of files that was successfully uploaded */ sucess_files: Array<{ /** * The name of the file that was uploaded */ file_name: string; /** * The language code associated with the file */ language_code: string; /** * The number of keys that was extracted from the file */ number_of_keys: number; }>; /** * List of files that failed to be uploaded */ failed_files: Array<{ file_name: string; reason: string; }>; /** * Statistics about the created keys */ created_keys: { /** * Ids if all the keys that was created */ all_created_key_ids: Array; all_updated_key_ids: Array; /** * Total number of translations that changed */ total_number_of_changed_translations: number; }; }; key_creation?: { /** * Statistics about the created keys */ created_keys: { /** * Ids if all the keys that was created */ all_created_key_ids: Array; all_updated_key_ids: Array; /** * Total number of translations that changed */ total_number_of_changed_translations: number; }; /** * List of keys that failed to be created */ failures: Array<{ code: string; reason: string; }>; }; preview_data_github_pull?: { /** * How many new keys were created */ number_of_new_keys: number; /** * The files involved in the pull */ files: Array<{ /** * The locale of the file */ locale: string; /** * Was the file found in the repository */ found: boolean; /** * How many translations was found in the file */ number_of_keys: number; /** * The name of the file */ file_name: string; }>; /** * Warnings that occurred during the pull */ warnings: Array; }; }>; } //# sourceMappingURL=KeysService.d.ts.map