@sprucelabs/data-stores 28.1.8 → 28.1.10

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.
@@ -756,7 +756,7 @@ const databaseAssertUtil = {
756
756
  assert.isEqual(indexes[0][0].toLowerCase(), 'uniquefield');
757
757
  yield db.syncUniqueIndexes(this.collectionName, [
758
758
  {
759
- fields: ['username'],
759
+ fields: ['uniqueField'],
760
760
  filter: { isActive: true },
761
761
  },
762
762
  ]);
@@ -766,7 +766,7 @@ const databaseAssertUtil = {
766
766
  filter: { otherField: { $exists: true } },
767
767
  },
768
768
  {
769
- fields: ['username'],
769
+ fields: ['uniqueField'],
770
770
  filter: { isActive: true },
771
771
  },
772
772
  ]);
@@ -1474,9 +1474,9 @@ const databaseAssertUtil = {
1474
1474
  try {
1475
1475
  yield db.syncUniqueIndexes(this.collectionName, [
1476
1476
  {
1477
- fields: ['username', 'dateScrambled'],
1477
+ fields: ['uniqueField', 'someField3'],
1478
1478
  filter: {
1479
- username: { $exists: true },
1479
+ uniqueField: { $exists: true },
1480
1480
  },
1481
1481
  },
1482
1482
  ]);
@@ -1487,9 +1487,9 @@ const databaseAssertUtil = {
1487
1487
  }
1488
1488
  try {
1489
1489
  yield db.createOne(this.collectionName, {
1490
- username: 'test',
1491
- phone: null,
1492
- dateScrambled: 'test',
1490
+ uniqueField: 'test',
1491
+ slug: null,
1492
+ someField3: 'test',
1493
1493
  });
1494
1494
  }
1495
1495
  catch (err) {
@@ -1497,30 +1497,30 @@ const databaseAssertUtil = {
1497
1497
  err.stack) !== null && _b !== void 0 ? _b : err.message);
1498
1498
  }
1499
1499
  yield assert.doesThrowAsync(() => db.createOne(this.collectionName, {
1500
- username: 'test',
1501
- phone: null,
1502
- dateScrambled: 'test',
1500
+ uniqueField: 'test',
1501
+ slug: null,
1502
+ someField3: 'test',
1503
1503
  }), undefined, `Creating a duplicate record with should throw an error.`);
1504
1504
  yield db.createOne(this.collectionName, {
1505
- phone: '555-000-0000',
1506
- dateScrambled: 'test',
1505
+ slug: '555-000-0000',
1506
+ someField3: 'test',
1507
1507
  });
1508
1508
  yield db.createOne(this.collectionName, {
1509
- phone: '555-000-0001',
1510
- dateScrambled: 'test',
1509
+ slug: '555-000-0001',
1510
+ someField3: 'test',
1511
1511
  });
1512
1512
  try {
1513
1513
  yield db.syncUniqueIndexes(this.collectionName, [
1514
1514
  {
1515
- fields: ['username', 'dateScrambled'],
1515
+ fields: ['uniqueField', 'someField3'],
1516
1516
  filter: {
1517
- username: { $exists: true },
1517
+ uniqueField: { $exists: true },
1518
1518
  },
1519
1519
  },
1520
1520
  {
1521
- fields: ['phone', 'dateScrambled'],
1521
+ fields: ['slug', 'someField3'],
1522
1522
  filter: {
1523
- phone: { $exists: true, $type: 'string' },
1523
+ slug: { $exists: true, $type: 'string' },
1524
1524
  },
1525
1525
  },
1526
1526
  ]);
@@ -1530,15 +1530,15 @@ const databaseAssertUtil = {
1530
1530
  err.stack) !== null && _c !== void 0 ? _c : err.message);
1531
1531
  }
1532
1532
  yield db.createOne(this.collectionName, {
1533
- username: 'test',
1534
- phone: null,
1535
- dateScrambled: 'next',
1533
+ uniqueField: 'test',
1534
+ slug: null,
1535
+ someField3: 'next',
1536
1536
  });
1537
1537
  try {
1538
1538
  yield db.createOne(this.collectionName, {
1539
- username: 'test2',
1540
- phone: null,
1541
- dateScrambled: 'next',
1539
+ uniqueField: 'test2',
1540
+ slug: null,
1541
+ someField3: 'next',
1542
1542
  });
1543
1543
  }
