@myapihq/cli 1.0.63 → 1.0.65
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 +12 -4
- package/dist/commands/config.d.ts +4 -4
- package/dist/commands/config.js +12 -12
- package/dist/commands/funnel.js +1 -1
- package/dist/commands/keys.js +2 -2
- package/dist/commands/org.js +1 -1
- package/dist/commands/update.js +1 -1
- package/dist/skills/my-api-hq/README.md +37 -0
- package/dist/skills/my-api-hq/SKILL.md +116 -0
- package/dist/skills/my-api-hq/claude/.claude-plugin/plugin.json +6 -0
- package/dist/skills/my-api-hq/make/.gitkeep +0 -0
- package/dist/skills/my-api-hq/n8n/.gitkeep +0 -0
- package/dist/skills/my-api-hq/openapi/.gitkeep +0 -0
- package/dist/skills/my-domain-api/README.md +37 -0
- package/dist/skills/my-domain-api/SKILL.md +83 -0
- package/dist/skills/my-domain-api/claude/.claude-plugin/plugin.json +6 -0
- package/dist/skills/my-domain-api/make/.gitkeep +0 -0
- package/dist/skills/my-domain-api/n8n/.gitkeep +0 -0
- package/dist/skills/my-domain-api/openapi/.gitkeep +0 -0
- package/dist/skills/my-funnel-api/README.md +39 -0
- package/dist/skills/my-funnel-api/SKILL.md +35 -0
- package/dist/skills/my-funnel-api/claude/.claude-plugin/plugin.json +6 -0
- package/dist/skills/my-funnel-api/make/.gitkeep +0 -0
- package/dist/skills/my-funnel-api/n8n/.gitkeep +0 -0
- package/dist/skills/my-funnel-api/openapi/.gitkeep +0 -0
- package/package.json +4 -1
- package/scripts/copy-skills.js +0 -13
- package/src/commands/auth.ts +0 -190
- package/src/commands/billing.ts +0 -92
- package/src/commands/config.ts +0 -71
- package/src/commands/domain.ts +0 -134
- package/src/commands/email.ts +0 -185
- package/src/commands/funnel.ts +0 -123
- package/src/commands/image.ts +0 -85
- package/src/commands/keys.ts +0 -68
- package/src/commands/org.ts +0 -135
- package/src/commands/pixel.ts +0 -62
- package/src/commands/setup.ts +0 -335
- package/src/commands/storage.ts +0 -56
- package/src/commands/update.ts +0 -89
- package/src/commands/url.ts +0 -28
- package/src/commands/webhook.ts +0 -66
- package/src/commands/workflow.ts +0 -102
- package/src/config.ts +0 -123
- package/src/index.ts +0 -203
- package/src/output.ts +0 -49
- package/src/utils.ts +0 -45
- package/thank-you.html +0 -56
- package/tsconfig.json +0 -15
package/dist/commands/auth.js
CHANGED
|
@@ -144,7 +144,7 @@ export async function whoami(flags = {}) {
|
|
|
144
144
|
// myapi auth switch [index] — switch between saved accounts.
|
|
145
145
|
export async function switchCmd(flags = {}, indexArg) {
|
|
146
146
|
if (flags.help) {
|
|
147
|
-
info('Usage: myapi auth switch [index]\n\nSwitches the active account. Run without arguments to see a numbered list\nof accounts and choose interactively.\n\nPass an index number to switch non-interactively:\n myapi auth switch 2\n\nNote: index numbers
|
|
147
|
+
info('Usage: myapi auth switch [index|email]\n\nSwitches the active account. Run without arguments to see a numbered list\nof accounts and choose interactively.\n\nPass an index number or email address to switch non-interactively:\n myapi auth switch 2\n myapi auth switch you@example.com\n\nNote: index numbers can shift as accounts are added or removed.\nUse email as a stable identifier in scripts.');
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
const accounts = listAccounts();
|
|
@@ -171,9 +171,17 @@ export async function switchCmd(flags = {}, indexArg) {
|
|
|
171
171
|
rl.close();
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
// Support email as a stable identifier
|
|
175
|
+
let idx;
|
|
176
|
+
const byEmail = accounts.find(a => a.email && a.email.toLowerCase() === idxStr.toLowerCase());
|
|
177
|
+
if (byEmail) {
|
|
178
|
+
idx = byEmail.index;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
idx = parseInt(idxStr, 10) - 1;
|
|
182
|
+
if (isNaN(idx) || idx < 0 || idx >= accounts.length) {
|
|
183
|
+
error('Invalid selection. Use an index number or email address.');
|
|
184
|
+
}
|
|
177
185
|
}
|
|
178
186
|
if (switchAccount(idx)) {
|
|
179
187
|
const a = accounts[idx];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function setOrg(id: string, flags: Record<string, string | boolean
|
|
2
|
-
export declare function setFunnel(id: string, flags: Record<string, string | boolean
|
|
3
|
-
export declare function setDomain(domain: string, flags: Record<string, string | boolean
|
|
4
|
-
export declare function view(flags: Record<string, string | boolean
|
|
1
|
+
export declare function setOrg(id: string, flags: Record<string, string | boolean>, via?: string): Promise<void>;
|
|
2
|
+
export declare function setFunnel(id: string, flags: Record<string, string | boolean>, via?: string): Promise<void>;
|
|
3
|
+
export declare function setDomain(domain: string, flags: Record<string, string | boolean>, via?: string): Promise<void>;
|
|
4
|
+
export declare function view(flags: Record<string, string | boolean>, via?: string): Promise<void>;
|
|
5
5
|
export declare function run(subcommand: string | undefined, args: string[], flags: Record<string, string | boolean>): Promise<void>;
|
package/dist/commands/config.js
CHANGED
|
@@ -2,9 +2,9 @@ import { hq, funnel as sdkFunnel } from '@myapihq/sdk';
|
|
|
2
2
|
import { requireConfig, saveConfig } from '../config.js';
|
|
3
3
|
import { success, error, info } from '../output.js';
|
|
4
4
|
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
5
|
-
export async function setOrg(id, flags) {
|
|
5
|
+
export async function setOrg(id, flags, via = 'auth config') {
|
|
6
6
|
if (!id || flags.help) {
|
|
7
|
-
info(
|
|
7
|
+
info(`Usage: myapi ${via} set-org <id>\n\nSets the default organization for all commands that require --org.\nThe ID is validated against the API before saving.\n\nExample:\n myapi ${via} set-org xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`);
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
if (!UUID_RE.test(id))
|
|
@@ -16,9 +16,9 @@ export async function setOrg(id, flags) {
|
|
|
16
16
|
saveConfig(config);
|
|
17
17
|
success(`Default organization set to: ${org.name || org.id}`);
|
|
18
18
|
}
|
|
19
|
-
export async function setFunnel(id, flags) {
|
|
19
|
+
export async function setFunnel(id, flags, via = 'auth config') {
|
|
20
20
|
if (!id || flags.help) {
|
|
21
|
-
info(
|
|
21
|
+
info(`Usage: myapi ${via} set-funnel <id>\n\nSets the default funnel. The funnel must belong to your current default org.\nThe ID is validated against the API before saving.\n\nExample:\n myapi ${via} set-funnel xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
if (!UUID_RE.test(id))
|
|
@@ -33,9 +33,9 @@ export async function setFunnel(id, flags) {
|
|
|
33
33
|
saveConfig(config);
|
|
34
34
|
success(`Default funnel set to: ${funnel.id}`);
|
|
35
35
|
}
|
|
36
|
-
export async function setDomain(domain, flags) {
|
|
36
|
+
export async function setDomain(domain, flags, via = 'auth config') {
|
|
37
37
|
if (!domain || flags.help) {
|
|
38
|
-
info(
|
|
38
|
+
info(`Usage: myapi ${via} set-domain <domain>\n\nSets the default domain used by domain commands when --domain is omitted.\n\nExample:\n myapi ${via} set-domain example.com`);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const config = requireConfig();
|
|
@@ -43,9 +43,9 @@ export async function setDomain(domain, flags) {
|
|
|
43
43
|
saveConfig(config);
|
|
44
44
|
success(`Default domain set to: ${domain}`);
|
|
45
45
|
}
|
|
46
|
-
export async function view(flags) {
|
|
46
|
+
export async function view(flags, via = 'auth config') {
|
|
47
47
|
if (flags.help) {
|
|
48
|
-
info(
|
|
48
|
+
info(`Usage: myapi ${via} view\n\nShows the currently configured defaults: default org, funnel, and domain.`);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
const config = requireConfig();
|
|
@@ -60,13 +60,13 @@ export async function run(subcommand, args, flags) {
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
if (subcommand === 'view')
|
|
63
|
-
await view(flags);
|
|
63
|
+
await view(flags, via);
|
|
64
64
|
else if (subcommand === 'set-org')
|
|
65
|
-
await setOrg(args[0], flags);
|
|
65
|
+
await setOrg(args[0], flags, via);
|
|
66
66
|
else if (subcommand === 'set-funnel')
|
|
67
|
-
await setFunnel(args[0], flags);
|
|
67
|
+
await setFunnel(args[0], flags, via);
|
|
68
68
|
else if (subcommand === 'set-domain')
|
|
69
|
-
await setDomain(args[0], flags);
|
|
69
|
+
await setDomain(args[0], flags, via);
|
|
70
70
|
else
|
|
71
71
|
error(`Unknown subcommand: ${subcommand}. Run "myapi config --help" for a list of valid subcommands.`);
|
|
72
72
|
}
|
package/dist/commands/funnel.js
CHANGED
|
@@ -114,7 +114,7 @@ export async function run(subcommand, args, flags) {
|
|
|
114
114
|
else if (subcommand === 'delete')
|
|
115
115
|
info('Usage: myapi funnel delete <id> --org <id>\n\nDeletes a funnel permanently.\n\nFlags:\n --org <id> Organization ID (or set default via myapi auth config set-org)');
|
|
116
116
|
else if (subcommand === 'push')
|
|
117
|
-
info('Usage: myapi funnel push [funnel_id] [slug] < page.html\n
|
|
117
|
+
info('Usage: myapi funnel push [funnel_id] [slug] < page.html\n\nPublishes an HTML page from stdin to a path within your funnel (website).\n\nArgument resolution:\n - If the first positional argument starts with "/", it is treated as the slug\n (funnel_id is omitted and your default funnel is used).\n - If the first positional argument looks like a UUID, it is treated as funnel_id;\n the second argument (if any) is the slug.\n - Omit both to use your configured default funnel and slug "/".\n\nFlags:\n --org <id> Organization ID (or set default via myapi auth config set-org)\n --slug <path> Alternative way to specify the slug\n\nExamples:\n echo \'<h1>Hello</h1>\' | myapi funnel push / # push to / on default funnel\n cat about.html | myapi funnel push /about # push to /about\n myapi funnel push < index.html # push to / on default funnel\n cat p.html | myapi funnel push <uuid> /pricing # explicit funnel + slug');
|
|
118
118
|
else if (subcommand === 'pull')
|
|
119
119
|
info('Usage: myapi funnel pull [funnel_id] [slug]\n\nFetches the HTML content of a funnel page.');
|
|
120
120
|
return;
|
package/dist/commands/keys.js
CHANGED
|
@@ -24,7 +24,7 @@ export async function createNew(flags) {
|
|
|
24
24
|
}
|
|
25
25
|
export async function list(flags) {
|
|
26
26
|
if (flags.help) {
|
|
27
|
-
info('Usage: myapi keys list [--json]\n\nLists all API keys associated with your account
|
|
27
|
+
info('Usage: myapi auth api-keys list [--json]\n\nLists all API keys associated with your account.\n\nAlias: myapi keys list\n\nFlags:\n --json Output raw JSON');
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const config = requireConfig();
|
|
@@ -48,7 +48,7 @@ export async function list(flags) {
|
|
|
48
48
|
}
|
|
49
49
|
export async function revoke(id, flags) {
|
|
50
50
|
if (flags.help) {
|
|
51
|
-
info('Usage: myapi keys revoke <id>\n\
|
|
51
|
+
info('Usage: myapi auth api-keys revoke <id>\n\nPermanently revokes an API key by ID. This action cannot be undone.\nThe key stops working immediately.\n\nAlias: myapi keys revoke <id>');
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
if (!id) {
|
package/dist/commands/org.js
CHANGED
|
@@ -100,7 +100,7 @@ export async function del(id, flags) {
|
|
|
100
100
|
}
|
|
101
101
|
export async function importOrg(args, flags) {
|
|
102
102
|
if (flags.help) {
|
|
103
|
-
info('Usage: myapi org import <domain> --org <id>\n\nSyncs brand information from an existing website into an organization.\nMyAPI fetches the site
|
|
103
|
+
info('Usage: myapi org import <domain> --org <id>\n\nSyncs brand information from an existing website into an organization profile.\nMyAPI fetches the site and extracts name, logo, description, and other brand\nsignals, then updates the org automatically.\n\nThis does NOT register or assign the domain — it only reads from the site\nto enrich the org profile. Think of it as "brand sync", not domain setup.\n\nPrerequisite: an org must already exist. Create one first:\n myapi org create --name "My Brand" --yes');
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
const config = requireConfig();
|
package/dist/commands/update.js
CHANGED
|
@@ -41,7 +41,7 @@ export async function checkForUpdate(currentVersion) {
|
|
|
41
41
|
// myapi update — explicit update, same logic as auto-update.
|
|
42
42
|
export async function update(flags = {}) {
|
|
43
43
|
if (flags.help) {
|
|
44
|
-
info('Usage: myapi update\n\nUpdates the MyAPI CLI and installed skills to the latest published version.\nEquivalent to: npm install -g @myapihq/cli@latest\n\
|
|
44
|
+
info('Usage: myapi update\n\nUpdates the MyAPI CLI and installed skills to the latest published version.\nEquivalent to: npm install -g @myapihq/cli@latest\n\nNotes:\n - Version pinning and rollback are not supported — always installs the latest.\n - The CLI also auto-updates silently on each command when a newer version is\n detected. If you need a stable version in CI, pin with:\n npm install -g @myapihq/cli@<version>\n and set NO_COLOR=1 to suppress ANSI output in non-TTY environments.');
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
info('› Checking for updates…');
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# my-api-hq
|
|
2
|
+
|
|
3
|
+
Core identity and billing hub for the MyAPI ecosystem. **Start here** — every other service requires an API key and often an `org_id` from this one.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Account management (register an account on myapihq.com)
|
|
8
|
+
- API key creation and management
|
|
9
|
+
- Organization management (`org_id` used by all other services)
|
|
10
|
+
- Balance top-up and billing history
|
|
11
|
+
|
|
12
|
+
## Quickstart
|
|
13
|
+
|
|
14
|
+
1. Register an account on myapihq.com
|
|
15
|
+
2. Generate an API key from the dashboard
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 3. Use the generated api_key for all subsequent requests
|
|
19
|
+
export MYAPI_KEY=hq_live_...
|
|
20
|
+
|
|
21
|
+
# 4. Create an org (required by most services)
|
|
22
|
+
curl -sS -X POST https://api.myapihq.com/hq/orgs \
|
|
23
|
+
-H "Authorization: Bearer $MYAPI_KEY" \
|
|
24
|
+
-H "Content-Type: application/json" \
|
|
25
|
+
-d '{"name": "My Org"}'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Authentication
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Authorization: Bearer <api_key>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Links
|
|
35
|
+
|
|
36
|
+
- [Full skill documentation (SKILL.md)](./SKILL.md)
|
|
37
|
+
- [MyAPI HQ](https://myapihq.com)
|
|
@@ -0,0 +1,116 @@
|
|
|
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.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# my-domain-api
|
|
2
|
+
|
|
3
|
+
Register domains, check availability and pricing, import existing domains, and manage edge settings. Required before creating mailboxes (`my-email-api`) or funnels (`my-funnel-api`) — both need an owned domain.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Check domain availability and pricing
|
|
8
|
+
- Register new domains (auto-configures DNS + email infrastructure)
|
|
9
|
+
- Import existing domains
|
|
10
|
+
- Manage edge/DNS settings
|
|
11
|
+
|
|
12
|
+
## Quickstart
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Check availability
|
|
16
|
+
curl -sS https://mydomainapi.com/domain/check/example.com \
|
|
17
|
+
-H "Authorization: Bearer $MYAPI_KEY"
|
|
18
|
+
|
|
19
|
+
# Register a domain
|
|
20
|
+
curl -sS -X POST https://mydomainapi.com/domain/register \
|
|
21
|
+
-H "Authorization: Bearer $MYAPI_KEY" \
|
|
22
|
+
-H "Content-Type: application/json" \
|
|
23
|
+
-d '{"domain": "example.com", "org_id": "<org_id>"}'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Authentication
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Authorization: Bearer <api_key>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Requires `org_id` from `my-api-hq`.
|
|
33
|
+
|
|
34
|
+
## Links
|
|
35
|
+
|
|
36
|
+
- [Full skill documentation (SKILL.md)](./SKILL.md)
|
|
37
|
+
- [MyDomainAPI](https://mydomainapi.com)
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# my-funnel-api
|
|
2
|
+
|
|
3
|
+
Host multi-page sites and funnels by pushing raw HTML or using AI to plan, build, and edit complete funnels. Handles routing, edge delivery, webhook wiring, link/workflow verification, and lead management.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Create and host multi-page funnels from raw HTML
|
|
8
|
+
- AI-assisted funnel generation and editing
|
|
9
|
+
- Edge delivery on your domain
|
|
10
|
+
- Lead capture and management
|
|
11
|
+
- Webhook and workflow integration
|
|
12
|
+
|
|
13
|
+
## Quickstart
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create a funnel page
|
|
17
|
+
curl -sS -X POST https://myfunnelapi.com/funnel/page \
|
|
18
|
+
-H "Authorization: Bearer $MYAPI_KEY" \
|
|
19
|
+
-H "Content-Type: application/json" \
|
|
20
|
+
-d '{
|
|
21
|
+
"org_id": "<org_id>",
|
|
22
|
+
"domain": "yourdomain.com",
|
|
23
|
+
"slug": "/",
|
|
24
|
+
"html": "<html>...</html>"
|
|
25
|
+
}'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Authentication
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Authorization: Bearer <api_key>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Requires `org_id` and an owned domain from `my-domain-api`.
|
|
35
|
+
|
|
36
|
+
## Links
|
|
37
|
+
|
|
38
|
+
- [Full skill documentation (SKILL.md)](./SKILL.md)
|
|
39
|
+
- [MyFunnelAPI](https://myfunnelapi.com)
|
|
@@ -0,0 +1,35 @@
|
|
|
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).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
package/scripts/copy-skills.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Skills are not bundled in the CLI package for now.
|
|
3
|
-
import { existsSync, rmSync, mkdirSync } from 'fs';
|
|
4
|
-
import { join, dirname } from 'path';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
6
|
-
|
|
7
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const dest = join(__dirname, '..', 'src', 'skills');
|
|
9
|
-
|
|
10
|
-
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
|
|
11
|
-
mkdirSync(dest, { recursive: true });
|
|
12
|
-
|
|
13
|
-
console.log('copy-skills: no skills bundled.');
|