Files
mem0/integrations/zapier-mem0/searches/get_memories.js
T
Himanshu-Sangshetti 00aa647f78 chore(integrations): use pnpm, real Mem0 icon, fix Zapier field defaults
- Switch both packages from npm to pnpm (pnpm-lock.yaml) to match the
  repo convention (openclaw / pi-agent-plugin / vercel-ai-sdk); gitignore
  package-lock.json.
- Replace the placeholder n8n node icon with the real Mem0 mark (same
  asset used by integrations/mem0-plugin).
- Zapier: revert boolean/integer field defaults to strings — Zapier's
  schema requires string defaults (zapier validate now passes with 0
  errors). Runtime coercion (String(x)!=='false', Number()) is unchanged.
2026-07-20 11:55:29 +05:30

33 lines
869 B
JavaScript

'use strict';
const perform = async (z, bundle) => {
const body = {};
if (bundle.inputData.user_id) body.filters = { user_id: bundle.inputData.user_id };
const response = await z.request({
url: '/v3/memories/',
method: 'POST',
params: { page: 1, page_size: Math.max(1, Math.floor(Number(bundle.inputData.limit) || 50)) },
body,
});
const data = response.data;
return Array.isArray(data) ? data : data.results || [];
};
module.exports = {
key: 'get_memories',
noun: 'Memory',
display: {
label: 'Get Memories',
description: 'List stored memories for a user.',
},
operation: {
perform,
inputFields: [
{ key: 'user_id', label: 'User ID', type: 'string', required: true },
{ key: 'limit', label: 'Limit', type: 'integer', default: '50' },
],
sample: { id: '00000000-0000-0000-0000-000000000000', memory: 'User loves hiking' },
},
};