@carbon/ibmdotcom-services 2.38.0 → 2.40.0
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/es/services/CloudAccountAuth/CloudAccountAuth.js +5 -5
- package/es/services/DDO/DDO.js +20 -20
- package/es/services/KalturaPlayer/KalturaPlayer.js +10 -10
- package/es/services/Locale/Locale.js +56 -56
- package/es/services/MarketingSearch/MarketingSearch.js +5 -5
- package/es/services/Profile/Profile.js +10 -10
- package/es/services/SearchTypeahead/SearchTypeahead.js +7 -7
- package/es/services/Translation/Translation.js +9 -9
- package/es/services/VideoPlayer/VideoPlayer.js +4 -4
- package/lib/services/CloudAccountAuth/CloudAccountAuth.js +5 -5
- package/lib/services/DDO/DDO.js +20 -20
- package/lib/services/KalturaPlayer/KalturaPlayer.js +10 -10
- package/lib/services/Locale/Locale.js +56 -56
- package/lib/services/MarketingSearch/MarketingSearch.js +5 -5
- package/lib/services/Profile/Profile.js +10 -10
- package/lib/services/SearchTypeahead/SearchTypeahead.js +7 -7
- package/lib/services/Translation/Translation.js +9 -9
- package/lib/services/VideoPlayer/VideoPlayer.js +4 -4
- package/package.json +10 -10
- package/umd/ibmdotcom-services.js +807 -621
- package/umd/ibmdotcom-services.min.js +3 -3
|
@@ -53,12 +53,12 @@ var CloudAccountAuthAPI = /*#__PURE__*/function () {
|
|
|
53
53
|
}, {
|
|
54
54
|
key: "checkAPI",
|
|
55
55
|
value: (function () {
|
|
56
|
-
var _checkAPI = _asyncToGenerator(
|
|
56
|
+
var _checkAPI = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
57
57
|
var cloudLogin;
|
|
58
|
-
return _regeneratorRuntime.wrap(function
|
|
58
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
59
59
|
while (1) switch (_context.prev = _context.next) {
|
|
60
60
|
case 0:
|
|
61
|
-
_context.next =
|
|
61
|
+
_context.next = 1;
|
|
62
62
|
return axios.get('/api/v6/selected-account?profile=true', {
|
|
63
63
|
headers: {
|
|
64
64
|
Accept: 'application/json'
|
|
@@ -69,12 +69,12 @@ var CloudAccountAuthAPI = /*#__PURE__*/function () {
|
|
|
69
69
|
console.error(error);
|
|
70
70
|
return 'anonymous';
|
|
71
71
|
});
|
|
72
|
-
case
|
|
72
|
+
case 1:
|
|
73
73
|
cloudLogin = _context.sent;
|
|
74
74
|
return _context.abrupt("return", {
|
|
75
75
|
user: cloudLogin
|
|
76
76
|
});
|
|
77
|
-
case
|
|
77
|
+
case 2:
|
|
78
78
|
case "end":
|
|
79
79
|
return _context.stop();
|
|
80
80
|
}
|
package/es/services/DDO/DDO.js
CHANGED
|
@@ -101,19 +101,19 @@ var DDOAPI = /*#__PURE__*/function () {
|
|
|
101
101
|
}, {
|
|
102
102
|
key: "getAll",
|
|
103
103
|
value: (function () {
|
|
104
|
-
var _getAll = _asyncToGenerator(
|
|
105
|
-
return _regeneratorRuntime.wrap(function
|
|
104
|
+
var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
105
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
106
106
|
while (1) switch (_context.prev = _context.next) {
|
|
107
107
|
case 0:
|
|
108
|
-
_context.next =
|
|
108
|
+
_context.next = 1;
|
|
109
109
|
return this.isReady().then(function () {
|
|
110
110
|
return root.digitalData;
|
|
111
111
|
}).catch(function () {
|
|
112
112
|
return null;
|
|
113
113
|
});
|
|
114
|
-
case
|
|
114
|
+
case 1:
|
|
115
115
|
return _context.abrupt("return", _context.sent);
|
|
116
|
-
case
|
|
116
|
+
case 2:
|
|
117
117
|
case "end":
|
|
118
118
|
return _context.stop();
|
|
119
119
|
}
|
|
@@ -135,17 +135,17 @@ var DDOAPI = /*#__PURE__*/function () {
|
|
|
135
135
|
}, {
|
|
136
136
|
key: "setVersion",
|
|
137
137
|
value: (function () {
|
|
138
|
-
var _setVersion = _asyncToGenerator(
|
|
139
|
-
return _regeneratorRuntime.wrap(function
|
|
138
|
+
var _setVersion = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
139
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
140
140
|
while (1) switch (_context2.prev = _context2.next) {
|
|
141
141
|
case 0:
|
|
142
|
-
_context2.next =
|
|
142
|
+
_context2.next = 1;
|
|
143
143
|
return this.isReady().then(function () {
|
|
144
144
|
root.digitalData.page.pageInfo.version = settings.version;
|
|
145
145
|
});
|
|
146
|
-
case
|
|
146
|
+
case 1:
|
|
147
147
|
return _context2.abrupt("return", _context2.sent);
|
|
148
|
-
case
|
|
148
|
+
case 2:
|
|
149
149
|
case "end":
|
|
150
150
|
return _context2.stop();
|
|
151
151
|
}
|
|
@@ -167,17 +167,17 @@ var DDOAPI = /*#__PURE__*/function () {
|
|
|
167
167
|
}, {
|
|
168
168
|
key: "getLanguage",
|
|
169
169
|
value: (function () {
|
|
170
|
-
var _getLanguage = _asyncToGenerator(
|
|
171
|
-
return _regeneratorRuntime.wrap(function
|
|
170
|
+
var _getLanguage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
171
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
172
172
|
while (1) switch (_context3.prev = _context3.next) {
|
|
173
173
|
case 0:
|
|
174
|
-
_context3.next =
|
|
174
|
+
_context3.next = 1;
|
|
175
175
|
return this.isReady().then(function () {
|
|
176
176
|
return root.digitalData.page.pageInfo.language;
|
|
177
177
|
});
|
|
178
|
-
case
|
|
178
|
+
case 1:
|
|
179
179
|
return _context3.abrupt("return", _context3.sent);
|
|
180
|
-
case
|
|
180
|
+
case 2:
|
|
181
181
|
case "end":
|
|
182
182
|
return _context3.stop();
|
|
183
183
|
}
|
|
@@ -199,17 +199,17 @@ var DDOAPI = /*#__PURE__*/function () {
|
|
|
199
199
|
}, {
|
|
200
200
|
key: "getLocation",
|
|
201
201
|
value: (function () {
|
|
202
|
-
var _getLocation = _asyncToGenerator(
|
|
203
|
-
return _regeneratorRuntime.wrap(function
|
|
202
|
+
var _getLocation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
203
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
204
204
|
while (1) switch (_context4.prev = _context4.next) {
|
|
205
205
|
case 0:
|
|
206
|
-
_context4.next =
|
|
206
|
+
_context4.next = 1;
|
|
207
207
|
return this.isReady().then(function () {
|
|
208
208
|
return root.digitalData.user.location.country.toLowerCase();
|
|
209
209
|
});
|
|
210
|
-
case
|
|
210
|
+
case 1:
|
|
211
211
|
return _context4.abrupt("return", _context4.sent);
|
|
212
|
-
case
|
|
212
|
+
case 2:
|
|
213
213
|
case "end":
|
|
214
214
|
return _context4.stop();
|
|
215
215
|
}
|
|
@@ -205,20 +205,20 @@ var KalturaPlayerAPI = /*#__PURE__*/function () {
|
|
|
205
205
|
}, {
|
|
206
206
|
key: "embedMedia",
|
|
207
207
|
value: (function () {
|
|
208
|
-
var _embedMedia = _asyncToGenerator(
|
|
208
|
+
var _embedMedia = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(mediaId, targetId) {
|
|
209
209
|
var flashvars,
|
|
210
210
|
useIbmMetrics,
|
|
211
211
|
customReadyCallback,
|
|
212
212
|
fireEvent,
|
|
213
213
|
_args = arguments;
|
|
214
|
-
return _regeneratorRuntime.wrap(function
|
|
214
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
215
215
|
while (1) switch (_context.prev = _context.next) {
|
|
216
216
|
case 0:
|
|
217
217
|
flashvars = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
|
|
218
218
|
useIbmMetrics = _args.length > 3 && _args[3] !== undefined ? _args[3] : true;
|
|
219
219
|
customReadyCallback = _args.length > 4 && _args[4] !== undefined ? _args[4] : function () {};
|
|
220
220
|
fireEvent = this.fireEvent;
|
|
221
|
-
_context.next =
|
|
221
|
+
_context.next = 1;
|
|
222
222
|
return this.checkScript().then(function () {
|
|
223
223
|
var promiseKWidget = new Promise(function (resolve) {
|
|
224
224
|
var defaultFlashVars = {
|
|
@@ -308,9 +308,9 @@ var KalturaPlayerAPI = /*#__PURE__*/function () {
|
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
310
|
});
|
|
311
|
-
case
|
|
311
|
+
case 1:
|
|
312
312
|
return _context.abrupt("return", _context.sent);
|
|
313
|
-
case
|
|
313
|
+
case 2:
|
|
314
314
|
case "end":
|
|
315
315
|
return _context.stop();
|
|
316
316
|
}
|
|
@@ -373,11 +373,11 @@ var KalturaPlayerAPI = /*#__PURE__*/function () {
|
|
|
373
373
|
}, {
|
|
374
374
|
key: "api",
|
|
375
375
|
value: (function () {
|
|
376
|
-
var _api = _asyncToGenerator(
|
|
377
|
-
return _regeneratorRuntime.wrap(function
|
|
376
|
+
var _api = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(mediaId) {
|
|
377
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
378
378
|
while (1) switch (_context2.prev = _context2.next) {
|
|
379
379
|
case 0:
|
|
380
|
-
_context2.next =
|
|
380
|
+
_context2.next = 1;
|
|
381
381
|
return this.checkScript().then(function () {
|
|
382
382
|
if (mediaData && mediaData[mediaId]) {
|
|
383
383
|
return mediaData[mediaId];
|
|
@@ -396,9 +396,9 @@ var KalturaPlayerAPI = /*#__PURE__*/function () {
|
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
});
|
|
399
|
-
case
|
|
399
|
+
case 1:
|
|
400
400
|
return _context2.abrupt("return", _context2.sent);
|
|
401
|
-
case
|
|
401
|
+
case 2:
|
|
402
402
|
case "end":
|
|
403
403
|
return _context2.stop();
|
|
404
404
|
}
|
|
@@ -132,23 +132,23 @@ function _getLocaleFromLangAttr() {
|
|
|
132
132
|
* @returns {Promise<Locale|boolean>} The cookie object if 'cc' and 'lc' values are present, otherwise false.
|
|
133
133
|
*/
|
|
134
134
|
var _getLocaleFromCookie = /*#__PURE__*/function () {
|
|
135
|
-
var _ref = _asyncToGenerator(
|
|
135
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
136
136
|
var cookie;
|
|
137
|
-
return _regeneratorRuntime.wrap(function
|
|
137
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
138
138
|
while (1) switch (_context.prev = _context.next) {
|
|
139
139
|
case 0:
|
|
140
140
|
cookie = ipcinfoCookie.get();
|
|
141
141
|
if (!(cookie && cookie.cc && cookie.lc)) {
|
|
142
|
-
_context.next =
|
|
142
|
+
_context.next = 2;
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
|
-
_context.next =
|
|
145
|
+
_context.next = 1;
|
|
146
146
|
return LocaleAPI.getList(cookie);
|
|
147
|
-
case
|
|
147
|
+
case 1:
|
|
148
148
|
return _context.abrupt("return", cookie);
|
|
149
|
-
case
|
|
149
|
+
case 2:
|
|
150
150
|
return _context.abrupt("return", false);
|
|
151
|
-
case
|
|
151
|
+
case 3:
|
|
152
152
|
case "end":
|
|
153
153
|
return _context.stop();
|
|
154
154
|
}
|
|
@@ -166,47 +166,47 @@ var _getLocaleFromCookie = /*#__PURE__*/function () {
|
|
|
166
166
|
* @returns {Promise<Locale|boolean>} The verified locale or false if not found.
|
|
167
167
|
*/
|
|
168
168
|
var _getLocaleFromBrowser = /*#__PURE__*/function () {
|
|
169
|
-
var _ref2 = _asyncToGenerator(
|
|
170
|
-
var cc, lang, lc, list, verifiedCodes;
|
|
171
|
-
return _regeneratorRuntime.wrap(function
|
|
169
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
170
|
+
var cc, lang, lc, list, verifiedCodes, _t;
|
|
171
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
172
172
|
while (1) switch (_context2.prev = _context2.next) {
|
|
173
173
|
case 0:
|
|
174
174
|
_context2.prev = 0;
|
|
175
|
-
_context2.next =
|
|
175
|
+
_context2.next = 1;
|
|
176
176
|
return DDOAPI.getLocation();
|
|
177
|
-
case
|
|
177
|
+
case 1:
|
|
178
178
|
cc = _context2.sent;
|
|
179
179
|
// Language preference from browser can return in either 'en-US' format or
|
|
180
180
|
// 'en' so will need to extract language only.
|
|
181
181
|
lang = root.navigator.language;
|
|
182
182
|
lc = lang.split('-')[0];
|
|
183
183
|
if (!(cc && lc)) {
|
|
184
|
-
_context2.next =
|
|
184
|
+
_context2.next = 3;
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
|
-
_context2.next =
|
|
187
|
+
_context2.next = 2;
|
|
188
188
|
return LocaleAPI.getList({
|
|
189
189
|
cc: cc,
|
|
190
190
|
lc: lc
|
|
191
191
|
});
|
|
192
|
-
case
|
|
192
|
+
case 2:
|
|
193
193
|
list = _context2.sent;
|
|
194
194
|
verifiedCodes = LocaleAPI.verifyLocale(cc, lc, list); // Set the ipcInfo cookie.
|
|
195
195
|
ipcinfoCookie.set(verifiedCodes);
|
|
196
196
|
return _context2.abrupt("return", verifiedCodes);
|
|
197
|
-
case
|
|
198
|
-
_context2.next =
|
|
197
|
+
case 3:
|
|
198
|
+
_context2.next = 5;
|
|
199
199
|
break;
|
|
200
|
-
case
|
|
201
|
-
_context2.prev =
|
|
202
|
-
|
|
203
|
-
case
|
|
200
|
+
case 4:
|
|
201
|
+
_context2.prev = 4;
|
|
202
|
+
_t = _context2["catch"](0);
|
|
203
|
+
case 5:
|
|
204
204
|
return _context2.abrupt("return", false);
|
|
205
|
-
case
|
|
205
|
+
case 6:
|
|
206
206
|
case "end":
|
|
207
207
|
return _context2.stop();
|
|
208
208
|
}
|
|
209
|
-
}, _callee2, null, [[0,
|
|
209
|
+
}, _callee2, null, [[0, 4]]);
|
|
210
210
|
}));
|
|
211
211
|
return function _getLocaleFromBrowser() {
|
|
212
212
|
return _ref2.apply(this, arguments);
|
|
@@ -307,35 +307,35 @@ var LocaleAPI = /*#__PURE__*/function () {
|
|
|
307
307
|
}, {
|
|
308
308
|
key: "getLocale",
|
|
309
309
|
value: (function () {
|
|
310
|
-
var _getLocale = _asyncToGenerator(
|
|
310
|
+
var _getLocale = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
311
311
|
var localeGetters, _i, _localeGetters, getter, locale;
|
|
312
|
-
return _regeneratorRuntime.wrap(function
|
|
312
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
313
313
|
while (1) switch (_context3.prev = _context3.next) {
|
|
314
314
|
case 0:
|
|
315
315
|
localeGetters = [_getLocaleFromDDO, _getLocaleFromLangAttr, _getLocaleFromCookie, _getLocaleFromBrowser];
|
|
316
316
|
_i = 0, _localeGetters = localeGetters;
|
|
317
|
-
case
|
|
317
|
+
case 1:
|
|
318
318
|
if (!(_i < _localeGetters.length)) {
|
|
319
|
-
_context3.next =
|
|
319
|
+
_context3.next = 4;
|
|
320
320
|
break;
|
|
321
321
|
}
|
|
322
322
|
getter = _localeGetters[_i];
|
|
323
|
-
_context3.next =
|
|
323
|
+
_context3.next = 2;
|
|
324
324
|
return getter();
|
|
325
|
-
case
|
|
325
|
+
case 2:
|
|
326
326
|
locale = _context3.sent;
|
|
327
327
|
if (!locale) {
|
|
328
|
-
_context3.next =
|
|
328
|
+
_context3.next = 3;
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
331
331
|
return _context3.abrupt("return", locale);
|
|
332
|
-
case
|
|
332
|
+
case 3:
|
|
333
333
|
_i++;
|
|
334
|
-
_context3.next =
|
|
334
|
+
_context3.next = 1;
|
|
335
335
|
break;
|
|
336
|
-
case
|
|
336
|
+
case 4:
|
|
337
337
|
return _context3.abrupt("return", _getLocaleDefault());
|
|
338
|
-
case
|
|
338
|
+
case 5:
|
|
339
339
|
case "end":
|
|
340
340
|
return _context3.stop();
|
|
341
341
|
}
|
|
@@ -363,8 +363,8 @@ var LocaleAPI = /*#__PURE__*/function () {
|
|
|
363
363
|
}, {
|
|
364
364
|
key: "getLang",
|
|
365
365
|
value: (function () {
|
|
366
|
-
var _getLang = _asyncToGenerator(
|
|
367
|
-
return _regeneratorRuntime.wrap(function
|
|
366
|
+
var _getLang = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
367
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
368
368
|
while (1) switch (_context4.prev = _context4.next) {
|
|
369
369
|
case 0:
|
|
370
370
|
return _context4.abrupt("return", this.getLocale());
|
|
@@ -389,28 +389,28 @@ var LocaleAPI = /*#__PURE__*/function () {
|
|
|
389
389
|
}, {
|
|
390
390
|
key: "getLangDisplay",
|
|
391
391
|
value: (function () {
|
|
392
|
-
var _getLangDisplay = _asyncToGenerator(
|
|
393
|
-
var lang, list, countries, location;
|
|
394
|
-
return _regeneratorRuntime.wrap(function
|
|
392
|
+
var _getLangDisplay = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(locale) {
|
|
393
|
+
var lang, list, countries, location, _t2;
|
|
394
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
395
395
|
while (1) switch (_context5.prev = _context5.next) {
|
|
396
396
|
case 0:
|
|
397
397
|
if (!locale) {
|
|
398
|
-
_context5.next =
|
|
398
|
+
_context5.next = 1;
|
|
399
399
|
break;
|
|
400
400
|
}
|
|
401
|
-
|
|
402
|
-
_context5.next =
|
|
401
|
+
_t2 = locale;
|
|
402
|
+
_context5.next = 3;
|
|
403
403
|
break;
|
|
404
|
-
case
|
|
405
|
-
_context5.next =
|
|
404
|
+
case 1:
|
|
405
|
+
_context5.next = 2;
|
|
406
406
|
return this.getLocale();
|
|
407
|
-
case
|
|
408
|
-
|
|
409
|
-
case
|
|
410
|
-
lang =
|
|
411
|
-
_context5.next =
|
|
407
|
+
case 2:
|
|
408
|
+
_t2 = _context5.sent;
|
|
409
|
+
case 3:
|
|
410
|
+
lang = _t2;
|
|
411
|
+
_context5.next = 4;
|
|
412
412
|
return this.getList(lang);
|
|
413
|
-
case
|
|
413
|
+
case 4:
|
|
414
414
|
list = _context5.sent;
|
|
415
415
|
// combines the countryList arrays
|
|
416
416
|
countries = [];
|
|
@@ -433,13 +433,13 @@ var LocaleAPI = /*#__PURE__*/function () {
|
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
if (!location.length) {
|
|
436
|
-
_context5.next =
|
|
436
|
+
_context5.next = 5;
|
|
437
437
|
break;
|
|
438
438
|
}
|
|
439
439
|
return _context5.abrupt("return", "".concat(location[0].name, " \u2014 ").concat(location[0].locale[0][1]));
|
|
440
|
-
case
|
|
440
|
+
case 5:
|
|
441
441
|
return _context5.abrupt("return", _localeNameDefault);
|
|
442
|
-
case
|
|
442
|
+
case 6:
|
|
443
443
|
case "end":
|
|
444
444
|
return _context5.stop();
|
|
445
445
|
}
|
|
@@ -470,17 +470,17 @@ var LocaleAPI = /*#__PURE__*/function () {
|
|
|
470
470
|
}, {
|
|
471
471
|
key: "getList",
|
|
472
472
|
value: (function () {
|
|
473
|
-
var _getList = _asyncToGenerator(
|
|
473
|
+
var _getList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref3) {
|
|
474
474
|
var _this = this;
|
|
475
475
|
var cc, lc;
|
|
476
|
-
return _regeneratorRuntime.wrap(function
|
|
476
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
477
477
|
while (1) switch (_context6.prev = _context6.next) {
|
|
478
478
|
case 0:
|
|
479
479
|
cc = _ref3.cc, lc = _ref3.lc;
|
|
480
480
|
return _context6.abrupt("return", new Promise(function (resolve, reject) {
|
|
481
481
|
_this.fetchList(cc, lc, resolve, reject);
|
|
482
482
|
}));
|
|
483
|
-
case
|
|
483
|
+
case 1:
|
|
484
484
|
case "end":
|
|
485
485
|
return _context6.stop();
|
|
486
486
|
}
|
|
@@ -56,15 +56,15 @@ var MarketingSearchAPI = /*#__PURE__*/function () {
|
|
|
56
56
|
* }
|
|
57
57
|
*/
|
|
58
58
|
function () {
|
|
59
|
-
var _getResults = _asyncToGenerator(
|
|
59
|
+
var _getResults = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
|
|
60
60
|
var lc, cc, url;
|
|
61
|
-
return _regeneratorRuntime.wrap(function
|
|
61
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
62
62
|
while (1) switch (_context.prev = _context.next) {
|
|
63
63
|
case 0:
|
|
64
64
|
lc = 'en'; // TODO: create utility for fetching lc
|
|
65
65
|
cc = 'us'; // TODO: create utility for fetching cc
|
|
66
66
|
url = "".concat(_endpoint, "?locale=").concat(lc, "-").concat(cc, "&q=").concat(encodeURIComponent(query));
|
|
67
|
-
_context.next =
|
|
67
|
+
_context.next = 1;
|
|
68
68
|
return axios.get(url, {
|
|
69
69
|
headers: {
|
|
70
70
|
'Content-Type': 'application/json; charset=utf-8'
|
|
@@ -72,9 +72,9 @@ var MarketingSearchAPI = /*#__PURE__*/function () {
|
|
|
72
72
|
}).then(function (response) {
|
|
73
73
|
return response.data;
|
|
74
74
|
});
|
|
75
|
-
case
|
|
75
|
+
case 1:
|
|
76
76
|
return _context.abrupt("return", _context.sent);
|
|
77
|
-
case
|
|
77
|
+
case 2:
|
|
78
78
|
case "end":
|
|
79
79
|
return _context.stop();
|
|
80
80
|
}
|
|
@@ -62,11 +62,11 @@ var ProfileAPI = /*#__PURE__*/function () {
|
|
|
62
62
|
* }
|
|
63
63
|
*/
|
|
64
64
|
function () {
|
|
65
|
-
var _getUserStatus = _asyncToGenerator(
|
|
66
|
-
return _regeneratorRuntime.wrap(function
|
|
65
|
+
var _getUserStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
66
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
67
67
|
while (1) switch (_context.prev = _context.next) {
|
|
68
68
|
case 0:
|
|
69
|
-
_context.next =
|
|
69
|
+
_context.next = 1;
|
|
70
70
|
return axios.get(_endpoint, {
|
|
71
71
|
headers: {
|
|
72
72
|
'Content-Type': 'application/json; charset=utf-8'
|
|
@@ -80,9 +80,9 @@ var ProfileAPI = /*#__PURE__*/function () {
|
|
|
80
80
|
user: 'Unauthenticated'
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
|
-
case
|
|
83
|
+
case 1:
|
|
84
84
|
return _context.abrupt("return", _context.sent);
|
|
85
|
-
case
|
|
85
|
+
case 2:
|
|
86
86
|
case "end":
|
|
87
87
|
return _context.stop();
|
|
88
88
|
}
|
|
@@ -118,12 +118,12 @@ var ProfileAPI = /*#__PURE__*/function () {
|
|
|
118
118
|
}, {
|
|
119
119
|
key: "checkCloudDocsAPI",
|
|
120
120
|
value: (function () {
|
|
121
|
-
var _checkCloudDocsAPI = _asyncToGenerator(
|
|
121
|
+
var _checkCloudDocsAPI = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
122
122
|
var cloudLogin;
|
|
123
|
-
return _regeneratorRuntime.wrap(function
|
|
123
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
124
124
|
while (1) switch (_context2.prev = _context2.next) {
|
|
125
125
|
case 0:
|
|
126
|
-
_context2.next =
|
|
126
|
+
_context2.next = 1;
|
|
127
127
|
return axios.get('/api/v6/selected-account?profile=true', {
|
|
128
128
|
headers: {
|
|
129
129
|
Accept: 'application/json'
|
|
@@ -134,12 +134,12 @@ var ProfileAPI = /*#__PURE__*/function () {
|
|
|
134
134
|
console.error(error);
|
|
135
135
|
return 'anonymous';
|
|
136
136
|
});
|
|
137
|
-
case
|
|
137
|
+
case 1:
|
|
138
138
|
cloudLogin = _context2.sent;
|
|
139
139
|
return _context2.abrupt("return", {
|
|
140
140
|
user: cloudLogin
|
|
141
141
|
});
|
|
142
|
-
case
|
|
142
|
+
case 2:
|
|
143
143
|
case "end":
|
|
144
144
|
return _context2.stop();
|
|
145
145
|
}
|
|
@@ -52,25 +52,25 @@ var SearchTypeaheadAPI = /*#__PURE__*/function () {
|
|
|
52
52
|
* }
|
|
53
53
|
*/
|
|
54
54
|
function () {
|
|
55
|
-
var _getResults = _asyncToGenerator(
|
|
55
|
+
var _getResults = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query) {
|
|
56
56
|
var appid,
|
|
57
57
|
lang,
|
|
58
58
|
urlQuery,
|
|
59
59
|
url,
|
|
60
60
|
_args = arguments;
|
|
61
|
-
return _regeneratorRuntime.wrap(function
|
|
61
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
62
62
|
while (1) switch (_context.prev = _context.next) {
|
|
63
63
|
case 0:
|
|
64
64
|
appid = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
|
|
65
|
-
_context.next =
|
|
65
|
+
_context.next = 1;
|
|
66
66
|
return LocaleAPI.getLang();
|
|
67
|
-
case
|
|
67
|
+
case 1:
|
|
68
68
|
lang = _context.sent;
|
|
69
69
|
urlQuery = ["lang=".concat(lang.lc).concat(lang.cc ? "&cc=".concat(lang.cc) : ''), "query=".concat(encodeURIComponent(query)), "".concat(appid ? "appid=".concat(appid) : '')].filter(function (item) {
|
|
70
70
|
return item;
|
|
71
71
|
}).join('&');
|
|
72
72
|
url = "".concat(_endpoint, "?").concat(urlQuery);
|
|
73
|
-
_context.next =
|
|
73
|
+
_context.next = 2;
|
|
74
74
|
return axios.get(url, {
|
|
75
75
|
headers: {
|
|
76
76
|
'Content-Type': 'application/json; charset=utf-8'
|
|
@@ -78,9 +78,9 @@ var SearchTypeaheadAPI = /*#__PURE__*/function () {
|
|
|
78
78
|
}).then(function (response) {
|
|
79
79
|
return response.data.response;
|
|
80
80
|
});
|
|
81
|
-
case
|
|
81
|
+
case 2:
|
|
82
82
|
return _context.abrupt("return", _context.sent);
|
|
83
|
-
case
|
|
83
|
+
case 3:
|
|
84
84
|
case "end":
|
|
85
85
|
return _context.stop();
|
|
86
86
|
}
|
|
@@ -120,34 +120,34 @@ var TranslationAPI = /*#__PURE__*/function () {
|
|
|
120
120
|
}, {
|
|
121
121
|
key: "getTranslation",
|
|
122
122
|
value: (function () {
|
|
123
|
-
var _getTranslation = _asyncToGenerator(
|
|
123
|
+
var _getTranslation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(codes, endpoint) {
|
|
124
124
|
var _this = this;
|
|
125
125
|
var lang, country, locale;
|
|
126
|
-
return _regeneratorRuntime.wrap(function
|
|
126
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
127
127
|
while (1) switch (_context.prev = _context.next) {
|
|
128
128
|
case 0:
|
|
129
129
|
lang = 'en';
|
|
130
130
|
country = 'us';
|
|
131
131
|
if (!(codes && codes.lc && codes.cc)) {
|
|
132
|
-
_context.next =
|
|
132
|
+
_context.next = 1;
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
135
|
lang = codes.lc;
|
|
136
136
|
country = codes.cc;
|
|
137
|
-
_context.next =
|
|
137
|
+
_context.next = 3;
|
|
138
138
|
break;
|
|
139
|
-
case
|
|
140
|
-
_context.next =
|
|
139
|
+
case 1:
|
|
140
|
+
_context.next = 2;
|
|
141
141
|
return LocaleAPI.getLocale();
|
|
142
|
-
case
|
|
142
|
+
case 2:
|
|
143
143
|
locale = _context.sent;
|
|
144
144
|
lang = locale.lc;
|
|
145
145
|
country = locale.cc;
|
|
146
|
-
case
|
|
146
|
+
case 3:
|
|
147
147
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
148
148
|
_this.fetchTranslation(lang, country, endpoint, resolve, reject);
|
|
149
149
|
}));
|
|
150
|
-
case
|
|
150
|
+
case 4:
|
|
151
151
|
case "end":
|
|
152
152
|
return _context.stop();
|
|
153
153
|
}
|
|
@@ -54,13 +54,13 @@ var VideoPlayerAPI = /*#__PURE__*/function (_KalturaPlayerAPI) {
|
|
|
54
54
|
* }
|
|
55
55
|
*/
|
|
56
56
|
function () {
|
|
57
|
-
var _embedVideo = _asyncToGenerator(
|
|
58
|
-
return _regeneratorRuntime.wrap(function
|
|
57
|
+
var _embedVideo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(videoId, targetId, autoPlay) {
|
|
58
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
59
59
|
while (1) switch (_context.prev = _context.next) {
|
|
60
60
|
case 0:
|
|
61
|
-
_context.next =
|
|
61
|
+
_context.next = 1;
|
|
62
62
|
return KalturaPlayerAPI.embedMedia(videoId, targetId, autoPlay);
|
|
63
|
-
case
|
|
63
|
+
case 1:
|
|
64
64
|
case "end":
|
|
65
65
|
return _context.stop();
|
|
66
66
|
}
|
|
@@ -60,12 +60,12 @@ var CloudAccountAuthAPI = /*#__PURE__*/function () {
|
|
|
60
60
|
}, {
|
|
61
61
|
key: "checkAPI",
|
|
62
62
|
value: (function () {
|
|
63
|
-
var _checkAPI = (0, _asyncToGenerator2.default)(
|
|
63
|
+
var _checkAPI = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
64
64
|
var cloudLogin;
|
|
65
|
-
return _regenerator.default.wrap(function
|
|
65
|
+
return _regenerator.default.wrap(function (_context) {
|
|
66
66
|
while (1) switch (_context.prev = _context.next) {
|
|
67
67
|
case 0:
|
|
68
|
-
_context.next =
|
|
68
|
+
_context.next = 1;
|
|
69
69
|
return _axios.default.get('/api/v6/selected-account?profile=true', {
|
|
70
70
|
headers: {
|
|
71
71
|
Accept: 'application/json'
|
|
@@ -76,12 +76,12 @@ var CloudAccountAuthAPI = /*#__PURE__*/function () {
|
|
|
76
76
|
console.error(error);
|
|
77
77
|
return 'anonymous';
|
|
78
78
|
});
|
|
79
|
-
case
|
|
79
|
+
case 1:
|
|
80
80
|
cloudLogin = _context.sent;
|
|
81
81
|
return _context.abrupt("return", {
|
|
82
82
|
user: cloudLogin
|
|
83
83
|
});
|
|
84
|
-
case
|
|
84
|
+
case 2:
|
|
85
85
|
case "end":
|
|
86
86
|
return _context.stop();
|
|
87
87
|
}
|