appwrite-utils-cli 0.9.71 → 0.9.73
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/README.md +1 -0
- package/dist/migrations/attributes.js +18 -18
- package/package.json +1 -1
- package/src/migrations/attributes.ts +18 -18
package/README.md
CHANGED
@@ -124,6 +124,7 @@ This updated CLI ensures that developers have robust tools at their fingertips t
|
|
124
124
|
|
125
125
|
## Changelog
|
126
126
|
|
127
|
+
- 0.9.72: Fixed my own null bug
|
127
128
|
- 0.9.71: Reverted `node-appwrite` to 14, this seems to fix the xdefault error
|
128
129
|
- 0.9.70: I think I stopped it from deleting attributes, my bad on that
|
129
130
|
- 0.9.68: Temporarily disabled updating Attributes until `updateStringAttribute` is fixed -- it just deletes them now
|
@@ -124,10 +124,10 @@ export const createOrUpdateAttribute = async (db, dbId, collection, attribute) =
|
|
124
124
|
switch (finalAttribute.type) {
|
125
125
|
case "string":
|
126
126
|
if (action === "create") {
|
127
|
-
await tryAwaitWithRetry(async () => await db.createStringAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.size, finalAttribute.required || false, finalAttribute.xdefault
|
127
|
+
await tryAwaitWithRetry(async () => await db.createStringAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.size, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false, finalAttribute.encrypted));
|
128
128
|
}
|
129
129
|
else {
|
130
|
-
await tryAwaitWithRetry(async () => await db.updateStringAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
130
|
+
await tryAwaitWithRetry(async () => await db.updateStringAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
131
131
|
}
|
132
132
|
break;
|
133
133
|
case "integer":
|
@@ -140,7 +140,7 @@ export const createOrUpdateAttribute = async (db, dbId, collection, attribute) =
|
|
140
140
|
BigInt(finalAttribute.max) === BigInt(9223372036854776000)) {
|
141
141
|
delete finalAttribute.max;
|
142
142
|
}
|
143
|
-
await tryAwaitWithRetry(async () => await db.createIntegerAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault
|
143
|
+
await tryAwaitWithRetry(async () => await db.createIntegerAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
144
144
|
}
|
145
145
|
else {
|
146
146
|
if (finalAttribute.min &&
|
@@ -151,63 +151,63 @@ export const createOrUpdateAttribute = async (db, dbId, collection, attribute) =
|
|
151
151
|
BigInt(finalAttribute.max) === BigInt(9223372036854776000)) {
|
152
152
|
delete finalAttribute.max;
|
153
153
|
}
|
154
|
-
await tryAwaitWithRetry(async () => await db.updateIntegerAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault
|
154
|
+
await tryAwaitWithRetry(async () => await db.updateIntegerAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
155
155
|
}
|
156
156
|
break;
|
157
157
|
case "float":
|
158
158
|
if (action === "create") {
|
159
|
-
await tryAwaitWithRetry(async () => await db.createFloatAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault
|
159
|
+
await tryAwaitWithRetry(async () => await db.createFloatAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
160
160
|
}
|
161
161
|
else {
|
162
|
-
await tryAwaitWithRetry(async () => await db.updateFloatAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault
|
162
|
+
await tryAwaitWithRetry(async () => await db.updateFloatAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.min || -2147483647, finalAttribute.max || 2147483647, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
163
163
|
}
|
164
164
|
break;
|
165
165
|
case "boolean":
|
166
166
|
if (action === "create") {
|
167
|
-
await tryAwaitWithRetry(async () => await db.createBooleanAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
167
|
+
await tryAwaitWithRetry(async () => await db.createBooleanAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
168
168
|
}
|
169
169
|
else {
|
170
|
-
await tryAwaitWithRetry(async () => await db.updateBooleanAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
170
|
+
await tryAwaitWithRetry(async () => await db.updateBooleanAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
171
171
|
}
|
172
172
|
break;
|
173
173
|
case "datetime":
|
174
174
|
if (action === "create") {
|
175
|
-
await tryAwaitWithRetry(async () => await db.createDatetimeAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
175
|
+
await tryAwaitWithRetry(async () => await db.createDatetimeAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
176
176
|
}
|
177
177
|
else {
|
178
|
-
await tryAwaitWithRetry(async () => await db.updateDatetimeAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
178
|
+
await tryAwaitWithRetry(async () => await db.updateDatetimeAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
179
179
|
}
|
180
180
|
break;
|
181
181
|
case "email":
|
182
182
|
if (action === "create") {
|
183
|
-
await tryAwaitWithRetry(async () => await db.createEmailAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
183
|
+
await tryAwaitWithRetry(async () => await db.createEmailAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
184
184
|
}
|
185
185
|
else {
|
186
|
-
await tryAwaitWithRetry(async () => await db.updateEmailAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
186
|
+
await tryAwaitWithRetry(async () => await db.updateEmailAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
187
187
|
}
|
188
188
|
break;
|
189
189
|
case "ip":
|
190
190
|
if (action === "create") {
|
191
|
-
await tryAwaitWithRetry(async () => await db.createIpAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
191
|
+
await tryAwaitWithRetry(async () => await db.createIpAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
192
192
|
}
|
193
193
|
else {
|
194
|
-
await tryAwaitWithRetry(async () => await db.updateIpAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
194
|
+
await tryAwaitWithRetry(async () => await db.updateIpAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
195
195
|
}
|
196
196
|
break;
|
197
197
|
case "url":
|
198
198
|
if (action === "create") {
|
199
|
-
await tryAwaitWithRetry(async () => await db.createUrlAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
199
|
+
await tryAwaitWithRetry(async () => await db.createUrlAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
200
200
|
}
|
201
201
|
else {
|
202
|
-
await tryAwaitWithRetry(async () => await db.updateUrlAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault
|
202
|
+
await tryAwaitWithRetry(async () => await db.updateUrlAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
203
203
|
}
|
204
204
|
break;
|
205
205
|
case "enum":
|
206
206
|
if (action === "create") {
|
207
|
-
await tryAwaitWithRetry(async () => await db.createEnumAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.elements, finalAttribute.required || false, finalAttribute.xdefault
|
207
|
+
await tryAwaitWithRetry(async () => await db.createEnumAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.elements, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null, finalAttribute.array || false));
|
208
208
|
}
|
209
209
|
else {
|
210
|
-
await tryAwaitWithRetry(async () => await db.updateEnumAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.elements, finalAttribute.required || false, finalAttribute.xdefault
|
210
|
+
await tryAwaitWithRetry(async () => await db.updateEnumAttribute(dbId, collection.$id, finalAttribute.key, finalAttribute.elements, finalAttribute.required || false, finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null));
|
211
211
|
}
|
212
212
|
break;
|
213
213
|
case "relationship":
|
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": "0.9.
|
4
|
+
"version": "0.9.73",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -165,7 +165,7 @@ export const createOrUpdateAttribute = async (
|
|
165
165
|
finalAttribute.key,
|
166
166
|
finalAttribute.size,
|
167
167
|
finalAttribute.required || false,
|
168
|
-
finalAttribute.xdefault
|
168
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
169
169
|
finalAttribute.array || false,
|
170
170
|
finalAttribute.encrypted
|
171
171
|
)
|
@@ -178,7 +178,7 @@ export const createOrUpdateAttribute = async (
|
|
178
178
|
collection.$id,
|
179
179
|
finalAttribute.key,
|
180
180
|
finalAttribute.required || false,
|
181
|
-
finalAttribute.xdefault
|
181
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
182
182
|
)
|
183
183
|
);
|
184
184
|
}
|
@@ -206,7 +206,7 @@ export const createOrUpdateAttribute = async (
|
|
206
206
|
finalAttribute.required || false,
|
207
207
|
finalAttribute.min || -2147483647,
|
208
208
|
finalAttribute.max || 2147483647,
|
209
|
-
finalAttribute.xdefault
|
209
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
210
210
|
finalAttribute.array || false
|
211
211
|
)
|
212
212
|
);
|
@@ -232,7 +232,7 @@ export const createOrUpdateAttribute = async (
|
|
232
232
|
finalAttribute.required || false,
|
233
233
|
finalAttribute.min || -2147483647,
|
234
234
|
finalAttribute.max || 2147483647,
|
235
|
-
finalAttribute.xdefault
|
235
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
236
236
|
)
|
237
237
|
);
|
238
238
|
}
|
@@ -248,7 +248,7 @@ export const createOrUpdateAttribute = async (
|
|
248
248
|
finalAttribute.required || false,
|
249
249
|
finalAttribute.min || -2147483647,
|
250
250
|
finalAttribute.max || 2147483647,
|
251
|
-
finalAttribute.xdefault
|
251
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
252
252
|
finalAttribute.array || false
|
253
253
|
)
|
254
254
|
);
|
@@ -262,7 +262,7 @@ export const createOrUpdateAttribute = async (
|
|
262
262
|
finalAttribute.required || false,
|
263
263
|
finalAttribute.min || -2147483647,
|
264
264
|
finalAttribute.max || 2147483647,
|
265
|
-
finalAttribute.xdefault
|
265
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
266
266
|
)
|
267
267
|
);
|
268
268
|
}
|
@@ -276,7 +276,7 @@ export const createOrUpdateAttribute = async (
|
|
276
276
|
collection.$id,
|
277
277
|
finalAttribute.key,
|
278
278
|
finalAttribute.required || false,
|
279
|
-
finalAttribute.xdefault
|
279
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
280
280
|
finalAttribute.array || false
|
281
281
|
)
|
282
282
|
);
|
@@ -288,7 +288,7 @@ export const createOrUpdateAttribute = async (
|
|
288
288
|
collection.$id,
|
289
289
|
finalAttribute.key,
|
290
290
|
finalAttribute.required || false,
|
291
|
-
finalAttribute.xdefault
|
291
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
292
292
|
)
|
293
293
|
);
|
294
294
|
}
|
@@ -302,7 +302,7 @@ export const createOrUpdateAttribute = async (
|
|
302
302
|
collection.$id,
|
303
303
|
finalAttribute.key,
|
304
304
|
finalAttribute.required || false,
|
305
|
-
finalAttribute.xdefault
|
305
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
306
306
|
finalAttribute.array || false
|
307
307
|
)
|
308
308
|
);
|
@@ -314,7 +314,7 @@ export const createOrUpdateAttribute = async (
|
|
314
314
|
collection.$id,
|
315
315
|
finalAttribute.key,
|
316
316
|
finalAttribute.required || false,
|
317
|
-
finalAttribute.xdefault
|
317
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
318
318
|
)
|
319
319
|
);
|
320
320
|
}
|
@@ -328,7 +328,7 @@ export const createOrUpdateAttribute = async (
|
|
328
328
|
collection.$id,
|
329
329
|
finalAttribute.key,
|
330
330
|
finalAttribute.required || false,
|
331
|
-
finalAttribute.xdefault
|
331
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
332
332
|
finalAttribute.array || false
|
333
333
|
)
|
334
334
|
);
|
@@ -340,7 +340,7 @@ export const createOrUpdateAttribute = async (
|
|
340
340
|
collection.$id,
|
341
341
|
finalAttribute.key,
|
342
342
|
finalAttribute.required || false,
|
343
|
-
finalAttribute.xdefault
|
343
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
344
344
|
)
|
345
345
|
);
|
346
346
|
}
|
@@ -354,7 +354,7 @@ export const createOrUpdateAttribute = async (
|
|
354
354
|
collection.$id,
|
355
355
|
finalAttribute.key,
|
356
356
|
finalAttribute.required || false,
|
357
|
-
finalAttribute.xdefault
|
357
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
358
358
|
finalAttribute.array || false
|
359
359
|
)
|
360
360
|
);
|
@@ -366,7 +366,7 @@ export const createOrUpdateAttribute = async (
|
|
366
366
|
collection.$id,
|
367
367
|
finalAttribute.key,
|
368
368
|
finalAttribute.required || false,
|
369
|
-
finalAttribute.xdefault
|
369
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
370
370
|
)
|
371
371
|
);
|
372
372
|
}
|
@@ -380,7 +380,7 @@ export const createOrUpdateAttribute = async (
|
|
380
380
|
collection.$id,
|
381
381
|
finalAttribute.key,
|
382
382
|
finalAttribute.required || false,
|
383
|
-
finalAttribute.xdefault
|
383
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
384
384
|
finalAttribute.array || false
|
385
385
|
)
|
386
386
|
);
|
@@ -392,7 +392,7 @@ export const createOrUpdateAttribute = async (
|
|
392
392
|
collection.$id,
|
393
393
|
finalAttribute.key,
|
394
394
|
finalAttribute.required || false,
|
395
|
-
finalAttribute.xdefault
|
395
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
396
396
|
)
|
397
397
|
);
|
398
398
|
}
|
@@ -407,7 +407,7 @@ export const createOrUpdateAttribute = async (
|
|
407
407
|
finalAttribute.key,
|
408
408
|
finalAttribute.elements,
|
409
409
|
finalAttribute.required || false,
|
410
|
-
finalAttribute.xdefault
|
410
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null,
|
411
411
|
finalAttribute.array || false
|
412
412
|
)
|
413
413
|
);
|
@@ -420,7 +420,7 @@ export const createOrUpdateAttribute = async (
|
|
420
420
|
finalAttribute.key,
|
421
421
|
finalAttribute.elements,
|
422
422
|
finalAttribute.required || false,
|
423
|
-
finalAttribute.xdefault
|
423
|
+
finalAttribute.xdefault !== undefined ? finalAttribute.xdefault : null
|
424
424
|
)
|
425
425
|
);
|
426
426
|
}
|