@genlobe/mcp-server 3.6.1 → 3.6.2
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/dist/index.js +24 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2069,6 +2069,30 @@ const END_USER_ENDPOINTS = {
|
|
|
2069
2069
|
},
|
|
2070
2070
|
notes: "Three modes (#178 + #350): (1) sk_live_* alone -> tenant-scoped record, created_by_id is NULL (catalog/blog/global config). (2) sk_live_* + end-user JWT -> user-scoped record, created_by_id = user.id (server-side caller acting on behalf of a user). (3) pk_live_* + end-user JWT -> user-scoped record, created_by_id = user.id (canonical 'two-phase' frontend pattern: pk in the browser, JWT after login). pk_live_* WITHOUT a JWT is rejected with 401 — a public key alone is anonymous and can't be the creator of a record."
|
|
2071
2071
|
},
|
|
2072
|
+
{
|
|
2073
|
+
method: "POST",
|
|
2074
|
+
path: "/v1/entity/records/bulk",
|
|
2075
|
+
summary: "Bulk-insert up to 500 records into one schema in one transaction (migration-friendly)",
|
|
2076
|
+
auth: { api_key: "sk_live_* or pk_live_*", jwt: "optional (same modes as POST /v1/entity/records)", headers: "X-Organization-Id required when key is not organization-scoped" },
|
|
2077
|
+
request_body: {
|
|
2078
|
+
schema_id: "uuid (required) - all records in the batch target this schema",
|
|
2079
|
+
records: "array (required) - up to 500 JSON objects. Each is validated against the schema's fields_definition and reference fields (ADR-0009)."
|
|
2080
|
+
},
|
|
2081
|
+
notes: "All-or-nothing transaction: if ANY record fails schema or reference validation, the entire batch is rejected and nothing is persisted. Per-record errors include `record_index` so the agent can fix specific rows and retry. Capped at 500 records per call — for larger migrations, chunk the source dataset. Designed for Supabase → Genlobe table migrations (one source table → one custom_data_schema → one or more bulk chunks). Plan limits are checked once against the batch size; the whole batch fits or the whole batch fails. created_by_id follows the same rule as POST /v1/entity/records (NULL for sk_live_* alone, user.id when an end-user JWT is attached) and is identical for every row in the batch.",
|
|
2082
|
+
example_request: `{
|
|
2083
|
+
"schema_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
2084
|
+
"records": [
|
|
2085
|
+
{ "name": "Sugar 1kg", "price": 2.5, "stock": 100 },
|
|
2086
|
+
{ "name": "Rice 1kg", "price": 3.0, "stock": 50 },
|
|
2087
|
+
{ "name": "Coffee 250g", "price": 6.75, "stock": 30 }
|
|
2088
|
+
]
|
|
2089
|
+
}`,
|
|
2090
|
+
example_response: `{
|
|
2091
|
+
"schema_id": "550e8400-e29b-41d4-a716-446655440000",
|
|
2092
|
+
"inserted_count": 3,
|
|
2093
|
+
"items": [ { "id": "...", "schema_id": "...", "organization_id": "...", "data": {...} }, ... ]
|
|
2094
|
+
}`
|
|
2095
|
+
},
|
|
2072
2096
|
{
|
|
2073
2097
|
method: "GET",
|
|
2074
2098
|
path: "/v1/entity/records/mine",
|
package/package.json
CHANGED