@localazy/api-client
Version:
Official Node.js client for the Localazy API, providing a simple and type-safe way to integrate localization features into your JavaScript and TypeScript projects.
1,194 lines (1,119 loc) • 50.5 kB
TypeScript
import { Blob as Blob_2 } from 'node:buffer';
import { Locales } from '@localazy/languages';
export declare abstract class ApiBase {
protected api: ApiClient;
constructor(api: ApiClient);
protected static getId(val: string | {
id: string;
}, prop: string): string;
}
export declare class ApiClient {
client: IHttpAdapter;
projects: ApiProjects;
import: ApiImport;
export: ApiExport;
formats: ApiFormats;
files: ApiFiles;
keys: ApiKeys;
glossary: ApiGlossary;
webhooks: ApiWebhooks;
screenshots: ApiScreenshots;
constructor(options: ApiClientOptions);
}
export declare type ApiClientOptions = {
authToken: string;
apiUrl?: string;
};
export declare class ApiExport extends ApiBase {
/**
* Export translated keys as JSON object.
*
* @param request Export JSON request config.
* @param config Request config.
*/
json(request: ExportJsonRequest, config?: RequestConfig): Promise<I18nJson>;
protected static mapLanguages(languages: `${Locales}`[], result: Key[][]): ("es_419" | "zh#Hans" | "aa" | "aa_DJ" | "aa_ET" | "ab" | "ab_GE" | "ace" | "ace_ID" | "ach" | "ach_UG" | "ada" | "ady" | "ady_RU" | "ae" | "aeb" | "aeb_TN" | "af" | "af_NA" | "af_ZA" | "agq" | "ain" | "ain#Latn" | "ak" | "ak_GH" | "akk" | "akz" | "ale" | "aln" | "aln_XK" | "alt" | "am" | "am_ET" | "an" | "ang" | "anp" | "ar" | "ar_AE" | "ar_BH" | "ar_DJ" | "ar_DZ" | "ar_EG" | "ar_EH" | "ar_ER" | "ar_IL" | "ar_IQ" | "ar_JO" | "ar_KM" | "ar_KW" | "ar_LB" | "ar_LY" | "ar_MA" | "ar_MR" | "ar_OM" | "ar_PS" | "ar_QA" | "ar_SA" | "ar_SD" | "ar_SO" | "ar_SY" | "cs" | "cs_CZ" | "ar_TD" | "ar_TN" | "ar_YE" | "ar_IR" | "ar_SS" | "ar_AE#Syrc" | "ar_BH#Syrc" | "ar_DJ#Syrc" | "ar_DZ#Syrc" | "ar_EG#Syrc" | "ar_EH#Syrc" | "ar_ER#Syrc" | "ar_IL#Syrc" | "ar_IQ#Syrc" | "ar_JO#Syrc" | "ar_KM#Syrc" | "ar_KW#Syrc" | "ar_LB#Syrc" | "ar_LY#Syrc" | "ar_MA#Syrc" | "ar_MR#Syrc" | "ar_OM#Syrc" | "ar_PS#Syrc" | "en" | "ar_QA#Syrc" | "ar_SA#Syrc" | "ar_SD#Syrc" | "ar_SO#Syrc" | "ar_SY#Syrc" | "ar_TD#Syrc" | "ar_TN#Syrc" | "ar_YE#Syrc" | "ar_IR#Syrc" | "ar_SS#Syrc" | "arc" | "arn" | "aro" | "arp" | "arq" | "arq_DZ" | "ars" | "arw" | "ary" | "ary_MA" | "arz" | "arz_EG" | "as" | "as_IN" | "asa" | "ast" | "ast_ES" | "av" | "av_RU" | "avk" | "awa" | "awa_IN" | "ay" | "ay_BO" | "az_AZ#Arab" | "az_IQ" | "az_IR" | "az_RU#Arab" | "az#Arab" | "az_AZ#Cyrl" | "az_IQ#Cyrl" | "az_IR#Cyrl" | "az_RU" | "az#Cyrl" | "az_IQ#Latn" | "az_IR#Latn" | "az_RU#Latn" | "az" | "ba" | "ba_RU" | "bal" | "bal_AF" | "bal_IR" | "bal_PK" | "bal_AF#Latn" | "bal_IR#Latn" | "bal_PK#Latn" | "ban" | "ban_ID" | "bar" | "bar_AT" | "bar_DE" | "bas" | "bax" | "bbc" | "bbc_ID" | "bbj" | "be" | "be_BY" | "bej" | "bej_SD" | "bem" | "bem_ZM" | "bew" | "bew_ID" | "bez" | "bfd" | "bfq" | "bg" | "bg_BG" | "bgn" | "bgn_PK" | "bho" | "bho_IN" | "bho_MU" | "bho_NP" | "bi" | "bi_VU" | "bik" | "bik_PH" | "bin" | "bin_NG" | "bjn" | "bjn_ID" | "bkm" | "bla" | "bm_ML" | "bm" | "bm_ML#Nkoo" | "bm#Nkoo" | "bn" | "bn_BD" | "bn_IN" | "bo" | "bo_CN" | "bpy" | "bqi" | "bqi_IR" | "br" | "bra" | "brh" | "brh_PK" | "brh_PK#Latn" | "brx" | "brx_IN" | "bs_BA#Cyrl" | "bs#Cyrl" | "bs" | "bss" | "bua" | "bug" | "bug_ID" | "bum" | "bum_CM" | "byn" | "byv" | "ca" | "ca_AD" | "ca_ES" | "cad" | "car" | "cay" | "cch" | "ccp#Beng" | "ccp" | "ce" | "ce_RU" | "ceb" | "ceb_PH" | "cgg" | "cgg_UG" | "ch" | "ch_GU" | "chk" | "chk_FM" | "chm" | "chn" | "cho" | "chp" | "chp#Cans" | "chr" | "chy" | "cic" | "ckb" | "ckb_IQ" | "ckb_IR" | "co" | "cop#Arab" | "cop#Grek" | "cps" | "cr" | "cr#Latn" | "crh" | "crs" | "crs_SC" | "cs_SK" | "csb" | "csb_PL" | "cu" | "cv" | "cv_RU" | "cy" | "cy_GB" | "da" | "da_DK" | "da_DE" | "dak" | "dar" | "dav" | "de" | "de_AT" | "de_BE" | "de_CH" | "de_DE" | "de_LI" | "de_LU" | "de_BR" | "de_CZ" | "de_DK" | "de_FR" | "de_GB" | "de_HU" | "de_KZ" | "de_NL" | "de_PL" | "de_SI" | "de_SK" | "de_US" | "del" | "den" | "den#Cans" | "dgr" | "din" | "dje" | "dje_NE" | "doi" | "doi_IN" | "dsb" | "dtp" | "dua" | "dum" | "dv" | "dv_MV" | "dyo" | "dyo_SN" | "dyo_SN#Arab" | "dyu" | "dyu_BF" | "dz" | "dz_BT" | "ebu" | "ee" | "ee_GH" | "ee_TG" | "efi" | "efi_NG" | "egl" | "egy" | "eka" | "el" | "el_CY" | "el_GR" | "en_AG" | "en_AI" | "en_AS" | "en_AU" | "en_BB" | "en_BI" | "en_BM" | "en_BS" | "en_BW" | "en_BZ" | "en_CA" | "en_CC" | "en_CK" | "en_CM" | "en_CX" | "en_DG" | "en_DM" | "en_ER" | "en_FJ" | "en_FK" | "en_FM" | "en_GB" | "en_GD" | "en_GG" | "en_GH" | "en_GI" | "en_GM" | "en_GU" | "en_GY" | "en_HK" | "en_IE" | "en_IM" | "en_IN" | "en_IO" | "en_JE" | "en_JM" | "en_KE" | "en_KI" | "en_KN" | "en_KY" | "en_LC" | "en_LR" | "en_LS" | "en_MG" | "en_MH" | "en_MP" | "en_MS" | "en_MT" | "en_MU" | "en_MW" | "en_NA" | "en_NF" | "en_NG" | "en_NR" | "en_NU" | "en_NZ" | "en_PG" | "en_PH" | "en_PK" | "en_PN" | "en_PR" | "en_PW" | "en_RW" | "en_SB" | "en_SC" | "en_SD" | "en_SG" | "en_SH" | "en_SL" | "en_SS" | "en_SX" | "en_SZ" | "en_TC" | "en_TK" | "en_TO" | "en_TT" | "en_TV" | "en_TZ" | "en_UG" | "en_UM" | "en_US" | "en_VC" | "en_VG" | "en_VI" | "en_VU" | "en_WS" | "en_ZA" | "en_ZM" | "en_ZW" | "en_AC" | "en_AE" | "en_AR" | "en_AT" | "en_BA" | "en_BD" | "en_BE" | "en_BG" | "en_BR" | "en_CH" | "en_CL" | "en_CY" | "en_CZ" | "en_DE" | "en_DK" | "en_DZ" | "en_EE" | "en_EG" | "en_ES" | "en_ET" | "en_FI" | "en_FR" | "en_GR" | "en_HR" | "en_HU" | "en_IL" | "en_IQ" | "en_IT" | "en_JO" | "en_KZ" | "en_LB" | "en_LK" | "en_LT" | "en_LU" | "en_LV" | "en_MA" | "en_MX" | "en_MY" | "en_NL" | "en_PL" | "en_PT" | "en_RO" | "en_SE" | "en_SI" | "en_SK" | "en_TA" | "en_TH" | "en_TR" | "en_YE" | "enm" | "eo" | "es" | "es_AR" | "es_BO" | "es_CL" | "es_CO" | "es_CR" | "es_CU" | "es_DO" | "es_EA" | "es_EC" | "es_ES" | "es_GQ" | "es_GT" | "es_HN" | "es_IC" | "es_MX" | "es_NI" | "es_PA" | "es_PE" | "es_PR" | "es_PY" | "es_SV" | "es_UY" | "es_VE" | "es_AD" | "es_BZ" | "es_DE" | "es_FR" | "es_GI" | "es_PH" | "es_PT" | "es_RO" | "es_US" | "esu" | "et" | "et_EE" | "eu" | "eu_ES" | "ewo" | "ext" | "fa" | "fa_AF" | "fa_IR" | "fa_PK" | "fan" | "fan_GQ" | "ff" | "ff_GN" | "ff_SN" | "fi" | "fi_FI" | "fi_EE" | "fi_SE" | "fil" | "fil_PH" | "fil_US" | "fit" | "fj" | "fj_FJ" | "fo" | "fo_FO" | "fon" | "fon_BJ" | "fr" | "fr_BE" | "fr_BF" | "fr_BI" | "fr_BJ" | "fr_BL" | "fr_CA" | "fr_CD" | "fr_CF" | "fr_CG" | "fr_CH" | "fr_CI" | "fr_CM" | "fr_DJ" | "fr_DZ" | "fr_FR" | "fr_GA" | "fr_GF" | "fr_GN" | "fr_GP" | "fr_GQ" | "fr_HT" | "fr_KM" | "fr_LU" | "fr_MA" | "fr_MC" | "fr_MF" | "fr_MG" | "fr_ML" | "fr_MQ" | "fr_MU" | "fr_NC" | "fr_NE" | "fr_PF" | "fr_PM" | "fr_RE" | "fr_RW" | "fr_SC" | "fr_SN" | "fr_SY" | "fr_TD" | "fr_TG" | "fr_TN" | "fr_VU" | "fr_WF" | "fr_YT" | "fr_DE" | "fr_GB" | "fr_IT" | "fr_NL" | "fr_PT" | "fr_RO" | "fr_TF" | "fr_US" | "frc" | "frm" | "fro" | "frp" | "frr" | "frs" | "fur" | "fy" | "fy_NL" | "ga" | "ga_IE" | "ga_GB" | "gaa" | "gaa_GH" | "gag" | "gag#Cyrl" | "gan" | "gan_CN" | "gay" | "gba" | "gbz" | "gd" | "gd_GB" | "gez" | "gil" | "gil_KI" | "gl" | "gl_ES" | "glk" | "glk_IR" | "gmh" | "gn" | "gn_PY" | "goh" | "gom" | "gom_IN" | "gon_IN#Deva" | "gon#Deva" | "gon_IN" | "gon" | "gor" | "gor_ID" | "got" | "grb" | "grc" | "gsw" | "gsw_CH" | "gsw_LI" | "gsw_DE" | "gu" | "gu_IN" | "guc" | "gur" | "guz" | "guz_KE" | "gv" | "gv_IM" | "gwi" | "ha_NE#Arab" | "ha_NG#Arab" | "ha#Arab" | "ha_NE" | "ha_NG" | "ha" | "hai" | "hak" | "hak_CN" | "haw" | "haw_US" | "he" | "he_IL" | "hi" | "hi_IN" | "hi_FJ" | "hi_ZA" | "hif_FJ#Deva" | "hif#Deva" | "hif_FJ" | "hif" | "hil" | "hil_PH" | "hit" | "hmn" | "ho" | "ho_PG" | "hr" | "hr_BA" | "hr_HR" | "hr_AT" | "hr_RS" | "hr_SI" | "hsb" | "hsn" | "hsn_CN" | "ht" | "ht_HT" | "hu" | "hu_HU" | "hu_AT" | "hu_RO" | "hu_RS" | "hup" | "hy" | "hy_AM" | "hy_RU" | "hz" | "ia" | "iba" | "ibb" | "ibb_NG" | "id" | "id_ID" | "id_ID#Arab" | "ig" | "ig_NG" | "ii" | "ii_CN" | "ii_CN#Latn" | "ik" | "ilo" | "ilo_PH" | "inh" | "inh_RU" | "inh_RU#Arab" | "inh_RU#Latn" | "is" | "is_IS" | "it" | "it_CH" | "it_IT" | "it_SM" | "it_VA" | "it_DE" | "it_FR" | "it_HR" | "it_MT" | "it_US" | "iu_CA" | "iu" | "iu_CA#Latn" | "iu#Latn" | "izh" | "ja" | "ja_JP" | "jam" | "jam_JM" | "jgo" | "jmc" | "jpr" | "jrb" | "jut" | "jv" | "jv_ID" | "jv_ID#Java" | "ka" | "ka_GE" | "kaa" | "kab" | "kab_DZ" | "kac" | "kaj" | "kam" | "kam_KE" | "kbd" | "kbd_RU" | "kcg" | "kde" | "kde_TZ" | "kea" | "kea_CV" | "kfo" | "kg" | "kg_CD" | "kgp" | "kha" | "kha_IN" | "kha_IN#Beng" | "khq" | "khw" | "ki" | "ki_KE" | "kiu" | "kj" | "kj_NA" | "kk_KZ#Arab" | "kk_CN" | "kk#Arab" | "kk_KZ" | "kk_CN#Cyrl" | "kk" | "kkj" | "kl" | "kl_GL" | "kl_DK" | "kln" | "kln_KE" | "km" | "km_KH" | "kmb" | "kmb_AO" | "kn" | "kn_IN" | "ko" | "ko_KP" | "ko_KR" | "ko_CN" | "ko_US" | "koi" | "koi_RU" | "kok" | "kok_IN" | "kos" | "kpe" | "kr" | "krc" | "krc_RU" | "kri" | "kri_SL" | "krj" | "krl" | "kru" | "kru_IN" | "ks_IN" | "ks" | "ks_IN#Deva" | "ks#Deva" | "ksb" | "ksf" | "ksh" | "ku_SY" | "ku_TR#Arab" | "ku#Arab" | "ku_SY#Cyrl" | "ku_TR#Cyrl" | "ku#Cyrl" | "ku_SY#Latn" | "ku_TR" | "ku" | "kum" | "kum_RU" | "kut" | "kv" | "kv_RU" | "kw" | "ky_KG#Arab" | "ky#Arab" | "ky_KG" | "ky" | "ky_KG#Latn" | "ky#Latn" | "la" | "la_VA" | "lad" | "lag" | "lah" | "lah_PK" | "lam" | "lb" | "lb_LU" | "lez" | "lez_RU" | "lfn#Cyrl" | "lfn" | "lg" | "lg_UG" | "li" | "lij" | "liv" | "lkt" | "lmo" | "ln" | "ln_CD" | "lo" | "lo_LA" | "lol" | "loz" | "lrc" | "lrc_IR" | "lt" | "lt_LT" | "lt_PL" | "ltg" | "lu" | "lu_CD" | "lua" | "lua_CD" | "lui" | "lun" | "luo" | "luo_KE" | "lus" | "luy" | "luy_KE" | "lv" | "lv_LV" | "lzh" | "lzz#Geor" | "lzz" | "mad" | "mad_ID" | "maf" | "mag" | "mag_IN" | "mai" | "mai_IN" | "mai_NP" | "mak" | "mak_ID" | "man_GM" | "man_GN#Latn" | "man" | "man_GM#Nkoo" | "man_GN" | "man#Nkoo" | "mas" | "mdf" | "mdf_RU" | "mdr" | "men" | "men_SL" | "mer" | "mer_KE" | "mfe" | "mfe_MU" | "mg" | "mg_MG" | "mgh" | "mgh_MZ" | "mgo" | "mh" | "mh_MH" | "mi" | "mi_NZ" | "mic" | "min" | "min_ID" | "mk" | "mk_MK" | "ml" | "ml_IN" | "mn" | "mn_MN" | "mn_CN" | "mnc" | "mni" | "mni_IN" | "mni_IN#Mtei" | "moh" | "mos" | "mos_BF" | "mr" | "mr_IN" | "mrj" | "ms_BN#Arab" | "ms_MY#Arab" | "ms_SG#Arab" | "ms_CC" | "ms_ID" | "ms#Arab" | "ms_BN" | "ms_MY" | "ms_SG" | "ms_CC#Latn" | "ms_ID#Latn" | "ms" | "mt" | "mt_MT" | "mua" | "mus" | "mwl" | "mwr" | "mwr_IN" | "mwv" | "my" | "my_MM" | "myv" | "myv_RU" | "mzn" | "mzn_IR" | "na" | "na_NR" | "nan" | "nan_CN" | "nap" | "naq" | "nb" | "nb_NO" | "nb_SJ" | "nd" | "nd_ZW" | "nds" | "nds_DE" | "nds_NL" | "ne" | "ne_NP" | "ne_IN" | "new" | "ng" | "ng_NA" | "nia" | "niu" | "niu_NU" | "njo" | "nl" | "nl_AW" | "nl_BE" | "nl_BQ" | "nl_CW" | "nl_NL" | "nl_SR" | "nl_SX" | "nl_DE" | "nmg" | "nn" | "nn_NO" | "nnh" | "nog" | "non" | "nov" | "nqo" | "nr" | "nr_ZA" | "nso" | "nso_ZA" | "nus" | "nv" | "ny" | "ny_MW" | "ny_ZM" | "nym" | "nym_TZ" | "nyn" | "nyn_UG" | "nyo" | "nzi" | "oc" | "oc_FR" | "oj" | "oj#Latn" | "om" | "om_ET" | "om_ET#Ethi" | "or" | "or_IN" | "os" | "os_GE" | "osa" | "osa#Latn" | "pa_IN#Arab" | "pa#Arab" | "pa_PK#Guru" | "pa" | "pag" | "pag_PH" | "pal" | "pam" | "pam_PH" | "pap" | "pap_AW" | "pap_CW" | "pap_BQ" | "pau" | "pau_PW" | "pcd" | "pcm" | "pcm_NG" | "pdc" | "pdt" | "peo" | "pfl" | "phn" | "pi" | "pi#Sinh" | "pi#Thai" | "pl" | "pl_PL" | "pl_UA" | "pms" | "pnt#Cyrl" | "pnt" | "pnt#Latn" | "pon" | "pon_FM" | "prg" | "pro" | "ps" | "ps_AF" | "ps_PK" | "pt" | "pt_AO" | "pt_BR" | "pt_CV" | "pt_GQ" | "pt_GW" | "pt_MO" | "pt_MZ" | "pt_PT" | "pt_ST" | "pt_TL" | "qu" | "qu_BO" | "qu_EC" | "qu_PE" | "quc" | "quc_GT" | "qug" | "raj" | "raj_IN" | "rap" | "rar" | "rgn" | "rif_MA#Latn" | "rif#Latn" | "rif_MA" | "rif" | "rm" | "rm_CH" | "rn" | "rn_BI" | "ro" | "ro_MD" | "ro_RO" | "ro_RS" | "ro_MD#Cyrl" | "ro_RO#Cyrl" | "ro_RS#Cyrl" | "rof" | "rom" | "rom#Cyrl" | "rtm" | "ru" | "ru_BY" | "ru_KG" | "ru_KZ" | "ru_RU" | "ru_UA" | "ru_BG" | "ru_DE" | "ru_EE" | "ru_LT" | "ru_LV" | "ru_PL" | "ru_SJ" | "ru_TJ" | "ru_UZ" | "rue" | "rug" | "rup" | "rw" | "rw_RW" | "rwk" | "sa_IN" | "sa" | "sa_IN#Sinh" | "sa#Sinh" | "sad" | "sah" | "sah_RU" | "sam" | "saq" | "sas" | "sas_ID" | "sat" | "sat_IN" | "sat_IN#Beng" | "sat_IN#Deva" | "sat_IN#Olck" | "sat_IN#Orya" | "saz" | "sbp" | "sc" | "sc_IT" | "scn" | "sco" | "sco_GB" | "sd_IN#Arab" | "sd_PK" | "sd" | "sd_IN" | "sd_PK#Deva" | "sd#Deva" | "sd_IN#Sind" | "sd_PK#Sind" | "sd#Sind" | "sdc" | "sdh" | "sdh_IR" | "se" | "se_NO" | "se_NO#Cyrl" | "see" | "seh" | "seh_MZ" | "sei" | "sel" | "ses" | "sg" | "sg_CF" | "sga" | "sgs" | "shi_MA#Arab" | "shi#Arab" | "shi_MA#Latn" | "shi#Latn" | "shi" | "shn" | "shn_MM" | "si" | "si_LK" | "sid" | "sid_ET" | "sk" | "sk_SK" | "sk_CZ" | "sk_RS" | "sl" | "sl_SI" | "sl_AT" | "sli" | "sly" | "sm" | "sm_AS" | "sm_WS" | "sma" | "smj" | "smn" | "sms" | "sn" | "sn_ZW" | "snk" | "snk_ML" | "so" | "so_SO" | "so_DJ" | "so_ET" | "so_SO#Arab" | "so_DJ#Arab" | "so_ET#Arab" | "sq" | "sq_AL" | "sq_XK" | "sq_MK" | "sq_RS" | "sr_ME#Cyrl" | "sr" | "sr_BA#Latn" | "sr_RS#Latn" | "sr_XK#Latn" | "sr#Latn" | "srn" | "srn_SR" | "srr" | "srr_SN" | "ss" | "ss_SZ" | "ss_ZA" | "ssy" | "st" | "st_LS" | "st_ZA" | "stq" | "su" | "su_ID" | "su_ID#Sund" | "suk" | "suk_TZ" | "sus" | "sus_GN" | "sus_GN#Arab" | "sv" | "sv_AX" | "sv_FI" | "sv_SE" | "sw" | "sw_KE" | "sw_TZ" | "sw_UG" | "sw_CD" | "swb" | "swb_YT" | "swb_YT#Latn" | "syr" | "szl" | "ta" | "ta_LK" | "ta_SG" | "ta_IN" | "ta_MY" | "tcy" | "tcy_IN" | "te" | "te_IN" | "tem" | "tem_SL" | "teo" | "teo_UG" | "ter" | "tet" | "tet_TL" | "tg_TJ#Arab" | "tg#Arab" | "tg_TJ" | "tg" | "tg_TJ#Latn" | "tg#Latn" | "th" | "th_TH" | "ti" | "ti_ER" | "ti_ET" | "tig" | "tig_ER" | "tiv" | "tiv_NG" | "tk_TM#Arab" | "tk_AF#Arab" | "tk_IR#Arab" | "tk#Arab" | "tk_TM#Cyrl" | "tk_AF#Cyrl" | "tk_IR#Cyrl" | "tk#Cyrl" | "tk_TM" | "tk_AF" | "tk_IR" | "tk" | "tkl" | "tkl_TK" | "tkr#Cyrl" | "tkr" | "tli" | "tly#Arab" | "tly#Cyrl" | "tly" | "tmh" | "tmh_NE" | "tn" | "tn_BW" | "tn_ZA" | "to" | "to_TO" | "tog" | "tpi" | "tpi_PG" | "tr" | "tr_CY" | "tr_TR" | "tr_DE" | "tr_CY#Arab" | "tr_TR#Arab" | "tr_DE#Arab" | "tru" | "tru#Syrc" | "trv" | "ts" | "ts_MZ" | "ts_ZA" | "tsd" | "tsi" | "tt" | "tt_RU" | "ttt#Cyrl" | "ttt" | "ttt#Arab" | "tum" | "tum_MW" | "tvl" | "tvl_TV" | "twq" | "ty" | "ty_PF" | "tyv" | "tyv_RU" | "tzm_MA" | "tzm" | "tzm_MA#Tfng" | "tzm#Tfng" | "udm" | "udm_RU" | "udm_RU#Latn" | "ug_CN" | "ug" | "ug_CN#Cyrl" | "ug#Cyrl" | "ug_CN#Latn" | "ug#Latn" | "uga" | "uk" | "uk_UA" | "uk_RS" | "umb" | "umb_AO" | "ur" | "ur_PK" | "ur_IN" | "uz_UZ#Arab" | "uz#Arab" | "uz_UZ#Cyrl" | "uz_AF#Cyrl" | "uz#Cyrl" | "uz_AF#Latn" | "uz" | "vai#Latn" | "vai" | "ve" | "ve_ZA" | "vec" | "vep" | "vi" | "vi_VN" | "vi_US" | "vls" | "vls_BE" | "vmf" | "vmf_DE" | "vo" | "vot" | "vro" | "vun" | "wa" | "wae" | "wal" | "wal_ET" | "war" | "war_PH" | "was" | "wbp" | "wo" | "wo_SN" | "wo_SN#Arab" | "wuu" | "wuu_CN" | "xal" | "xh" | "xh_ZA" | "xmf" | "xog" | "xog_UG" | "yao" | "yap" | "yav" | "ybb" | "yi" | "yo" | "yo_NG" | "yrl" | "yue_HK#Hans" | "yue#Hans" | "yue_CN#Hant" | "yue" | "za" | "za_CN" | "za_CN#Hans" | "zap" | "zea" | "zen" | "zgh" | "zgh_MA" | "zh_HK#Hans" | "zh_MO#Hans" | "zh_TW#Hans" | "zh_ID#Hans" | "zh_MY#Hans" | "zh_TH#Hans" | "zh_US#Hans" | "zh_VN#Hans" | "zh_CN#Hant" | "zh_SG#Hant" | "zh_ID" | "zh_MY" | "zh_TH" | "zh_US" | "zh_VN" | "zu" | "zu_ZA" | "zun" | "zza" | "zza_TR" | "az_AZ#Latn" | "bs_BA#Latn" | "pa_IN#Guru" | "pa_PK#Arab" | "shi_MA#Tfng" | "sr_BA#Cyrl" | "sr_ME#Latn" | "sr_RS#Cyrl" | "sr_XK#Cyrl" | "uz_AF#Arab" | "uz_UZ#Latn" | "yue_CN#Hans" | "yue_HK#Hant" | "zh_CN#Hans" | "zh_HK#Hant" | "zh_MO#Hant" | "zh_SG#Hans" | "zh_TW#Hant" | "zh#Hant" | "ar_001" | "en_001" | "yi_001" | "en_150" | "se_SE" | "en_AD" | "en_MM" | "xxa" | "xxb" | "xxc" | "xxd" | "xxe" | "xxf" | "xxg" | Json)[][];
protected static mapResult(keysList: Key[]): Json;
}
export declare class ApiFiles extends ApiBase {
/**
* List all {@link File files} in the project.
*
* @param request Files list request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/files#list-files-in-project Localazy API Docs}
*/
list(request: FilesListRequest, config?: RequestConfig): Promise<File_2[]>;
/**
* First {@link File file} in the project.
*
* @param request Files list request config.
* @param config Request config.
* @throws Error At least one file must exist, otherwise an error is thrown.
*
* @see {@link https://localazy.com/docs/api/files#list-files-in-project Localazy API Docs}
*/
first(request: FilesListRequest, config?: RequestConfig): Promise<File_2>;
/**
* List all {@link Key keys} for the language in the {@link File file}.
*
* @param request File list keys request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/files#retrieve-a-list-of-keys-and-translations-from-file
* | Localazy API Docs}
*/
listKeys(request: FileListKeysRequest, config?: RequestConfig): Promise<Key[]>;
/**
* List all {@link Key keys} for the language in the {@link File file}. Result is paginated.
*
* @param request File list keys request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/files#retrieve-a-list-of-keys-and-translations-from-file
* | Localazy API Docs}
*/
listKeysPage(request: FileListKeysRequest, config?: RequestConfig): Promise<KeysPaginated>;
/**
* Get the contents of the {@link File file}.
*
* @param request File get contents request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/files#list-file-content Localazy API Docs}
*/
getContents(request: FileGetContentsRequest, config?: RequestConfig): Promise<Blob_2>;
}
export declare class ApiFormats extends ApiBase {
/**
* List all {@link Format formats} and related options.
*
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/import#list-available-file-types Localazy API Docs}
*/
list(config?: RequestConfig): Promise<Format[]>;
}
export declare class ApiGlossary extends ApiBase {
/**
* List all {@link GlossaryRecord glossary records} in the project.
*
* @param request Glossary records list request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/glossary#list-all-glossary-terms Localazy API Docs}
*/
list(request: GlossaryListRequest, config?: RequestConfig): Promise<GlossaryRecord[]>;
/**
* Find {@link GlossaryRecord glossary record} specified by `id`.
*
* @param request Glossary record find request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/glossary#get-glossary-term Localazy API Docs}
*/
find(request: GlossaryFindRequest, config?: RequestConfig): Promise<GlossaryRecord>;
/**
* Create {@link GlossaryRecord glossary record}.
* There is a limit of 1000 glossary records per project.
*
* @param request Glossary record create request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/glossary#create-new-glossary-term Localazy API Docs}
*/
create(request: GlossaryCreateRequest, config?: RequestConfig): Promise<string>;
/**
* Update {@link GlossaryRecord glossary record} specified by `id`.
*
* @param request Glossary record update request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/glossary#update-glossary-term Localazy API Docs}
*/
update(request: GlossaryUpdateRequest, config?: RequestConfig): Promise<void>;
/**
* Delete {@link GlossaryRecord glossary record} specified by `id`.
*
* @param request Glossary record delete request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/glossary#delete-glossary-term Localazy API Docs}
*/
delete(request: GlossaryDeleteRequest, config?: RequestConfig): Promise<void>;
}
export declare class ApiImport extends ApiBase {
/**
* Import source keys from JSON object.
*
* @param request Import JSON request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/import#import-content-to-a-project Localazy API Docs}
*/
json(request: ImportJsonRequest, config?: RequestConfig): Promise<ReturnType<ApiImport['getImportedFile']>>;
/**
* Get progress of the import session.
*
* @param request Import session progress request.
* @param config Request config.
*
* Not available in the Localazy API Docs yet.
*/
getProgress(request: ImportProgressRequest, config?: RequestConfig): Promise<UploadSessionStatus>;
protected getImportedFile(project: string | Project, data: ImportData, importBatch: string): Promise<File_2 & {
importBatch: string;
}>;
}
export declare class ApiKeys extends ApiBase {
/**
* Update {@link Key key}.
*
* @param request Key update request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/source-keys#update-source-key Localazy API Docs}
*/
update(request: KeyUpdateRequest, config?: RequestConfig): Promise<void>;
/**
* Delete {@link Key key}.
*
* @param request Key delete request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/source-keys#delete-source-key Localazy API Docs}
*/
delete(request: KeyDeleteRequest, config?: RequestConfig): Promise<void>;
/**
* Deprecate keys.
*
* @param request Key deprecate request config.
* @param config Request config.
*/
deprecate(request: KeyDeprecateRequest, config?: RequestConfig): Promise<void>;
}
export declare class ApiProjects extends ApiBase {
/**
* List all {@link Project projects}.
*
* @param request Projects list request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/projects#list-projects Localazy API Docs}
*/
list(request?: ProjectsListRequest, config?: RequestConfig): Promise<Project[]>;
/**
* First {@link Project project}.
*
* @param request Projects list request config.
* @param config Request config.
* @throws Error At least one project must exist, otherwise an error is thrown.
*
* @see {@link https://localazy.com/docs/api/projects#list-projects Localazy API Docs}
*/
first(request?: ProjectsListRequest, config?: RequestConfig): Promise<Project>;
}
export declare class ApiScreenshots extends ApiBase {
/**
* List all {@link Screenshot screenshots} in the project.
*
* @param request Screenshots list request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/screenshot-management#list-screenshots Localazy API Docs}
*/
list(request: ScreenshotsListRequest, config?: RequestConfig): Promise<Screenshot[]>;
/**
* List all {@link ScreenshotTag screenshots tags} in the project.
*
* @param request Screenshots list tags request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/screenshot-management#list-screenshots-tags Localazy API Docs}
*/
listTags(request: ScreenshotsListTagsRequest, config?: RequestConfig): Promise<ScreenshotTag[]>;
/**
* Create {@link Screenshot screenshot}.
*
* @param request Screenshot create request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/screenshot-management#create-a-new-screenshot Localazy API Docs}
*/
create(request: ScreenshotCreateRequest, config?: RequestConfig): Promise<string>;
/**
* Update the image data of {@link Screenshot screenshot}.
*
* @param request Screenshot update image data request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/screenshot-management#update-the-image-of-an-existing-screenshot
* | Localazy API Docs}
*/
updateImageData(request: ScreenshotUpdateImageDataRequest, config?: RequestConfig): Promise<void>;
/**
* Update {@link Screenshot screenshot}.
* Image data are updated with `screenshots.updateImageData`.
*
* @param request Screenshot update request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/screenshot-management#update-an-existing-screenshot Localazy API Docs}
*/
update(request: ScreenshotUpdateRequest, config?: RequestConfig): Promise<void>;
/**
* Delete {@link Screenshot screenshot}.
*
* @param request Screenshot delete request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/screenshot-management#delete-a-screenshot Localazy API Docs}
*/
delete(request: ScreenshotDeleteRequest, config?: RequestConfig): Promise<void>;
}
export declare class ApiWebhooks extends ApiBase {
/**
* List all {@link Webhook webhooks} in the project.
*
* @param request Webhooks list request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/webhooks-api#list-webhooks-configuration Localazy API Docs}
*/
list(request: WebhooksListRequest, config?: RequestConfig): Promise<Webhook[]>;
/**
* Update all {@link Webhook webhooks} in the project.
*
* @param request Webhooks update request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/webhooks-api#update-webhooks-configuration Localazy API Docs}
*/
update(request: WebhooksUpdateRequest, config?: RequestConfig): Promise<void>;
/**
* Get secret for {@link Webhook webhooks} in the project.
* Localazy signs the webhook events it sends to your endpoints and adds a signature in the request header
* {@link https://localazy.com/docs/api/webhooks-api#security}.
*
* @param request Webhooks get secret request config.
* @param config Request config.
*
* @see {@link https://localazy.com/docs/api/webhooks-api#webhook-secrets Localazy API Docs}
*/
getSecret(request: WebhooksGetSecretRequest, config?: RequestConfig): Promise<WebhooksSecret>;
}
export declare const delay: (ms?: number) => Promise<unknown>;
export declare type ExportJsonRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
file: File_2 | string;
langs: `${Locales}`[];
};
export declare class FetchHttpAdapter implements IHttpAdapter<RequestConfig> {
protected apiUrl: string;
protected authToken: string;
constructor(options: ApiClientOptions);
get(url: string, config?: RequestConfig): Promise<object | string | Blob>;
post(url: string, data: unknown, config?: RequestConfig): Promise<object | string | Blob>;
put(url: string, data: unknown, config?: RequestConfig): Promise<object | string | Blob>;
delete(url: string, config?: RequestConfig): Promise<object | string | Blob>;
protected urlFactory(url: string): string;
protected configFactory(method: string, config?: RequestConfig, data?: unknown): RequestInit;
protected makeRequest(method: string, url: string, config?: RequestConfig, data?: unknown): Promise<object | string | Blob>;
}
declare type File_2 = {
/**
* Unique identifier of the file.
*/
id: string;
/**
* Type of the file; please refer to file formats. Value complex is used for complex files described above.
*/
type: string;
/**
* Name of the file.
*/
name: string;
/**
* Stored path to the file. Optional and only available if provided.
*/
path?: string;
/**
* The module the file belongs to. Optional and only available if provided.
*/
module?: string;
/**
* A list of associated product flavors. Optional and only available if provided.
*/
productFlavors?: string;
/**
* A build type the file is associated with. Optional and only available if provided.
*/
buildType?: string;
};
export { File_2 as File }
export declare type FileGetContentsRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* File object or File ID.
*/
file: File_2 | string;
/**
* Locale code. See Locales enum with all available codes.
*/
lang: `${Locales}`;
};
export declare type FileListKeysRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* File object or File ID.
*/
file: File_2 | string;
/**
* Locale code. See Locales enum with all available codes.
*/
lang: `${Locales}`;
/**
* Returns also deprecated keys.
*/
deprecated?: boolean;
/**
* Number of keys to be returned in a single call (max 1000). Default 1000.
*/
limit?: number;
/**
* Used for paging long lists.
*/
next?: string;
/**
* Receive additional info such as translation note, whether it's hidden etc.
*/
extra_info?: boolean;
/**
* Receive also metadata for the key.
*/
metadata?: boolean;
};
export declare type FilesListRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
};
export declare type Format = {
type: string;
name: string;
supportStrings: boolean;
supportPlurals: boolean;
supportArrays: boolean;
supportStructuredKeys: boolean;
plurals?: FormatPluralMeta[];
arrays?: FormatArrayMeta[];
keyTransformers?: FormatKeyTransformerMeta[];
};
export declare type FormatArrayMeta = {
type: string;
name: string;
isDefault: boolean;
};
export declare type FormatKeyTransformerMeta = {
type: string;
name: string;
isDefault: boolean;
};
export declare type FormatPluralMeta = {
type: string;
name: string;
isDefault: boolean;
requiredParams?: FormatPluralMetaRequiredParam[];
};
export declare type FormatPluralMetaRequiredParam = {
type: string;
description: string;
};
export declare type GlossaryCreateRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Description of the glossary term.
*/
description: string;
/**
* Whether the term should be translated or left as is.
*/
translateTerm: boolean;
/**
* Wheter the term is case-sensitive or not.
*/
caseSensitive: boolean;
/**
* Contains an array of the term and it’s translations.
*/
term: GlossaryRecordTerm[];
};
export declare type GlossaryDeleteRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* GlossaryRecord object or GlossaryRecord ID.
*/
glossaryRecord: GlossaryRecord | string;
};
export declare type GlossaryFindRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* GlossaryRecord object or GlossaryRecord ID.
*/
glossaryRecord: GlossaryRecord | string;
};
export declare type GlossaryListRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
};
export declare type GlossaryRecord = {
/**
* GlossaryRecord ID.
*/
id: string;
/**
* Description of the glossary term.
*/
description: string;
/**
* Whether the term should be translated or left as is.
*/
translateTerm: boolean;
/**
* Wheter the term is case-sensitive or not.
*/
caseSensitive: boolean;
/**
* Contains an array of the term and it’s translations.
*/
term: GlossaryRecordTerm[];
};
export declare type GlossaryRecordTerm = {
/**
* Language code in which the term is used. Make sure to include source language.
*/
lang: `${Locales}`;
/**
* The value of the glossary term.
*/
term: string;
};
export declare type GlossaryUpdateRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* GlossaryRecord object or GlossaryRecord ID.
*/
glossaryRecord: GlossaryRecord | string;
/**
* Description of the glossary term.
*/
description: string;
/**
* Whether the term should be translated or left as is.
*/
translateTerm: boolean;
/**
* Wheter the term is case-sensitive or not.
*/
caseSensitive: boolean;
/**
* Contains an array of the term and it’s translations.
*/
term: GlossaryRecordTerm[];
};
export declare enum I18nDeprecate {
NONE = "none",
FILE = "file",
PROJECT = "project"
}
/**
* @example
* ```json
* {
* "en": {
* "headers": {
* "name": "Name"
* },
* "status": [
* "Published",
* "Draft"
* ],
* "tooltips.company": "Company"
* }
* }
* ```
*/
export declare type I18nJson = Partial<LocalesKeys> & Json;
export declare interface IHttpAdapter<T = object> {
get: (url: string, config?: T) => Promise<object | string | Blob>;
post: (url: string, data: unknown, config?: T) => Promise<object | string | Blob>;
put: (url: string, data: unknown, config?: T) => Promise<object | string | Blob>;
delete: (url: string, config?: T) => Promise<object | string | Blob>;
}
export declare type ImportContentOptions = {
/**
* The file type to be used for backing the strings. @see https://localazy.com/docs/api/import#response-1
* Default: 'api'
*/
type?: string;
/**
* Plural type to be used for encoding plurals in the output file. Available options depend on the type.
* @see [Formats](https://localazy.com/docs/api/import#retrieve-a-list-of-available-file-types)
*/
plural?: string;
/**
* Defines how to encode string arrays. Available options depend on the type
* @see [Formats](https://localazy.com/docs/api/import#retrieve-a-list-of-available-file-types)
*/
array?: string;
/**
* Defines how to transform structured keys for formats into plain string ones for a format that doesn't
* support structured keys. Available options depend on the type.
* @see [Formats](https://localazy.com/docs/api/import#retrieve-a-list-of-available-file-types)
*/
keyTransformer?: string;
/**
* Key-value map of additional parameters that may be necessary for array, plural and keyTransformer.
* @see [Formats](https://localazy.com/docs/api/import#retrieve-a-list-of-available-file-types)
*/
params?: Record<string, any>;
/**
* List of additional features for the given type. Available options depend on the type
* @see [Integration quick starts](https://localazy.com/docs/integrations)
*/
features?: string[];
};
export declare type ImportData = ImportI18nOptions & {
files: ImportDataFile[];
};
export declare const importDataFactory: (request: ImportJsonRequest, chunks: I18nJson[]) => ImportData;
export declare type ImportDataFile = ImportFileOptions & {
content: ImportContentOptions & I18nJson;
};
export declare type ImportFileOptions = {
/**
* The file name.
*
* Default: 'content.json'
*/
name?: string;
/**
* The path to the file without the file name.
*/
path?: string;
/**
* Optional module specification.
*/
module?: string;
/**
* Optional build type.
*/
buildType?: string;
/**
* Optional product flavors.
*/
productFlavors?: string[];
};
export declare type ImportI18nOptions = {
/**
* Import all translations to go through the review process.
* Useful when you are unsure about their quality and want to do an extra check.
* Default: false
*/
importAsNew?: boolean;
/**
* Import all translations and set them as the current version.
* By default, Localazy doesn't overwrite existing current translations and lets you decide through
* the review process.
* Default: false
*/
forceCurrent?: boolean;
/**
* Overwrite the source language translations even if there are existing human changes.
* This option is useful when the source of truth is not Localazy, and it's required to
* always synchronize the source language translations.
* Default: false
*/
forceSource?: boolean;
/**
* Do not import translations that are the same as the source language content.
* Default: true
*/
filterSource?: boolean;
/**
* Tell the server to deprecate any key missing in this upload batch
* Default: 'none'
*/
deprecate?: `${I18nDeprecate}`;
};
export declare type ImportJsonRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
json: I18nJson;
i18nOptions?: ImportI18nOptions;
fileOptions?: ImportFileOptions;
contentOptions?: ImportContentOptions;
};
export declare type ImportProgressRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Import session identifier.
*/
importBatch: string;
};
export declare type Json<K extends string | number | symbol = any, T = any> = Record<K, T | any>;
export declare class JsonUtils {
/**
* Physical limit is 100000.
*/
static readonly CHUNK_LIMIT: number;
static slice(json: I18nJson): I18nJson[];
/**
* Example input:
* const json = {
* en: {
* headers: {
* name: 'Name',
* user: 'User',
* },
* 'headers.company': 'Company',
* user: {
* role: ['Admin', 'Editor'],
* },
* },
* };
*
* Example result:
* const result = [
* { en: { headers: { name: 'Name' } } },
* { en: { headers: { user: 'User' } } },
* { en: { 'headers.company': 'Company' } },
* { en: { user: { role: ['Admin', 'Editor'] } } },
* ];
*/
protected static sliceByValue(json: Json, keys?: string[]): Json[];
protected static mergeChunkValues(values: Json[]): Json;
}
export declare type Key = {
/**
* Key ID.
*/
id: string;
/**
* Nested keys are stored as array entries. Simple keys are arrays containing single item.
*/
key: string[];
value: KeyValue;
/**
* Associated comment for translators.
* Only available when extra_info=true.
*/
comment?: string;
/**
* Information about the deprecation state of the key (-1 = not deprecated).
* Only available when extra_info=true.
*/
deprecated?: number;
/**
* Information about whether the key is marked as hidden or visible on Localazy.
* Only available when extra_info=true.
*/
hidden?: boolean;
/**
* Information about the character limit (-1 = no limit specified).
* Only available when extra_info=true.
*/
limit?: number;
};
export declare type KeyDeleteRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Key object or Key ID.
*/
key: Key | string;
};
export declare type KeyDeprecateRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* List of keys identifiers to deprecate.
*/
phrases: Key[] | Pick<Key, 'id'>[] | string[];
};
export declare type KeysPaginated = {
keys: Key[];
/**
* Next is the paging key. The field is not contained if there are no more pages.
*/
next?: string;
};
export declare type KeyUpdateRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Key object or Key ID.
*/
key: Key | string;
/**
* Set to 0 or greater to mark the key as deprecated in the corresponding version;
* set to -1 to mark the key as not deprecated.
*/
deprecated?: number;
/**
* Set to true to mark the key as hidden on Localazy.
*/
hidden?: boolean;
/**
* Provide custom comment for translators.
*/
comment?: string;
/**
* Change the character limit or set to -1 to disable it.
*/
limit?: number;
};
export declare type KeyValue = string | string[] | Record<string, any>;
export declare type Language = {
/**
* Internal identifier of the language on Localazy.
*/
id: number;
/**
* Locale code.
*/
code: string;
/**
* English name of the language / locale.
*/
name: string;
/**
* Number of active keys.
*/
active: number;
/**
* Number of keys waiting for review.
*/
review: number;
/**
* Number of keys with approved version/translation.
*/
current: number;
/**
* Number of keys that are already translated (but may not be approved yet).
*/
translated: number;
/**
* Number of keys in the source changed state.
*/
sourceChanged: number;
/**
* Number of keys in the need review state.
*/
needImprovement: number;
};
export { Locales }
export declare type LocalesKeys = Record<Locales, any>;
export declare type Organization = {
availableKeys: number;
usedKeys: number;
figma: boolean;
connectedApps: boolean;
releaseTags: boolean;
formatConversions: boolean;
screenshots: boolean;
screenshotsForFigma: boolean;
additionalMt: boolean;
mtPretranslate: boolean;
webhooks: boolean;
};
export declare type Project = {
/**
* Unique project identifier.
*/
id: string;
/**
* Identifier of the organization the project belongs to.
*/
orgId: string;
/**
* Project name.
*/
name: string;
/**
* Project slug.
*/
slug: string;
/**
* Full URL to the project image or empty string if there is no image available.
*/
image: string;
/**
* Full URL to the project on Localazy.
*/
url: string;
/**
* Project description.
*/
description: string;
/**
* Project type.
*/
type: `${ProjectType}`;
/**
* Project tone.
*/
tone: `${ProjectTone}`;
/**
* Role of the current user accessing API (based on the token).
*/
role: `${UserRole}`;
/**
* The identifier of the source language of the project.
*/
sourceLanguage: number;
/**
* List of enabled features and available source keys.
* Only available if the organization query parameter is set to true.
*/
organization: Organization;
/**
* List of all languages and their current state. Only available if the languages query parameter is set to true.
*/
languages: Language[];
};
export declare type ProjectsListRequest = {
/**
* Include the organization object in the output.
*/
organization?: boolean;
/**
* Include languages in the output.
*/
languages?: boolean;
};
export declare enum ProjectTone {
NOT_SPECIFIED = "not_specified",
FORMAL = "formal",
INFORMAL = "informal"
}
export declare enum ProjectType {
PUBLIC = "public",
PRIVATE = "private",
RESTRICTED = "restricted"
}
export declare type RequestConfig = {
headers?: Record<string, string>;
params?: Record<string, string>;
responseType?: 'json' | 'text' | 'blob';
};
export declare type Screenshot = {
id: string;
url: string;
comment: string;
phrases: ScreenshotPhrase[];
tags: ScreenshotTag[];
ocrData: string;
metadata: ScreenshotMetadata;
};
export declare type ScreenshotCreateRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Image in data format with base64 encoding: `data:image/jpeg;base64...`.
* JPEG or PNG images are supported.
* Must be larger or equal to 36x36.
* Must be smaller or equal to 4096x4096.
* Must be smaller than 5 MB.
*/
encodedData: string;
};
export declare type ScreenshotDeleteRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Screenshot object or Screenshot ID.
*/
screenshot: Screenshot | string;
};
export declare type ScreenshotMetadata = Record<string, string>;
export declare type ScreenshotPhrase = string;
export declare type ScreenshotsListRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
};
export declare type ScreenshotsListTagsRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
};
export declare type ScreenshotTag = string;
export declare type ScreenshotUpdateImageDataRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Screenshot object or Screenshot ID.
*/
screenshot: Screenshot | string;
/**
* Image in data format with base64 encoding: `data:image/jpeg;base64...`.
* JPEG or PNG images are supported.
* Must be larger or equal to 36x36.
* Must be smaller or equal to 4096x4096.
* Must be smaller than 5 MB.
*/
encodedData: string;
};
export declare type ScreenshotUpdateRequest = {
/**
* Project object or Project ID.
*/
project: Project | string;
/**
* Screenshot object or Screenshot ID.
*/
screenshot: Screenshot | string;
/**
* Custom comment for the screenshot
*/
comment?: string;
/**
* Add or remove tags. Adding has priority over removing. Cannot be used together with tags.
*/
addTags?: ScreenshotTag[];
removeTags?: ScreenshotTag[];
/**
* Replace tags with the current value. Cannot be used together with addTags and/or removeTags.
*/
tags?: ScreenshotTag[];
/**
* Add or remove linked phrases. Adding has priority over removing. Cannot be used together with phrases.
*/
addPhrases?: ScreenshotPhrase[];
removePhrases?: ScreenshotPhrase[];
/**
* Replace linked phrases with the current value. Cannot be used together with addPhrases and/or removePhrases.
*/
phrases?: ScreenshotPhrase[];
/**
* Add or remove metadata. Adding has priority over removing. Cannot be used together with metadata.
*/
addMetadata?: ScreenshotMetadata;
removeMetadata?: string[];
/**
* Replace metadata with the current value. Cannot be used together with addMetadata and/or removeMetadata.
*/
metadata?: ScreenshotMetadata;
};
export declare type UploadSessionStatus = {
/**
* Possible status of the upload session.
*/
status: UploadStatus;
/**
* Number of keys added in the upload session.
*/
added?: number;
/**
* Number of keys updated in the upload session.
*/
updated?: number;
/**
* Number of keys deprecated in the upload session.
*/
deprecated?: number;
};
export declare enum UploadStatus {
NOT_FOUND = "not_found",
SCHEDULED = "scheduled",
IN_PROGRESS = "in_progress",
DONE = "done",
INVALID_ID = "invalid_id",
ERROR = "error"
}
export declare enum UserRole {
NONE = "none",
TRANSLATOR = "translator",
TRUSTED_TRANSLATOR = "trusted_translator",
REVIEWER = "reviewer",
MANAGER = "manager",
OWNER = "owner",
DEVELOPER = "developer"
}
export declare type Webhook = {
/**
* Whether the webhook is enabled or disabled.
*/
enabled: boolean;
/**
* Custom ID that is passed when the webhook is invoked. Empty by default.
*/
customId?: string;
/**
* Description of the webhook. Empty by default.
*/
description?: string;
/**
* URL which is invoked on the webhook event.
*/
url: string;
/**
* The list of event types for which this webhook is invoked.
*/
events: `${WebhookEvent}`[];
};
export declare enum WebhookEvent {
PROJECT_PUBLISHED = "project_published",
IMPORT_FINISHED = "import_finished",
IMPORT_FINISHED_EMPTY = "import_finished_empty",
COMMENT_ADDED = "comment_added",
TAG_PROMOTED = "tag_promoted"
}
export declare type WebhooksGetSecretRequest = {
/**
* Project object or Projec