appwrite-utils-cli 0.0.256 → 0.0.258

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.
@@ -405,8 +405,6 @@ export class DataLoader {
405
405
  const mergedUsers = this.mergedUserMap.get(existingId) || [];
406
406
  mergedUsers.push(`${item[primaryKeyField]}`);
407
407
  this.mergedUserMap.set(existingId, mergedUsers);
408
- transformedItem["userId"] = existingId;
409
- transformedItem["docId"] = existingId;
410
408
  }
411
409
  // Remove user-specific keys from the transformed item
412
410
  const userKeys = ["email", "phone", "name", "labels", "prefs"];
@@ -153,6 +153,12 @@ export class ImportController {
153
153
  item.context.userId ||
154
154
  item.finalData.docId ||
155
155
  item.finalData.userId;
156
+ if (item.finalData.hasOwnProperty("userId")) {
157
+ delete item.finalData.userId;
158
+ }
159
+ if (item.finalData.hasOwnProperty("docId")) {
160
+ delete item.finalData.docId;
161
+ }
156
162
  return this.database
157
163
  .createDocument(db.$id, collection.$id, id, item.finalData)
158
164
  .then(() => {
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.0.256",
4
+ "version": "0.0.258",
5
5
  "main": "src/main.ts",
6
6
  "type": "module",
7
7
  "repository": {
@@ -512,8 +512,6 @@ export class DataLoader {
512
512
  const mergedUsers = this.mergedUserMap.get(existingId) || [];
513
513
  mergedUsers.push(`${item[primaryKeyField]}`);
514
514
  this.mergedUserMap.set(existingId, mergedUsers);
515
- transformedItem["userId"] = existingId;
516
- transformedItem["docId"] = existingId;
517
515
  }
518
516
 
519
517
  // Remove user-specific keys from the transformed item
@@ -230,6 +230,12 @@ export class ImportController {
230
230
  item.context.userId ||
231
231
  item.finalData.docId ||
232
232
  item.finalData.userId;
233
+ if (item.finalData.hasOwnProperty("userId")) {
234
+ delete item.finalData.userId;
235
+ }
236
+ if (item.finalData.hasOwnProperty("docId")) {
237
+ delete item.finalData.docId;
238
+ }
233
239
  return this.database
234
240
  .createDocument(db.$id, collection.$id, id, item.finalData)
235
241
  .then(() => {