@lukoweb/apitogo 0.2.54 → 0.2.57

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 (82) hide show
  1. package/dist/cli/cli.js +2196 -1352
  2. package/dist/declarations/cli/platform/client/platform-api.d.ts +29 -0
  3. package/dist/declarations/cli/platform/helpers/platform-plan-catalog.d.ts +6 -0
  4. package/dist/declarations/config/validators/ZudokuConfig.d.ts +2 -0
  5. package/dist/declarations/lib/authentication/providers/openid.d.ts +2 -1
  6. package/dist/declarations/lib/plugins/markdown/index.d.ts +2 -1
  7. package/dist/flat-config.d.ts +1 -0
  8. package/docs/cli/commands.md +50 -32
  9. package/docs/cli/go-live.md +66 -93
  10. package/docs/cli/overview.md +18 -17
  11. package/docs/cli/setup.md +130 -141
  12. package/docs/cli/shape.md +94 -11
  13. package/docs/cli/walkthrough.md +1 -1
  14. package/docs/components/slot.mdx +116 -119
  15. package/docs/configuration/api-reference.md +98 -397
  16. package/docs/configuration/authentication.md +118 -159
  17. package/docs/configuration/footer.mdx +89 -118
  18. package/docs/configuration/make-config.mdx +2 -2
  19. package/docs/configuration/overview.md +97 -166
  20. package/docs/configuration/plans.md +100 -110
  21. package/docs/configuration/portal.md +116 -0
  22. package/docs/customization/colors-theme.mdx +255 -278
  23. package/docs/customization/fonts.md +105 -110
  24. package/docs/customization/landing-page.md +189 -188
  25. package/docs/deploy/apitogo.md +13 -17
  26. package/docs/deployment.md +15 -9
  27. package/docs/guides/stripe-setup.mdx +123 -0
  28. package/docs/markdown/frontmatter.md +172 -173
  29. package/docs/mcp/go-live.md +100 -100
  30. package/docs/mcp/overview.md +76 -76
  31. package/docs/quickstart.md +88 -72
  32. package/docs/writing.mdx +68 -72
  33. package/package.json +1 -1
  34. package/src/config/v2/docs-navigation.ts +7 -2
  35. package/src/config/v2/index.ts +1 -0
  36. package/src/config/v2/resolve.ts +28 -0
  37. package/src/config/v2/rules.ts +32 -1
  38. package/src/config/v2/schema.ts +9 -0
  39. package/src/config/v2/services.ts +90 -15
  40. package/src/config/v2/starter-landing.ts +41 -0
  41. package/src/config/v2/wrapper.ts +141 -7
  42. package/src/config/validators/ZudokuConfig.ts +794 -792
  43. package/src/lib/authentication/providers/openid.tsx +6 -1
  44. package/src/lib/plugins/markdown/index.tsx +86 -82
  45. package/src/vite/dev-server.ts +9 -1
  46. package/src/vite/dev-ssr-config.ts +32 -0
  47. package/src/vite/plugin-config.ts +4 -2
  48. package/src/vite/plugin-docs.ts +213 -205
  49. package/docs/concepts/auth-provider-api-identities.md +0 -105
  50. package/docs/configuration/ai-assistants.md +0 -65
  51. package/docs/configuration/api-catalog.md +0 -109
  52. package/docs/configuration/authentication-auth0.md +0 -181
  53. package/docs/configuration/authentication-azure-ad.md +0 -245
  54. package/docs/configuration/authentication-clerk.md +0 -117
  55. package/docs/configuration/authentication-firebase.md +0 -69
  56. package/docs/configuration/authentication-pingfederate.md +0 -143
  57. package/docs/configuration/authentication-supabase.md +0 -233
  58. package/docs/configuration/build-configuration.mdx +0 -147
  59. package/docs/configuration/docs.md +0 -282
  60. package/docs/configuration/llms.md +0 -90
  61. package/docs/configuration/manifest.md +0 -129
  62. package/docs/configuration/navigation.mdx +0 -415
  63. package/docs/configuration/protected-routes.md +0 -150
  64. package/docs/configuration/search.md +0 -164
  65. package/docs/configuration/sentry.mdx +0 -44
  66. package/docs/configuration/site.md +0 -124
  67. package/docs/configuration/slots.mdx +0 -125
  68. package/docs/configuration/vite-config.md +0 -18
  69. package/docs/custom-plugins.md +0 -285
  70. package/docs/deploy/apache-nginx.md +0 -41
  71. package/docs/deploy/cloudflare-pages.md +0 -74
  72. package/docs/deploy/direct-upload.md +0 -17
  73. package/docs/deploy/github-pages.md +0 -49
  74. package/docs/deploy/vercel.md +0 -101
  75. package/docs/extending/events.md +0 -124
  76. package/docs/guides/environment-variables.md +0 -94
  77. package/docs/guides/managing-api-keys-and-identities.md +0 -89
  78. package/docs/guides/navigation-rules.mdx +0 -203
  79. package/docs/guides/processors.mdx +0 -234
  80. package/docs/guides/transforming-examples.md +0 -156
  81. package/docs/guides/using-multiple-apis.md +0 -87
  82. package/docs/plugins.md +0 -24
