appwrite-utils-cli 0.10.73 → 0.10.74
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/transfer.js +6 -0
- package/package.json +1 -1
- package/src/migrations/transfer.ts +10 -0
package/README.md
CHANGED
@@ -148,6 +148,7 @@ This updated CLI ensures that developers have robust tools at their fingertips t
|
|
148
148
|
|
149
149
|
## Changelog
|
150
150
|
|
151
|
+
- 0.10.74: Fix moving users, should update Labels now
|
151
152
|
- 0.10.73: Fix moving users, passwords should work now (from Appwrite, Argon2)
|
152
153
|
- 0.10.71: Fix create template function `__dirname`
|
153
154
|
- 0.10.70: Fixed `--transfer-users` phones
|
@@ -414,11 +414,17 @@ export const transferUsersLocalToRemote = async (localUsers, endpoint, projectId
|
|
414
414
|
if (phone) {
|
415
415
|
await tryAwaitWithRetry(async () => remoteUsers.updatePhone(user.$id, phone));
|
416
416
|
}
|
417
|
+
if (user.labels && user.labels.length > 0) {
|
418
|
+
await tryAwaitWithRetry(async () => remoteUsers.updateLabels(user.$id, user.labels));
|
419
|
+
}
|
417
420
|
}
|
418
421
|
else {
|
419
422
|
await tryAwaitWithRetry(async () => remoteUsers.create(user.$id, user.email, phone, // phone - optional
|
420
423
|
user.password, // password - cannot transfer hashed passwords
|
421
424
|
user.name));
|
425
|
+
if (user.labels && user.labels.length > 0) {
|
426
|
+
await tryAwaitWithRetry(async () => remoteUsers.updateLabels(user.$id, user.labels));
|
427
|
+
}
|
422
428
|
}
|
423
429
|
// Update user preferences and status
|
424
430
|
await tryAwaitWithRetry(async () => remoteUsers.updatePrefs(user.$id, user.prefs));
|
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.10.
|
4
|
+
"version": "0.10.74",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -829,6 +829,11 @@ export const transferUsersLocalToRemote = async (
|
|
829
829
|
remoteUsers.updatePhone(user.$id, phone)
|
830
830
|
);
|
831
831
|
}
|
832
|
+
if (user.labels && user.labels.length > 0) {
|
833
|
+
await tryAwaitWithRetry(async () =>
|
834
|
+
remoteUsers.updateLabels(user.$id, user.labels)
|
835
|
+
);
|
836
|
+
}
|
832
837
|
} else {
|
833
838
|
await tryAwaitWithRetry(async () =>
|
834
839
|
remoteUsers.create(
|
@@ -839,6 +844,11 @@ export const transferUsersLocalToRemote = async (
|
|
839
844
|
user.name
|
840
845
|
)
|
841
846
|
);
|
847
|
+
if (user.labels && user.labels.length > 0) {
|
848
|
+
await tryAwaitWithRetry(async () =>
|
849
|
+
remoteUsers.updateLabels(user.$id, user.labels)
|
850
|
+
);
|
851
|
+
}
|
842
852
|
}
|
843
853
|
|
844
854
|
// Update user preferences and status
|