@n8n-plus/n8n-plus
Version:
n8n Workflow Automation Tool (plus edition)
25 lines • 1.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MOCK_QUIRKS = void 0;
exports.quirkMatches = quirkMatches;
exports.findMockQuirks = findMockQuirks;
exports.MOCK_QUIRKS = [
{
service: 'Notion',
guidance: 'Notion documents partial response variants (objects with only `{object, id}`) alongside full ones for many resources (pages, databases, blocks, users). ALWAYS return the FULL response object with all documented fields (`properties`, `parent`, `created_time`, schema, etc.) — never a partial form. Use a partial variant ONLY if the request body explicitly opts in (e.g. a `template` field for create-page). The `object` field must match the endpoint\'s resource type — GET `/v1/databases/{id}` returns `object: "database"`, not `"page"`.',
rationale: 'Notion exposes partial variants for many resources without a client-controllable flag. The LLM occasionally picks the partial form (or returns a page-shaped object for a database GET), which crashes n8n nodes that read fields like properties[*].type.',
addedAt: '2026-05-08',
},
];
function quirkMatches(quirk, service, method, pathname) {
if (quirk.service !== service)
return false;
if (!quirk.endpoint)
return true;
const key = `${method.toUpperCase()} ${pathname}`;
return quirk.endpoint.toUpperCase() === key.toUpperCase();
}
function findMockQuirks(service, method, pathname) {
return exports.MOCK_QUIRKS.filter((q) => quirkMatches(q, service, method, pathname)).map((q) => q.guidance);
}
//# sourceMappingURL=mock-quirks.js.map