@@ -1,282 +0,0 @@
1
- ---
2
- title: Documentation
3
- navigation_label: Documentation
4
- navigation_icon: book
5
- ---
6
-
7
- APIToGo uses a file-based routing system for documentation pages, similar to many modern frameworks.
8
- This page explains how routing works and how to customize it.
9
-
10
- ## File Based Routing
11
-
12
- By default, APIToGo automatically creates routes for all Markdown and MDX files based on their file
13
- path. Files are served at URLs that match their file structure, minus the file extension.
14
-
15
- ### Basic Examples
16
-
17
- ```text title="File tree"
18
- pages/
19
- ├── introduction.md → /introduction
20
- ├── quickstart.mdx → /quickstart
21
- ├── guides/
22
- │ ├── getting-started.md → /guides/getting-started
23
- │ └── advanced.md → /guides/advanced
24
- └── api/
25
- └── reference.md → /api/reference
26
- ```
27
-
28
- ### File Extensions
29
-
30
- Both `.md` and `.mdx` files are supported:
31
-
32
- - `.md` files support standard Markdown with frontmatter
33
- - `.mdx` files support JSX components within Markdown
34
-
35
- The file extension is automatically removed from the URL.
36
-
37
- ## Custom Paths
38
-
39
- You can override the default file-based routing by specifying custom paths in your navigation
40
- configuration. When a file has a custom path, it will only be accessible at that custom path, not at
41
- its original file-based path.
42
-
43
- ### Navigation Configuration
44
-
45
- ```tsx {5-6,13-14} title="config" showLineNumbers
46
- export default {
47
- navigation: [
48
- {
49
- type: "doc",
50
- file: "guides/getting-started.md",
51
- path: "start-here", // Custom path
52
- label: "Start Here",
53
- },
54
- {
55
- type: "category",
56
- label: "Advanced",
57
- link: {
58
- file: "guides/advanced.md",
59
- path: "advanced-guide", // Custom path for category link
60
- },
61
- items: [
62
- // ... other items
63
- ],
64
- },
65
- ],
66
- };
67
- ```
68
-
69
- In this example:
70
-
71
- - `guides/getting-started.md` is accessible at `/start-here` (not `/guides/getting-started`)
72
- - `guides/advanced.md` is accessible at `/advanced-guide` (not `/guides/advanced`)
73
-
74
- ## Configuration Options
75
-
76
- Configure docs routing and behavior through the `docs` section in your config:
77
-
78
- ```tsx title="config"
79
- export default {
80
- docs: {
81
- files: ["/pages/**/*.{md,mdx}"],
82
- defaultOptions: {
83
- toc: true,
84
- disablePager: false,
85
- showLastModified: true,
86
- suggestEdit: {
87
- url: "https://github.com/your-org/your-repo/edit/main/docs",
88
- text: "Edit this page",
89
- },
90
- },
91
- },
92
- };
93
- ```
94
-
95
- ### `files`
96
-
97
- **Type:** `string | string[]`
98
- **Default:** `"/pages/**/*.{md,mdx}"`
99
-
100
- Glob patterns that specify which files to include as documentation pages. You can provide a single
101
- pattern or an array of patterns.
102
-
103
- ```tsx title="config"
104
- // Single pattern
105
- docs: {
106
- files: "/content/**/*.md";
107
- }
108
-
109
- // Multiple patterns
110
- docs: {
111
- files: ["/pages/**/*.{md,mdx}", "/guides/**/*.md", "/tutorials/**/*.mdx"];
112
- }
113
- ```
114
-
115
- ### `defaultOptions`
116
-
117
- Default options applied to all documentation pages. These can be overridden on individual pages
118
- using frontmatter.
119
-
120
- #### `toc`
121
-
122
- **Type:** `boolean`
123
- **Default:** `true`
124
-
125
- Whether to show the table of contents (TOC) by default.
126
-
127
- ```tsx title="config"
128
- docs: {
129
- defaultOptions: {
130
- toc: false; // Hide TOC by default
131
- }
132
- }
133
- ```
134
-
135
- #### `disablePager`
136
-
137
- **Type:** `boolean`
138
- **Default:** `false`
139
-
140
- Whether to disable the previous/next page navigation by default.
141
-
142
- ```tsx title="config"
143
- docs: {
144
- defaultOptions: {
145
- disablePager: true; // Disable pager by default
146
- }
147
- }
148
- ```
149
-
150
- #### `showLastModified`
151
-
152
- **Type:** `boolean`
153
- **Default:** `false`
154
-
155
- Whether to show the last modified date by default.
156
-
157
- ```tsx title="config"
158
- docs: {
159
- defaultOptions: {
160
- showLastModified: true; // Show last modified date
161
- }
162
- }
163
- ```
164
-
165
- #### `suggestEdit`
166
-
167
- **Type:** `{ url: string; text?: string }`
168
- **Default:** `undefined`
169
-
170
- Configuration for the "Edit this page" link.
171
-
172
- ```tsx title="config"
173
- docs: {
174
- defaultOptions: {
175
- suggestEdit: {
176
- url: "https://github.com/your-org/your-repo/edit/main/docs",
177
- text: "Edit this page on GitHub" // Optional custom text
178
- }
179
- }
180
- }
181
- ```
182
-
183
- The `url` should be a template where the file path will be appended. For example, if your docs are
184
- in a `docs/pages/` directory, the URL might be
185
- `https://github.com/your-org/your-repo/edit/main/docs/pages`.
186
-
187
- #### `copyPage`
188
-
189
- **Type:** `boolean` **Default:** `undefined`
190
-
191
- Whether to show a copy button in the page header that allows users to copy the page markdown. This
192
- feature requires `publishMarkdown` to be enabled (see below).
193
-
194
- ```tsx title="config"
195
- docs: {
196
- defaultOptions: {
197
- copyPage: true; // Enable copy button for all pages
198
- }
199
- }
200
- ```
201
-
202
- The copy button provides:
203
-
204
- - A primary "Copy page" action that copies the markdown to clipboard
205
- - A dropdown with additional options:
206
- - Copy link to page
207
- - Open markdown file (requires `publishMarkdown: true`)
208
- - AI assistant options (Claude, ChatGPT by default — see [AI Assistants](./ai-assistants.md) to
209
- customize)
210
-
211
- > **Note:** The copy button requires `publishMarkdown: true` to be set in your docs config. If
212
- > `copyPage` is enabled but `publishMarkdown` is not, a warning will be displayed.
213
-
214
- ### `publishMarkdown`
215
-
216
- **Type:** `boolean` **Default:** `false`
217
-
218
- When enabled, generates `.md` files for each documentation page during build. Pages can then be
219
- accessed at their URL path with the `.md` extension appended (e.g., `/docs/quickstart.md`).
220
-
221
- ```tsx title="config"
222
- docs: {
223
- publishMarkdown: true,
224
- }
225
- ```
226
-
227
- The generated markdown files:
228
-
229
- - Have frontmatter removed for cleaner content
230
- - Are accessible at `{page-url}.md` in both development and production
231
- - Are required for the `copyPage` button functionality
232
- - Are used by LLM features (see [llms.txt configuration](/docs/configuration/llms) for more details)
233
-
234
- ### `llms`
235
-
236
- **Type:** `object` **Default:** `undefined`
237
-
238
- Configuration for generating LLM-friendly documentation files. See the
239
- [llms.txt configuration](/docs/configuration/llms) page for complete documentation.
240
-
241
- ```tsx title="config"
242
- docs: {
243
- llms: {
244
- llmsTxt: true, // Generate llms.txt summary file
245
- llmsTxtFull: true, // Generate llms-full.txt with complete content
246
- includeProtected: false
247
- }
248
- }
249
- ```
250
-
251
- ## Overriding Defaults
252
-
253
- You can override [default options](#defaultoptions) on individual pages using frontmatter:
254
-
255
- ```markdown
256
- ---
257
- toc: false
258
- disablePager: true
259
- showLastModified: false
260
- ---
261
-
262
- # My Page
263
-
264
- This page has custom options that override the defaults.
265
- ```
266
-
267
- ## Route Resolution
268
-
269
- APIToGo resolves routes in the following order:
270
-
271
- 1. **Custom paths from navigation** - If a file has a custom path defined in navigation, it's served
272
- at that path
273
- 2. **File-based paths** - All other files are served at their file-based paths
274
-
275
- ## Best Practices
276
-
277
- 1. **Use descriptive file names** - File names become part of the URL, so make them clear and
278
- SEO-friendly
279
- 2. **Organize with folders** - Use folder structure to group related content
280
- 3. **Custom paths for better UX** - Use custom paths for important pages that need memorable URLs
281
- (sometimes also called slugs)
282
- 4. **Consistent naming** - Use consistent naming conventions for files and folders
@@ -1,90 +0,0 @@
1
- ---
2
- title: LLM-Friendly Documentation Export
3
- navigation_label: llms.txt
4
- navigation_icon: bot
5
- ---
6
-
7
- APIToGo can generate LLM-friendly versions of your documentation following the
8
- [llms.txt](https://llmstxt.org/) specification.
9
-
10
- During build, you can optionally generate:
11
-
12
- - **`.md` files** - Individual pages with frontmatter removed (via `publishMarkdown`)
13
- - **`llms.txt`** - Summary with links to all pages
14
- - **`llms-full.txt`** - Complete documentation in one file
15
-
16
- All options are disabled by default.
17
-
18
- ## Configuration
19
-
20
- LLM features are configured through the `docs` section in your config:
21
-
22
- ```tsx title="config"
23
- export default {
24
- docs: {
25
- files: "pages/**/*.{md,mdx}", // Your markdown files
26
- publishMarkdown: true, // Generate .md files
27
- llms: {
28
- llmsTxt: true, // Generate llms.txt
29
- llmsTxtFull: true, // Generate llms-full.txt
30
- includeProtected: false, // Exclude protected routes
31
- },
32
- },
33
- };
34
- ```
35
-
36
- All options are disabled by default.
37
-
38
- :::tip
39
-
40
- When enabled, markdown files are generated during build and deleted after creating the `llms.txt`
41
- files unless `publishMarkdown: true` is set (see
42
- [`publishMarkdown` docs](/docs/configuration/docs#publishmarkdown)).
43
-
44
- :::
45
-
46
- ### `llmsTxt`
47
-
48
- **Type:** `boolean` **Default:** `false`
49
-
50
- Generates an `llms.txt` file with links to all documentation pages:
51
-
52
- ```markdown title="llms.txt"
53
- # Documentation
54
-
55
- - [Quickstart](/docs/quickstart.md): Get started with APIToGo
56
- - [Writing](/docs/writing.md): A guide to writing documentation
57
- ```
58
-
59
- ### `llmsTxtFull`
60
-
61
- **Type:** `boolean` **Default:** `false`
62
-
63
- Generates `llms-full.txt` containing the complete content of all pages.
64
-
65
- ### `includeProtected`
66
-
67
- **Type:** `boolean` **Default:** `false`
68
-
69
- By default, protected routes are excluded. Set to `true` to include them in the generated files.
70
-
71
- ## Output
72
-
73
- Generated files are available in the output directory after build:
74
-
75
- ```text
76
- dist/
77
- ├── llms.txt # Generated if llmsTxt: true
78
- ├── llms-full.txt # Generated if llmsTxtFull: true
79
- └── docs/
80
- ├── quickstart.md # Generated if publishMarkdown: true
81
- ├── writing.md
82
- └── ...
83
- ```
84
-
85
- **Important:** Individual `.md` files are only kept in the final build if `publishMarkdown: true`.
86
- If only `llmsTxt` or `llmsTxtFull` is enabled, the `.md` files are generated temporarily during the
87
- build but deleted after the `llms.txt` files are created.
88
-
89
- Redirect pages, error pages (400, 404, 500), and protected routes (unless `includeProtected: true`)
90
- are automatically excluded from all generated files.
@@ -1,129 +0,0 @@
1
- # Site configuration (apitogo.config.json)
2
-
3
- Dev portal sites use `apitogo.config.json` for site settings, plans, authentication, and backend
4
- metadata, with optional `.env` overrides for secrets and local tweaks.
5
-
6
- ## Files
7
-
8
- | File | Purpose |
9
- | --------------------- | ----------------------------------------------------------- |
10
- | `apitogo.config.json` | Committed defaults: site, modules, authentication, backend |
11
- | `.env` | Public client vars + publish secrets via `APITOGO_CONFIG_*` |
12
-
13
- ## Canonical shape
14
-
15
- ```json
16
- {
17
- "site": {
18
- "title": "My API",
19
- "logo": {
20
- "src": { "light": "/logo-light.png", "dark": "/logo-dark.png" },
21
- "alt": "My API",
22
- "width": "130px"
23
- }
24
- },
25
- "authentication": {
26
- "enabled": true,
27
- "type": "dev-portal",
28
- "apiBaseUrl": "https://your-dev-portal-api.example.com"
29
- },
30
- "gateway": {
31
- "authMode": "bringYourOwnOidc",
32
- "oidcMetadataUrl": "https://login.example.com/.well-known/openid-configuration",
33
- "publicRoutes": ["/health"],
34
- "cors": {
35
- "allowedOrigins": ["https://myapp.example.com", "http://localhost:5173"]
36
- }
37
- },
38
- "modules": {
39
- "docs": { "files": "/pages/**/*.{md,mdx}" },
40
- "landing": { "enabled": true, "path": "/", "layout": "landing" },
41
- "userPanel": {
42
- "enabled": true,
43
- "dashboard": { "enabled": true },
44
- "userManagement": { "enabled": true },
45
- "plans": {
46
- "enabled": true,
47
- "items": [
48
- {
49
- "sku": "free",
50
- "displayName": "Free",
51
- "priceAmount": 0
52
- }
53
- ]
54
- }
55
- }
56
- },
57
- "apis": [{ "type": "file", "input": "./apis/openapi.yaml", "path": "api" }]
58
- }
59
- ```
60
-
61
- - **Site name / logo:** only `site.title` and `site.logo` (platform branding is derived at publish).
62
- - **OpenAPI path:** `backend.openApiPath` is derived from `apis[0].input`.
63
- - **Billing / account plans:** use `modules.userPanel.plans.enabled` and store the plan catalog in
64
- `modules.userPanel.plans.items`. Edit the manifest by hand. In a config version 2 project,
65
- `npx apitogo config` writes plans to `apitogo/plans.json` instead. See
66
- [Gateway plans](./plans.md). Legacy root `plans` is migrated on load.
67
- - **Docs / API keys:** configure under `modules.docs` and `modules.userPanel.apiKeys` only.
68
- - **Gateway:** top-level `gateway` (not under `authentication`). See [Gateway CORS](#gateway-cors)
69
- and [Gateway plans](./plans.md).
70
-
71
- ## Gateway CORS
72
-
73
- Browser calls from your developer portal (and any other SPA) to the API gateway are cross-origin.
74
- APItoGo always allows the portal site origin. Add extra origins under `gateway.cors.allowedOrigins`
75
- when tenant apps or local frontends call the gateway:
76
-
77
- ```json
78
- {
79
- "gateway": {
80
- "cors": {
81
- "allowedOrigins": ["https://myapp.example.com", "http://localhost:5173"]
82
- }
83
- }
84
- }
85
- ```
86
-
87
- | Rule | Detail |
88
- | --------------- | ----------------------------------------------------------------------------------- |
89
- | Portal origin | Always allowed by the platform (`https://{your-portal-host}`). Do not list it here. |
90
- | Extra origins | Absolute `http://` or `https://` origins only — no path, query, or fragment. |
91
- | Wildcard | `"*"` is allowed (replaces the list; credentials stay off). |
92
- | Empty / omitted | Portal playground still works; only extras are missing. |
93
-
94
- Apply with `npx apitogo deploy` / `publish_dev_portal` so APIM policies pick up the change.
95
-
96
- ## Environment variables
97
-
98
- Public client URL (mirrors `authentication.apiBaseUrl`):
99
-
100
- ```sh
101
- VITE_APITOGO_AUTHENTICATION_API_BASE_URL=https://your-dev-portal-api.example.com
102
- ```
103
-
104
- Nested config overrides (uppercase SCREAMING_SNAKE path segments; camelCase still accepted):
105
-
106
- ```sh
107
- APITOGO_CONFIG_SITE__TITLE=My Local Site
108
- APITOGO_CONFIG_PRICING__ENABLED=true
109
- APITOGO_CONFIG_PROJECT_ID=your-local-project-id
110
- APITOGO_CONFIG_AUTHENTICATION__API_BASE_URL=https://your-dev-portal-api.example.com
111
- ```
112
-
113
- Publish secrets (uncomment in `.env`, never commit):
114
-
115
- ```sh
116
- APITOGO_CONFIG_AUTHENTICATION__OIDC__AUTHORITY=https://login.example.com
117
- APITOGO_CONFIG_AUTHENTICATION__OIDC__CLIENT_ID=your-client-id
118
- APITOGO_CONFIG_AUTHENTICATION__OIDC__CLIENT_SECRET=your-client-secret
119
- APITOGO_CONFIG_AUTHENTICATION__STRIPE__SECRET_KEY=sk_test_...
120
- APITOGO_CONFIG_AUTHENTICATION__STRIPE__WEBHOOK_SECRET=whsec_...
121
- ```
122
-
123
- ## Related
124
-
125
- - [Gateway plans](./plans.md)
126
- - [Authentication](./authentication.md)
127
- - [Overview](./overview.md)
128
- - [MCP overview](../mcp/overview.md)
129
- - [Environment variables](../guides/environment-variables.md)