@como/como-client 0.7.93 → 0.7.94

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.
Files changed (3) hide show
  1. package/lib/como.js +397 -344
  2. package/package.json +1 -1
  3. package/src/como.js +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@como/como-client",
3
- "version": "0.7.93",
3
+ "version": "0.7.94",
4
4
  "description": "Client module for Como's loaylty API",
5
5
  "main": "src/como.js",
6
6
  "scripts": {
package/src/como.js CHANGED
@@ -303,6 +303,23 @@ class Como {
303
303
  }
304
304
  }
305
305
 
306
+ /**
307
+ * @param {string} language language code
308
+ */
309
+ async updateLanguage(language) {
310
+ const { api } = this.comoData;
311
+ try {
312
+ const data = await api.updateLanguage(language);
313
+ return data;
314
+ } catch (error) {
315
+ if (error.response && error.response.data) {
316
+ const { code, message } = error.response.data;
317
+ throw new Error(code || message);
318
+ }
319
+ throw error;
320
+ }
321
+ }
322
+
306
323
  /**
307
324
  *
308
325
  * @param {string} unsubscribeSms unsubscribe user at location