json-object-editor 0.10.638 → 0.10.640

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-object-editor",
3
- "version": "0.10.638",
3
+ "version": "0.10.640",
4
4
  "description": "JOE the Json Object Editor | Platform Edition",
5
5
  "main": "app.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -59,7 +59,7 @@ JOE is software that allows you to manage data models via JSON objects. There ar
59
59
  - `saveObject({ object })`
60
60
  - `saveObjects({ objects, stopOnError?, concurrency? })`
61
61
  - Batch save with per-item history/events. Defaults: `stopOnError=false`, `concurrency=5`.
62
- - Each object must include `itemtype`; `_id` and `joeUpdated` are set when omitted.
62
+ - Each object must include `itemtype`; `_id` and `joeUpdated` are set when omitted. `created` is set on first save when missing.
63
63
  - Return shape: `{ results, errors, saved, failed }`.
64
64
 
65
65
  - Quick tests (PowerShell)
@@ -158,6 +158,8 @@ MCP.tools = {
158
158
  // Get schema definition; summaryOnly to return normalized summary instead of full schema
159
159
  getSchema: async ({ name, summaryOnly }, _ctx) => {
160
160
  if (!name) throw new Error("Missing required param 'name'");
161
+ const Schemas = getSchemas();
162
+ if (!Schemas) throw new Error('Schemas module not initialized');
161
163
  if (summaryOnly) {
162
164
  const sum = Schemas && Schemas.summary && Schemas.summary[name];
163
165
  if (!sum) throw new Error(`Schema summary for "${name}" not found`);
@@ -170,6 +172,8 @@ MCP.tools = {
170
172
 
171
173
  // Get multiple schemas. With summaryOnly, return summaries; without names, returns all.
172
174
  getSchemas: async ({ names, summaryOnly } = {}, _ctx) => {
175
+ const Schemas = getSchemas();
176
+ if (!Schemas) throw new Error('Schemas module not initialized');
173
177
  const all = (Schemas && Schemas.schema) || {};
174
178
  if (summaryOnly) {
175
179
  const allS = (Schemas && Schemas.summary) || {};