@sera4/essentia 1.1.14 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sera4/essentia",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "A library of utilities for Teleporte Web Services",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/package.tar.gz CHANGED
Binary file
@@ -28,7 +28,8 @@ db.PaperTrail = PaperTrail.init(sequelize, Sequelize, { UUID: true, underscored:
28
28
  debug: false, userModel: 'Account', userModelAttribute: 'account_id',
29
29
  enableCompression: true });
30
30
 
31
- db.PaperTrail.defineModels();
31
+ // sending in DB will allow you to access this using db['Revision'] later.
32
+ db.PaperTrail.defineModels(db);
32
33
 
33
34
  .. and for any model that needs a papertrail, call hasPaperTrail() on it ..
34
35
  db["Tenant"].hasPaperTrail();
@@ -1,7 +1,7 @@
1
1
  import * as jsdiff from 'diff';
2
2
  import _ from 'lodash';
3
3
  import helpers from './helpers.js';
4
- // import Sequelize from 'sequelize';
4
+ import paginator from "../paginator/sql-pagination.js";
5
5
 
6
6
  let failHard = false;
7
7
  let als;
@@ -595,17 +595,16 @@ paperTrail.init = (sequelize, sequelizePackage, optionsArg) => {
595
595
  foreignKey: options.defaultAttributes.revisionId,
596
596
  constraints: false,
597
597
  });
598
+ paginator.paginate(Revision);
598
599
 
599
- // https://github.com/nielsgl/sequelize-paper-trail/issues/10
600
- // RevisionChange.belongsTo(Revision, {
601
- // foreignKey: options.defaultAttributes.revisionId,
602
- // });
603
600
  RevisionChange.belongsTo(Revision);
604
601
 
605
- if (db) db[RevisionChange.name] = RevisionChange;
602
+ if (db)
603
+ db[RevisionChange.name] = RevisionChange;
606
604
  }
607
605
 
608
- if (db) db[Revision.name] = Revision;
606
+ if (db)
607
+ db[Revision.name] = Revision;
609
608
 
610
609
  /*
611
610
  * We could extract this to a separate function so that having a
@@ -634,4 +633,4 @@ paperTrail.enableFailHard = () => {
634
633
  failHard = true;
635
634
  };
636
635
 
637
- export default paperTrail;
636
+ export default paperTrail;