appwrite-utils-cli 0.10.69 → 0.10.70
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 +5 -2
- package/package.json +1 -1
- package/src/migrations/transfer.ts +6 -2
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.70: Fixed `--transfer-users` phones
|
151
152
|
- 0.10.67: Added `--transfer-users` boolean flag to also transfer users between projects
|
152
153
|
- 0.10.66: Fixed `ignore` always being an empty array, if not set, so it properly ignores the defaults
|
153
154
|
- 0.10.65: Fixed the stupid local functions not caring about the ignore string, and added `__pycache__` and `.venv` to default ignores
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { tryAwaitWithRetry } from "appwrite-utils";
|
1
|
+
import { converterFunctions, tryAwaitWithRetry } from "appwrite-utils";
|
2
2
|
import { Client, Databases, IndexType, Query, Storage, Users, } from "node-appwrite";
|
3
3
|
import { InputFile } from "node-appwrite/file";
|
4
4
|
import { getAppwriteClient } from "../utils/helperFunctions.js";
|
@@ -404,7 +404,10 @@ export const transferUsersLocalToRemote = async (localUsers, endpoint, projectId
|
|
404
404
|
catch (error) {
|
405
405
|
// User doesn't exist, proceed with creation
|
406
406
|
}
|
407
|
-
|
407
|
+
const phone = user.phone
|
408
|
+
? converterFunctions.convertPhoneStringToUSInternational(user.phone)
|
409
|
+
: undefined;
|
410
|
+
await tryAwaitWithRetry(async () => remoteUsers.create(user.$id, user.email, phone, // phone - optional
|
408
411
|
user.password, // password - cannot transfer hashed passwords
|
409
412
|
user.name));
|
410
413
|
// Update user preferences and status
|
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.70",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { tryAwaitWithRetry } from "appwrite-utils";
|
1
|
+
import { converterFunctions, tryAwaitWithRetry } from "appwrite-utils";
|
2
2
|
import {
|
3
3
|
Client,
|
4
4
|
Databases,
|
@@ -811,11 +811,15 @@ export const transferUsersLocalToRemote = async (
|
|
811
811
|
// User doesn't exist, proceed with creation
|
812
812
|
}
|
813
813
|
|
814
|
+
const phone = user.phone
|
815
|
+
? converterFunctions.convertPhoneStringToUSInternational(user.phone)
|
816
|
+
: undefined;
|
817
|
+
|
814
818
|
await tryAwaitWithRetry(async () =>
|
815
819
|
remoteUsers.create(
|
816
820
|
user.$id,
|
817
821
|
user.email,
|
818
|
-
|
822
|
+
phone, // phone - optional
|
819
823
|
user.password, // password - cannot transfer hashed passwords
|
820
824
|
user.name
|
821
825
|
)
|