@smartico/public-api 0.0.84 → 0.0.86
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.
- package/README.md +1 -1
- package/dist/MiniGames/SAWTemplateUI.d.ts +1 -0
- package/dist/SmarticoAPI.d.ts +1 -0
- package/dist/WSAPI/WSAPI.d.ts +3 -1
- package/dist/WSAPI/WSAPITypes.d.ts +5 -0
- package/dist/index.js +38 -18
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +10 -0
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +1 -0
- package/docs/classes/WSAPI.md +18 -0
- package/docs/interfaces/TGetTranslations.md +11 -0
- package/package.json +1 -1
- package/src/MiniGames/SAWTemplateUI.ts +1 -1
- package/src/SmarticoAPI.ts +4 -0
- package/src/WSAPI/WSAPI.ts +10 -1
- package/src/WSAPI/WSAPITypes.ts +4 -0
package/dist/index.modern.mjs
CHANGED
|
@@ -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
|
}
|