appwrite-utils-cli 1.2.15 → 1.2.16
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/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.
|
4
|
+
"version": "1.2.16",
|
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 =
|
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);
|