propro-utils 1.7.43 → 1.7.45
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/middlewares/account_info.js +5 -0
- package/package.json +1 -1
- package/src/index.js +10 -0
- package/utils/serviceManager.js +4 -0
|
@@ -197,12 +197,17 @@ const checkIfUserExists = async accountId => {
|
|
|
197
197
|
const userSchema = await ServiceManager.getService("UserSchema");
|
|
198
198
|
|
|
199
199
|
console.log("ACCOUNT INFO: 2", userSchema);
|
|
200
|
+
|
|
200
201
|
const userStyleSchema = await ServiceManager.getService("UserStyleSchema");
|
|
201
202
|
|
|
202
203
|
console.log("ACCOUNT INFO: 3", userStyleSchema);
|
|
204
|
+
|
|
203
205
|
const folderSchema = await ServiceManager.getService("FolderSchema");
|
|
206
|
+
|
|
204
207
|
console.log("ACCOUNT INFO: 4", folderSchema);
|
|
208
|
+
|
|
205
209
|
const themeSchema = await ServiceManager.getService("ThemeSchema");
|
|
210
|
+
|
|
206
211
|
console.log("ACCOUNT INFO: 5", themeSchema);
|
|
207
212
|
|
|
208
213
|
const schemaResults = [
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -100,11 +100,21 @@ class ProProAuthMiddleware {
|
|
|
100
100
|
this.redisClient
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
console.log("SERVER AUTH INITIALIZED", {
|
|
105
|
+
userSchema: this.userSchema,
|
|
106
|
+
userStyleSchema: this.userStyleSchema,
|
|
107
|
+
folderSchema: this.folderSchema,
|
|
108
|
+
themeSchema: this.themeSchema,
|
|
109
|
+
redisClient: this.redisClient
|
|
110
|
+
});
|
|
111
|
+
|
|
103
112
|
ServiceManager.registerService('UserSchema', this.userSchema);
|
|
104
113
|
ServiceManager.registerService('UserStyleSchema', this.userStyleSchema);
|
|
105
114
|
ServiceManager.registerService('RedisClient', this.redisClient);
|
|
106
115
|
ServiceManager.registerService('FolderSchema', this.folderSchema);
|
|
107
116
|
ServiceManager.registerService('ThemeSchema', this.themeSchema);
|
|
117
|
+
|
|
108
118
|
return this.serverAuth.middleware();
|
|
109
119
|
}
|
|
110
120
|
|
package/utils/serviceManager.js
CHANGED
|
@@ -31,15 +31,19 @@ class ServiceManager {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
getService(name) {
|
|
34
|
+
// console.log("GET SERVICE ", {name, service: this.services[name], servicePromise: this.servicePromises[name]});
|
|
35
|
+
|
|
34
36
|
if (this.services[name]) {
|
|
35
37
|
return this.services[name];
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
if (!this.servicePromises[name]) {
|
|
39
41
|
this.servicePromises[name] = {};
|
|
42
|
+
console.log("GET SERVICE - Promise assignment");
|
|
40
43
|
this.servicePromises[name].promise = new Promise(resolve => {
|
|
41
44
|
this.servicePromises[name].resolve = resolve;
|
|
42
45
|
});
|
|
46
|
+
console.log("GET SERVICE - Promise assignment over", this.servicePromises[name]);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
return this.servicePromises[name].promise;
|