@smartico/public-api 0.0.83 → 0.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -551,7 +551,7 @@ const UserAchievementTransform = items => {
551
551
  return items.filter(r => r.ach_id >= 1).map(r => ({
552
552
  id: r.ach_id,
553
553
  name: r.ach_public_meta.name,
554
- desription: r.ach_public_meta.description,
554
+ description: r.ach_public_meta.description,
555
555
  unlock_mission_description: r.ach_public_meta.unlock_mission_description,
556
556
  image: r.ach_public_meta.image_url,
557
557
  is_completed: r.isCompleted,
@@ -940,6 +940,13 @@ class WSAPI {
940
940
  };
941
941
  return o;
942
942
  }
943
+ /** Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office. */
944
+ async getTranslations(lang_code) {
945
+ const r = await this.api.getTranslationsT(null, lang_code, []);
946
+ return {
947
+ translations: r.translations
948
+ };
949
+ }
943
950
  async updateOnSpin(data) {
944
951
  const templates = await OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(null), CACHE_DATA_SEC);
945
952
  const index = templates.findIndex(t => t.id === data.saw_template_id);
@@ -1362,6 +1369,9 @@ class SmarticoAPI {
1362
1369
  async levelsGetT(user_ext_id) {
1363
1370
  return GetLevelMapResponseTransform(await this.levelsGet(user_ext_id));
1364
1371
  }
1372
+ async getTranslationsT(user_ext_id, lang_code, areas, cacheSec = 60) {
1373
+ return await this.coreGetTranslations(user_ext_id, lang_code, areas, 30);
1374
+ }
1365
1375
  getWSCalls() {
1366
1376
  return new WSAPI(this);
1367
1377
  }