Prepare an imported action object for creation on an actor.
Handles ID regeneration (top-level and embedded effects), origin rewriting (self-referential and foreign), and schema validation.
Raw parsed object from JSON export (shape of item.toObject())
{ ok: true, data } on success; { ok: false, errors: [...] } on failure
{ ok: true, data }
{ ok: false, errors: [...] }
const parsed = JSON.parse(jsonString);const result = prepareImportedActionData(parsed);if (result.ok) { const item = await Item.create(result.data, { parent: actor });} else { console.error("Import failed:", result.errors);} Copy
const parsed = JSON.parse(jsonString);const result = prepareImportedActionData(parsed);if (result.ok) { const item = await Item.create(result.data, { parent: actor });} else { console.error("Import failed:", result.errors);}
Prepare an imported action object for creation on an actor.
Handles ID regeneration (top-level and embedded effects), origin rewriting (self-referential and foreign), and schema validation.