propro-utils 1.7.45 → 1.7.47
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 +19 -20
- package/package.json +1 -1
- package/src/index.js +16 -12
|
@@ -177,45 +177,44 @@ const checkIfUserExists = async accountId => {
|
|
|
177
177
|
console.warn("Invalid accountId provided:", accountId);
|
|
178
178
|
throw new Error("Invalid accountId provided");
|
|
179
179
|
}
|
|
180
|
-
console.log("ACCOUNT INFO: 1");
|
|
180
|
+
// console.log("ACCOUNT INFO: 1");
|
|
181
181
|
|
|
182
182
|
try {
|
|
183
|
-
|
|
184
|
-
const schemaResults = await Promise.all([
|
|
183
|
+
const schemaResults = await Promise.all([
|
|
185
184
|
ServiceManager.getService("UserSchema"),
|
|
186
185
|
ServiceManager.getService("UserStyleSchema"),
|
|
187
186
|
ServiceManager.getService("FolderSchema"),
|
|
188
187
|
ServiceManager.getService("ThemeSchema"),
|
|
189
188
|
]);
|
|
190
189
|
|
|
191
|
-
console.log("ACCOUNT INFO: 2", schemaResults);
|
|
190
|
+
// console.log("ACCOUNT INFO: 2", schemaResults);
|
|
192
191
|
|
|
193
192
|
const [userSchema, userStyleSchema, folderSchema, themeSchema] =
|
|
194
193
|
schemaResults;
|
|
195
194
|
|
|
196
|
-
|
|
197
|
-
const userSchema = await ServiceManager.getService("UserSchema");
|
|
195
|
+
// */
|
|
196
|
+
// const userSchema = await ServiceManager.getService("UserSchema");
|
|
198
197
|
|
|
199
|
-
console.log("ACCOUNT INFO: 2", userSchema);
|
|
198
|
+
// console.log("ACCOUNT INFO: 2", userSchema);
|
|
200
199
|
|
|
201
|
-
const userStyleSchema = await ServiceManager.getService("UserStyleSchema");
|
|
200
|
+
// const userStyleSchema = await ServiceManager.getService("UserStyleSchema");
|
|
202
201
|
|
|
203
|
-
console.log("ACCOUNT INFO: 3", userStyleSchema);
|
|
202
|
+
// console.log("ACCOUNT INFO: 3", userStyleSchema);
|
|
204
203
|
|
|
205
|
-
const folderSchema = await ServiceManager.getService("FolderSchema");
|
|
204
|
+
// const folderSchema = await ServiceManager.getService("FolderSchema");
|
|
206
205
|
|
|
207
|
-
console.log("ACCOUNT INFO: 4", folderSchema);
|
|
206
|
+
// console.log("ACCOUNT INFO: 4", folderSchema);
|
|
208
207
|
|
|
209
|
-
const themeSchema = await ServiceManager.getService("ThemeSchema");
|
|
210
|
-
|
|
211
|
-
console.log("ACCOUNT INFO: 5", themeSchema);
|
|
208
|
+
// const themeSchema = await ServiceManager.getService("ThemeSchema");
|
|
212
209
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
210
|
+
// console.log("ACCOUNT INFO: 5", themeSchema);
|
|
211
|
+
|
|
212
|
+
// const schemaResults = [
|
|
213
|
+
// userSchema,
|
|
214
|
+
// userStyleSchema,
|
|
215
|
+
// folderSchema,
|
|
216
|
+
// themeSchema,
|
|
217
|
+
// ];
|
|
219
218
|
|
|
220
219
|
|
|
221
220
|
if (!userSchema) {
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -101,19 +101,23 @@ class ProProAuthMiddleware {
|
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
console.log("SERVER AUTH INITIALIZED", {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
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
111
|
|
|
112
|
-
ServiceManager.registerService('UserSchema', this.userSchema);
|
|
113
|
-
|
|
114
|
-
ServiceManager.registerService('
|
|
115
|
-
|
|
116
|
-
ServiceManager.registerService('
|
|
112
|
+
if (!!this?.userSchema) ServiceManager.registerService('UserSchema', this.userSchema);
|
|
113
|
+
|
|
114
|
+
if (!!this?.userStyleSchema) ServiceManager.registerService('UserStyleSchema', this.userStyleSchema);
|
|
115
|
+
|
|
116
|
+
if (!!this?.redisClient) ServiceManager.registerService('RedisClient', this.redisClient);
|
|
117
|
+
|
|
118
|
+
if (!!this?.folderSchema) ServiceManager.registerService('FolderSchema', this.folderSchema);
|
|
119
|
+
|
|
120
|
+
if (!!this?.themeSchema) ServiceManager.registerService('ThemeSchema', this.themeSchema);
|
|
117
121
|
|
|
118
122
|
return this.serverAuth.middleware();
|
|
119
123
|
}
|