@absolutejs/engagement-apollo 0.0.5 → 0.0.7

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/README.md CHANGED
@@ -12,15 +12,17 @@ const person = await apollo.enrichPerson?.({ email: "jane@acme.com" });
12
12
  const company = await apollo.enrichCompany?.({ domain: "acme.com" });
13
13
 
14
14
  // Outreach activity (what's been sent / opened / replied) for a contact
15
- const activity = await apollo.listActivities?.({ contactEmail: "jane@acme.com" });
15
+ const activity = await apollo.listActivities?.({
16
+ contactEmail: "jane@acme.com",
17
+ });
16
18
  ```
17
19
 
18
20
  ## Capabilities
19
21
 
20
- | Method | Apollo endpoint | Notes |
21
- | --- | --- | --- |
22
- | `enrichPerson` | `POST /v1/people/match` | Consumes an enrichment credit per match. |
23
- | `enrichCompany` | `GET /v1/organizations/enrich` | Domain required. |
22
+ | Method | Apollo endpoint | Notes |
23
+ | ---------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
24
+ | `enrichPerson` | `POST /v1/people/match` | Consumes an enrichment credit per match. |
25
+ | `enrichCompany` | `GET /v1/organizations/enrich` | Domain required. |
24
26
  | `listActivities` | `POST /v1/emailer_messages/search` | **Plan-gated** — engagement API access varies by Apollo plan. Returns `[]` if unsupported; verify field mapping against a live account before relying on it. |
25
27
 
26
28
  All calls fail soft: a non-2xx response or an unexpected shape returns `null` / `[]`
package/dist/index.js CHANGED
@@ -45,7 +45,11 @@ var apolloSource = (options) => {
45
45
  const org = isRecord(person.organization) ? person.organization : null;
46
46
  const contact = isRecord(person.contact) ? person.contact : null;
47
47
  const personalEmails = Array.isArray(person.personal_emails) ? person.personal_emails.map(str) : [];
48
- const emails = Array.from(new Set([str(person.email), contact ? str(contact.email) : null, ...personalEmails].filter((value) => value !== null).filter((value) => !LOCKED_EMAIL.test(value))));
48
+ const emails = Array.from(new Set([
49
+ str(person.email),
50
+ contact ? str(contact.email) : null,
51
+ ...personalEmails
52
+ ].filter((value) => value !== null).filter((value) => !LOCKED_EMAIL.test(value))));
49
53
  return {
50
54
  company: org ? str(org.name) : null,
51
55
  companyDomain: org ? str(org.primary_domain) : null,
@@ -92,12 +96,18 @@ var apolloSource = (options) => {
92
96
  ...query.domain ? { q_organization_domains_list: [query.domain] } : {},
93
97
  ...!query.domain && query.company ? { q_keywords: query.company } : {}
94
98
  });
99
+ const searchRequests = search ? 1 : 0;
95
100
  const previews = search && Array.isArray(search.people) ? search.people : [];
96
101
  const ids = previews.map((person) => isRecord(person) ? str(person.id) : null).filter((id) => id !== null);
97
- if (ids.length === 0)
98
- return [];
102
+ if (ids.length === 0) {
103
+ return { people: [], revealsAttempted: 0, searchRequests };
104
+ }
99
105
  const revealed = await Promise.all(ids.map((id) => matchById(id)));
100
- return revealed.filter((person) => person !== null);
106
+ return {
107
+ people: revealed.filter((person) => person !== null),
108
+ revealsAttempted: ids.length,
109
+ searchRequests
110
+ };
101
111
  };
102
112
  const enrichCompany = async (query) => {
103
113
  if (!query.domain)
@@ -0,0 +1,10 @@
1
+ import type { ApolloOptions } from "./index";
2
+ export declare const manifest: Omit<import("@absolutejs/manifest").PackageManifest<ApolloOptions, never>, "contract" | "settings" | "tools"> & (({
3
+ contract: 1;
4
+ tools?: Record<string, import("@absolutejs/manifest").LegacyManifestTool<never>> | undefined;
5
+ } | {
6
+ contract: 2;
7
+ tools?: Record<string, import("@absolutejs/manifest").AuthorizedManifestTool<never>> | undefined;
8
+ }) & {
9
+ settings: import("@sinclair/typebox").TObject<{}>;
10
+ });
@@ -0,0 +1,72 @@
1
+ // @bun
2
+ // src/manifest.ts
3
+ import { defineImplementation, defineManifest } from "@absolutejs/manifest";
4
+ import { Type } from "@sinclair/typebox";
5
+ var manifest = defineManifest()({
6
+ contract: 2,
7
+ discovery: {
8
+ audiences: ["agent-hosts", "application-developers"],
9
+ intents: [
10
+ "enrich a person with Apollo",
11
+ "enrich a company with Apollo",
12
+ "search people by role",
13
+ "read Apollo outreach activity"
14
+ ],
15
+ keywords: ["apollo", "engagement", "enrichment", "outreach", "sales"],
16
+ protocols: ["HTTPS"]
17
+ },
18
+ identity: {
19
+ accent: "#5c4cff",
20
+ category: "sales",
21
+ description: "Apollo-backed EngagementSource for person and company enrichment, role-based people search, and outreach activity with explicit provider-credit accounting.",
22
+ docsUrl: "https://github.com/absolutejs/engagement-adapters/tree/main/apollo",
23
+ name: "@absolutejs/engagement-apollo",
24
+ tagline: "Connect Apollo enrichment and outreach to your site."
25
+ },
26
+ implements: [
27
+ defineImplementation()({
28
+ contract: "engagement/source",
29
+ factory: "apolloSource",
30
+ from: "@absolutejs/engagement-apollo",
31
+ requires: {
32
+ env: [
33
+ {
34
+ description: "Apollo API key",
35
+ docsUrl: "https://developer.apollo.io/keys/",
36
+ key: "APOLLO_API_KEY",
37
+ secret: true
38
+ }
39
+ ],
40
+ peers: [
41
+ {
42
+ name: "@absolutejs/engagement",
43
+ range: ">=0.0.7 <0.1",
44
+ reason: "Shared engagement contracts and rate-limit identity"
45
+ }
46
+ ]
47
+ },
48
+ settings: Type.Object({
49
+ baseUrl: Type.Optional(Type.String({
50
+ description: "Apollo-compatible API origin. Leave empty for the official Apollo API.",
51
+ format: "uri",
52
+ title: "API origin"
53
+ }))
54
+ }),
55
+ title: "Apollo",
56
+ wiring: {
57
+ code: "apolloSource({ apiKey: ${env.APOLLO_API_KEY}, ...${settings} })",
58
+ imports: [
59
+ {
60
+ from: "@absolutejs/engagement-apollo",
61
+ names: ["apolloSource"]
62
+ }
63
+ ]
64
+ }
65
+ })
66
+ ],
67
+ settings: Type.Object({}),
68
+ wiring: []
69
+ });
70
+ export {
71
+ manifest
72
+ };
@@ -0,0 +1,85 @@
1
+ {
2
+ "contract": 2,
3
+ "discovery": {
4
+ "audiences": [
5
+ "agent-hosts",
6
+ "application-developers"
7
+ ],
8
+ "intents": [
9
+ "enrich a person with Apollo",
10
+ "enrich a company with Apollo",
11
+ "search people by role",
12
+ "read Apollo outreach activity"
13
+ ],
14
+ "keywords": [
15
+ "apollo",
16
+ "engagement",
17
+ "enrichment",
18
+ "outreach",
19
+ "sales"
20
+ ],
21
+ "protocols": [
22
+ "HTTPS"
23
+ ]
24
+ },
25
+ "identity": {
26
+ "accent": "#5c4cff",
27
+ "category": "sales",
28
+ "description": "Apollo-backed EngagementSource for person and company enrichment, role-based people search, and outreach activity with explicit provider-credit accounting.",
29
+ "docsUrl": "https://github.com/absolutejs/engagement-adapters/tree/main/apollo",
30
+ "name": "@absolutejs/engagement-apollo",
31
+ "tagline": "Connect Apollo enrichment and outreach to your site."
32
+ },
33
+ "implements": [
34
+ {
35
+ "contract": "engagement/source",
36
+ "factory": "apolloSource",
37
+ "from": "@absolutejs/engagement-apollo",
38
+ "requires": {
39
+ "env": [
40
+ {
41
+ "description": "Apollo API key",
42
+ "docsUrl": "https://developer.apollo.io/keys/",
43
+ "key": "APOLLO_API_KEY",
44
+ "secret": true
45
+ }
46
+ ],
47
+ "peers": [
48
+ {
49
+ "name": "@absolutejs/engagement",
50
+ "range": ">=0.0.7 <0.1",
51
+ "reason": "Shared engagement contracts and rate-limit identity"
52
+ }
53
+ ]
54
+ },
55
+ "settings": {
56
+ "type": "object",
57
+ "properties": {
58
+ "baseUrl": {
59
+ "description": "Apollo-compatible API origin. Leave empty for the official Apollo API.",
60
+ "format": "uri",
61
+ "title": "API origin",
62
+ "type": "string"
63
+ }
64
+ }
65
+ },
66
+ "title": "Apollo",
67
+ "wiring": {
68
+ "code": "apolloSource({ apiKey: ${env.APOLLO_API_KEY}, ...${settings} })",
69
+ "imports": [
70
+ {
71
+ "from": "@absolutejs/engagement-apollo",
72
+ "names": [
73
+ "apolloSource"
74
+ ]
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ ],
80
+ "settings": {
81
+ "type": "object",
82
+ "properties": {}
83
+ },
84
+ "wiring": []
85
+ }
package/package.json CHANGED
@@ -2,9 +2,10 @@
2
2
  "author": "Alex Kahn",
3
3
  "description": "Apollo.io EngagementSource adapter for @absolutejs/engagement — person/company enrichment and outreach activity (emails sent/opened/replied) from the Apollo API.",
4
4
  "devDependencies": {
5
- "@absolutejs/engagement": "0.0.4",
6
- "@types/bun": "latest",
7
- "typescript": "5.8.3"
5
+ "@absolutejs/engagement": "0.0.7",
6
+ "@types/bun": "1.3.14",
7
+ "prettier": "3.8.1",
8
+ "typescript": "5.9.3"
8
9
  },
9
10
  "files": [
10
11
  "dist",
@@ -22,7 +23,7 @@
22
23
  "main": "./dist/index.js",
23
24
  "name": "@absolutejs/engagement-apollo",
24
25
  "peerDependencies": {
25
- "@absolutejs/engagement": ">=0.0.1"
26
+ "@absolutejs/engagement": ">=0.0.7 <0.1"
26
27
  },
27
28
  "publishConfig": {
28
29
  "access": "public"
@@ -30,14 +31,52 @@
30
31
  "repository": {
31
32
  "directory": "apollo",
32
33
  "type": "git",
33
- "url": "https://github.com/absolutejs/engagement-adapters.git"
34
+ "url": "git+https://github.com/absolutejs/engagement-adapters.git"
34
35
  },
35
36
  "scripts": {
36
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --target=bun --external @absolutejs/engagement && tsc --emitDeclarationOnly --project tsconfig.json",
37
- "release": "bun run build && bun publish",
38
- "typecheck": "tsc --noEmit"
37
+ "build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=bun --external @absolutejs/engagement --external '@absolutejs/engagement/*' --external @absolutejs/manifest --external @sinclair/typebox && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit",
38
+ "format": "prettier --write \"./**/*.{ts,json,md}\"",
39
+ "release": "bun run check:package && npm publish --access public",
40
+ "test": "bun test",
41
+ "typecheck": "tsc --noEmit",
42
+ "verify-package": "absolute-manifest verify-package",
43
+ "check:package": "bun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts"
39
44
  },
40
45
  "type": "module",
41
46
  "types": "./dist/index.d.ts",
42
- "version": "0.0.5"
47
+ "version": "0.0.7",
48
+ "exports": {
49
+ ".": {
50
+ "types": "./dist/index.d.ts",
51
+ "import": "./dist/index.js",
52
+ "default": "./dist/index.js"
53
+ },
54
+ "./manifest": {
55
+ "types": "./dist/manifest.d.ts",
56
+ "import": "./dist/manifest.js",
57
+ "default": "./dist/manifest.js"
58
+ },
59
+ "./manifest.json": "./dist/manifest.json"
60
+ },
61
+ "absolutejs": {
62
+ "manifestContract": 2,
63
+ "runtimePeers": {
64
+ "@absolutejs/engagement": {
65
+ "artifactImports": [
66
+ "@absolutejs/engagement"
67
+ ],
68
+ "buildExternals": [
69
+ "@absolutejs/engagement",
70
+ "@absolutejs/engagement/*"
71
+ ],
72
+ "optional": false,
73
+ "range": ">=0.0.7 <0.1",
74
+ "tested": "0.0.7"
75
+ }
76
+ }
77
+ },
78
+ "dependencies": {
79
+ "@absolutejs/manifest": "0.7.2",
80
+ "@sinclair/typebox": "0.34.52"
81
+ }
43
82
  }