propro-utils 1.5.47 → 1.5.50

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.
@@ -88,7 +88,7 @@ async function createDefaultFolders(folderSchema, accountId) {
88
88
  folderSchema.create({
89
89
  ...folder,
90
90
  id: uuidv4(),
91
- accountId,
91
+ user_id: accountId,
92
92
  })
93
93
  );
94
94
  return Promise.all(folderPromises);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.5.47",
3
+ "version": "1.5.50",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -50,10 +50,17 @@ let _serverAuth, _clientAuth;
50
50
  * ```
51
51
  */
52
52
  class ProProAuthMiddleware {
53
- constructor(options = {}, userSchema, userStyleSchema, redisClient) {
53
+ constructor(
54
+ options = {},
55
+ userSchema,
56
+ userStyleSchema,
57
+ folderSchema,
58
+ redisClient
59
+ ) {
54
60
  this.options = options;
55
61
  this.userSchema = userSchema;
56
62
  this.userStyleSchema = userStyleSchema;
63
+ this.folderSchema = folderSchema;
57
64
  this.redisClient = redisClient;
58
65
  this.serverAuth = null;
59
66
  this.clientAuth = null;
@@ -84,6 +91,7 @@ class ProProAuthMiddleware {
84
91
  this.options.serverOptions,
85
92
  this.userSchema,
86
93
  this.userStyleSchema,
94
+ this.folderSchema,
87
95
  this.redisClient
88
96
  );
89
97
  }
@@ -91,6 +99,7 @@ class ProProAuthMiddleware {
91
99
  ServiceManager.registerService('UserSchema', this.userSchema);
92
100
  ServiceManager.registerService('UserStyleSchema', this.userStyleSchema);
93
101
  ServiceManager.registerService('RedisClient', this.redisClient);
102
+ ServiceManager.registerService('FolderSchema', this.folderSchema);
94
103
  return this.serverAuth.middleware();
95
104
  }
96
105