oro-sdk 5.7.0 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,9 @@ function _regeneratorRuntime() {
12
12
  var exports = {},
13
13
  Op = Object.prototype,
14
14
  hasOwn = Op.hasOwnProperty,
15
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
16
+ obj[key] = desc.value;
17
+ },
15
18
  $Symbol = "function" == typeof Symbol ? Symbol : {},
16
19
  iteratorSymbol = $Symbol.iterator || "@@iterator",
17
20
  asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
@@ -35,40 +38,9 @@ function _regeneratorRuntime() {
35
38
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
36
39
  generator = Object.create(protoGenerator.prototype),
37
40
  context = new Context(tryLocsList || []);
38
- return generator._invoke = function (innerFn, self, context) {
39
- var state = "suspendedStart";
40
- return function (method, arg) {
41
- if ("executing" === state) throw new Error("Generator is already running");
42
- if ("completed" === state) {
43
- if ("throw" === method) throw arg;
44
- return doneResult();
45
- }
46
- for (context.method = method, context.arg = arg;;) {
47
- var delegate = context.delegate;
48
- if (delegate) {
49
- var delegateResult = maybeInvokeDelegate(delegate, context);
50
- if (delegateResult) {
51
- if (delegateResult === ContinueSentinel) continue;
52
- return delegateResult;
53
- }
54
- }
55
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
56
- if ("suspendedStart" === state) throw state = "completed", context.arg;
57
- context.dispatchException(context.arg);
58
- } else "return" === context.method && context.abrupt("return", context.arg);
59
- state = "executing";
60
- var record = tryCatch(innerFn, self, context);
61
- if ("normal" === record.type) {
62
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
63
- return {
64
- value: record.arg,
65
- done: context.done
66
- };
67
- }
68
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
69
- }
70
- };
71
- }(innerFn, self, context), generator;
41
+ return defineProperty(generator, "_invoke", {
42
+ value: makeInvokeMethod(innerFn, self, context)
43
+ }), generator;
72
44
  }
73
45
  function tryCatch(fn, obj, arg) {
74
46
  try {
@@ -122,13 +94,49 @@ function _regeneratorRuntime() {
122
94
  reject(record.arg);
123
95
  }
124
96
  var previousPromise;
125
- this._invoke = function (method, arg) {
126
- function callInvokeWithMethodAndArg() {
127
- return new PromiseImpl(function (resolve, reject) {
128
- invoke(method, arg, resolve, reject);
129
- });
97
+ defineProperty(this, "_invoke", {
98
+ value: function (method, arg) {
99
+ function callInvokeWithMethodAndArg() {
100
+ return new PromiseImpl(function (resolve, reject) {
101
+ invoke(method, arg, resolve, reject);
102
+ });
103
+ }
104
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
105
+ }
106
+ });
107
+ }
108
+ function makeInvokeMethod(innerFn, self, context) {
109
+ var state = "suspendedStart";
110
+ return function (method, arg) {
111
+ if ("executing" === state) throw new Error("Generator is already running");
112
+ if ("completed" === state) {
113
+ if ("throw" === method) throw arg;
114
+ return doneResult();
115
+ }
116
+ for (context.method = method, context.arg = arg;;) {
117
+ var delegate = context.delegate;
118
+ if (delegate) {
119
+ var delegateResult = maybeInvokeDelegate(delegate, context);
120
+ if (delegateResult) {
121
+ if (delegateResult === ContinueSentinel) continue;
122
+ return delegateResult;
123
+ }
124
+ }
125
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
126
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
127
+ context.dispatchException(context.arg);
128
+ } else "return" === context.method && context.abrupt("return", context.arg);
129
+ state = "executing";
130
+ var record = tryCatch(innerFn, self, context);
131
+ if ("normal" === record.type) {
132
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
133
+ return {
134
+ value: record.arg,
135
+ done: context.done
136
+ };
137
+ }
138
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
130
139
  }
131
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
132
140
  };
133
141
  }
134
142
  function maybeInvokeDelegate(delegate, context) {
@@ -184,7 +192,13 @@ function _regeneratorRuntime() {
184
192
  done: !0
185
193
  };
186
194
  }
187
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
195
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
196
+ value: GeneratorFunctionPrototype,
197
+ configurable: !0
198
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
199
+ value: GeneratorFunction,
200
+ configurable: !0
201
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
188
202
  var ctor = "function" == typeof genFun && genFun.constructor;
189
203
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
190
204
  }, exports.mark = function (genFun) {
@@ -205,8 +219,9 @@ function _regeneratorRuntime() {
205
219
  return this;
206
220
  }), define(Gp, "toString", function () {
207
221
  return "[object Generator]";
208
- }), exports.keys = function (object) {
209
- var keys = [];
222
+ }), exports.keys = function (val) {
223
+ var object = Object(val),
224
+ keys = [];
210
225
  for (var key in object) keys.push(key);
211
226
  return keys.reverse(), function next() {
212
227
  for (; keys.length;) {
@@ -319,12 +334,18 @@ function _wrapRegExp() {
319
334
  }
320
335
  return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
321
336
  var result = _super.exec.call(this, str);
322
- return result && (result.groups = buildGroups(result, this)), result;
337
+ if (result) {
338
+ result.groups = buildGroups(result, this);
339
+ var indices = result.indices;
340
+ indices && (indices.groups = buildGroups(indices, this));
341
+ }
342
+ return result;
323
343
  }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
324
344
  if ("string" == typeof substitution) {
325
345
  var groups = _groups.get(this);
326
346
  return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
327
- return "$" + groups[name];
347
+ var group = groups[name];
348
+ return "$" + (Array.isArray(group) ? group.join("$") : group);
328
349
  }));
