dexie-cloud-addon 4.0.1-beta.54 → 4.0.1-beta.55

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.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.0.1-beta.54, Mon Dec 18 2023
11
+ * Version 4.0.1-beta.55, Tue Jan 02 2024
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -2336,7 +2336,28 @@
2336
2336
  function promptForEmail(userInteraction, title, emailHint) {
2337
2337
  return __awaiter(this, void 0, void 0, function* () {
2338
2338
  let email = emailHint || '';
2339
- while (!email || !/^[\w-+.]+@([\w-]+\.)+[\w-]{2,10}$/.test(email)) {
2339
+ // Regular expression for email validation
2340
+ // ^[\w-+.]+@([\w-]+\.)+[\w-]{2,10}(\sas\s[\w-+.]+@([\w-]+\.)+[\w-]{2,10})?$
2341
+ //
2342
+ // ^[\w-+.]+ : Matches the start of the string. Allows one or more word characters
2343
+ // (a-z, A-Z, 0-9, and underscore), hyphen, plus, or dot.
2344
+ //
2345
+ // @ : Matches the @ symbol.
2346
+ // ([\w-]+\.)+ : Matches one or more word characters or hyphens followed by a dot.
2347
+ // The plus sign outside the parentheses means this pattern can repeat one or more times,
2348
+ // allowing for subdomains.
2349
+ // [\w-]{2,10} : Matches between 2 and 10 word characters or hyphens. This is typically for
2350
+ // the domain extension like .com, .net, etc.
2351
+ // (\sas\s[\w-+.]+@([\w-]+\.)+[\w-]{2,10})?$ : This part is optional (due to the ? at the end).
2352
+ // If present, it matches " as " followed by another valid email address. This allows for the
2353
+ // input to be either a single email address or two email addresses separated by " as ".
2354
+ //
2355
+ // The use case for "<email1> as <email2>"" is for when a database owner with full access to the
2356
+ // database needs to impersonate another user in the database in order to troubleshoot. This
2357
+ // format will only be possible to use when email1 is the owner of an API client with GLOBAL_READ
2358
+ // and GLOBAL_WRITE permissions on the database. The email will be checked on the server before
2359
+ // allowing it and giving out a token for email2, using the OTP sent to email1.
2360
+ while (!email || !/^[\w-+.]+@([\w-]+\.)+[\w-]{2,10}(\sas\s[\w-+.]+@([\w-]+\.)+[\w-]{2,10})?$/.test(email)) {
2340
2361
  email = (yield interactWithUser(userInteraction, {
2341
2362
  type: 'email',
2342
2363
  title,
@@ -6228,7 +6249,7 @@
6228
6249
  const syncComplete = new rxjs.Subject();
6229
6250
  dexie.cloud = {
6230
6251
  // @ts-ignore
6231
- version: "4.0.1-beta.54",
6252
+ version: "4.0.1-beta.55",
6232
6253
  options: Object.assign({}, DEFAULT_OPTIONS),
6233
6254
  schema: null,
6234
6255
  get currentUserId() {
@@ -6505,7 +6526,7 @@
6505
6526
  }
6506
6527
  }
6507
6528
  // @ts-ignore
6508
- dexieCloud.version = "4.0.1-beta.54";
6529
+ dexieCloud.version = "4.0.1-beta.55";
6509
6530
  Dexie.Cloud = dexieCloud;
6510
6531
 
6511
6532
  // In case the SW lives for a while, let it reuse already opened connections: