appwrite-utils-cli 1.2.5 → 1.2.7
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/dist/interactiveCLI.js
CHANGED
@@ -1660,6 +1660,7 @@ export class InteractiveCLI {
|
|
1660
1660
|
message: "Select what to transfer:",
|
1661
1661
|
choices: [
|
1662
1662
|
{ name: "👥 Users", value: "users", checked: true },
|
1663
|
+
{ name: "👥 Teams", value: "teams", checked: true },
|
1663
1664
|
{ name: "🗄️ Databases", value: "databases", checked: true },
|
1664
1665
|
{ name: "📦 Storage Buckets", value: "buckets", checked: true },
|
1665
1666
|
{ name: "⚡ Functions", value: "functions", checked: true },
|
@@ -1746,6 +1747,7 @@ export class InteractiveCLI {
|
|
1746
1747
|
targetProject: targetConfig.targetProject,
|
1747
1748
|
targetKey: targetConfig.targetKey,
|
1748
1749
|
transferUsers: transferOptions.transferTypes.includes("users"),
|
1750
|
+
transferTeams: transferOptions.transferTypes.includes("teams"),
|
1749
1751
|
transferDatabases: transferOptions.transferTypes.includes("databases"),
|
1750
1752
|
transferBuckets: transferOptions.transferTypes.includes("buckets"),
|
1751
1753
|
transferFunctions: transferOptions.transferTypes.includes("functions"),
|
@@ -1764,6 +1766,9 @@ export class InteractiveCLI {
|
|
1764
1766
|
MessageFormatter.info("Users with preserved password hashes can log in with their original passwords", { prefix: "Transfer" });
|
1765
1767
|
MessageFormatter.info("Users with temporary passwords will need to reset their passwords", { prefix: "Transfer" });
|
1766
1768
|
}
|
1769
|
+
if (transferOptions.transferTypes.includes("teams") && results.teams.transferred > 0) {
|
1770
|
+
MessageFormatter.info("Team memberships have been transferred and may require user acceptance of invitations", { prefix: "Transfer" });
|
1771
|
+
}
|
1767
1772
|
}
|
1768
1773
|
}
|
1769
1774
|
catch (error) {
|
@@ -6,6 +6,7 @@ export interface ComprehensiveTransferOptions {
|
|
6
6
|
targetProject: string;
|
7
7
|
targetKey: string;
|
8
8
|
transferUsers?: boolean;
|
9
|
+
transferTeams?: boolean;
|
9
10
|
transferDatabases?: boolean;
|
10
11
|
transferBuckets?: boolean;
|
11
12
|
transferFunctions?: boolean;
|
@@ -18,6 +19,11 @@ export interface TransferResults {
|
|
18
19
|
skipped: number;
|
19
20
|
failed: number;
|
20
21
|
};
|
22
|
+
teams: {
|
23
|
+
transferred: number;
|
24
|
+
skipped: number;
|
25
|
+
failed: number;
|
26
|
+
};
|
21
27
|
databases: {
|
22
28
|
transferred: number;
|
23
29
|
skipped: number;
|
@@ -41,6 +47,8 @@ export declare class ComprehensiveTransfer {
|
|
41
47
|
private targetClient;
|
42
48
|
private sourceUsers;
|
43
49
|
private targetUsers;
|
50
|
+
private sourceTeams;
|
51
|
+
private targetTeams;
|
44
52
|
private sourceDatabases;
|
45
53
|
private targetDatabases;
|
46
54
|
private sourceStorage;
|
@@ -57,6 +65,7 @@ export declare class ComprehensiveTransfer {
|
|
57
65
|
constructor(options: ComprehensiveTransferOptions);
|
58
66
|
execute(): Promise<TransferResults>;
|
59
67
|
private transferAllUsers;
|
68
|
+
private transferAllTeams;
|
60
69
|
private transferAllDatabases;
|
61
70
|
/**
|
62
71
|
* Phase 1: Create database structure (collections, attributes, indexes) without transferring documents
|
@@ -93,8 +102,44 @@ export declare class ComprehensiveTransfer {
|
|
93
102
|
*/
|
94
103
|
private createCollectionIndexesWithStatusCheck;
|
95
104
|
/**
|
96
|
-
* Helper method to transfer documents between databases
|
105
|
+
* Helper method to transfer documents between databases using bulk operations with content and permission-based filtering
|
97
106
|
*/
|
98
107
|
private transferDocumentsBetweenDatabases;
|
108
|
+
/**
|
109
|
+
* Fetch target documents by IDs in batches to check existence and permissions
|
110
|
+
*/
|
111
|
+
private fetchTargetDocumentsBatch;
|
112
|
+
/**
|
113
|
+
* Transfer documents using bulk operations with proper batch size handling
|
114
|
+
*/
|
115
|
+
private transferDocumentsBulk;
|
116
|
+
/**
|
117
|
+
* Direct HTTP implementation of bulk upsert API
|
118
|
+
*/
|
119
|
+
private bulkUpsertDocuments;
|
120
|
+
/**
|
121
|
+
* Transfer documents individually with rate limiting
|
122
|
+
*/
|
123
|
+
private transferDocumentsIndividual;
|
124
|
+
/**
|
125
|
+
* Update documents individually with content and/or permission changes
|
126
|
+
*/
|
127
|
+
private updateDocumentsIndividual;
|
128
|
+
/**
|
129
|
+
* Utility method to chunk arrays
|
130
|
+
*/
|
131
|
+
private chunkArray;
|
132
|
+
/**
|
133
|
+
* Helper method to fetch all teams with pagination
|
134
|
+
*/
|
135
|
+
private fetchAllTeams;
|
136
|
+
/**
|
137
|
+
* Helper method to fetch all memberships for a team with pagination
|
138
|
+
*/
|
139
|
+
private fetchAllMemberships;
|
140
|
+
/**
|
141
|
+
* Helper method to transfer team memberships
|
142
|
+
*/
|
143
|
+
private transferTeamMemberships;
|
99
144
|
private printSummary;
|
100
145
|
}
|