329
350
  }
330
351
  if ("function" == typeof substitution) {
@@ -2087,7 +2108,7 @@ var OroClient = /*#__PURE__*/function () {
2087
2108
  /*#__PURE__*/
2088
2109
  function () {
2089
2110
  var _signUp = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(email, password, practice, tosAndCpAcceptance, tokenData, subscription, skipEmailValidation) {
2090
- var privateKey, symmetricEncryptor, recoveryPassword, hashedPassword, emailConfirmed, signupRequest, identity, symetricEncryptor;
2111
+ var privateKey, symmetricEncryptor, recoveryPassword, hashedPassword, emailConfirmed, subscriptionAcceptance, signupRequest, identity, symetricEncryptor;
2091
2112
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2092
2113
  while (1) {
2093
2114
  switch (_context2.prev = _context2.next) {
@@ -2097,21 +2118,25 @@ var OroClient = /*#__PURE__*/function () {
2097
2118
  symmetricEncryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
2098
2119
  recoveryPassword = symmetricEncryptor.bytesEncryptToBase64Payload(privateKey);
2099
2120
  hashedPassword = this.toolbox.hashStringToBase64(this.toolbox.hashStringToBase64(password));
2121
+ email = email.toLowerCase();
2100
2122
  emailConfirmed = !!skipEmailValidation;
2123
+ subscriptionAcceptance = subscription ? {
2124
+ email: email
2125
+ } : undefined;
2101
2126
  signupRequest = {
2102
2127
  practiceUuid: practice.uuid,
2103
- email: email.toLowerCase(),
2128
+ email: email,
2104
2129
  emailConfirmed: emailConfirmed,
2105
2130
  password: hashedPassword,
2106
2131
  publicKey: this.toolbox.encodeToBase64(this.rsa["public"]()),
2107
2132
  recoveryPassword: recoveryPassword,
2108
2133
  tosAndCpAcceptance: tosAndCpAcceptance,
2109
2134
  tokenData: tokenData,
2110
- subscription: subscription
2135
+ subscriptionAcceptance: subscriptionAcceptance
2111
2136
  };
2112
- _context2.next = 9;
2137
+ _context2.next = 11;
2113
2138
  return this.guardClient.identityCreate(signupRequest);
2114
- case 9:
2139
+ case 11:
2115
2140
  identity = _context2.sent;
2116
2141
  if (identity.recoveryLogin) {
2117
2142
  //Ensure we can recover from a page reload
@@ -2119,7 +2144,7 @@ var OroClient = /*#__PURE__*/function () {
2119
2144
  sessionStorage.setItem(sessionStorePrivateKeyName(identity.id), symetricEncryptor.bytesEncryptToBase64Payload(privateKey));
2120
2145
  }
2121
2146
  return _context2.abrupt("return", identity);
2122
- case 12:
2147
+ case 14:
2123
2148
  case "end":
2124
2149
  return _context2.stop();
2125
2150
  }