propro-utils 1.5.69 → 1.5.72

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.
@@ -99,6 +99,15 @@ async function createDefaultFolders(folderSchema, accountId) {
99
99
  }
100
100
  }
101
101
 
102
+ /**
103
+ * Checks if a user exists based on the given account ID.
104
+ * If the user does not exist, creates a new user with the given account ID.
105
+ * If the user exists but doesn't have global styles, creates them.
106
+ *
107
+ * @param {string} accountId - The account ID of the user to check/create.
108
+ * @returns {Promise<Object>} A promise that resolves to the user object.
109
+ * @throws {Error} If there's an issue with database operations.
110
+ */
102
111
  const debugLog = (area, message, data = null) => {
103
112
  const timestamp = new Date().toISOString();
104
113
  console.log(
@@ -128,15 +137,6 @@ const timeoutPromise = (promise, timeout, name) => {
128
137
  ]);
129
138
  };
130
139
 
131
- /**
132
- * Checks if a user exists based on the given account ID.
133
- * If the user does not exist, creates a new user with the given account ID.
134
- * If the user exists but doesn't have global styles, creates them.
135
- *
136
- * @param {string} accountId - The account ID of the user to check/create.
137
- * @returns {Promise<Object>} A promise that resolves to the user object.
138
- * @throws {Error} If there's an issue with database operations.
139
- */
140
140
  const checkIfUserExists = async accountId => {
141
141
  const startTime = Date.now();
142
142
  try {
@@ -160,7 +160,7 @@ const checkIfUserExists = async accountId => {
160
160
  ServiceManager.getService('FolderSchema').catch(e => {
161
161
  throw new Error(`Failed to get FolderSchema: ${e.message}`);
162
162
  }),
163
- ServiceManager.getService('Theme').catch(e => {
163
+ ServiceManager.getService('ThemeSchema').catch(e => {
164
164
  throw new Error(`Failed to get Theme: ${e.message}`);
165
165
  }),
166
166
  ]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.5.69",
3
+ "version": "1.5.72",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {