fix(zapier): address review feedback (masked key, ES imports) + test hygiene
- authentication: API key field is now type 'password' so Zapier masks it in the connection UI instead of showing it in cleartext. - index: use ES imports for the platform version and package version instead of require(), matching the repo's TypeScript rule. dist stays flat; both versions resolve at runtime. - AGENTS.md: add the Key Directories row for integrations/zapier-mem0. - tests: disable telemetry during test runs so CI never fires real PostHog events, which also removes a lingering open handle after the suite. Verified: build + zapier validate (0 failures) + 16 tests (13 unit, 3 live E2E).
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"testMatch": ["**/test/**/*.test.ts"],
|
||||
"setupFiles": ["<rootDir>/test/setup.ts"],
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": ["ts-jest", {}]
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ export default {
|
||||
{
|
||||
key: 'apiKey',
|
||||
label: 'Mem0 API Key',
|
||||
type: 'string',
|
||||
// `password` so Zapier masks the key in the connection UI (it is a secret).
|
||||
type: 'password',
|
||||
required: true,
|
||||
helpText:
|
||||
'Your Mem0 API key (starts with `m0-`). Create one at [app.mem0.ai](https://app.mem0.ai) → Settings → API Keys.',
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import { version as platformVersion } from 'zapier-platform-core';
|
||||
import authentication from './authentication';
|
||||
import { includeApiKey, handleBadResponses } from './middleware';
|
||||
import addMemory from './creates/add_memory';
|
||||
import deleteMemory from './creates/delete_memory';
|
||||
import searchMemories from './searches/search_memories';
|
||||
import getMemories from './searches/get_memories';
|
||||
|
||||
// Read version at runtime from the package manifest (one directory up from dist/).
|
||||
const { version } = require('../package.json');
|
||||
const platformVersion = require('zapier-platform-core').version;
|
||||
import pkg from '../package.json';
|
||||
|
||||
const app = {
|
||||
version,
|
||||
version: pkg.version,
|
||||
platformVersion,
|
||||
|
||||
authentication,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// Disable telemetry during tests so runs never fire real PostHog events
|
||||
// (and so the fire-and-forget fetch cannot leave an open handle after tests).
|
||||
process.env.MEM0_TELEMETRY = 'false';
|
||||
Reference in New Issue
Block a user