MCPcopy
hub / github.com/musistudio/claude-code-router / createItem

Function createItem

examples/plugins/claude-design-plugin.cjs:2725–2741  ·  view source on GitHub ↗
(store, collection, organizationUuid, body, me)

Source from the content-addressed store, hash-verified

2723}
2724
2725function createItem(store, collection, organizationUuid, body, me) {
2726 const now = new Date().toISOString();
2727 const uuid = stringValue(body.uuid) || stringValue(body.id) || randomUuid();
2728 const title = stringValue(body.title) || stringValue(body.name) || "Untitled design";
2729 const model = stringValue(body.model) || me.defaultModelId;
2730 const data = {
2731 ...body,
2732 organization_uuid: organizationUuid
2733 };
2734
2735 store.database.run(
2736 "INSERT OR REPLACE INTO claude_design_items (collection, uuid, created_at, updated_at, title, model, data_json, messages_json) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
2737 [collection, uuid, now, now, title, model, JSON.stringify(data), JSON.stringify([])]
2738 );
2739 store.persist();
2740 return getItem(store, collection, organizationUuid, uuid, me);
2741}
2742
2743function getItem(store, collection, organizationUuid, uuid, me) {
2744 const row = queryRows(

Callers 2

handleOrganizationApiFunction · 0.85
getItemFunction · 0.85

Calls 5

randomUuidFunction · 0.85
getItemFunction · 0.85
persistMethod · 0.80
stringValueFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…