appwrite-utils
Advanced tools
Comparing version 0.9.94 to 0.9.95
@@ -23,4 +23,4 @@ import { type Databases, type Storage } from "node-appwrite"; | ||
processBatch(db: ConfigDatabase, collection: ConfigCollection, importDef: ImportDef, dataToImport: any[], updateDefs?: ImportDef[]): Promise<void>; | ||
handleCreate(context: any, finalItem: any, updateDefs?: ImportDef[]): Promise<void>; | ||
handleUpdate(context: any, finalItem: any, importDef: ImportDef): Promise<void>; | ||
handleCreate(context: any, finalItem: any, updateDefs?: ImportDef[]): Promise<any>; | ||
handleUpdate(context: any, finalItem: any, importDef: ImportDef): Promise<any>; | ||
getAttributeMappingsWithActions(attributeMappings: AttributeMappings, context: any, item: any): { | ||
@@ -27,0 +27,0 @@ postImportActions: { |
@@ -132,8 +132,10 @@ import { ID, Query } from "node-appwrite"; | ||
} | ||
let afterContext; | ||
if (importDef.type === "create" || !importDef.type) { | ||
await this.handleCreate(context, finalItem, updateDefs); | ||
afterContext = await this.handleCreate(context, finalItem, updateDefs); | ||
} | ||
else { | ||
await this.handleUpdate(context, finalItem, importDef); | ||
afterContext = await this.handleUpdate(context, finalItem, importDef); | ||
} | ||
context = { ...context, ...afterContext }; | ||
if (attributeMappingsWithActions.some((m) => m.postImportActions)) { | ||
@@ -169,2 +171,3 @@ this.postImportActionsQueue.push({ | ||
} | ||
return context; | ||
} | ||
@@ -187,2 +190,3 @@ async handleUpdate(context, finalItem, importDef) { | ||
} | ||
return context; | ||
} | ||
@@ -189,0 +193,0 @@ getAttributeMappingsWithActions(attributeMappings, context, item) { |
{ | ||
"name": "appwrite-utils", | ||
"version": "0.9.94", | ||
"version": "0.9.95", | ||
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -202,2 +202,3 @@ # AppwriteUtils Package | ||
- 0.9.95: Fixed a context issue with updating documents in their afterActions using their created data | ||
- 0.9.94: Added a bunch of different splitting functions for more fine-grained control and updated how the `trySplitByDifferentSeparators` works to fix the logic. Added converters are above. Also made it so converters and validation actions can take arrays for the item, because why not. | ||
@@ -204,0 +205,0 @@ - 0.9.93: Moved relationship resolution to the end |
649167
16141
246