@schibsted/account-sdk-browser 5.2.5 → 5.2.6
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/es5/global.js +85 -57
- package/es5/global.js.map +1 -1
- package/es5/global.min.js +1 -1
- package/es5/global.min.js.map +1 -1
- package/es5/identity.js +1 -1
- package/es5/identity.js.map +1 -1
- package/es5/identity.min.js +1 -1
- package/es5/identity.min.js.map +1 -1
- package/es5/index.js +85 -57
- package/es5/index.js.map +1 -1
- package/es5/index.min.js +1 -1
- package/es5/index.min.js.map +1 -1
- package/es5/monetization.js +561 -533
- package/es5/monetization.js.map +1 -1
- package/es5/monetization.min.js +1 -1
- package/es5/monetization.min.js.map +1 -1
- package/identity.js +1 -1
- package/index.js +1 -1
- package/monetization.js +1 -1
- package/package.json +1 -1
- package/payment.js +1 -1
- package/src/monetization.js +18 -6
- package/src/version.js +1 -1
package/LICENSE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c)
|
|
1
|
+
Copyright (c) 2026 Schibsted Products & Technology AS
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
4
4
|
associated documentation files (the "Software"), to deal in the Software without restriction,
|
package/README.md
CHANGED
|
@@ -325,7 +325,7 @@ and push.
|
|
|
325
325
|
|
|
326
326
|
## LICENSE
|
|
327
327
|
|
|
328
|
-
Copyright (c)
|
|
328
|
+
Copyright (c) 2026 Schibsted Products & Technology AS
|
|
329
329
|
|
|
330
330
|
Licensed under the [MIT
|
|
331
331
|
License](https://github.com/schibsted/account-sdk-browser/blob/master/LICENSE.md)
|
package/es5/global.js
CHANGED
|
@@ -12203,7 +12203,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12203
12203
|
|
|
12204
12204
|
|
|
12205
12205
|
|
|
12206
|
-
var version = '5.2.
|
|
12206
|
+
var version = '5.2.6';
|
|
12207
12207
|
/* harmony default export */ __webpack_exports__["default"] = (version);
|
|
12208
12208
|
|
|
12209
12209
|
/***/ }),
|
|
@@ -12277,31 +12277,37 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12277
12277
|
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15__);
|
|
12278
12278
|
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(174);
|
|
12279
12279
|
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_16__);
|
|
12280
|
-
/* harmony import */ var
|
|
12281
|
-
/* harmony import */ var
|
|
12282
|
-
/* harmony import */ var
|
|
12283
|
-
/* harmony import */ var
|
|
12284
|
-
/* harmony import */ var
|
|
12285
|
-
/* harmony import */ var
|
|
12286
|
-
/* harmony import */ var
|
|
12287
|
-
/* harmony import */ var
|
|
12288
|
-
/* harmony import */ var
|
|
12289
|
-
/* harmony import */ var
|
|
12290
|
-
/* harmony import */ var
|
|
12291
|
-
/* harmony import */ var
|
|
12292
|
-
/* harmony import */ var
|
|
12293
|
-
/* harmony import */ var
|
|
12294
|
-
/* harmony import */ var
|
|
12295
|
-
/* harmony import */ var
|
|
12296
|
-
/* harmony import */ var
|
|
12297
|
-
/* harmony import */ var
|
|
12298
|
-
/* harmony import */ var
|
|
12299
|
-
/* harmony import */ var
|
|
12300
|
-
/* harmony import */ var
|
|
12301
|
-
/* harmony import */ var
|
|
12302
|
-
/* harmony import */ var
|
|
12303
|
-
/* harmony import */ var
|
|
12304
|
-
/* harmony import */ var
|
|
12280
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(76);
|
|
12281
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_17__);
|
|
12282
|
+
/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(183);
|
|
12283
|
+
/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_18__);
|
|
12284
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(149);
|
|
12285
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19__);
|
|
12286
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(182);
|
|
12287
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_20__);
|
|
12288
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(201);
|
|
12289
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_21__);
|
|
12290
|
+
/* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(176);
|
|
12291
|
+
/* harmony import */ var core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_async_iterator_js__WEBPACK_IMPORTED_MODULE_22__);
|
|
12292
|
+
/* harmony import */ var core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(177);
|
|
12293
|
+
/* harmony import */ var core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_to_string_tag_js__WEBPACK_IMPORTED_MODULE_23__);
|
|
12294
|
+
/* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(178);
|
|
12295
|
+
/* harmony import */ var core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_json_to_string_tag_js__WEBPACK_IMPORTED_MODULE_24__);
|
|
12296
|
+
/* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(179);
|
|
12297
|
+
/* harmony import */ var core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_math_to_string_tag_js__WEBPACK_IMPORTED_MODULE_25__);
|
|
12298
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(180);
|
|
12299
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_26__);
|
|
12300
|
+
/* harmony import */ var _validate_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(184);
|
|
12301
|
+
/* harmony import */ var _url_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(204);
|
|
12302
|
+
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(205);
|
|
12303
|
+
/* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(206);
|
|
12304
|
+
/* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_30__);
|
|
12305
|
+
/* harmony import */ var _RESTClient_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(215);
|
|
12306
|
+
/* harmony import */ var _cache_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(207);
|
|
12307
|
+
/* harmony import */ var _spidTalk_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(223);
|
|
12308
|
+
/* harmony import */ var _SDKError_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(190);
|
|
12309
|
+
/* harmony import */ var _version_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(224);
|
|
12310
|
+
/* harmony import */ var _global_registry_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(225);
|
|
12305
12311
|
/* Copyright 2024 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.
|
|
12306
12312
|
* See LICENSE.md in the project root.
|
|
12307
12313
|
*/
|
|
@@ -12310,6 +12316,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12310
12316
|
|
|
12311
12317
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12312
12318
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
12319
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12320
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12321
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12322
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12323
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12324
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12313
12325
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12314
12326
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
12315
12327
|
|
|
@@ -12332,6 +12344,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
12332
12344
|
|
|
12333
12345
|
|
|
12334
12346
|
|
|
12347
|
+
|
|
12348
|
+
|
|
12349
|
+
|
|
12335
12350
|
|
|
12336
12351
|
|
|
12337
12352
|
|
|
@@ -12388,21 +12403,22 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12388
12403
|
window = _ref$window === void 0 ? globalWindow() : _ref$window;
|
|
12389
12404
|
_classCallCheck(this, Monetization);
|
|
12390
12405
|
_this = _super.call(this);
|
|
12391
|
-
|
|
12406
|
+
_spidTalk_js__WEBPACK_IMPORTED_MODULE_33__["emulate"](window);
|
|
12392
12407
|
// validate options
|
|
12393
|
-
Object(
|
|
12394
|
-
_this.cache = new
|
|
12408
|
+
Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isNonEmptyString"])(clientId), 'clientId parameter is required');
|
|
12409
|
+
_this.cache = new _cache_js__WEBPACK_IMPORTED_MODULE_32__["default"](function () {
|
|
12395
12410
|
return window && window.sessionStorage;
|
|
12396
12411
|
});
|
|
12397
12412
|
_this.clientId = clientId;
|
|
12398
12413
|
_this.env = env;
|
|
12399
12414
|
_this.redirectUri = redirectUri;
|
|
12415
|
+
_this.pendingHasAccessRequests = {};
|
|
12400
12416
|
_this._setSpidServerUrl(env);
|
|
12401
12417
|
if (sessionDomain) {
|
|
12402
|
-
Object(
|
|
12418
|
+
Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isUrl"])(sessionDomain), 'sessionDomain parameter is not a valid URL');
|
|
12403
12419
|
_this._setSessionServiceUrl(sessionDomain);
|
|
12404
12420
|
}
|
|
12405
|
-
Object(
|
|
12421
|
+
Object(_global_registry_js__WEBPACK_IMPORTED_MODULE_36__["registerGlobal"])(window, 'Monetization', _assertThisInitialized(_this));
|
|
12406
12422
|
return _this;
|
|
12407
12423
|
}
|
|
12408
12424
|
|
|
@@ -12415,9 +12431,9 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12415
12431
|
_createClass(Monetization, [{
|
|
12416
12432
|
key: "_setSpidServerUrl",
|
|
12417
12433
|
value: function _setSpidServerUrl(url) {
|
|
12418
|
-
Object(
|
|
12419
|
-
this._spid = new
|
|
12420
|
-
serverUrl: Object(
|
|
12434
|
+
Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isStr"])(url), "url parameter is invalid: ".concat(url));
|
|
12435
|
+
this._spid = new _RESTClient_js__WEBPACK_IMPORTED_MODULE_31__["default"]({
|
|
12436
|
+
serverUrl: Object(_url_js__WEBPACK_IMPORTED_MODULE_28__["urlMapper"])(url, _config_js__WEBPACK_IMPORTED_MODULE_29__["ENDPOINTS"].SPiD),
|
|
12421
12437
|
defaultParams: {
|
|
12422
12438
|
client_id: this.clientId,
|
|
12423
12439
|
redirect_uri: this.redirectUri
|
|
@@ -12434,15 +12450,15 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12434
12450
|
}, {
|
|
12435
12451
|
key: "_setSessionServiceUrl",
|
|
12436
12452
|
value: function _setSessionServiceUrl(domain) {
|
|
12437
|
-
Object(
|
|
12438
|
-
var client_sdrn = "sdrn:".concat(
|
|
12439
|
-
this._sessionService = new
|
|
12453
|
+
Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isStr"])(domain), "domain parameter is invalid: ".concat(domain));
|
|
12454
|
+
var client_sdrn = "sdrn:".concat(_config_js__WEBPACK_IMPORTED_MODULE_29__["NAMESPACE"][this.env], ":client:").concat(this.clientId);
|
|
12455
|
+
this._sessionService = new _RESTClient_js__WEBPACK_IMPORTED_MODULE_31__["default"]({
|
|
12440
12456
|
serverUrl: domain,
|
|
12441
12457
|
log: this.log,
|
|
12442
12458
|
defaultParams: {
|
|
12443
12459
|
client_sdrn: client_sdrn,
|
|
12444
12460
|
redirect_uri: this.redirectUri,
|
|
12445
|
-
sdk_version:
|
|
12461
|
+
sdk_version: _version_js__WEBPACK_IMPORTED_MODULE_35__["default"]
|
|
12446
12462
|
}
|
|
12447
12463
|
});
|
|
12448
12464
|
}
|
|
@@ -12460,7 +12476,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12460
12476
|
key: "hasAccess",
|
|
12461
12477
|
value: function () {
|
|
12462
12478
|
var _hasAccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(productIds, userId) {
|
|
12463
|
-
var sortedIds, cacheKey, data, expiresSeconds;
|
|
12479
|
+
var sortedIds, cacheKey, data, promise, expiresSeconds;
|
|
12464
12480
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12465
12481
|
while (1) switch (_context.prev = _context.next) {
|
|
12466
12482
|
case 0:
|
|
@@ -12468,50 +12484,62 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12468
12484
|
_context.next = 2;
|
|
12469
12485
|
break;
|
|
12470
12486
|
}
|
|
12471
|
-
throw new
|
|
12487
|
+
throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_34__["default"]("hasAccess can only be called if 'sessionDomain' is configured");
|
|
12472
12488
|
case 2:
|
|
12473
12489
|
if (userId) {
|
|
12474
12490
|
_context.next = 4;
|
|
12475
12491
|
break;
|
|
12476
12492
|
}
|
|
12477
|
-
throw new
|
|
12493
|
+
throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_34__["default"]("'userId' must be specified");
|
|
12478
12494
|
case 4:
|
|
12479
12495
|
if (Array.isArray(productIds)) {
|
|
12480
12496
|
_context.next = 6;
|
|
12481
12497
|
break;
|
|
12482
12498
|
}
|
|
12483
|
-
throw new
|
|
12499
|
+
throw new _SDKError_js__WEBPACK_IMPORTED_MODULE_34__["default"]("'productIds' must be an array");
|
|
12484
12500
|
case 6:
|
|
12485
|
-
sortedIds = productIds.sort();
|
|
12486
|
-
cacheKey = this._accessCacheKey(
|
|
12501
|
+
sortedIds = _toConsumableArray(productIds).sort();
|
|
12502
|
+
cacheKey = this._accessCacheKey(sortedIds, userId);
|
|
12487
12503
|
data = this.cache.get(cacheKey);
|
|
12488
12504
|
if (data) {
|
|
12489
|
-
_context.next =
|
|
12505
|
+
_context.next = 21;
|
|
12490
12506
|
break;
|
|
12491
12507
|
}
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12508
|
+
if (!this.pendingHasAccessRequests[cacheKey]) {
|
|
12509
|
+
this.pendingHasAccessRequests[cacheKey] = this._sessionService.get("/hasAccess/".concat(sortedIds.join(',')));
|
|
12510
|
+
}
|
|
12511
|
+
promise = this.pendingHasAccessRequests[cacheKey];
|
|
12512
|
+
_context.prev = 12;
|
|
12513
|
+
_context.next = 15;
|
|
12514
|
+
return promise;
|
|
12515
|
+
case 15:
|
|
12495
12516
|
data = _context.sent;
|
|
12496
12517
|
expiresSeconds = data.ttl;
|
|
12497
12518
|
this.cache.set(cacheKey, data, expiresSeconds * 1000);
|
|
12498
|
-
case
|
|
12519
|
+
case 18:
|
|
12520
|
+
_context.prev = 18;
|
|
12521
|
+
// If it rejects, we still want to clear the pending request
|
|
12522
|
+
if (this.pendingHasAccessRequests[cacheKey] === promise) {
|
|
12523
|
+
delete this.pendingHasAccessRequests[cacheKey];
|
|
12524
|
+
}
|
|
12525
|
+
return _context.finish(18);
|
|
12526
|
+
case 21:
|
|
12499
12527
|
if (data.entitled) {
|
|
12500
|
-
_context.next =
|
|
12528
|
+
_context.next = 23;
|
|
12501
12529
|
break;
|
|
12502
12530
|
}
|
|
12503
12531
|
return _context.abrupt("return", null);
|
|
12504
|
-
case
|
|
12532
|
+
case 23:
|
|
12505
12533
|
this.emit('hasAccess', {
|
|
12506
12534
|
ids: sortedIds,
|
|
12507
12535
|
data: data
|
|
12508
12536
|
});
|
|
12509
12537
|
return _context.abrupt("return", data);
|
|
12510
|
-
case
|
|
12538
|
+
case 25:
|
|
12511
12539
|
case "end":
|
|
12512
12540
|
return _context.stop();
|
|
12513
12541
|
}
|
|
12514
|
-
}, _callee, this);
|
|
12542
|
+
}, _callee, this, [[12,, 18, 21]]);
|
|
12515
12543
|
}));
|
|
12516
12544
|
function hasAccess(_x, _x2) {
|
|
12517
12545
|
return _hasAccess.apply(this, arguments);
|
|
@@ -12540,7 +12568,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12540
12568
|
}, {
|
|
12541
12569
|
key: "_accessCacheKey",
|
|
12542
12570
|
value: function _accessCacheKey(productIds, userId) {
|
|
12543
|
-
return "prd_".concat(productIds.sort(), "_").concat(userId);
|
|
12571
|
+
return "prd_".concat(_toConsumableArray(productIds).sort(), "_").concat(userId);
|
|
12544
12572
|
}
|
|
12545
12573
|
|
|
12546
12574
|
/**
|
|
@@ -12552,7 +12580,7 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12552
12580
|
key: "subscriptionsUrl",
|
|
12553
12581
|
value: function subscriptionsUrl() {
|
|
12554
12582
|
var redirectUri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.redirectUri;
|
|
12555
|
-
Object(
|
|
12583
|
+
Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isUrl"])(redirectUri), "subscriptionsUrl(): redirectUri is invalid");
|
|
12556
12584
|
return this._spid.makeUrl('account/subscriptions', {
|
|
12557
12585
|
redirect_uri: redirectUri
|
|
12558
12586
|
});
|
|
@@ -12567,14 +12595,14 @@ var Monetization = /*#__PURE__*/function (_EventEmitter) {
|
|
|
12567
12595
|
key: "productsUrl",
|
|
12568
12596
|
value: function productsUrl() {
|
|
12569
12597
|
var redirectUri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.redirectUri;
|
|
12570
|
-
Object(
|
|
12598
|
+
Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["assert"])(Object(_validate_js__WEBPACK_IMPORTED_MODULE_27__["isUrl"])(redirectUri), "productsUrl(): redirectUri is invalid");
|
|
12571
12599
|
return this._spid.makeUrl('account/products', {
|
|
12572
12600
|
redirect_uri: redirectUri
|
|
12573
12601
|
});
|
|
12574
12602
|
}
|
|
12575
12603
|
}]);
|
|
12576
12604
|
return Monetization;
|
|
12577
|
-
}(
|
|
12605
|
+
}(tiny_emitter__WEBPACK_IMPORTED_MODULE_30___default.a);
|
|
12578
12606
|
/* harmony default export */ __webpack_exports__["default"] = (Monetization);
|
|
12579
12607
|
|
|
12580
12608
|
/***/ }),
|