authscape 1.0.60 → 1.0.63

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/index.js +1033 -15
  2. package/package.json +5 -5
  3. package/readme.md +1 -13
package/index.js CHANGED
@@ -1,51 +1,1069 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports.default = void 0;
8
+ exports["default"] = void 0;
7
9
 
8
10
  var _react = _interopRequireWildcard(require("react"));
9
11
 
10
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
13
 
12
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
15
 
14
16
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
17
 
16
18
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
19
 
18
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
21
 
20
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
22
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
23
 
22
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
24
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
+
26
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
27
+
28
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
23
29
 
24
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
30
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25
31
 
26
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
32
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
27
33
 
28
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
29
35
 
30
- var DummyComponent =
31
- /*#__PURE__*/
32
- function (_Component) {
36
+ var DummyComponent = /*#__PURE__*/function (_Component) {
33
37
  _inherits(DummyComponent, _Component);
34
38
 
39
+ var _super = _createSuper(DummyComponent);
40
+
35
41
  function DummyComponent() {
36
42
  _classCallCheck(this, DummyComponent);
37
43
 
38
- return _possibleConstructorReturn(this, _getPrototypeOf(DummyComponent).apply(this, arguments));
44
+ return _super.apply(this, arguments);
39
45
  }
40
46
 
41
47
  _createClass(DummyComponent, [{
42
48
  key: "render",
43
49
  value: function render() {
44
- return _react.default.createElement("div", null, "I am a dummy react npm module");
50
+ return /*#__PURE__*/_react["default"].createElement("div", null, "I am a dummy react npm module");
45
51
  }
46
52
  }]);
47
53
 
48
54
  return DummyComponent;
49
55
  }(_react.Component);
50
56
 
51
- exports.default = DummyComponent;
57
+ exports["default"] = DummyComponent;
58
+ "use strict";
59
+
60
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
61
+
62
+ Object.defineProperty(exports, "__esModule", {
63
+ value: true
64
+ });
65
+ exports["default"] = void 0;
66
+
67
+ var _axios = _interopRequireDefault(require("axios"));
68
+
69
+ var _querystring = _interopRequireDefault(require("querystring"));
70
+
71
+ var _jsFileDownload = _interopRequireDefault(require("js-file-download"));
72
+
73
+ var _nextCookies = _interopRequireDefault(require("next-cookies"));
74
+
75
+ var _nookies = require("nookies");
76
+
77
+ var _BaseUri = require("./BaseUri");
78
+
79
+ var _helper = _interopRequireDefault(require("./helper"));
80
+
81
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
82
+
83
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
84
+
85
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
86
+
87
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
88
+
89
+ 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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
90
+
91
+ 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); } }
92
+
93
+ 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); }); }; }
94
+
95
+ var setupDefaultOptions = /*#__PURE__*/function () {
96
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
97
+ var ctx,
98
+ defaultOptions,
99
+ accessToken,
100
+ _args = arguments;
101
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
102
+ while (1) {
103
+ switch (_context.prev = _context.next) {
104
+ case 0:
105
+ ctx = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
106
+ defaultOptions = {};
107
+
108
+ if ((0, _helper["default"])().isObjectEmpty(ctx)) {
109
+ accessToken = (0, _nextCookies["default"])(ctx).access_token || '';
110
+
111
+ if (accessToken !== null && accessToken !== undefined && accessToken != "") {
112
+ defaultOptions = {
113
+ headers: {
114
+ Authorization: "Bearer " + accessToken
115
+ }
116
+ };
117
+ } else {
118
+ defaultOptions = {
119
+ headers: {}
120
+ };
121
+ }
122
+ } else {
123
+ defaultOptions = {
124
+ headers: {}
125
+ };
126
+ }
127
+
128
+ return _context.abrupt("return", defaultOptions);
129
+
130
+ case 4:
131
+ case "end":
132
+ return _context.stop();
133
+ }
134
+ }
135
+ }, _callee);
136
+ }));
137
+
138
+ return function setupDefaultOptions() {
139
+ return _ref.apply(this, arguments);
140
+ };
141
+ }();
142
+
143
+ var RefreshToken = /*#__PURE__*/function () {
144
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(originalRequest, instance) {
145
+ var accessToken, refreshToken, response, domain;
146
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
147
+ while (1) {
148
+ switch (_context2.prev = _context2.next) {
149
+ case 0:
150
+ accessToken = (0, _nextCookies["default"])(null).access_token || '';
151
+ refreshToken = (0, _nextCookies["default"])(null).refresh_token || '';
152
+ _context2.next = 4;
153
+ return instance.post(process.env.AUTHORITYURI + "/connect/token", _querystring["default"].stringify({
154
+ grant_type: 'refresh_token',
155
+ client_id: process.env.client_id,
156
+ client_secret: process.env.client_secret,
157
+ refresh_token: refreshToken
158
+ }), {
159
+ headers: {
160
+ "Content-Type": "application/x-www-form-urlencoded",
161
+ "Authorization": "Bearer " + accessToken
162
+ }
163
+ });
164
+
165
+ case 4:
166
+ response = _context2.sent;
167
+
168
+ if (!(response != null && response.status == 200)) {
169
+ _context2.next = 14;
170
+ break;
171
+ }
172
+
173
+ originalRequest.headers['Authorization'] = 'Bearer ' + response.data.access_token;
174
+ domain = getCookieDomain();
175
+ _context2.next = 10;
176
+ return (0, _nookies.setCookie)(null, "access_token", response.data.access_token, {
177
+ maxAge: 2147483647,
178
+ path: '/',
179
+ domain: domain,
180
+ secure: true
181
+ });
182
+
183
+ case 10:
184
+ _context2.next = 12;
185
+ return (0, _nookies.setCookie)(null, "expires_in", response.data.expires_in, {
186
+ maxAge: 2147483647,
187
+ path: '/',
188
+ domain: domain,
189
+ secure: true
190
+ });
191
+
192
+ case 12:
193
+ _context2.next = 14;
194
+ return (0, _nookies.setCookie)(null, "refresh_token", response.data.refresh_token, {
195
+ maxAge: 2147483647,
196
+ path: '/',
197
+ domain: domain,
198
+ secure: true
199
+ });
200
+
201
+ case 14:
202
+ case "end":
203
+ return _context2.stop();
204
+ }
205
+ }
206
+ }, _callee2);
207
+ }));
208
+
209
+ return function RefreshToken(_x, _x2) {
210
+ return _ref2.apply(this, arguments);
211
+ };
212
+ }();
213
+
214
+ var apiService = function apiService() {
215
+ var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
216
+ var env = (0, _BaseUri.GetEnvironment)();
217
+
218
+ if (env == "development") {
219
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
220
+ }
221
+
222
+ var baseUri = process.env.APIURI + "/api";
223
+
224
+ var instance = _axios["default"].create({
225
+ baseURL: baseUri,
226
+ //timeout: 10000,
227
+ params: {} // do not remove this, its added to add params later in the config
228
+
229
+ });
230
+
231
+ instance.interceptors.response.use(function (response) {
232
+ return response;
233
+ }, /*#__PURE__*/function () {
234
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(error) {
235
+ var originalConfig;
236
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
237
+ while (1) {
238
+ switch (_context3.prev = _context3.next) {
239
+ case 0:
240
+ originalConfig = error.config;
241
+
242
+ if (!error.response) {
243
+ _context3.next = 10;
244
+ break;
245
+ }
246
+
247
+ if (!(error.response.status === 401 && !originalConfig._retry)) {
248
+ _context3.next = 7;
249
+ break;
250
+ }
251
+
252
+ originalConfig._retry = true; // Do something, call refreshToken() request for example;
253
+
254
+ _context3.next = 6;
255
+ return RefreshToken(originalConfig, instance);
256
+
257
+ case 6:
258
+ return _context3.abrupt("return", instance.request(originalConfig));
259
+
260
+ case 7:
261
+ if (!(error.response.status === 400)) {
262
+ _context3.next = 10;
263
+ break;
264
+ }
265
+
266
+ // Do something
267
+ if (error.response.config.url.includes("/connect/token")) // remove the access and refresh if invalid
268
+ {
269
+ (0, _nookies.destroyCookie)(ctx, "access_token", {
270
+ maxAge: 2147483647,
271
+ path: '/',
272
+ domain: process.env.cookieDomain
273
+ });
274
+ (0, _nookies.destroyCookie)(ctx, "refresh_token", {
275
+ maxAge: 2147483647,
276
+ path: '/',
277
+ domain: process.env.cookieDomain
278
+ });
279
+ (0, _nookies.destroyCookie)(ctx, "expires_in", {
280
+ maxAge: 2147483647,
281
+ path: '/',
282
+ domain: process.env.cookieDomain
283
+ });
284
+ }
285
+
286
+ return _context3.abrupt("return", Promise.reject(error));
287
+
288
+ case 10:
289
+ return _context3.abrupt("return", Promise.reject(error));
290
+
291
+ case 11:
292
+ case "end":
293
+ return _context3.stop();
294
+ }
295
+ }
296
+ }, _callee3);
297
+ }));
298
+
299
+ return function (_x3) {
300
+ return _ref3.apply(this, arguments);
301
+ };
302
+ }());
303
+ return {
304
+ get: function () {
305
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(url) {
306
+ var options,
307
+ defaultOptions,
308
+ _args4 = arguments;
309
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
310
+ while (1) {
311
+ switch (_context4.prev = _context4.next) {
312
+ case 0:
313
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
314
+ _context4.prev = 1;
315
+ _context4.next = 4;
316
+ return setupDefaultOptions(ctx);
317
+
318
+ case 4:
319
+ defaultOptions = _context4.sent;
320
+ _context4.next = 7;
321
+ return instance.get(url, _objectSpread(_objectSpread({}, defaultOptions), options));
322
+
323
+ case 7:
324
+ return _context4.abrupt("return", _context4.sent);
325
+
326
+ case 10:
327
+ _context4.prev = 10;
328
+ _context4.t0 = _context4["catch"](1);
329
+ return _context4.abrupt("return", _context4.t0.response);
330
+
331
+ case 13:
332
+ case "end":
333
+ return _context4.stop();
334
+ }
335
+ }
336
+ }, _callee4, null, [[1, 10]]);
337
+ }));
338
+
339
+ function get(_x4) {
340
+ return _get.apply(this, arguments);
341
+ }
342
+
343
+ return get;
344
+ }(),
345
+ post: function () {
346
+ var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(url, data) {
347
+ var options,
348
+ defaultOptions,
349
+ _args5 = arguments;
350
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
351
+ while (1) {
352
+ switch (_context5.prev = _context5.next) {
353
+ case 0:
354
+ options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
355
+ _context5.prev = 1;
356
+ _context5.next = 4;
357
+ return setupDefaultOptions(ctx);
358
+
359
+ case 4:
360
+ defaultOptions = _context5.sent;
361
+ _context5.next = 7;
362
+ return instance.post(url, data, _objectSpread(_objectSpread({}, defaultOptions), options));
363
+
364
+ case 7:
365
+ return _context5.abrupt("return", _context5.sent);
366
+
367
+ case 10:
368
+ _context5.prev = 10;
369
+ _context5.t0 = _context5["catch"](1);
370
+ return _context5.abrupt("return", _context5.t0.response);
371
+
372
+ case 13:
373
+ case "end":
374
+ return _context5.stop();
375
+ }
376
+ }
377
+ }, _callee5, null, [[1, 10]]);
378
+ }));
379
+
380
+ function post(_x5, _x6) {
381
+ return _post.apply(this, arguments);
382
+ }
383
+
384
+ return post;
385
+ }(),
386
+ put: function () {
387
+ var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(url, data) {
388
+ var options,
389
+ defaultOptions,
390
+ _args6 = arguments;
391
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
392
+ while (1) {
393
+ switch (_context6.prev = _context6.next) {
394
+ case 0:
395
+ options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
396
+ _context6.prev = 1;
397
+ _context6.next = 4;
398
+ return setupDefaultOptions(ctx);
399
+
400
+ case 4:
401
+ defaultOptions = _context6.sent;
402
+ _context6.next = 7;
403
+ return instance.put(url, data, _objectSpread(_objectSpread({}, defaultOptions), options));
404
+
405
+ case 7:
406
+ return _context6.abrupt("return", _context6.sent);
407
+
408
+ case 10:
409
+ _context6.prev = 10;
410
+ _context6.t0 = _context6["catch"](1);
411
+ return _context6.abrupt("return", _context6.t0.response);
412
+
413
+ case 13:
414
+ case "end":
415
+ return _context6.stop();
416
+ }
417
+ }
418
+ }, _callee6, null, [[1, 10]]);
419
+ }));
420
+
421
+ function put(_x7, _x8) {
422
+ return _put.apply(this, arguments);
423
+ }
424
+
425
+ return put;
426
+ }(),
427
+ "delete": function () {
428
+ var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(url) {
429
+ var options,
430
+ defaultOptions,
431
+ _args7 = arguments;
432
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
433
+ while (1) {
434
+ switch (_context7.prev = _context7.next) {
435
+ case 0:
436
+ options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
437
+ _context7.prev = 1;
438
+ _context7.next = 4;
439
+ return setupDefaultOptions(ctx);
440
+
441
+ case 4:
442
+ defaultOptions = _context7.sent;
443
+ _context7.next = 7;
444
+ return instance["delete"](url, _objectSpread(_objectSpread({}, defaultOptions), options));
445
+
446
+ case 7:
447
+ return _context7.abrupt("return", _context7.sent);
448
+
449
+ case 10:
450
+ _context7.prev = 10;
451
+ _context7.t0 = _context7["catch"](1);
452
+ return _context7.abrupt("return", _context7.t0.response);
453
+
454
+ case 13:
455
+ case "end":
456
+ return _context7.stop();
457
+ }
458
+ }
459
+ }, _callee7, null, [[1, 10]]);
460
+ }));
461
+
462
+ function _delete(_x9) {
463
+ return _delete2.apply(this, arguments);
464
+ }
465
+
466
+ return _delete;
467
+ }(),
468
+ GetCurrentUser: function () {
469
+ var _GetCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
470
+ var accessToken, defaultOptions, response;
471
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
472
+ while (1) {
473
+ switch (_context8.prev = _context8.next) {
474
+ case 0:
475
+ _context8.prev = 0;
476
+ accessToken = (0, _nextCookies["default"])(ctx).access_token || null;
477
+
478
+ if (!accessToken) {
479
+ _context8.next = 11;
480
+ break;
481
+ }
482
+
483
+ _context8.next = 5;
484
+ return setupDefaultOptions(ctx);
485
+
486
+ case 5:
487
+ defaultOptions = _context8.sent;
488
+ _context8.next = 8;
489
+ return instance.get('/UserManagement', defaultOptions);
490
+
491
+ case 8:
492
+ response = _context8.sent;
493
+
494
+ if (!(response != null && response.status == 200)) {
495
+ _context8.next = 11;
496
+ break;
497
+ }
498
+
499
+ return _context8.abrupt("return", response.data);
500
+
501
+ case 11:
502
+ _context8.next = 15;
503
+ break;
504
+
505
+ case 13:
506
+ _context8.prev = 13;
507
+ _context8.t0 = _context8["catch"](0);
508
+
509
+ case 15:
510
+ return _context8.abrupt("return", null);
511
+
512
+ case 16:
513
+ case "end":
514
+ return _context8.stop();
515
+ }
516
+ }
517
+ }, _callee8, null, [[0, 13]]);
518
+ }));
519
+
520
+ function GetCurrentUser() {
521
+ return _GetCurrentUser.apply(this, arguments);
522
+ }
523
+
524
+ return GetCurrentUser;
525
+ }(),
526
+ DownloadFile: function () {
527
+ var _DownloadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(url, fileName, completed) {
528
+ var defaultOptions, options, response;
529
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
530
+ while (1) {
531
+ switch (_context9.prev = _context9.next) {
532
+ case 0:
533
+ _context9.prev = 0;
534
+ //let defaultOptions = await setupDefaultOptions();
535
+ defaultOptions = {};
536
+ options = {
537
+ responseType: "blob"
538
+ };
539
+ _context9.next = 5;
540
+ return instance.get(url, _objectSpread(_objectSpread({}, defaultOptions), options));
541
+
542
+ case 5:
543
+ response = _context9.sent;
544
+
545
+ if (response.status === 200) {
546
+ (0, _jsFileDownload["default"])(response.data, fileName);
547
+
548
+ if (completed !== undefined) {
549
+ completed();
550
+ }
551
+ }
552
+
553
+ _context9.next = 13;
554
+ break;
555
+
556
+ case 9:
557
+ _context9.prev = 9;
558
+ _context9.t0 = _context9["catch"](0);
559
+ console.error(_context9.t0);
560
+
561
+ if (completed !== undefined) {
562
+ completed();
563
+ }
564
+
565
+ case 13:
566
+ case "end":
567
+ return _context9.stop();
568
+ }
569
+ }
570
+ }, _callee9, null, [[0, 9]]);
571
+ }));
572
+
573
+ function DownloadFile(_x10, _x11, _x12) {
574
+ return _DownloadFile.apply(this, arguments);
575
+ }
576
+
577
+ return DownloadFile;
578
+ }()
579
+ };
580
+ };
581
+
582
+ var _default = apiService;
583
+ exports["default"] = _default;
584
+ "use strict";
585
+
586
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
587
+
588
+ Object.defineProperty(exports, "__esModule", {
589
+ value: true
590
+ });
591
+ exports["default"] = AuthorizationComponent;
592
+
593
+ var _react = _interopRequireWildcard(require("react"));
594
+
595
+ var _apiService = _interopRequireDefault(require("./apiService"));
596
+
597
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
598
+
599
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
600
+
601
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
602
+
603
+ 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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
604
+
605
+ 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); } }
606
+
607
+ 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); }); }; }
608
+
609
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
610
+
611
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
612
+
613
+ 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); }
614
+
615
+ 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; }
616
+
617
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
618
+
619
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
620
+
621
+ function AuthorizationComponent(_ref) {
622
+ var children = _ref.children,
623
+ setCurrentUser = _ref.setCurrentUser,
624
+ userLoaded = _ref.userLoaded,
625
+ isLoading = _ref.isLoading;
626
+
627
+ var _useState = (0, _react.useState)(false),
628
+ _useState2 = _slicedToArray(_useState, 2),
629
+ loaded = _useState2[0],
630
+ setLoaded = _useState2[1];
631
+
632
+ var validateUserSignedIn = /*#__PURE__*/function () {
633
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
634
+ var usr;
635
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
636
+ while (1) {
637
+ switch (_context.prev = _context.next) {
638
+ case 0:
639
+ setLoaded(true);
640
+ _context.next = 3;
641
+ return (0, _apiService["default"])().GetCurrentUser();
642
+
643
+ case 3:
644
+ usr = _context.sent;
645
+
646
+ if (usr != null) {
647
+ setCurrentUser(usr);
648
+ } else {
649
+ setCurrentUser(null);
650
+ }
651
+
652
+ userLoaded();
653
+
654
+ case 6:
655
+ case "end":
656
+ return _context.stop();
657
+ }
658
+ }
659
+ }, _callee);
660
+ }));
661
+
662
+ return function validateUserSignedIn() {
663
+ return _ref2.apply(this, arguments);
664
+ };
665
+ }();
666
+
667
+ (0, _react.useEffect)(function () {
668
+ if (!loaded) {
669
+ validateUserSignedIn();
670
+ }
671
+ }, [loaded]);
672
+ return children;
673
+ }
674
+ "use strict";
675
+
676
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
677
+
678
+ Object.defineProperty(exports, "__esModule", {
679
+ value: true
680
+ });
681
+ exports["default"] = void 0;
682
+
683
+ var _react = _interopRequireDefault(require("react"));
684
+
685
+ var _nookies = require("nookies");
686
+
687
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
688
+
689
+ 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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
690
+
691
+ 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); } }
692
+
693
+ 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); }); }; }
694
+
695
+ var authService = function authService() {
696
+ return {
697
+ dec2hex: function dec2hex(dec) {
698
+ return ('0' + dec.toString(16)).substr(-2);
699
+ },
700
+ generateRandomString: function generateRandomString() {
701
+ var array = new Uint32Array(56 / 2);
702
+ window.crypto.getRandomValues(array);
703
+ return Array.from(array, authService().dec2hex).join('');
704
+ },
705
+ sha256: function sha256(plain) {
706
+ var encoder = new TextEncoder();
707
+ var data = encoder.encode(plain);
708
+ return window.crypto.subtle.digest('SHA-256', data);
709
+ },
710
+ base64urlencode: function base64urlencode(a) {
711
+ var str = "";
712
+ var bytes = new Uint8Array(a);
713
+ var len = bytes.byteLength;
714
+
715
+ for (var i = 0; i < len; i++) {
716
+ str += String.fromCharCode(bytes[i]);
717
+ }
718
+
719
+ return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
720
+ },
721
+ challenge_from_verifier: function () {
722
+ var _challenge_from_verifier = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(v) {
723
+ var hashed, base64encoded;
724
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
725
+ while (1) {
726
+ switch (_context.prev = _context.next) {
727
+ case 0:
728
+ _context.next = 2;
729
+ return authService().sha256(v);
730
+
731
+ case 2:
732
+ hashed = _context.sent;
733
+ base64encoded = authService().base64urlencode(hashed);
734
+ return _context.abrupt("return", base64encoded);
735
+
736
+ case 5:
737
+ case "end":
738
+ return _context.stop();
739
+ }
740
+ }
741
+ }, _callee);
742
+ }));
743
+
744
+ function challenge_from_verifier(_x) {
745
+ return _challenge_from_verifier.apply(this, arguments);
746
+ }
747
+
748
+ return challenge_from_verifier;
749
+ }(),
750
+ login: function () {
751
+ var _login = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
752
+ var redirectUserUri,
753
+ dnsRecord,
754
+ deviceId,
755
+ state,
756
+ verifier,
757
+ challenge,
758
+ redirectUri,
759
+ loginUri,
760
+ _args2 = arguments;
761
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
762
+ while (1) {
763
+ switch (_context2.prev = _context2.next) {
764
+ case 0:
765
+ redirectUserUri = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : null;
766
+ dnsRecord = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
767
+ deviceId = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
768
+ state = "1234";
769
+
770
+ if (redirectUserUri != null) {
771
+ localStorage.setItem("redirectUri", redirectUserUri);
772
+ }
773
+
774
+ verifier = authService().generateRandomString();
775
+ _context2.next = 8;
776
+ return authService().challenge_from_verifier(verifier);
777
+
778
+ case 8:
779
+ challenge = _context2.sent;
780
+ window.localStorage.setItem("verifier", verifier);
781
+ redirectUri = window.location.origin + "/signin-oidc";
782
+ loginUri = process.env.AUTHORITYURI + "/connect/authorize?response_type=code&state=" + state + "&client_id=" + process.env.client_id + "&scope=email%20openid%20offline_access%20profile%20api1&redirect_uri=" + redirectUri + "&code_challenge=" + challenge + "&code_challenge_method=S256";
783
+
784
+ if (deviceId) {
785
+ loginUri += "&deviceId=" + deviceId; // will be for chrome extention and mobile apps later
786
+ }
787
+
788
+ window.location.href = loginUri;
789
+
790
+ case 14:
791
+ case "end":
792
+ return _context2.stop();
793
+ }
794
+ }
795
+ }, _callee2);
796
+ }));
797
+
798
+ function login() {
799
+ return _login.apply(this, arguments);
800
+ }
801
+
802
+ return login;
803
+ }(),
804
+ signUp: function signUp() {
805
+ var redirectUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
806
+ var AuthUri = process.env.AUTHORITYURI;
807
+ var url = "";
808
+
809
+ if (redirectUrl == null) {
810
+ url = AuthUri + "/Account/Register?returnUrl=" + window.location.href;
811
+ localStorage.setItem("redirectUri", window.location.href);
812
+ } else {
813
+ url = AuthUri + "/Account/Register?returnUrl=" + redirectUrl;
814
+ localStorage.setItem("redirectUri", redirectUrl);
815
+ }
816
+
817
+ window.location.href = url;
818
+ },
819
+ logout: function () {
820
+ var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
821
+ var AuthUri, cookieDomain;
822
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
823
+ while (1) {
824
+ switch (_context3.prev = _context3.next) {
825
+ case 0:
826
+ AuthUri = process.env.AUTHORITYURI;
827
+ cookieDomain = process.env.cookieDomain;
828
+ (0, _nookies.destroyCookie)({}, "access_token", {
829
+ maxAge: 2147483647,
830
+ path: '/',
831
+ domain: cookieDomain
832
+ });
833
+ (0, _nookies.destroyCookie)({}, "refresh_token", {
834
+ maxAge: 2147483647,
835
+ path: '/',
836
+ domain: cookieDomain
837
+ });
838
+ (0, _nookies.destroyCookie)({}, "expires_in", {
839
+ maxAge: 2147483647,
840
+ path: '/',
841
+ domain: cookieDomain
842
+ });
843
+ setTimeout(function () {
844
+ window.location.href = AuthUri + "/connect/logout?redirect=" + window.location.href;
845
+ }, 500);
846
+
847
+ case 6:
848
+ case "end":
849
+ return _context3.stop();
850
+ }
851
+ }
852
+ }, _callee3);
853
+ }));
854
+
855
+ function logout() {
856
+ return _logout.apply(this, arguments);
857
+ }
858
+
859
+ return logout;
860
+ }()
861
+ };
862
+ };
863
+
864
+ var _default = authService;
865
+ exports["default"] = _default;
866
+ "use strict";
867
+
868
+ Object.defineProperty(exports, "__esModule", {
869
+ value: true
870
+ });
871
+ exports.GetEnvironment = GetEnvironment;
872
+
873
+ function GetEnvironment() {
874
+ return process.env.STAGE;
875
+ }
876
+ "use strict";
877
+
878
+ Object.defineProperty(exports, "__esModule", {
879
+ value: true
880
+ });
881
+ exports["default"] = void 0;
882
+
883
+ var _react = _interopRequireDefault(require("react"));
884
+
885
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
886
+
887
+ var Helper = function Helper() {
888
+ return {
889
+ isObjectEmpty: function isObjectEmpty(obj) {
890
+ return Object.keys(obj).length == 0;
891
+ }
892
+ };
893
+ };
894
+
895
+ var _default = Helper;
896
+ exports["default"] = _default;
897
+ "use strict";
898
+
899
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
900
+
901
+ Object.defineProperty(exports, "__esModule", {
902
+ value: true
903
+ });
904
+ exports["default"] = void 0;
905
+
906
+ var _react = _interopRequireWildcard(require("react"));
907
+
908
+ var _axios = _interopRequireDefault(require("axios"));
909
+
910
+ var _querystring = _interopRequireDefault(require("querystring"));
911
+
912
+ var _nookies = require("nookies");
913
+
914
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
915
+
916
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
917
+
918
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
919
+
920
+ 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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
921
+
922
+ 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); } }
923
+
924
+ 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); }); }; }
925
+
926
+ var signInValidator = /*#__PURE__*/function () {
927
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(queryCode) {
928
+ var codeVerifier, headers, queryString, response, domain, redirectUri;
929
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
930
+ while (1) {
931
+ switch (_context.prev = _context.next) {
932
+ case 0:
933
+ codeVerifier = window.localStorage.getItem("verifier");
934
+
935
+ if (!(queryCode != null && codeVerifier != null)) {
936
+ _context.next = 18;
937
+ break;
938
+ }
939
+
940
+ headers = {
941
+ 'Content-Type': 'application/x-www-form-urlencoded'
942
+ };
943
+ queryString = _querystring["default"].stringify({
944
+ code: queryCode,
945
+ grant_type: "authorization_code",
946
+ redirect_uri: window.location.origin + "/signin-oidc",
947
+ client_id: process.env.client_id,
948
+ client_secret: process.env.client_secret,
949
+ code_verifier: codeVerifier
950
+ });
951
+ _context.next = 6;
952
+ return _axios["default"].post(process.env.AUTHORITYURI + '/connect/token', queryString, {
953
+ headers: headers
954
+ });
955
+
956
+ case 6:
957
+ response = _context.sent;
958
+ window.localStorage.removeItem("verifier");
959
+ domain = process.env.cookieDomain;
960
+ _context.next = 11;
961
+ return (0, _nookies.setCookie)(null, "access_token", response.data.access_token, {
962
+ maxAge: 2147483647,
963
+ path: '/',
964
+ domain: domain,
965
+ secure: true
966
+ });
967
+
968
+ case 11:
969
+ _context.next = 13;
970
+ return (0, _nookies.setCookie)(null, "expires_in", response.data.expires_in, {
971
+ maxAge: 2147483647,
972
+ path: '/',
973
+ domain: domain,
974
+ secure: true
975
+ });
976
+
977
+ case 13:
978
+ _context.next = 15;
979
+ return (0, _nookies.setCookie)(null, "refresh_token", response.data.refresh_token, {
980
+ maxAge: 2147483647,
981
+ path: '/',
982
+ domain: domain,
983
+ secure: true
984
+ });
985
+
986
+ case 15:
987
+ redirectUri = localStorage.getItem("redirectUri");
988
+ localStorage.clear();
989
+
990
+ if (redirectUri != null) {
991
+ window.location.href = redirectUri;
992
+ } else {
993
+ window.location.href = "/";
994
+ }
995
+
996
+ case 18:
997
+ case "end":
998
+ return _context.stop();
999
+ }
1000
+ }
1001
+ }, _callee);
1002
+ }));
1003
+
1004
+ return function signInValidator(_x) {
1005
+ return _ref.apply(this, arguments);
1006
+ };
1007
+ }();
1008
+
1009
+ var _default = signInValidator;
1010
+ exports["default"] = _default;
1011
+ "use strict";
1012
+
1013
+ Object.defineProperty(exports, "__esModule", {
1014
+ value: true
1015
+ });
1016
+ exports["default"] = void 0;
1017
+
1018
+ var Slug = function Slug(slug) {
1019
+ var index = slug.lastIndexOf("-") + 1;
1020
+
1021
+ if (slug.length > index) {
1022
+ slug = slug.substr(index);
1023
+ return slug;
1024
+ }
1025
+
1026
+ return null;
1027
+ };
1028
+
1029
+ var _default = Slug;
1030
+ exports["default"] = _default;
1031
+ "use strict";
1032
+
1033
+ Object.defineProperty(exports, "__esModule", {
1034
+ value: true
1035
+ });
1036
+ exports["default"] = void 0;
1037
+
1038
+ var storeWithExpiry = function storeWithExpiry() {
1039
+ return {
1040
+ set: function set(key, value, ttl) {
1041
+ var now = new Date();
1042
+ var item = {
1043
+ value: value,
1044
+ expiry: now.getTime() + ttl
1045
+ };
1046
+ localStorage.setItem(key, JSON.stringify(item));
1047
+ },
1048
+ get: function get(key) {
1049
+ var itemStr = localStorage.getItem(key);
1050
+
1051
+ if (!itemStr) {
1052
+ return null;
1053
+ }
1054
+
1055
+ var item = JSON.parse(itemStr);
1056
+ var now = new Date();
1057
+
1058
+ if (now.getTime() > item.expiry) {
1059
+ localStorage.removeItem(key);
1060
+ return null;
1061
+ }
1062
+
1063
+ return item.value;
1064
+ }
1065
+ };
1066
+ };
1067
+
1068
+ var _default = storeWithExpiry;
1069
+ exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.60",
3
+ "version": "1.0.63",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,15 +10,15 @@
10
10
  "author": "zuechb",
11
11
  "license": "ISC",
12
12
  "peerDependencies": {
13
- "react": "^16.6.1",
14
- "react-dom": "^16.6.3"
13
+ "react": "^18.2.0",
14
+ "react-dom": "^18.2.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/cli": "^7.1.5",
18
18
  "@babel/core": "^7.1.6",
19
19
  "@babel/preset-env": "^7.1.6",
20
20
  "@babel/preset-react": "^7.0.0",
21
- "react": "^16.6.1",
22
- "react-dom": "^16.6.3"
21
+ "react": "^18.2.0",
22
+ "react-dom": "^18.2.0"
23
23
  }
24
24
  }
package/readme.md CHANGED
@@ -1,13 +1 @@
1
- Dummy react component
2
- ====
3
-
4
- This will be a how to guide for your fellow developers
5
-
6
- ```
7
- <DummyComponent />
8
- ```
9
-
10
- etc
11
- ===
12
-
13
- Thanks
1
+ Working on docs...