@lukoweb/apitogo 0.2.30 → 0.2.34
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/cli/cli.js +794 -248
- package/dist/declarations/app/entry.server.d.ts +2 -2
- package/dist/declarations/app/main.d.ts +3 -1
- package/dist/declarations/cli/platform/client/platform-api.d.ts +16 -5
- package/dist/declarations/cli/platform/helpers/deploy-artifact-hash.d.ts +1 -1
- package/dist/declarations/cli/platform/helpers/package-files.d.ts +1 -1
- package/dist/declarations/cli/platform/helpers/platform-plan.d.ts +1 -1
- package/dist/declarations/cli/platform/helpers/zip.d.ts +1 -1
- package/dist/declarations/cli/platform/tools/infrastructure.d.ts +0 -4
- package/dist/declarations/config/effective-redirects.d.ts +6 -0
- package/dist/declarations/config/header-navigation-guard.d.ts +2 -0
- package/dist/declarations/config/resolve-modules.d.ts +1 -4
- package/dist/declarations/config/validators/HeaderNavigationSchema.d.ts +1 -2
- package/docs/cli/commands.md +151 -75
- package/docs/cli/go-live.md +135 -123
- package/docs/cli/walkthrough.md +40 -1
- package/docs/configuration/gateway.md +52 -0
- package/docs/guides/customer-account.md +33 -2
- package/docs/mcp/tools.md +101 -102
- package/package.json +2 -1
- package/src/app/demo.tsx +78 -77
- package/src/app/entry.client.tsx +115 -107
- package/src/app/entry.server.tsx +164 -160
- package/src/app/main.tsx +175 -167
- package/src/app/standalone.tsx +61 -60
- package/src/config/effective-redirects.ts +31 -0
- package/src/config/header-navigation-guard.ts +13 -0
- package/src/config/resolve-modules.ts +331 -354
- package/src/config/v2/home-redirect.ts +104 -98
- package/src/config/v2/index.ts +127 -126
- package/src/config/v2/ledger.ts +242 -235
- package/src/config/v2/resolve.ts +12 -4
- package/src/config/v2/rules.ts +716 -714
- package/src/config/v2/services.ts +799 -663
- package/src/config/v2/workspace.ts +17 -1
- package/src/config/validators/HeaderNavigationSchema.ts +42 -44
- package/src/lib/assets/powered-by-icon.png +0 -0
- package/src/lib/authentication/providers/dev-portal-auth-pages.tsx +667 -602
- package/src/lib/authentication/providers/dev-portal.tsx +476 -448
- package/src/lib/components/HeaderNavigation.tsx +176 -176
- package/src/lib/components/MobileTopNavigation.tsx +283 -283
- package/src/lib/components/navigation/PoweredByZudoku.tsx +42 -39
- package/src/vite/plugin-offroot-resolve.ts +68 -67
- package/src/vite/prerender/prerender.ts +242 -242
package/docs/cli/go-live.md
CHANGED
|
@@ -1,123 +1,135 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Go live with CLI
|
|
3
|
-
description:
|
|
4
|
-
Publish an APIToGo developer portal with npx apitogo deploy — platform plans, secrets, and status.
|
|
5
|
-
sidebar_icon: rocket
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
**Go live** publishes your shaped portal to APItoGo hosting, optionally deploys the backend, upserts
|
|
9
|
-
gateway plans, and verifies the live site. `npx apitogo deploy` is the source of truth; MCP
|
|
10
|
-
`publish_dev_portal` spawns the same CLI.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
- [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Go live with CLI
|
|
3
|
+
description:
|
|
4
|
+
Publish an APIToGo developer portal with npx apitogo deploy — platform plans, secrets, and status.
|
|
5
|
+
sidebar_icon: rocket
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Go live** publishes your shaped portal to APItoGo hosting, optionally deploys the backend, upserts
|
|
9
|
+
gateway plans, and verifies the live site. `npx apitogo deploy` is the source of truth; MCP
|
|
10
|
+
`publish_dev_portal` spawns the same CLI.
|
|
11
|
+
|
|
12
|
+
:::note
|
|
13
|
+
|
|
14
|
+
This page describes **config version 1** projects (the older `dev-portal` scaffold). A config
|
|
15
|
+
version 2 project, which `npx @lukoweb/apitogo@latest init` creates by default, is published
|
|
16
|
+
differently: run `npx apitogo project create`, then `npx apitogo deploy`. Its resources are
|
|
17
|
+
`portal`, `gateway`, `identity` and `plans`, and the options `--platform-plan` and `--project-name`
|
|
18
|
+
do not apply. See [Walkthrough: from an empty folder to a customer's first call](./walkthrough.md)
|
|
19
|
+
and
|
|
20
|
+
[Config version 2: create the project, then deploy](./commands.md#config-version-2-create-the-project-then-deploy).
|
|
21
|
+
|
|
22
|
+
:::
|
|
23
|
+
|
|
24
|
+
## Before you publish
|
|
25
|
+
|
|
26
|
+
1. Confirm **gateway / API plans** in `apitogo.config.json`. Do not invent Free + Pro unless you
|
|
27
|
+
chose them.
|
|
28
|
+
2. Save secrets in the site **`.env`** (never commit or paste into tickets):
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
APITOGO_CONFIG_AUTHENTICATION__OIDC__AUTHORITY=https://login.example.com
|
|
32
|
+
APITOGO_CONFIG_AUTHENTICATION__OIDC__CLIENT_ID=your-client-id
|
|
33
|
+
APITOGO_CONFIG_AUTHENTICATION__OIDC__CLIENT_SECRET=your-client-secret
|
|
34
|
+
# Only when you have paid project plans:
|
|
35
|
+
APITOGO_CONFIG_AUTHENTICATION__STRIPE__SECRET_KEY=sk_test_...
|
|
36
|
+
APITOGO_CONFIG_AUTHENTICATION__STRIPE__WEBHOOK_SECRET=whsec_...
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. Export platform credentials and choose a **platform hosting** plan: **Free**, **Starter**, or
|
|
40
|
+
**Professional**. Starter and Professional use Stripe checkout on the platform.
|
|
41
|
+
|
|
42
|
+
**Free** cannot publish **paid gateway plans** (`priceAmount > 0`) or attach a **custom domain**.
|
|
43
|
+
If your manifest has paid API tiers, use Starter or Professional — see
|
|
44
|
+
[Gateway plans](../configuration/plans.md).
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
export APITOGO_API_KEY_ID=apk_...
|
|
48
|
+
export APITOGO_API_SECRET=...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Happy path
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd ./dev-portal
|
|
55
|
+
npx apitogo deploy --platform-plan free
|
|
56
|
+
npx apitogo status
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`npx apitogo deploy`:
|
|
60
|
+
|
|
61
|
+
- Creates or links the platform project
|
|
62
|
+
- Provisions modules and syncs gateway plans
|
|
63
|
+
- Deploys the API hub (when configured)
|
|
64
|
+
- Updates the portal backend (including auth API URL in `.env`) and builds + deploys the portal
|
|
65
|
+
frontend
|
|
66
|
+
|
|
67
|
+
If deploy is blocked, fix the reported checklist (missing secrets, plan, OpenAPI). Do not invent
|
|
68
|
+
credentials.
|
|
69
|
+
|
|
70
|
+
After success, register **`manualSteps.oidcRedirectUri`** in your IdP. When Stripe is required for
|
|
71
|
+
paid gateway plans, create a webhook at `manualSteps.stripeWebhookUrl` for the listed events.
|
|
72
|
+
|
|
73
|
+
Do not treat warm-pool URLs as live until deploy and status succeed.
|
|
74
|
+
|
|
75
|
+
## Target specific resources
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx apitogo deploy --only apihub
|
|
79
|
+
npx apitogo deploy --only portal-backend
|
|
80
|
+
npx apitogo deploy --only portal-frontend
|
|
81
|
+
npx apitogo deploy --only apihub,portal-frontend
|
|
82
|
+
npx apitogo deploy --only portal-frontend --force
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| Resource | What it updates |
|
|
86
|
+
| ----------------- | ------------------------------------------------ |
|
|
87
|
+
| `apihub` | Gateway plans/baseline, API hub package + deploy |
|
|
88
|
+
| `portal-backend` | Dev-portal module settings and plan catalog |
|
|
89
|
+
| `portal-frontend` | Site build + Static Web App deploy |
|
|
90
|
+
|
|
91
|
+
Omit `--only` to apply all three. Use `--force` to redeploy even when hashes match.
|
|
92
|
+
|
|
93
|
+
## Other deploy flags
|
|
94
|
+
|
|
95
|
+
| Flag | Purpose |
|
|
96
|
+
| ----------------- | ------------------------------------- |
|
|
97
|
+
| `--project-id` | Override project GUID |
|
|
98
|
+
| `--project-name` | Display name when creating a project |
|
|
99
|
+
| `--platform-plan` | `free` \| `starter` \| `professional` |
|
|
100
|
+
| `--resume-from` | Resume publish ledger from step id |
|
|
101
|
+
| `--no-wait` | Do not wait for long-running jobs |
|
|
102
|
+
| `--json` | Print raw JSON result only |
|
|
103
|
+
|
|
104
|
+
Resume state is stored in `.apitogo/publish-state.json`.
|
|
105
|
+
|
|
106
|
+
## After publish
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npx apitogo status # account + project + live checks
|
|
110
|
+
npx apitogo status --skip-live # skip live health probes
|
|
111
|
+
npx apitogo teardown --yes # delete the platform project
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Platform plan vs API plans
|
|
115
|
+
|
|
116
|
+
| Kind | Meaning | How |
|
|
117
|
+
| ---------------- | ------------------------------------------- | ------------------------------------------------------------------ |
|
|
118
|
+
| Platform hosting | Free / Starter / Professional on APItoGo | `--platform-plan` |
|
|
119
|
+
| Gateway / API | End-user SKUs and rate limits on `/pricing` | `apitogo.config.json` — [Gateway plans](../configuration/plans.md) |
|
|
120
|
+
|
|
121
|
+
## CLI deploy vs MCP publish
|
|
122
|
+
|
|
123
|
+
| Path | Use when |
|
|
124
|
+
| ------------------------ | -------------------------------------------- |
|
|
125
|
+
| `npx apitogo deploy` | Terminal, CI, scripts — full product go-live |
|
|
126
|
+
| MCP `publish_dev_portal` | Agent-driven go-live with the same engine |
|
|
127
|
+
|
|
128
|
+
## Related
|
|
129
|
+
|
|
130
|
+
- [Shape](./shape.md)
|
|
131
|
+
- [Commands](./commands.md)
|
|
132
|
+
- [Authentication](../configuration/authentication.md)
|
|
133
|
+
- [Manifest](../configuration/manifest.md)
|
|
134
|
+
- [Gateway plans](../configuration/plans.md)
|
|
135
|
+
- [MCP go live](../mcp/go-live.md)
|
package/docs/cli/walkthrough.md
CHANGED
|
@@ -108,7 +108,46 @@ What the gateway answers:
|
|
|
108
108
|
The customer sees their calls on the **Usage** page. See
|
|
109
109
|
[Your customers' account pages](../guides/customer-account.md).
|
|
110
110
|
|
|
111
|
-
## 5.
|
|
111
|
+
## 5. Sell a paid plan (optional)
|
|
112
|
+
|
|
113
|
+
Free plans need no payment. To charge your customers, the project needs two things: a Starter or
|
|
114
|
+
Professional plan with APItoGo, and your own Stripe account. Your customers pay you, not APItoGo.
|
|
115
|
+
|
|
116
|
+
1. Create the project on a paid platform plan: `npx apitogo project create --plan starter`. This
|
|
117
|
+
opens the platform's checkout for the hosting fee. A project that already exists on the Free plan
|
|
118
|
+
cannot be moved: create a new one. See
|
|
119
|
+
[Selling paid plans needs Starter or Professional](./commands.md#selling-paid-plans-needs-starter-or-professional).
|
|
120
|
+
2. In your Stripe account, copy the secret key (it starts with `sk_test_` while you test). Store it
|
|
121
|
+
as a project secret. The command asks for the value, so it stays out of the config:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx apitogo secrets set STRIPE_KEY
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
3. Turn billing on in `apitogo.config.json`:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
"plans": {
|
|
131
|
+
"billing": { "provider": "stripe", "apiKey": "secret:STRIPE_KEY" }
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
4. Give a plan a price in `plans.json`: `"priceAmount": 49`, `"priceCurrency": "usd"` and
|
|
136
|
+
`"billingPeriod": "month"`. Its limits cannot be higher than your platform plan allows. A plan
|
|
137
|
+
with a price is refused while billing is off, so nobody is offered a plan they cannot pay for.
|
|
138
|
+
5. Deploy: `npx apitogo deploy`. The output says whether Stripe is in test or live mode and prints
|
|
139
|
+
your portal's webhook address.
|
|
140
|
+
6. In Stripe, add that address as a webhook endpoint with the events `checkout.session.completed`,
|
|
141
|
+
`customer.subscription.updated`, `customer.subscription.deleted` and `invoice.payment_failed`.
|
|
142
|
+
Copy the signing secret (it starts with `whsec_`), store it with
|
|
143
|
+
`npx apitogo secrets set STRIPE_WEBHOOK`, add `"webhookSecret": "secret:STRIPE_WEBHOOK"` next to
|
|
144
|
+
`apiKey`, and deploy again. Until then a payment does not activate the plan, because the portal
|
|
145
|
+
cannot confirm it came from Stripe.
|
|
146
|
+
|
|
147
|
+
While you use a test key, pay with [Stripe's test cards](https://docs.stripe.com/testing). No real
|
|
148
|
+
money moves. Never type a live key until you have tested the whole path.
|
|
149
|
+
|
|
150
|
+
## 6. Remove a test project
|
|
112
151
|
|
|
113
152
|
```bash
|
|
114
153
|
npx apitogo teardown --yes
|
|
@@ -194,6 +194,53 @@ npx apitogo secrets set GATEWAY_SECRET
|
|
|
194
194
|
The value is a reference, never the secret itself. The secret is stored encrypted and never shown
|
|
195
195
|
again. Then make your API refuse any call without that header.
|
|
196
196
|
|
|
197
|
+
## Run your API on the platform (`managed` origin)
|
|
198
|
+
|
|
199
|
+
If you have no place to host your API, the platform can run your code. Set the origin mode to
|
|
200
|
+
`managed` and point `source` at the folder with your code:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
"gateway": {
|
|
204
|
+
"origin": {
|
|
205
|
+
"mode": "managed",
|
|
206
|
+
"source": "backend",
|
|
207
|
+
"runtime": "nodejs",
|
|
208
|
+
"runtimeVersion": "NODE_22_LTS",
|
|
209
|
+
"healthPath": "/health",
|
|
210
|
+
"exclude": ["tests/"]
|
|
211
|
+
},
|
|
212
|
+
"specs": ["openapi.json"]
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
| Field | Meaning |
|
|
217
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
218
|
+
| `source` | Folder with your code, relative to the config. Files in its `.gitignore` and in `exclude` are not uploaded. |
|
|
219
|
+
| `runtime` | `nodejs`, `python` or `dotnet`. |
|
|
220
|
+
| `runtimeVersion` | For example `NODE_22_LTS`. The platform lists the allowed values. |
|
|
221
|
+
| `healthPath` | Path the platform probes to check that your API is up. |
|
|
222
|
+
| `exclude` | More paths to leave out, in `.gitignore` syntax. |
|
|
223
|
+
|
|
224
|
+
`npx apitogo project create` prepares the hosting for your code. `npx apitogo deploy` then uploads
|
|
225
|
+
the OpenAPI file and the config, uploads your code and waits until it runs, and the gateway starts
|
|
226
|
+
sending calls to it. A deploy with the same code uploads nothing. A .NET project is published for
|
|
227
|
+
you (this needs the .NET SDK on your machine), or you can point `source` at a folder that is already
|
|
228
|
+
published.
|
|
229
|
+
|
|
230
|
+
Your code can also be reached by its own address, so check that a call came through the gateway. The
|
|
231
|
+
platform gives your code two settings for this: `APITOGO_ORIGIN_SECRET_HEADER` (the header name) and
|
|
232
|
+
`APITOGO_ORIGIN_SECRET` (the value). The gateway sends that header with every call. Refuse any
|
|
233
|
+
request without it, as in
|
|
234
|
+
[Keep your API from being called directly](#keep-your-api-from-being-called-directly):
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
const header = process.env.APITOGO_ORIGIN_SECRET_HEADER.toLowerCase();
|
|
238
|
+
if (req.headers[header] !== process.env.APITOGO_ORIGIN_SECRET) {
|
|
239
|
+
res.writeHead(403).end();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
197
244
|
## 4. Try it and check it
|
|
198
245
|
|
|
199
246
|
Run these before you deploy:
|
|
@@ -219,3 +266,8 @@ curl -i https://YOUR-GATEWAY-ADDRESS/orders
|
|
|
219
266
|
| `404` | The path is not in your OpenAPI file. |
|
|
220
267
|
| `429` | The rate limit was reached. |
|
|
221
268
|
| `502` or `504` | Your API did not answer. Check `origin.url` and `healthPath`. |
|
|
269
|
+
|
|
270
|
+
A change is live a few seconds after `deploy` reports it ready: the gateway keeps answering with the
|
|
271
|
+
previous rules for up to about ten seconds. If a test right after a deploy shows the old behavior,
|
|
272
|
+
wait a moment and try again. The same delay applies when you remove a gateway: its keys stop working
|
|
273
|
+
within seconds, not at the same instant.
|
|
@@ -28,7 +28,37 @@ The plans come from `plans.json`. A plan has a name, limits, and optionally a pr
|
|
|
28
28
|
subscribes to a plan and may hold more than one. Unsubscribing from a plan stops that plan's keys
|
|
29
29
|
from working and keeps the customer's other plans.
|
|
30
30
|
|
|
31
|
-
Free plans work without any payment. For paid plans see
|
|
31
|
+
Free plans work without any payment. For paid plans see
|
|
32
|
+
[Sell a paid plan](../cli/walkthrough.md#5-sell-a-paid-plan-optional).
|
|
33
|
+
|
|
34
|
+
### Paying for a plan
|
|
35
|
+
|
|
36
|
+
A plan with a price sends the customer to Stripe's checkout page. The portal never sees the card
|
|
37
|
+
details.
|
|
38
|
+
|
|
39
|
+
1. The customer chooses the plan and pays on Stripe's page.
|
|
40
|
+
2. Stripe returns the customer to **Billing**. The page says it is confirming the payment for a few
|
|
41
|
+
seconds, because Stripe tells the portal separately. Then the plan is active and the customer can
|
|
42
|
+
create a key for it.
|
|
43
|
+
3. If the customer closes the checkout or goes back, the **Plans** page says checkout was cancelled
|
|
44
|
+
and nothing was charged.
|
|
45
|
+
|
|
46
|
+
If a payment fails, Stripe retries it. The subscription shows as past due. When Stripe finally
|
|
47
|
+
cancels it, the plan ends and its keys stop working with `401`. The customer is not moved to a free
|
|
48
|
+
plan on their own. They can subscribe to one on the **Plans** page.
|
|
49
|
+
|
|
50
|
+
## Cancelling and refunds
|
|
51
|
+
|
|
52
|
+
- **The customer cancels** on the **Plans** page. The subscription ends in Stripe at once, the plan
|
|
53
|
+
ends and the customer's keys stop working with `401`.
|
|
54
|
+
- **You cancel** a subscription in your Stripe dashboard. Stripe tells the portal, and the plan ends
|
|
55
|
+
the same way.
|
|
56
|
+
- **A refund** is made in your Stripe dashboard. A refund alone does not end the plan: the customer
|
|
57
|
+
keeps the key until the subscription is cancelled. Cancel it as well if the customer should lose
|
|
58
|
+
access. The portal has no refund screen.
|
|
59
|
+
|
|
60
|
+
What you see is in your own Stripe account: payments, customers and refunds. APItoGo does not take a
|
|
61
|
+
share and does not issue refunds. Tax and trials are not handled by the portal.
|
|
32
62
|
|
|
33
63
|
## API keys
|
|
34
64
|
|
|
@@ -59,9 +89,10 @@ the customer calls, those calls show as errors in the usage page.
|
|
|
59
89
|
|
|
60
90
|
| What the customer sees | What to check |
|
|
61
91
|
| --------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
62
|
-
| `401` with a key that should work | The key was revoked, or the plan was cancelled
|
|
92
|
+
| `401` with a key that should work | The key was revoked, or the plan was cancelled or its payment ended. Check the API keys page. |
|
|
63
93
|
| `401` on a project you set up by hand | `gateway.policies.access`: when it also requires a login token, a key alone is refused. |
|
|
64
94
|
| `429` | The plan's limit was reached. The rate limit renews each period; the quota carries `Retry-After`. |
|
|
95
|
+
| A customer paid but has no plan | The webhook is missing or its signing secret is wrong. Check it in Stripe and in `plans.billing`. |
|
|
65
96
|
| The usage page shows nothing after real calls | Calls only count when made with a key. Check that the gateway has been deployed with plans. |
|
|
66
97
|
| Calls from the portal's own pages are blocked | Run `npx apitogo deploy` again. The gateway lists the portal's address after the portal exists. |
|
|
67
98
|
|
package/docs/mcp/tools.md
CHANGED
|
@@ -1,102 +1,101 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: MCP tools
|
|
3
|
-
description: APItoGo MCP tool catalog by category and hand-edit exceptions.
|
|
4
|
-
sidebar_icon: wrench
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Tools are exposed by the APItoGo MCP server. Prefer **`apply_product_intent`** for create / shape /
|
|
8
|
-
go-live. Use granular tools for advanced edits, debugging, or CI.
|
|
9
|
-
|
|
10
|
-
## Lifecycle (prefer these)
|
|
11
|
-
|
|
12
|
-
| Tool | Role |
|
|
13
|
-
| ------------------------------------ | ---------------------------------------------- |
|
|
14
|
-
| `apply_product_intent` | Shape or goLive from a product intent |
|
|
15
|
-
| `create_dev_portal` | Scaffold site (+ optional project bootstrap) |
|
|
16
|
-
| `check_dev_portal_publish_readiness` | Pre-publish checklist |
|
|
17
|
-
| `publish_dev_portal` | Publish portal + plans (+ optional backend) |
|
|
18
|
-
| `verify_dev_portal_live` | Post-publish verification |
|
|
19
|
-
| `bootstrap_dev_portal` | CI one-shot provision + deploy |
|
|
20
|
-
| `bootstrap_project` | Create platform project only (plan unselected) |
|
|
21
|
-
| `teardown_project` | Tear down a project |
|
|
22
|
-
|
|
23
|
-
## Site shaping
|
|
24
|
-
|
|
25
|
-
| Tool | Role |
|
|
26
|
-
| ---------------------------------- | ------------------------------------------------------------------------- |
|
|
27
|
-
| `update_dev_portal_manifest` | Plans, branding, backend, projectId |
|
|
28
|
-
| `set_dev_portal_openapi` | OpenAPI / API reference |
|
|
29
|
-
| `set_dev_portal_theme` | Colors and fonts |
|
|
30
|
-
| `add_dev_portal_page` | Add a TSX docs page (site components; `template`: docs\|guide\|marketing) |
|
|
31
|
-
| `update_dev_portal_page` | Edit a docs page |
|
|
32
|
-
| `scaffold_dev_portal_landing_page` | Scaffold missing landing file |
|
|
33
|
-
| `get_dev_portal_landing_guide` | Landing component catalog |
|
|
34
|
-
| `preview_dev_portal_site` | Start / restart local preview |
|
|
35
|
-
| `build_dev_portal_site` | Production build |
|
|
36
|
-
|
|
37
|
-
Hosted page CRUD also exists (`list/create/delete/rename/reorder_dev_portal_pages`) for the platform
|
|
38
|
-
API surface.
|
|
39
|
-
|
|
40
|
-
## Projects and platform billing
|
|
41
|
-
|
|
42
|
-
| Tool | Role |
|
|
43
|
-
| ------------------------------------------- | ------------------------------------- |
|
|
44
|
-
| `whoami`, `list_projects`, `get_project`, … | Tenant / project CRUD |
|
|
45
|
-
| `list_platform_plans` | Free / Starter / Professional + quota |
|
|
46
|
-
| `ensure_platform_plan` | Select or checkout platform plan |
|
|
47
|
-
| `wait_for_platform_plan` | Poll until active |
|
|
48
|
-
| `get_subscription` | Current subscription |
|
|
49
|
-
| `select_free_plan` | Free hosting |
|
|
50
|
-
| `create_checkout_session` | Stripe checkout for paid hosting |
|
|
51
|
-
|
|
52
|
-
## Backend and OpenAPI
|
|
53
|
-
|
|
54
|
-
| Tool | Role |
|
|
55
|
-
| ----------------------- | ------------------------ |
|
|
56
|
-
| `validate_openapi` | Validate OpenAPI |
|
|
57
|
-
| `update_openapi` | Update stored OpenAPI |
|
|
58
|
-
| `package_backend` | Package backend artifact |
|
|
59
|
-
| `deploy_backend` | Deploy API hub |
|
|
60
|
-
| `get_backend_summary` | Backend status |
|
|
61
|
-
| `get_deployment_status` | Deployment job status |
|
|
62
|
-
| `get_gateway_readiness` | Gateway readiness |
|
|
63
|
-
|
|
64
|
-
## Gateway
|
|
65
|
-
|
|
66
|
-
| Tool | Role |
|
|
67
|
-
| ------------------------------------------------------------------ | ------------------------ |
|
|
68
|
-
| `list/get/create/update/patch_gateway_plan` | Plan CRUD |
|
|
69
|
-
| `add_actions_to_gateway_plan` / `remove_actions_from_gateway_plan` | Attach ops |
|
|
70
|
-
| `set_action_public` | Public routes |
|
|
71
|
-
| `upsert_entitlement` | Entitlements |
|
|
72
|
-
| `configure_gateway_baseline` | Baseline policies |
|
|
73
|
-
| `get/update_gateway_settings` | Settings |
|
|
74
|
-
| `get/update_gateway_auth` | Gateway auth |
|
|
75
|
-
| `sync_gateway_plans_from_manifest` | Post-publish action sync |
|
|
76
|
-
| `reorder_gateway_plans_from_manifest` | Plan order |
|
|
77
|
-
|
|
78
|
-
## Infrastructure and deploy
|
|
79
|
-
|
|
80
|
-
| Tool | Role |
|
|
81
|
-
| ------------------------------------------------------ | ---------------- |
|
|
82
|
-
| `activate_module` | Activate modules |
|
|
83
|
-
| `get_infrastructure_status` / Azure variants | Infra status |
|
|
84
|
-
| `list_provisioning_jobs`, `wait_for_job` | Jobs |
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
102
|
-
- [Go live](./go-live.md)
|
|
1
|
+
---
|
|
2
|
+
title: MCP tools
|
|
3
|
+
description: APItoGo MCP tool catalog by category and hand-edit exceptions.
|
|
4
|
+
sidebar_icon: wrench
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Tools are exposed by the APItoGo MCP server. Prefer **`apply_product_intent`** for create / shape /
|
|
8
|
+
go-live. Use granular tools for advanced edits, debugging, or CI.
|
|
9
|
+
|
|
10
|
+
## Lifecycle (prefer these)
|
|
11
|
+
|
|
12
|
+
| Tool | Role |
|
|
13
|
+
| ------------------------------------ | ---------------------------------------------- |
|
|
14
|
+
| `apply_product_intent` | Shape or goLive from a product intent |
|
|
15
|
+
| `create_dev_portal` | Scaffold site (+ optional project bootstrap) |
|
|
16
|
+
| `check_dev_portal_publish_readiness` | Pre-publish checklist |
|
|
17
|
+
| `publish_dev_portal` | Publish portal + plans (+ optional backend) |
|
|
18
|
+
| `verify_dev_portal_live` | Post-publish verification |
|
|
19
|
+
| `bootstrap_dev_portal` | CI one-shot provision + deploy |
|
|
20
|
+
| `bootstrap_project` | Create platform project only (plan unselected) |
|
|
21
|
+
| `teardown_project` | Tear down a project |
|
|
22
|
+
|
|
23
|
+
## Site shaping
|
|
24
|
+
|
|
25
|
+
| Tool | Role |
|
|
26
|
+
| ---------------------------------- | ------------------------------------------------------------------------- |
|
|
27
|
+
| `update_dev_portal_manifest` | Plans, branding, backend, projectId |
|
|
28
|
+
| `set_dev_portal_openapi` | OpenAPI / API reference |
|
|
29
|
+
| `set_dev_portal_theme` | Colors and fonts |
|
|
30
|
+
| `add_dev_portal_page` | Add a TSX docs page (site components; `template`: docs\|guide\|marketing) |
|
|
31
|
+
| `update_dev_portal_page` | Edit a docs page |
|
|
32
|
+
| `scaffold_dev_portal_landing_page` | Scaffold missing landing file |
|
|
33
|
+
| `get_dev_portal_landing_guide` | Landing component catalog |
|
|
34
|
+
| `preview_dev_portal_site` | Start / restart local preview |
|
|
35
|
+
| `build_dev_portal_site` | Production build |
|
|
36
|
+
|
|
37
|
+
Hosted page CRUD also exists (`list/create/delete/rename/reorder_dev_portal_pages`) for the platform
|
|
38
|
+
API surface.
|
|
39
|
+
|
|
40
|
+
## Projects and platform billing
|
|
41
|
+
|
|
42
|
+
| Tool | Role |
|
|
43
|
+
| ------------------------------------------- | ------------------------------------- |
|
|
44
|
+
| `whoami`, `list_projects`, `get_project`, … | Tenant / project CRUD |
|
|
45
|
+
| `list_platform_plans` | Free / Starter / Professional + quota |
|
|
46
|
+
| `ensure_platform_plan` | Select or checkout platform plan |
|
|
47
|
+
| `wait_for_platform_plan` | Poll until active |
|
|
48
|
+
| `get_subscription` | Current subscription |
|
|
49
|
+
| `select_free_plan` | Free hosting |
|
|
50
|
+
| `create_checkout_session` | Stripe checkout for paid hosting |
|
|
51
|
+
|
|
52
|
+
## Backend and OpenAPI
|
|
53
|
+
|
|
54
|
+
| Tool | Role |
|
|
55
|
+
| ----------------------- | ------------------------ |
|
|
56
|
+
| `validate_openapi` | Validate OpenAPI |
|
|
57
|
+
| `update_openapi` | Update stored OpenAPI |
|
|
58
|
+
| `package_backend` | Package backend artifact |
|
|
59
|
+
| `deploy_backend` | Deploy API hub |
|
|
60
|
+
| `get_backend_summary` | Backend status |
|
|
61
|
+
| `get_deployment_status` | Deployment job status |
|
|
62
|
+
| `get_gateway_readiness` | Gateway readiness |
|
|
63
|
+
|
|
64
|
+
## Gateway
|
|
65
|
+
|
|
66
|
+
| Tool | Role |
|
|
67
|
+
| ------------------------------------------------------------------ | ------------------------ |
|
|
68
|
+
| `list/get/create/update/patch_gateway_plan` | Plan CRUD |
|
|
69
|
+
| `add_actions_to_gateway_plan` / `remove_actions_from_gateway_plan` | Attach ops |
|
|
70
|
+
| `set_action_public` | Public routes |
|
|
71
|
+
| `upsert_entitlement` | Entitlements |
|
|
72
|
+
| `configure_gateway_baseline` | Baseline policies |
|
|
73
|
+
| `get/update_gateway_settings` | Settings |
|
|
74
|
+
| `get/update_gateway_auth` | Gateway auth |
|
|
75
|
+
| `sync_gateway_plans_from_manifest` | Post-publish action sync |
|
|
76
|
+
| `reorder_gateway_plans_from_manifest` | Plan order |
|
|
77
|
+
|
|
78
|
+
## Infrastructure and deploy
|
|
79
|
+
|
|
80
|
+
| Tool | Role |
|
|
81
|
+
| ------------------------------------------------------ | ---------------- |
|
|
82
|
+
| `activate_module` | Activate modules |
|
|
83
|
+
| `get_infrastructure_status` / Azure variants | Infra status |
|
|
84
|
+
| `list_provisioning_jobs`, `wait_for_job` | Jobs |
|
|
85
|
+
| `get/set/delete_custom_domain` | Custom domain |
|
|
86
|
+
| `get_dev_portal_deploy_config`, `deploy_dev_portal`, … | SWA deploy |
|
|
87
|
+
|
|
88
|
+
## Hand-edit exceptions
|
|
89
|
+
|
|
90
|
+
| Change | Where |
|
|
91
|
+
| ----------------- | -------------------------------------------------------- |
|
|
92
|
+
| Home page content | `landing/LandingPage.tsx` |
|
|
93
|
+
| Site footer | `apitogo.config.json` → `modules.landing.content.footer` |
|
|
94
|
+
|
|
95
|
+
There is **no** `update_dev_portal_landing` tool for arbitrary home content.
|
|
96
|
+
|
|
97
|
+
## Related
|
|
98
|
+
|
|
99
|
+
- [Overview](./overview.md)
|
|
100
|
+
- [Shape](./shape.md)
|
|
101
|
+
- [Go live](./go-live.md)
|