appwrite-utils-cli 1.2.15 → 1.2.17

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.
@@ -376,6 +376,12 @@ export const transferUsersLocalToRemote = async (localUsers, endpoint, projectId
376
376
  if (user.status === false) {
377
377
  await tryAwaitWithRetry(async () => remoteUsers.updateStatus(user.$id, false));
378
378
  }
379
+ if (user.emailVerification) {
380
+ await tryAwaitWithRetry(async () => remoteUsers.updateEmailVerification(user.$id, true));
381
+ }
382
+ if (user.phoneVerification) {
383
+ await tryAwaitWithRetry(async () => remoteUsers.updatePhoneVerification(user.$id, true));
384
+ }
379
385
  totalTransferred++;
380
386
  console.log(chalk.green(`Transferred user ${user.$id}`));
381
387
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "appwrite-utils-cli",
3
3
  "description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
4
- "version": "1.2.15",
4
+ "version": "1.2.17",
5
5
  "main": "src/main.ts",
6
6
  "type": "module",
7
7
  "repository": {
@@ -109,7 +109,7 @@ export const createOrUpdateIndexWithStatusCheck = async (
109
109
  collection: Models.Collection,
110
110
  index: Index,
111
111
  retryCount: number = 0,
112
- maxRetries: number = 5
112
+ maxRetries: number = 3,
113
113
  ): Promise<boolean> => {
114
114
  console.log(chalk.blue(`Creating/updating index '${index.key}' (attempt ${retryCount + 1}/${maxRetries + 1})`));
115
115
 
@@ -171,10 +171,10 @@ export const createOrUpdateIndexWithStatusCheck = async (
171
171
  console.log(chalk.red(`Error creating index '${index.key}': ${errorMessage}`));
172
172
 
173
173
  // Check if this is a permanent error that shouldn't be retried
174
- if (errorMessage.includes('not found') ||
175
- errorMessage.includes('missing') ||
176
- errorMessage.includes('does not exist') ||
177
- errorMessage.includes('attribute') && errorMessage.includes('not found')) {
174
+ if (errorMessage.toLowerCase().includes('not found') ||
175
+ errorMessage.toLowerCase().includes('missing') ||
176
+ errorMessage.toLowerCase().includes('does not exist') ||
177
+ errorMessage.toLowerCase().includes('attribute') && errorMessage.toLowerCase().includes('not found')) {
178
178
  console.log(chalk.red(`❌ Index '${index.key}' has permanent error - not retrying`));
179
179
  return false;
180
180
  }
@@ -285,8 +285,7 @@ export const createOrUpdateIndex = async (
285
285
  (existingIndex) =>
286
286
  (existingIndex.key === index.key &&
287
287
  existingIndex.type === index.type &&
288
- existingIndex.attributes === index.attributes) ||
289
- JSON.stringify(existingIndex) === JSON.stringify(index)
288
+ existingIndex.attributes === index.attributes)
290
289
  )
291
290
  ) {
292
291
  await db.deleteIndex(dbId, collectionId, existingIndex.indexes[0].key);