Skip to content

feat: Apollo extended operations — enrich person, enrich company, email status (#17)#79

Open
jackulau wants to merge 1 commit into
wespreadjam:mainfrom
jackulau:17
Open

feat: Apollo extended operations — enrich person, enrich company, email status (#17)#79
jackulau wants to merge 1 commit into
wespreadjam:mainfrom
jackulau:17

Conversation

@jackulau

Copy link
Copy Markdown

Summary

Closes #17. Extends the Apollo integration with a formal credential definition and three new operations.

  • apolloCredential — built with defineApiKeyCredential (X-Api-Key header), matches devtoCredential/apifyCredential shape.
  • apolloEnrichPersonNodePOST /api/v1/people/match by email, returns a typed person projection.
  • apolloEnrichCompanyNodeGET /api/v1/organizations/enrich by domain, returns a typed organization projection.
  • apolloGetEmailStatusNode — reuses people/match and normalizes email_status via an exported mapApolloEmailStatus helper to valid / invalid / unknown.

Wired through apollo/index.ts, integrations/index.ts, and the top-level builtInNodes array in packages/nodes/src/index.ts.

Also fixes a pre-existing import in google-sheets/googleSheets.ts that was pulling defineOAuth2Credential from a non-existent '../types/credentials.js' path — corrected to '@jam-nodes/core'. Without this, anything loading packages/nodes/src/index.ts (including the new Apollo tests) fails module resolution.

Test plan

  • 39 new unit tests cover credential metadata, schema validation, success/empty/null paths, 4xx/5xx responses, network errors, and the full email status mapping matrix
  • npx vitest run src/integrations/apollo — 39/39 pass
  • Note: pre-existing typecheck errors on main (Zod v4 drift in transform/sort.ts, Slack NodeCredentials.slack missing) are unchanged by this PR

Extends the Apollo integration per issue wespreadjam#17.

New operations:
- apolloEnrichPersonNode — POST /api/v1/people/match by email
- apolloEnrichCompanyNode — GET /api/v1/organizations/enrich by domain
- apolloGetEmailStatusNode — reuses people/match to derive a normalized
  valid/invalid/unknown verdict via the mapApolloEmailStatus helper

Also adds apolloCredential built with defineApiKeyCredential (X-Api-Key header)
and wires the new nodes + credential through every barrel (apollo, integrations,
top-level src/index.ts) including the builtInNodes array.

Fixes an unrelated pre-existing bug in google-sheets/googleSheets.ts that was
importing defineOAuth2Credential from a non-existent '../types/credentials.js'
path — corrected to '@jam-nodes/core'. Without this fix, anything that loads
packages/nodes/src/index.ts (including the new apollo integration test that
asserts builtInNodes contains the new nodes) fails to resolve modules.

39 new unit tests cover: credential metadata, schema validation, success paths,
null/missing-field handling, 4xx/5xx responses, network errors, and the full
status mapping matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Integration] Apollo - Extended operations

1 participant