1544
1544
  catch (err) {
@@ -689,7 +689,7 @@ const databaseAssertUtil = {
689
689
  test_utils_1.assert.isEqual(indexes[0][0].toLowerCase(), 'uniquefield');
690
690
  await db.syncUniqueIndexes(this.collectionName, [
691
691
  {
692
- fields: ['username'],
692
+ fields: ['uniqueField'],
693
693
  filter: { isActive: true },
694
694
  },
695
695
  ]);
@@ -699,7 +699,7 @@ const databaseAssertUtil = {
699
699
  filter: { otherField: { $exists: true } },
700
700
  },
701
701
  {
702
- fields: ['username'],
702
+ fields: ['uniqueField'],
703
703
  filter: { isActive: true },
704
704
  },
705
705
  ]);
@@ -1349,9 +1349,9 @@ const databaseAssertUtil = {
1349
1349
  try {
1350
1350
  await db.syncUniqueIndexes(this.collectionName, [
1351
1351
  {
1352
- fields: ['username', 'dateScrambled'],
1352
+ fields: ['uniqueField', 'someField3'],
1353
1353
  filter: {
1354
- username: { $exists: true },
1354
+ uniqueField: { $exists: true },
1355
1355
  },
1356
1356
  },
1357
1357
  ]);
@@ -1362,9 +1362,9 @@ const databaseAssertUtil = {
1362
1362
  }
1363
1363
  try {
1364
1364
  await db.createOne(this.collectionName, {
1365
- username: 'test',
1366
- phone: null,
1367
- dateScrambled: 'test',
1365
+ uniqueField: 'test',
1366
+ slug: null,
1367
+ someField3: 'test',
1368
1368
  });
1369
1369
  }
1370
1370
  catch (err) {
@@ -1372,30 +1372,30 @@ const databaseAssertUtil = {
1372
1372
  err.stack) !== null && _b !== void 0 ? _b : err.message);
1373
1373
  }
1374
1374
  await test_utils_1.assert.doesThrowAsync(() => db.createOne(this.collectionName, {
1375
- username: 'test',
1376
- phone: null,
1377
- dateScrambled: 'test',
1375
+ uniqueField: 'test',
1376
+ slug: null,
1377
+ someField3: 'test',
1378
1378
  }), undefined, `Creating a duplicate record with should throw an error.`);
1379
1379
  await db.createOne(this.collectionName, {
1380
- phone: '555-000-0000',
1381
- dateScrambled: 'test',
1380
+ slug: '555-000-0000',
1381
+ someField3: 'test',
1382
1382
  });
1383
1383
  await db.createOne(this.collectionName, {
1384
- phone: '555-000-0001',
1385
- dateScrambled: 'test',
1384
+ slug: '555-000-0001',
1385
+ someField3: 'test',
1386
1386
  });
1387
1387
  try {
1388
1388
  await db.syncUniqueIndexes(this.collectionName, [
1389
1389
  {
1390
- fields: ['username', 'dateScrambled'],
1390
+ fields: ['uniqueField', 'someField3'],
1391
1391
  filter: {
1392
- username: { $exists: true },
1392
+ uniqueField: { $exists: true },
1393
1393
  },
1394
1394
  },
1395
1395
  {
1396
- fields: ['phone', 'dateScrambled'],
1396
+ fields: ['slug', 'someField3'],
1397
1397
  filter: {
1398
- phone: { $exists: true, $type: 'string' },
1398
+ slug: { $exists: true, $type: 'string' },
1399
1399
  },
1400
1400
  },
1401
1401
  ]);
@@ -1405,15 +1405,15 @@ const databaseAssertUtil = {
1405
1405
  err.stack) !== null && _c !== void 0 ? _c : err.message);
1406
1406
  }
1407
1407
  await db.createOne(this.collectionName, {
1408
- username: 'test',
1409
- phone: null,
1410
- dateScrambled: 'next',
1408
+ uniqueField: 'test',
1409
+ slug: null,
1410
+ someField3: 'next',
1411
1411
  });
1412
1412
  try {
1413
1413
  await db.createOne(this.collectionName, {
1414
- username: 'test2',
1415
- phone: null,
1416
- dateScrambled: 'next',
1414
+ uniqueField: 'test2',
1415
+ slug: null,
1416
+ someField3: 'next',
1417
1417
  });
1418
1418
  }
1419
1419
  catch (err) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "28.1.8",
6
+ "version": "28.1.10",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "!build/__tests__",