@myapihq/sdk 1.1.0-wip.4 → 1.2.0

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.
Files changed (67) hide show
  1. package/dist/audience.d.ts +71 -0
  2. package/dist/audience.js +54 -0
  3. package/dist/client.d.ts +1 -1
  4. package/dist/client.js +8 -1
  5. package/dist/company.d.ts +20 -0
  6. package/dist/company.js +25 -0
  7. package/dist/config.d.ts +6 -0
  8. package/dist/config.js +20 -2
  9. package/dist/crm.d.ts +122 -0
  10. package/dist/crm.js +84 -0
  11. package/dist/database.d.ts +36 -0
  12. package/dist/database.js +65 -0
  13. package/dist/domain.d.ts +19 -1
  14. package/dist/domain.js +22 -2
  15. package/dist/email-verify.d.ts +30 -0
  16. package/dist/email-verify.js +17 -0
  17. package/dist/email.d.ts +33 -0
  18. package/dist/email.js +53 -0
  19. package/dist/exposes.d.ts +2 -0
  20. package/dist/exposes.js +14 -0
  21. package/dist/funnel.d.ts +10 -0
  22. package/dist/funnel.js +20 -0
  23. package/dist/hq.d.ts +10 -0
  24. package/dist/hq.js +28 -0
  25. package/dist/image.d.ts +14 -0
  26. package/dist/image.js +12 -0
  27. package/dist/index.d.ts +6 -1
  28. package/dist/index.js +13 -2
  29. package/dist/llm.d.ts +50 -0
  30. package/dist/llm.js +27 -0
  31. package/dist/people.d.ts +54 -0
  32. package/dist/people.js +22 -0
  33. package/dist/pixel.d.ts +3 -0
  34. package/dist/pixel.js +15 -0
  35. package/dist/services.d.ts +17 -0
  36. package/dist/services.js +190 -0
  37. package/dist/storage.d.ts +3 -1
  38. package/dist/storage.js +7 -0
  39. package/dist/url.d.ts +2 -0
  40. package/dist/url.js +4 -0
  41. package/dist/webhook.d.ts +8 -1
  42. package/dist/webhook.js +14 -2
  43. package/dist/workflow.d.ts +2 -0
  44. package/dist/workflow.js +12 -0
  45. package/package.json +2 -1
  46. package/scripts/scaffold-sdk.js +501 -0
  47. package/src/audience.ts +162 -0
  48. package/src/client.ts +9 -1
  49. package/src/company.ts +48 -0
  50. package/src/config.ts +21 -1
  51. package/src/crm.ts +235 -0
  52. package/src/database.ts +103 -0
  53. package/src/domain.ts +44 -2
  54. package/src/email.ts +84 -0
  55. package/src/exposes.ts +16 -0
  56. package/src/funnel.ts +34 -0
  57. package/src/hq.ts +41 -0
  58. package/src/image.ts +31 -0
  59. package/src/index.ts +12 -1
  60. package/src/llm.ts +86 -0
  61. package/src/people.ts +84 -0
  62. package/src/pixel.ts +16 -0
  63. package/src/services.ts +220 -0
  64. package/src/storage.ts +15 -6
  65. package/src/url.ts +5 -0
  66. package/src/webhook.ts +25 -2
  67. package/src/workflow.ts +13 -0
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ // Canonical service registry — the single source of truth for everything
3
+ // downstream (skill plugin.json generators, mirror-repo publisher, docs site,
4
+ // scaffolders, etc.).
5
+ //
6
+ // To add a service: append an entry here. To rename, change description, or
7
+ // re-categorize: edit here. Run `npm run canonical-sync` to propagate to
8
+ // every rendered artifact (plugin.json files today; npm/PyPI metadata,
9
+ // GitHub repo descriptions, docs site landing pages tomorrow).
10
+ //
11
+ // CI enforces no drift: `services-sync.test.ts` runs `canonical-sync
12
+ // --check` and fails on any difference.
13
+ //
14
+ // Skill names MUST match the directory names under skills/<name>/ and the
15
+ // repo names we want to claim on GitHub/npm. Don't paraphrase.
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SERVICES = void 0;
18
+ const SHARED_KEYWORDS = ['mcp', 'claude-skill', 'ai-agent', 'cli', 'myapi'];
19
+ const k = (...extra) => [...SHARED_KEYWORDS, ...extra];
20
+ exports.SERVICES = [
21
+ // ── identity / infra ────────────────────────────────────────────────
22
+ {
23
+ module: 'hq',
24
+ skill: 'my-api-hq',
25
+ domain: 'myapihq.com',
26
+ description: 'Core identity and billing hub. Manage auth, organizations, and billing.',
27
+ category: 'identity',
28
+ status: 'ga',
29
+ keywords: k('auth', 'identity', 'billing', 'organization'),
30
+ },
31
+ {
32
+ module: 'domain',
33
+ skill: 'my-domain-api',
34
+ domain: 'mydomainapi.com',
35
+ description: 'Domain registration and check with automated DNS and email infrastructure.',
36
+ category: 'infra',
37
+ status: 'ga',
38
+ keywords: k('domain', 'dns', 'registration'),
39
+ },
40
+ // ── send ────────────────────────────────────────────────────────────
41
+ {
42
+ // Customer-facing email surface (mailboxes, campaigns, templates,
43
+ // warmup) is gated pre-launch — 503 SERVICE_NOT_LAUNCHED. Sibling
44
+ // `my-email-verify-api` stays GA and remains the discoverable entry
45
+ // point for the email primitive today.
46
+ module: 'email',
47
+ skill: 'my-email-api',
48
+ domain: 'myemailapi.com',
49
+ description: 'Send transactional and bulk email from your own domain. Mailboxes, AI templates, drip campaigns, and warmup.',
50
+ category: 'send',
51
+ status: 'preview',
52
+ keywords: k('email', 'transactional', 'campaign', 'smtp'),
53
+ },
54
+ {
55
+ module: 'email',
56
+ skill: 'my-email-verify-api',
57
+ domain: 'myemailapi.com',
58
+ description: 'Sync single-address email verification — syntax + DNS + Microsoft probe. Pre-send quality gate for campaigns.',
59
+ category: 'send',
60
+ status: 'ga',
61
+ keywords: k('email', 'verification', 'deliverability', 'syntax', 'dns'),
62
+ },
63
+ {
64
+ module: 'funnel',
65
+ skill: 'my-funnel-api',
66
+ domain: 'myfunnelapi.com',
67
+ description: 'Build multi-page sites and funnels with headless HTML upload.',
68
+ category: 'send',
69
+ status: 'ga',
70
+ keywords: k('funnel', 'landing-page', 'website', 'static-site'),
71
+ },
72
+ {
73
+ module: 'url',
74
+ skill: 'my-url-to',
75
+ domain: 'myurlto.com',
76
+ description: 'Stateless link routing and URL shortening for the MyAPI ecosystem.',
77
+ category: 'send',
78
+ status: 'preview',
79
+ keywords: k('url', 'shortener', 'redirect', 'link'),
80
+ },
81
+ {
82
+ module: 'image',
83
+ skill: 'my-image-api',
84
+ domain: 'myimageapi.com',
85
+ description: 'Generate AI images from a text prompt. Async, polls until ready, returns a public CDN URL.',
86
+ category: 'compute',
87
+ status: 'ga',
88
+ keywords: k('image', 'ai-image', 'gemini', 'text-to-image'),
89
+ },
90
+ // ── capture ─────────────────────────────────────────────────────────
91
+ {
92
+ module: 'webhook',
93
+ skill: 'my-webhook-api',
94
+ domain: 'mywebhookapi.com',
95
+ description: 'Receive inbound HTTP webhooks. Per-org endpoints with full delivery history.',
96
+ category: 'capture',
97
+ status: 'ga',
98
+ keywords: k('webhook', 'inbound', 'event'),
99
+ },
100
+ {
101
+ module: 'pixel',
102
+ skill: 'my-pixel-api',
103
+ domain: 'mypixelapi.com',
104
+ description: 'Tracking pixel + identity resolution. Capture visits, events, and stitch known users to anonymous sessions.',
105
+ category: 'capture',
106
+ status: 'planned',
107
+ keywords: k('pixel', 'analytics', 'tracking', 'visit', 'identity'),
108
+ },
109
+ // ── data ────────────────────────────────────────────────────────────
110
+ {
111
+ // Goldfox-backed people search is gated pre-launch — 503 SERVICE_NOT_LAUNCHED.
112
+ // Internal Goldfox lookups still work (`crm contacts promote` resolves a
113
+ // goldfox_person_id server-side), but the agent-facing search/get path
114
+ // is hidden until backend lifts the gate.
115
+ module: 'people',
116
+ skill: 'my-people-api',
117
+ domain: 'mypeopleapi.com',
118
+ description: 'Contact database backed by the Goldfox crawl. Filter people by confidence tier, seniority, email type, country, link confidence, plus rich behavioral company signals (has_c_level, has_careers_page, has_decision_maker). The targeting layer for outbound campaigns.',
119
+ category: 'data',
120
+ status: 'preview',
121
+ keywords: k('people', 'contact', 'b2b', 'targeting', 'goldfox'),
122
+ },
123
+ {
124
+ // Goldfox-backed company search gated pre-launch (same reason as people).
125
+ module: 'company',
126
+ skill: 'my-company-api',
127
+ domain: 'mycompanyapi.com',
128
+ description: 'Company database backed by the Goldfox crawl. Filter companies by confidence tier, country/TLD consistency, behavioral page signals (has_careers_page, has_investors_page, has_shop_page, has_c_level, has_decision_maker), legal-entity status, headcount, and source-URL count.',
129
+ category: 'data',
130
+ status: 'preview',
131
+ keywords: k('company', 'firmographics', 'b2b', 'goldfox'),
132
+ },
133
+ {
134
+ // Saved audiences sit on top of people/company — gated together with them.
135
+ module: 'audience',
136
+ skill: 'my-audience-api',
137
+ domain: 'myaudienceapi.com',
138
+ description: 'Saved audiences = named filter snapshots over people/company database. Reuse across campaigns; refresh re-evaluates against current data.',
139
+ category: 'data',
140
+ status: 'preview',
141
+ keywords: k('audience', 'segment', 'filter'),
142
+ },
143
+ {
144
+ module: 'crm',
145
+ skill: 'my-crm-api',
146
+ domain: 'mycrmapi.com',
147
+ description: 'The canonical store of engaged people + companies. Auto-ingest from inbound webhooks (configurable dot-path). Fixed lifecycle_stage enum, soft delete, event timeline.',
148
+ category: 'data',
149
+ status: 'ga',
150
+ keywords: k('crm', 'contact', 'pipeline', 'engagement'),
151
+ },
152
+ // ── store ───────────────────────────────────────────────────────────
153
+ {
154
+ module: 'storage',
155
+ skill: 'my-storage-api',
156
+ domain: 'mystorageapi.com',
157
+ description: 'Edge-hosted asset storage. Upload local files or ingest from URLs, each gets a stable public CDN URL.',
158
+ category: 'store',
159
+ status: 'ga',
160
+ keywords: k('storage', 'cdn', 'asset', 'upload'),
161
+ },
162
+ {
163
+ module: 'database',
164
+ skill: 'my-database-api',
165
+ domain: 'mydatabaseapi.com',
166
+ description: 'Per-org KV store with namespaces + compare-and-swap. JSON values up to 256 KB. The substrate for stateful agent-built apps.',
167
+ category: 'store',
168
+ status: 'ga',
169
+ keywords: k('kv-store', 'database', 'state'),
170
+ },
171
+ // ── compute ─────────────────────────────────────────────────────────
172
+ {
173
+ module: 'workflow',
174
+ skill: 'my-workflow-api',
175
+ domain: 'myworkflowapi.com',
176
+ description: 'React to inbound webhooks with step chains: send email, post to Slack, call HTTP URLs.',
177
+ category: 'compute',
178
+ status: 'ga',
179
+ keywords: k('workflow', 'automation', 'orchestration'),
180
+ },
181
+ {
182
+ module: 'llm',
183
+ skill: 'my-llm-api',
184
+ domain: 'myllmapi.com',
185
+ description: 'Provider-agnostic LLM completions + embeddings via MyAPI. Routes to managed models (Gemini today, more soon) at upstream cost. Use in workflow steps, not for your own reasoning.',
186
+ category: 'compute',
187
+ status: 'ga',
188
+ keywords: k('llm', 'completion', 'embedding', 'gemini'),
189
+ },
190
+ ];
package/dist/storage.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Exposes } from './exposes';
2
+ export declare const EXPOSES: Exposes;
1
3
  export interface Asset {
2
4
  asset_id: string;
3
5
  url: string;
@@ -5,7 +7,7 @@ export interface Asset {
5
7
  created_at: string;
6
8
  }
7
9
  export declare function ingestAsset(apiKey: string, orgId: string, url: string, name?: string): Promise<Asset>;
8
- export type UploadContentType = 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
10
+ export type UploadContentType = 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm';
9
11
  export declare function uploadAsset(apiKey: string, orgId: string, file: Blob | Buffer, contentType: UploadContentType, name?: string): Promise<Asset>;
10
12
  export declare function listAssets(apiKey: string, orgId: string): Promise<Asset[]>;
11
13
  export declare function deleteAsset(apiKey: string, orgId: string, assetId: string): Promise<void>;
package/dist/storage.js CHANGED
@@ -1,11 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXPOSES = void 0;
3
4
  exports.ingestAsset = ingestAsset;
4
5
  exports.uploadAsset = uploadAsset;
5
6
  exports.listAssets = listAssets;
6
7
  exports.deleteAsset = deleteAsset;
7
8
  const client_1 = require("./client");
8
9
  const config_1 = require("./config");
10
+ exports.EXPOSES = [
11
+ 'POST /storage/orgs/{org_id}/assets/ingest',
12
+ 'POST /storage/orgs/{org_id}/assets/upload',
13
+ 'GET /storage/orgs/{org_id}/assets',
14
+ 'DELETE /storage/orgs/{org_id}/assets/{asset_id}',
15
+ ];
9
16
  async function ingestAsset(apiKey, orgId, url, name) {
10
17
  return (0, client_1.request)('POST', `${config_1.STORAGE_BASE}/storage/orgs/${encodeURIComponent(orgId)}/assets/ingest`, apiKey, { url, name });
11
18
  }
package/dist/url.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Exposes } from './exposes';
2
+ export declare const EXPOSES: Exposes;
1
3
  export interface ShortenResponse {
2
4
  short_code: string;
3
5
  short_url: string;
package/dist/url.js CHANGED
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXPOSES = void 0;
3
4
  exports.shortenUrl = shortenUrl;
4
5
  const client_1 = require("./client");
5
6
  const config_1 = require("./config");
7
+ exports.EXPOSES = [
8
+ 'POST /url/orgs/{org_id}/shorten',
9
+ ];
6
10
  async function shortenUrl(apiKey, orgId, url) {
7
11
  return (0, client_1.request)('POST', `${config_1.URL_BASE}/url/orgs/${encodeURIComponent(orgId)}/shorten`, apiKey, { url });
8
12
  }
package/dist/webhook.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { Exposes } from './exposes';
2
+ export declare const EXPOSES: Exposes;
1
3
  export interface WebhookEndpoint {
2
4
  id: string;
3
5
  org_id: string;
@@ -5,6 +7,7 @@ export interface WebhookEndpoint {
5
7
  description?: string;
6
8
  slug: string;
7
9
  url: string;
10
+ crm_email_path?: string;
8
11
  created_at: string;
9
12
  }
10
13
  export interface Delivery {
@@ -13,7 +16,11 @@ export interface Delivery {
13
16
  payload: unknown;
14
17
  received_at: string;
15
18
  }
16
- export declare function createEndpoint(apiKey: string, orgId: string, name: string, description?: string): Promise<WebhookEndpoint>;
19
+ export interface CreateEndpointOptions {
20
+ description?: string;
21
+ crm_email_path?: string;
22
+ }
23
+ export declare function createEndpoint(apiKey: string, orgId: string, name: string, opts?: CreateEndpointOptions): Promise<WebhookEndpoint>;
17
24
  export declare function listEndpoints(apiKey: string, orgId: string): Promise<WebhookEndpoint[]>;
18
25
  export declare function deleteEndpoint(apiKey: string, orgId: string, endpointId: string): Promise<void>;
19
26
  export declare function getDelivery(apiKey: string, orgId: string, deliveryId: string): Promise<Delivery>;
package/dist/webhook.js CHANGED
@@ -1,13 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXPOSES = void 0;
3
4
  exports.createEndpoint = createEndpoint;
4
5
  exports.listEndpoints = listEndpoints;
5
6
  exports.deleteEndpoint = deleteEndpoint;
6
7
  exports.getDelivery = getDelivery;
7
8
  const client_1 = require("./client");
8
9
  const config_1 = require("./config");
9
- async function createEndpoint(apiKey, orgId, name, description) {
10
- return (0, client_1.request)('POST', `${config_1.WEBHOOK_BASE}/webhook/orgs/${encodeURIComponent(orgId)}/endpoints`, apiKey, { name, description });
10
+ exports.EXPOSES = [
11
+ 'POST /webhook/orgs/{org_id}/endpoints',
12
+ 'GET /webhook/orgs/{org_id}/endpoints',
13
+ 'DELETE /webhook/orgs/{org_id}/endpoints/{endpoint_id}',
14
+ 'GET /webhook/orgs/{org_id}/deliveries/{delivery_id}',
15
+ ];
16
+ async function createEndpoint(apiKey, orgId, name, opts = {}) {
17
+ const body = { name };
18
+ if (opts.description !== undefined)
19
+ body.description = opts.description;
20
+ if (opts.crm_email_path !== undefined)
21
+ body.crm_email_path = opts.crm_email_path;
22
+ return (0, client_1.request)('POST', `${config_1.WEBHOOK_BASE}/webhook/orgs/${encodeURIComponent(orgId)}/endpoints`, apiKey, body);
11
23
  }
12
24
  async function listEndpoints(apiKey, orgId) {
13
25
  return (0, client_1.request)('GET', `${config_1.WEBHOOK_BASE}/webhook/orgs/${encodeURIComponent(orgId)}/endpoints`, apiKey);
@@ -1,3 +1,5 @@
1
+ import type { Exposes } from './exposes';
2
+ export declare const EXPOSES: Exposes;
1
3
  /**
2
4
  * A single step in a workflow.
3
5
  *
package/dist/workflow.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EXPOSES = void 0;
3
4
  exports.createWorkflow = createWorkflow;
4
5
  exports.listWorkflows = listWorkflows;
5
6
  exports.getWorkflow = getWorkflow;
@@ -11,6 +12,17 @@ exports.listWorkflowRuns = listWorkflowRuns;
11
12
  exports.getWorkflowRun = getWorkflowRun;
12
13
  const client_1 = require("./client");
13
14
  const config_1 = require("./config");
15
+ exports.EXPOSES = [
16
+ 'POST /workflow/orgs/{org_id}/workflows',
17
+ 'GET /workflow/orgs/{org_id}/workflows',
18
+ 'GET /workflow/orgs/{org_id}/workflows/{workflow_id}',
19
+ 'PATCH /workflow/orgs/{org_id}/workflows/{workflow_id}',
20
+ 'DELETE /workflow/orgs/{org_id}/workflows/{workflow_id}',
21
+ 'POST /workflow/orgs/{org_id}/workflows/{workflow_id}/enable',
22
+ 'POST /workflow/orgs/{org_id}/workflows/{workflow_id}/disable',
23
+ 'GET /workflow/orgs/{org_id}/workflows/{workflow_id}/runs',
24
+ 'GET /workflow/orgs/{org_id}/runs/{run_id}',
25
+ ];
14
26
  async function createWorkflow(apiKey, orgId, payload) {
15
27
  return (0, client_1.request)('POST', `${config_1.WORKFLOW_BASE}/workflow/orgs/${encodeURIComponent(orgId)}/workflows`, apiKey, payload);
16
28
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
- "version": "1.1.0-wip.4",
3
+ "license": "Apache-2.0",
4
+ "version": "1.2.0",
4
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",