@myapihq/cli 1.0.29 → 1.0.39
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/dist/commands/auth.js +15 -0
- package/dist/commands/billing.js +29 -28
- package/dist/commands/domain.d.ts +1 -0
- package/dist/commands/domain.js +33 -13
- package/dist/commands/org.js +9 -4
- package/dist/commands/setup.d.ts +2 -1
- package/dist/commands/setup.js +58 -5
- package/dist/commands/update.js +5 -1
- package/dist/config.js +1 -1
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +11 -0
- package/package.json +1 -1
- package/scripts/copy-skills.js +3 -26
- package/src/commands/auth.ts +16 -0
- package/src/commands/billing.ts +36 -36
- package/src/commands/domain.ts +33 -16
- package/src/commands/org.ts +14 -9
- package/src/commands/setup.ts +60 -5
- package/src/commands/update.ts +5 -1
- package/src/config.ts +1 -1
- package/src/utils.ts +11 -0
- package/dist/skills/my-api-hq.md +0 -116
- package/dist/skills/my-domain-api.md +0 -83
- package/dist/skills/my-funnel-api.md +0 -35
- package/src/skills/my-api-hq.md +0 -116
- package/src/skills/my-domain-api.md +0 -83
- package/src/skills/my-funnel-api.md +0 -35
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: my-funnel-api:funnel
|
|
3
|
-
description: >
|
|
4
|
-
A lean CRUD and CDN Publishing API. Manage funnel configurations, push raw HTML pages, and deploy static assets to the edge KV.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# MyFunnelAPI Skill
|
|
8
|
-
|
|
9
|
-
## 1. Funnel Management (Authenticated)
|
|
10
|
-
These endpoints manage the database records and structural configuration of funnels.
|
|
11
|
-
|
|
12
|
-
- `GET /funnel/orgs/{org_id}/funnels`
|
|
13
|
-
Lists all funnels for the specified organization.
|
|
14
|
-
- `POST /funnel/orgs/{org_id}/funnels`
|
|
15
|
-
Creates a new funnel entry. Expects basic configuration metadata (name, domain, etc.). Body: `{ "domain": "example.com" }`
|
|
16
|
-
- `GET /funnel/orgs/{org_id}/funnels/{id}`
|
|
17
|
-
Retrieves the metadata and configuration details of a specific funnel.
|
|
18
|
-
- `DELETE /funnel/orgs/{org_id}/funnels/{id}`
|
|
19
|
-
Deletes a funnel from the database and automatically purges all of its preview and published pages from the edge KV cache.
|
|
20
|
-
|
|
21
|
-
## 2. Publishing & Edge Deployment (Authenticated)
|
|
22
|
-
These endpoints interact with the edge KV cache to push HTML/JS content to the edge domains. As soon as you push a page, it is live.
|
|
23
|
-
|
|
24
|
-
- `POST /funnel/orgs/{org_id}/funnels/{id}/push-page`
|
|
25
|
-
Deploys raw HTML to a specific slug on the live funnel (e.g., pushing custom HTML to /contact). Body: `{"slug": "/route", "html": "..."}`.
|
|
26
|
-
- `POST /funnel/orgs/{org_id}/funnels/{id}/verify`
|
|
27
|
-
Pre-publish verification. Validates syntax and structure of raw HTML or an existing page slug.
|
|
28
|
-
|
|
29
|
-
## 3. Public Proxies (Unauthenticated)
|
|
30
|
-
These endpoints are called directly by the end-users' browsers (via the deployed static HTML). They do not require API keys. They are stateless and act as routing proxies to the Webhook API.
|
|
31
|
-
|
|
32
|
-
- `POST /funnel/funnels/{id}/submit/{slug...}`
|
|
33
|
-
The endpoint for HTML form submissions. Validates the JSON payload, returns a 200 OK to the browser, and asynchronously POSTs the data to the organization's matching webhook (or fallback webhook).
|
|
34
|
-
- `POST /funnel/funnels/{id}/event`
|
|
35
|
-
The endpoint for analytics and tracking scripts. Proxies click events, pageviews, and pixel tracking data to the configured webhook endpoints. Includes built-in rate limiting (max 60 req/min per funnel).
|
package/src/skills/my-api-hq.md
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: my-api-hq
|
|
3
|
-
description: >
|
|
4
|
-
Core Identity and Billing hub. Manage auth, organizations (get org_id), and billing (checkout/topup).
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# MyApiHQ Skill
|
|
8
|
-
Root entry point for the ecosystem. All other skills require an `api_key` and often an `org_id` from here.
|
|
9
|
-
|
|
10
|
-
## Platform Conventions
|
|
11
|
-
|
|
12
|
-
### Response Envelope
|
|
13
|
-
Every response across all services is wrapped in:
|
|
14
|
-
```json
|
|
15
|
-
{
|
|
16
|
-
"success": true,
|
|
17
|
-
"data": { ... },
|
|
18
|
-
"error": null,
|
|
19
|
-
"meta": { "request_id": "...", "latency_ms": 12, "service": "...", "version": "v1" }
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
On error, `success` is `false`, `data` is `null`, and `error` contains a string error code or object. Always check `success` before reading `data`.
|
|
23
|
-
|
|
24
|
-
### Pagination
|
|
25
|
-
List endpoints accept `?limit=` and `?offset=` and return `total`, `limit`, `offset` in the body.
|
|
26
|
-
|
|
27
|
-
## Authentication & Key Management
|
|
28
|
-
|
|
29
|
-
You need to go to myapihq.com and register an account. Generate an api key and export it to pass it to the agent (as env).
|
|
30
|
-
|
|
31
|
-
### Account Login
|
|
32
|
-
```
|
|
33
|
-
POST /hq/account/login
|
|
34
|
-
{ "email": "...", "password": "..." }
|
|
35
|
-
→ { "data": { "token": "<JWT>" } }
|
|
36
|
-
```
|
|
37
|
-
Errors: `401` wrong password.
|
|
38
|
-
|
|
39
|
-
**Refresh Token:**
|
|
40
|
-
```
|
|
41
|
-
POST /hq/account/refresh
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**Google OAuth:**
|
|
45
|
-
- `GET /hq/auth/google/redirect` — Initiates Google OAuth flow.
|
|
46
|
-
- `GET /hq/auth/google/callback` — OAuth callback.
|
|
47
|
-
|
|
48
|
-
### API Key Management
|
|
49
|
-
**Generate Persistent Key:**
|
|
50
|
-
```
|
|
51
|
-
POST /hq/account/create/key
|
|
52
|
-
Authorization: Bearer <JWT from login>
|
|
53
|
-
{ "name": "MyKey" }
|
|
54
|
-
→ { "data": { "api_key": "hq_live_...", "id": "...", "prefix": "..." } }
|
|
55
|
-
```
|
|
56
|
-
Errors: `401` no auth.
|
|
57
|
-
|
|
58
|
-
Use `Authorization: Bearer <api_key>` for all subsequent requests across the entire ecosystem.
|
|
59
|
-
|
|
60
|
-
**List Keys:** `GET /hq/account/keys`
|
|
61
|
-
|
|
62
|
-
**Revoke Key:** `DELETE /hq/account/delete/key/{id}`
|
|
63
|
-
|
|
64
|
-
### Cross-Session Storage
|
|
65
|
-
**Always persist credentials immediately.** Write a `.env` file:
|
|
66
|
-
```
|
|
67
|
-
MYAPI_API_KEY=hq_live_...
|
|
68
|
-
MYAPI_ACCOUNT_ID=...
|
|
69
|
-
```
|
|
70
|
-
Also save to agent memory if your runtime supports it (e.g., Claude Code memory). On every new session, check for credentials before creating a new account.
|
|
71
|
-
|
|
72
|
-
## Organization Management
|
|
73
|
-
**You MUST create an org to get an `org_id` for other APIs.**
|
|
74
|
-
|
|
75
|
-
### Create Org (sync)
|
|
76
|
-
```
|
|
77
|
-
POST /hq/orgs
|
|
78
|
-
{ "name": "Acme Inc" (required), "tagline", "description", "business_sector",
|
|
79
|
-
"logo_url", "favicon_url", "og_image_url",
|
|
80
|
-
"color_palette": { "primary": "#hex", ... },
|
|
81
|
-
"font_family", "imagery_style", "headline", "subheadline", "cta_text",
|
|
82
|
-
"value_propositions": ["..."],
|
|
83
|
-
"social_links": { "twitter": "url", ... },
|
|
84
|
-
"canonical_url", "privacy_policy_url", "cookie_policy_url", "terms_url",
|
|
85
|
-
"gdpr_enabled": false, "default_language": "en", "tracking": {} }
|
|
86
|
-
→ { "data": { "id": "<org_id>", ... } }
|
|
87
|
-
```
|
|
88
|
-
Errors: `400` invalid_json · `422` name_required, invalid_field:color_palette, invalid_field:value_propositions, invalid_field:social_links, invalid_field:tracking · `402` insufficient balance (org creation has a cost on paid plan).
|
|
89
|
-
|
|
90
|
-
### Async Brand Import
|
|
91
|
-
```
|
|
92
|
-
POST /hq/org-imports
|
|
93
|
-
{ "org_id": "<id>" (required), "domain": "example.com" (required), "auto_accept": false }
|
|
94
|
-
→ { "data": { "job_id": "...", "status": "pending" } }
|
|
95
|
-
|
|
96
|
-
GET /hq/org-imports/{job_id}
|
|
97
|
-
→ Poll until status = "awaiting_confirm". Returns brand_preview.
|
|
98
|
-
|
|
99
|
-
POST /hq/org-imports/{job_id}/confirm
|
|
100
|
-
{ ...optional overrides matching POST /hq/orgs payload... }
|
|
101
|
-
→ { "data": { "id": "<org_id>", ... } }
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Manage Orgs
|
|
105
|
-
- `GET /hq/orgs` — list all orgs.
|
|
106
|
-
- `GET /hq/orgs/{id}` — get org details. Errors: `404` org_not_found.
|
|
107
|
-
- `PATCH /hq/orgs/{id}` — partial update, same fields as create. Errors: `400` invalid_json · `404` org_not_found · `422` invalid_field:*.
|
|
108
|
-
- `DELETE /hq/orgs/{id}` — delete org and cascade. Errors: `404` org_not_found.
|
|
109
|
-
|
|
110
|
-
## Billing
|
|
111
|
-
- **Setup Payment Method:** You need to do this from the myapihq dashboard directly.
|
|
112
|
-
- **Check Balance:** `GET /hq/billing/balance` → `{ "data": { "balance_cents": 1000, "balance_display": "$10.00", "credits_cents": 500, "credits_display": "$5.00", "has_payment_method": true } }`.
|
|
113
|
-
- **Billing History:** `GET /hq/billing/history`
|
|
114
|
-
- **Top Up:** `POST /hq/billing/topup` — `{ "amount_cents": 1000 }` → `{ "data": { "new_balance_cents": 2000, "new_balance_display": "$20.00" } }`.
|
|
115
|
-
|
|
116
|
-
**On 402 from any service:** check balance and top up here before retrying.
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: my-domain-api
|
|
3
|
-
description: >
|
|
4
|
-
Register new domains, check availability and pricing, import existing domains, and manage edge settings. Use this before creating mailboxes or funnels — both require an owned domain.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# MyDomainAPI Skill
|
|
8
|
-
|
|
9
|
-
## Quick Start
|
|
10
|
-
1. `GET /domain/orgs/{org_id}/list?filter=all` — lists domains owned by your account. `filter` can be `all`, `unassigned`, or `org` (default).
|
|
11
|
-
2. `GET /domain/orgs/{org_id}/check/available/{domain}` — confirm availability and price.
|
|
12
|
-
3. `POST /domain/orgs/{org_id}/register` with `domain` and optional `years`.
|
|
13
|
-
4. Proceed to `my-email-api` for mailboxes or `my-funnel-api` for a website.
|
|
14
|
-
|
|
15
|
-
DNS is fully managed by the platform — enabling seamless email deliverability, tracking pixel, and edge delivery integration. Manual DNS record management is not exposed.
|
|
16
|
-
|
|
17
|
-
## Dependencies & Backlinks
|
|
18
|
-
- **Auth & Billing:** 401/402 → fall back to `my-api-hq`.
|
|
19
|
-
- **Next Steps:** After registration → `my-email-api` for mailboxes or `my-funnel-api` for a website.
|
|
20
|
-
|
|
21
|
-
## Authentication
|
|
22
|
-
`Authorization: Bearer <api_key>` (from `my-api-hq`).
|
|
23
|
-
|
|
24
|
-
## Endpoints
|
|
25
|
-
|
|
26
|
-
### Check Availability
|
|
27
|
-
```
|
|
28
|
-
GET /domain/orgs/{org_id}/check/available/{domain}
|
|
29
|
-
→ { "available": true, "price_cents": 1200 }
|
|
30
|
-
```
|
|
31
|
-
Errors: `400` INVALID_DOMAIN, TLD_NOT_SUPPORTED.
|
|
32
|
-
|
|
33
|
-
### Register Domain
|
|
34
|
-
```
|
|
35
|
-
POST /domain/orgs/{org_id}/register
|
|
36
|
-
{ "domain": "example.com", "years": 1 }
|
|
37
|
-
→ { "domain": "...", "status": "provisioning", "domain_id": "..." }
|
|
38
|
-
```
|
|
39
|
-
Errors: `400` invalid request, INVALID_DOMAIN, TLD_NOT_SUPPORTED · `409` DOMAIN_ALREADY_OWNED, DOMAIN_UNAVAILABLE · `402` INSUFFICIENT_BALANCE (includes `required_cents`) or UPGRADE_REQUIRED (free account) · `403` `already_owned` flag is not permitted.
|
|
40
|
-
|
|
41
|
-
### Import Existing Domain
|
|
42
|
-
```
|
|
43
|
-
POST /domain/orgs/{org_id}/import
|
|
44
|
-
{ "domain": "example.com", "namecheap_api_user": "optional", "namecheap_api_key": "optional" }
|
|
45
|
-
```
|
|
46
|
-
Sets up DNS and email infrastructure automatically. Optionally updates Namecheap NS if credentials are provided.
|
|
47
|
-
Errors: `402` insufficient balance.
|
|
48
|
-
|
|
49
|
-
To use Namecheap automation: go to **Profile > Tools > Namecheap API Access**, generate an API Key, and whitelist the MyAPI-HQ server IP — otherwise the API calls will be rejected.
|
|
50
|
-
|
|
51
|
-
### List & Status
|
|
52
|
-
```
|
|
53
|
-
GET /domain/orgs/{org_id}/list
|
|
54
|
-
GET /domain/orgs/{org_id}/{domain}/status
|
|
55
|
-
```
|
|
56
|
-
Errors (status): `404` DOMAIN_NOT_FOUND.
|
|
57
|
-
|
|
58
|
-
### Assign / Unassign Domain
|
|
59
|
-
```
|
|
60
|
-
POST /domain/orgs/{org_id}/{domain}/assign
|
|
61
|
-
{ "org_id": "<target_org_id>" } // Pass null to unassign
|
|
62
|
-
```
|
|
63
|
-
Associates a domain already in the account with a specific organization, or removes it from its current organization if `org_id` is null.
|
|
64
|
-
Errors: `404` DOMAIN_NOT_FOUND · `422` ORG_NOT_FOUND.
|
|
65
|
-
|
|
66
|
-
### Edge Settings
|
|
67
|
-
|
|
68
|
-
**Update:**
|
|
69
|
-
```
|
|
70
|
-
POST /domain/orgs/{org_id}/{domain}/settings
|
|
71
|
-
{
|
|
72
|
-
"security_level": "essentially_off", // essentially_off | medium | high | under_attack
|
|
73
|
-
"browser_check": "off", // on | off
|
|
74
|
-
"purge_cache": true
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
*To allow AI training bots and crawlers: set `security_level: "essentially_off"` and `browser_check: "off"`.*
|
|
78
|
-
|
|
79
|
-
**Get:**
|
|
80
|
-
```
|
|
81
|
-
GET /domain/orgs/{org_id}/{domain}/settings
|
|
82
|
-
→ { "domain": "...", "security_level": "...", "browser_check": "...", "ai_bots_protection": "disabled", "is_robots_txt_managed": false }
|
|
83
|
-
```
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: my-funnel-api:funnel
|
|
3
|
-
description: >
|
|
4
|
-
A lean CRUD and CDN Publishing API. Manage funnel configurations, push raw HTML pages, and deploy static assets to the edge KV.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# MyFunnelAPI Skill
|
|
8
|
-
|
|
9
|
-
## 1. Funnel Management (Authenticated)
|
|
10
|
-
These endpoints manage the database records and structural configuration of funnels.
|
|
11
|
-
|
|
12
|
-
- `GET /funnel/orgs/{org_id}/funnels`
|
|
13
|
-
Lists all funnels for the specified organization.
|
|
14
|
-
- `POST /funnel/orgs/{org_id}/funnels`
|
|
15
|
-
Creates a new funnel entry. Expects basic configuration metadata (name, domain, etc.). Body: `{ "domain": "example.com" }`
|
|
16
|
-
- `GET /funnel/orgs/{org_id}/funnels/{id}`
|
|
17
|
-
Retrieves the metadata and configuration details of a specific funnel.
|
|
18
|
-
- `DELETE /funnel/orgs/{org_id}/funnels/{id}`
|
|
19
|
-
Deletes a funnel from the database and automatically purges all of its preview and published pages from the edge KV cache.
|
|
20
|
-
|
|
21
|
-
## 2. Publishing & Edge Deployment (Authenticated)
|
|
22
|
-
These endpoints interact with the edge KV cache to push HTML/JS content to the edge domains. As soon as you push a page, it is live.
|
|
23
|
-
|
|
24
|
-
- `POST /funnel/orgs/{org_id}/funnels/{id}/push-page`
|
|
25
|
-
Deploys raw HTML to a specific slug on the live funnel (e.g., pushing custom HTML to /contact). Body: `{"slug": "/route", "html": "..."}`.
|
|
26
|
-
- `POST /funnel/orgs/{org_id}/funnels/{id}/verify`
|
|
27
|
-
Pre-publish verification. Validates syntax and structure of raw HTML or an existing page slug.
|
|
28
|
-
|
|
29
|
-
## 3. Public Proxies (Unauthenticated)
|
|
30
|
-
These endpoints are called directly by the end-users' browsers (via the deployed static HTML). They do not require API keys. They are stateless and act as routing proxies to the Webhook API.
|
|
31
|
-
|
|
32
|
-
- `POST /funnel/funnels/{id}/submit/{slug...}`
|
|
33
|
-
The endpoint for HTML form submissions. Validates the JSON payload, returns a 200 OK to the browser, and asynchronously POSTs the data to the organization's matching webhook (or fallback webhook).
|
|
34
|
-
- `POST /funnel/funnels/{id}/event`
|
|
35
|
-
The endpoint for analytics and tracking scripts. Proxies click events, pageviews, and pixel tracking data to the configured webhook endpoints. Includes built-in rate limiting (max 60 req/min per funnel).
|