@carbon/ibmdotcom-services 1.18.0-rc.1 → 1.18.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,44 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.18.1](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/ibmdotcom-services@1.18.1-rc.1...@carbon/ibmdotcom-services@1.18.1) (2021-04-27)
7
+
8
+ **Note:** Version bump only for package @carbon/ibmdotcom-services
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.18.1-rc.1](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/ibmdotcom-services@1.18.1-rc.0...@carbon/ibmdotcom-services@1.18.1-rc.1) (2021-04-26)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **locale:** return locale with the fetch list call ([#5899](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/5899)) ([ff11ca5](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/commit/ff11ca5)), closes [#5890](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/5890)
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.18.1-rc.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/ibmdotcom-services@1.18.0...@carbon/ibmdotcom-services@1.18.1-rc.0) (2021-04-22)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **dependencies:** changed @carbon/telemetry to be a dependency ([#5871](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/5871)) ([5a1e23b](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/commit/5a1e23b)), closes [#5867](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/issues/5867)
31
+
32
+
33
+
34
+
35
+
36
+ # [1.18.0](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/ibmdotcom-services@1.18.0-rc.1...@carbon/ibmdotcom-services@1.18.0) (2021-04-21)
37
+
38
+ **Note:** Version bump only for package @carbon/ibmdotcom-services
39
+
40
+
41
+
42
+
43
+
6
44
  # [1.18.0-rc.1](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/compare/@carbon/ibmdotcom-services@1.18.0-rc.0...@carbon/ibmdotcom-services@1.18.0-rc.1) (2021-04-20)
7
45
 
8
46
 
@@ -202,7 +202,7 @@ var LocaleAPI = /*#__PURE__*/function () {
202
202
  key: "getLocale",
203
203
  value: function () {
204
204
  var _getLocale = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
205
- var cookie, lang, cc, _lang, lc, list, verifiedCodes;
205
+ var cookie, lang, list, cc, _lang, lc, _list, verifiedCodes;
206
206
 
207
207
  return _regeneratorRuntime.wrap(function _callee$(_context) {
208
208
  while (1) {
@@ -216,7 +216,7 @@ var LocaleAPI = /*#__PURE__*/function () {
216
216
  lang = _context.sent;
217
217
 
218
218
  if (!lang) {
219
- _context.next = 10;
219
+ _context.next = 11;
220
220
  break;
221
221
  }
222
222
 
@@ -224,25 +224,26 @@ var LocaleAPI = /*#__PURE__*/function () {
224
224
  return this.getList(lang);
225
225
 
226
226
  case 7:
227
- return _context.abrupt("return", lang);
227
+ list = _context.sent;
228
+ return _context.abrupt("return", list.locale);
228
229
 
229
- case 10:
230
+ case 11:
230
231
  if (!(cookie && cookie.cc && cookie.lc)) {
231
- _context.next = 16;
232
+ _context.next = 17;
232
233
  break;
233
234
  }
234
235
 
235
- _context.next = 13;
236
+ _context.next = 14;
236
237
  return this.getList(cookie);
237
238
 
238
- case 13:
239
+ case 14:
239
240
  return _context.abrupt("return", cookie);
240
241
 
241
- case 16:
242
- _context.next = 18;
242
+ case 17:
243
+ _context.next = 19;
243
244
  return geolocation();
244
245
 
245
- case 18:
246
+ case 19:
246
247
  cc = _context.sent;
247
248
 
248
249
  /**
@@ -253,24 +254,24 @@ var LocaleAPI = /*#__PURE__*/function () {
253
254
  lc = _lang.split('-')[0];
254
255
 
255
256
  if (!(cc && lc)) {
256
- _context.next = 28;
257
+ _context.next = 29;
257
258
  break;
258
259
  }
259
260
 
260
- _context.next = 24;
261
+ _context.next = 25;
261
262
  return this.getList({
262
263
  cc: cc,
263
264
  lc: lc
264
265
  });
265
266
 
266
- case 24:
267
- list = _context.sent;
268
- verifiedCodes = this.verifyLocale(cc, lc, list); // set the ipcInfo cookie
267
+ case 25:
268
+ _list = _context.sent;
269
+ verifiedCodes = this.verifyLocale(cc, lc, _list); // set the ipcInfo cookie
269
270
 
270
271
  ipcinfoCookie.set(verifiedCodes);
271
272
  return _context.abrupt("return", verifiedCodes);
272
273
 
273
- case 28:
274
+ case 29:
274
275
  case "end":
275
276
  return _context.stop();
276
277
  }
@@ -401,7 +402,7 @@ var LocaleAPI = /*#__PURE__*/function () {
401
402
  }()
402
403
  /**
403
404
  * Get the country list of all supported countries and their languages
404
- * if not set in session storage
405
+ * if it is not already stored in session storage
405
406
  *
406
407
  * @param {object} params params object
407
408
  * @param {string} params.cc country code
@@ -475,6 +476,10 @@ var LocaleAPI = /*#__PURE__*/function () {
475
476
  _requestsList[key] = axios.get(url, _axiosConfig).then(function (response) {
476
477
  var data = response.data;
477
478
  data['timestamp'] = Date.now();
479
+ data.locale = {
480
+ lc: lc,
481
+ cc: cc
482
+ };
478
483
  sessionStorage.setItem("".concat(_sessionListKey, "-").concat(cc, "-").concat(lc), JSON.stringify(data));
479
484
  return data;
480
485
  });
@@ -219,7 +219,7 @@ var LocaleAPI = /*#__PURE__*/function () {
219
219
  key: "getLocale",
220
220
  value: function () {
221
221
  var _getLocale = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
222
- var cookie, lang, cc, _lang, lc, list, verifiedCodes;
222
+ var cookie, lang, list, cc, _lang, lc, _list, verifiedCodes;
223
223
 
224
224
  return _regenerator.default.wrap(function _callee$(_context) {
225
225
  while (1) {
@@ -233,7 +233,7 @@ var LocaleAPI = /*#__PURE__*/function () {
233
233
  lang = _context.sent;
234
234
 
235
235
  if (!lang) {
236
- _context.next = 10;
236
+ _context.next = 11;
237
237
  break;
238
238
  }
239
239
 
@@ -241,25 +241,26 @@ var LocaleAPI = /*#__PURE__*/function () {
241
241
  return this.getList(lang);
242
242
 
243
243
  case 7:
244
- return _context.abrupt("return", lang);
244
+ list = _context.sent;
245
+ return _context.abrupt("return", list.locale);
245
246
 
246
- case 10:
247
+ case 11:
247
248
  if (!(cookie && cookie.cc && cookie.lc)) {
248
- _context.next = 16;
249
+ _context.next = 17;
249
250
  break;
250
251
  }
251
252
 
252
- _context.next = 13;
253
+ _context.next = 14;
253
254
  return this.getList(cookie);
254
255
 
255
- case 13:
256
+ case 14:
256
257
  return _context.abrupt("return", cookie);
257
258
 
258
- case 16:
259
- _context.next = 18;
259
+ case 17:
260
+ _context.next = 19;
260
261
  return (0, _geolocation.default)();
261
262
 
262
- case 18:
263
+ case 19:
263
264
  cc = _context.sent;
264
265
 
265
266
  /**
@@ -270,25 +271,25 @@ var LocaleAPI = /*#__PURE__*/function () {
270
271
  lc = _lang.split('-')[0];
271
272
 
272
273
  if (!(cc && lc)) {
273
- _context.next = 28;
274
+ _context.next = 29;
274
275
  break;
275
276
  }
276
277
 
277
- _context.next = 24;
278
+ _context.next = 25;
278
279
  return this.getList({
279
280
  cc: cc,
280
281
  lc: lc
281
282
  });
282
283
 
283
- case 24:
284
- list = _context.sent;
285
- verifiedCodes = this.verifyLocale(cc, lc, list); // set the ipcInfo cookie
284
+ case 25:
285
+ _list = _context.sent;
286
+ verifiedCodes = this.verifyLocale(cc, lc, _list); // set the ipcInfo cookie
286
287
 
287
288
  _ipcinfoCookie.default.set(verifiedCodes);
288
289
 
289
290
  return _context.abrupt("return", verifiedCodes);
290
291
 
291
- case 28:
292
+ case 29:
292
293
  case "end":
293
294
  return _context.stop();
294
295
  }
@@ -419,7 +420,7 @@ var LocaleAPI = /*#__PURE__*/function () {
419
420
  }()
420
421
  /**
421
422
  * Get the country list of all supported countries and their languages
422
- * if not set in session storage
423
+ * if it is not already stored in session storage
423
424
  *
424
425
  * @param {object} params params object
425
426
  * @param {string} params.cc country code
@@ -493,6 +494,10 @@ var LocaleAPI = /*#__PURE__*/function () {
493
494
  _requestsList[key] = _axios.default.get(url, _axiosConfig).then(function (response) {
494
495
  var data = response.data;
495
496
  data['timestamp'] = Date.now();
497
+ data.locale = {
498
+ lc: lc,
499
+ cc: cc
500
+ };
496
501
  sessionStorage.setItem("".concat(_sessionListKey, "-").concat(cc, "-").concat(lc), JSON.stringify(data));
497
502
  return data;
498
503
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibmdotcom-services",
3
3
  "description": "Carbon for IBM.com Services",
4
- "version": "1.18.0-rc.1",
4
+ "version": "1.18.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -44,7 +44,8 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@babel/runtime": "^7.5.0",
47
- "@carbon/ibmdotcom-utilities": "1.18.0-rc.0",
47
+ "@carbon/ibmdotcom-utilities": "1.18.1",
48
+ "@carbon/telemetry": "0.0.0-alpha.6",
48
49
  "axios": "^0.21.1",
49
50
  "window-or-global": "^1.0.1"
50
51
  },
@@ -59,7 +60,6 @@
59
60
  "@babel/plugin-transform-object-assign": "^7.2.0",
60
61
  "@babel/plugin-transform-runtime": "7.5.5",
61
62
  "@babel/preset-env": "^7.4.3",
62
- "@carbon/telemetry": "0.0.0-alpha.6",
63
63
  "@rollup/plugin-node-resolve": "^8.4.0",
64
64
  "all-contributors-cli": "^5.2.1",
65
65
  "babel-core": "^7.0.0-bridge.0",
@@ -95,5 +95,5 @@
95
95
  "release": {
96
96
  "branch": "master"
97
97
  },
98
- "gitHead": "fc5e1b7e80a59a3297228c2d6451ba4d97e942d2"
98
+ "gitHead": "74017ff79ccadad0ef72d416a249ad3664a9eb78"
99
99
  }