@lukoweb/apitogo 0.2.56 → 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 (80) hide show
  1. package/dist/cli/cli.js +1026 -540
  2. package/dist/declarations/cli/platform/client/platform-api.d.ts +6 -0
  3. package/dist/declarations/config/validators/ZudokuConfig.d.ts +2 -0
  4. package/dist/declarations/lib/authentication/providers/openid.d.ts +2 -1
  5. package/dist/declarations/lib/plugins/markdown/index.d.ts +2 -1
  6. package/dist/flat-config.d.ts +1 -0
  7. package/docs/cli/commands.md +50 -32
  8. package/docs/cli/go-live.md +66 -93
  9. package/docs/cli/overview.md +18 -17
  10. package/docs/cli/setup.md +130 -141
  11. package/docs/cli/shape.md +94 -11
  12. package/docs/components/slot.mdx +116 -119
  13. package/docs/configuration/api-reference.md +98 -397
  14. package/docs/configuration/authentication.md +118 -159
  15. package/docs/configuration/footer.mdx +89 -118
  16. package/docs/configuration/make-config.mdx +2 -2
  17. package/docs/configuration/overview.md +97 -166
  18. package/docs/configuration/plans.md +100 -110
  19. package/docs/configuration/portal.md +116 -0
  20. package/docs/customization/colors-theme.mdx +255 -278
  21. package/docs/customization/fonts.md +105 -110
  22. package/docs/customization/landing-page.md +189 -188
  23. package/docs/deploy/apitogo.md +13 -17
  24. package/docs/deployment.md +15 -9
  25. package/docs/guides/stripe-setup.mdx +123 -0
  26. package/docs/markdown/frontmatter.md +172 -173
  27. package/docs/mcp/go-live.md +100 -100
  28. package/docs/mcp/overview.md +76 -76
  29. package/docs/quickstart.md +88 -72
  30. package/docs/writing.mdx +68 -72
  31. package/package.json +1 -1
  32. package/src/config/v2/docs-navigation.ts +7 -2
  33. package/src/config/v2/index.ts +1 -0
  34. package/src/config/v2/resolve.ts +28 -0
  35. package/src/config/v2/rules.ts +32 -1
  36. package/src/config/v2/schema.ts +9 -0
  37. package/src/config/v2/services.ts +78 -2
  38. package/src/config/v2/starter-landing.ts +41 -0
  39. package/src/config/v2/wrapper.ts +127 -7
  40. package/src/config/validators/ZudokuConfig.ts +794 -792
  41. package/src/lib/authentication/providers/openid.tsx +6 -1
  42. package/src/lib/plugins/markdown/index.tsx +86 -82
  43. package/src/vite/dev-server.ts +9 -1
  44. package/src/vite/dev-ssr-config.ts +32 -0
  45. package/src/vite/plugin-config.ts +4 -2
  46. package/src/vite/plugin-docs.ts +213 -205
  47. package/docs/concepts/auth-provider-api-identities.md +0 -105
  48. package/docs/configuration/ai-assistants.md +0 -65
  49. package/docs/configuration/api-catalog.md +0 -109
  50. package/docs/configuration/authentication-auth0.md +0 -181
  51. package/docs/configuration/authentication-azure-ad.md +0 -245
  52. package/docs/configuration/authentication-clerk.md +0 -117
  53. package/docs/configuration/authentication-firebase.md +0 -69
  54. package/docs/configuration/authentication-pingfederate.md +0 -143
  55. package/docs/configuration/authentication-supabase.md +0 -233
  56. package/docs/configuration/build-configuration.mdx +0 -147
  57. package/docs/configuration/docs.md +0 -282
  58. package/docs/configuration/llms.md +0 -90
  59. package/docs/configuration/manifest.md +0 -129
  60. package/docs/configuration/navigation.mdx +0 -415
  61. package/docs/configuration/protected-routes.md +0 -150
  62. package/docs/configuration/search.md +0 -164
  63. package/docs/configuration/sentry.mdx +0 -44
  64. package/docs/configuration/site.md +0 -124
  65. package/docs/configuration/slots.mdx +0 -125
  66. package/docs/configuration/vite-config.md +0 -18
  67. package/docs/custom-plugins.md +0 -285
  68. package/docs/deploy/apache-nginx.md +0 -41
  69. package/docs/deploy/cloudflare-pages.md +0 -74
  70. package/docs/deploy/direct-upload.md +0 -17
  71. package/docs/deploy/github-pages.md +0 -49
  72. package/docs/deploy/vercel.md +0 -101
  73. package/docs/extending/events.md +0 -124
  74. package/docs/guides/environment-variables.md +0 -94
  75. package/docs/guides/managing-api-keys-and-identities.md +0 -89
  76. package/docs/guides/navigation-rules.mdx +0 -203
  77. package/docs/guides/processors.mdx +0 -234
  78. package/docs/guides/transforming-examples.md +0 -156
  79. package/docs/guides/using-multiple-apis.md +0 -87
  80. package/docs/plugins.md +0 -24
@@ -1,156 +0,0 @@
1
- ---
2
- title: Transforming Operation Examples
3
- sidebar_icon: git-compare-arrows
4
- ---
5
-
6
- APIToGo allows you to transform operation examples in both request and response sections of your API
7
- documentation. This feature is particularly useful when you need to:
8
-
9
- - Modify example data before displaying it
10
- - Add dynamic values to examples
11
- - Format examples in a specific way
12
- - Filter or transform example content based on certain conditions
13
-
14
- ## Configuration
15
-
16
- To use this feature, you need to configure the `transformExamples` function in your
17
- `apitogo.config.json` file. Here's how to do it:
18
-
19
- ```tsx
20
- import type { ApitogoConfig } from "@lukoweb/apitogo";
21
-
22
- const config: ApitogoConfig = {
23
- // ... other config options ...
24
- defaults: {
25
- apis: {
26
- transformExamples: (options) => {
27
- // Transform the content here
28
- return options.content;
29
- },
30
- },
31
- },
32
- };
33
- ```
34
-
35
- ## The Transform Function
36
-
37
- The `transformExamples` function receives an options object with the following properties:
38
-
39
- 1. `content`: An array of Content objects containing the example data
40
- 1. `operation`: The operation being displayed
41
- 1. `type`: Either "request" or "response" indicating which type of example is being transformed
42
- 1. `auth`: The current authentication state
43
- 1. `context`: `ApitogoContext` (runtime context from `@lukoweb/apitogo`)
44
-
45
- The function should return an array of Content objects with the transformed examples.
46
-
47
- ## Example Usage
48
-
49
- Here's a practical example showing how to transform examples:
50
-
51
- ```tsx
52
- const config: ApitogoConfig = {
53
- defaults: {
54
- apis: {
55
- transformExamples: ({ content, type }) => {
56
- // Example: Add a timestamp to all examples
57
- const timestamp = new Date().toISOString();
58
-
59
- return content.map((contentItem) => ({
60
- ...contentItem,
61
- example: {
62
- ...contentItem.example,
63
- timestamp,
64
- // You can modify other example properties here
65
- },
66
- }));
67
- },
68
- },
69
- },
70
- };
71
- ```
72
-
73
- ## Use Cases
74
-
75
- ### Adding Dynamic Values
76
-
77
- ```tsx
78
- transformExamples: ({ content, auth }) => {
79
- const apiKey = auth.accessToken;
80
-
81
- return content.map((contentItem) => ({
82
- ...contentItem,
83
- example: {
84
- ...contentItem.example,
85
- headers: {
86
- ...contentItem.example.headers,
87
- Authorization: `Bearer ${apiKey}`,
88
- },
89
- },
90
- }));
91
- };
92
- ```
93
-
94
- ### Formatting Examples
95
-
96
- ```tsx
97
- transformExamples: ({ content }) => {
98
- return content.map((contentItem) => ({
99
- ...contentItem,
100
- example: {
101
- ...contentItem.example,
102
- // Format dates in a specific way
103
- createdAt: new Date(contentItem.example.createdAt).toLocaleDateString(),
104
- // Format numbers with specific precision
105
- amount: Number(contentItem.example.amount).toFixed(2),
106
- },
107
- }));
108
- };
109
- ```
110
-
111
- ### Conditional Transformation
112
-
113
- ```tsx
114
- transformExamples: ({ content, auth, type }) => {
115
- const isAuthenticated = auth.isAuthenticated;
116
-
117
- return content.map((contentItem) => ({
118
- ...contentItem,
119
- example: isAuthenticated
120
- ? contentItem.example // Show full example for authenticated users
121
- : { ...contentItem.example, sensitiveData: undefined }, // Hide sensitive data for unauthenticated users
122
- }));
123
- };
124
- ```
125
-
126
- ### Using JWT Claims
127
-
128
- ```tsx
129
- transformExamples: async ({ content, auth, context }) => {
130
- const token = await context.authentication.getAccessToken();
131
-
132
- // Decode the JWT (this is a simple example - in production you might want to use a proper JWT library)
133
- const [, payload] = token.split(".");
134
- const decodedPayload = JSON.parse(atob(payload));
135
-
136
- return content.map((contentItem) => ({
137
- ...contentItem,
138
- example: {
139
- ...contentItem.example,
140
- // Add user-specific data from the JWT
141
- userId: decodedPayload.sub,
142
- organizationId: decodedPayload.org_id,
143
- // You can add any other claims from the JWT
144
- role: decodedPayload.role,
145
- },
146
- }));
147
- };
148
- ```
149
-
150
- ## Best Practices
151
-
152
- 1. Always return an array of Content objects, even if you're not transforming the content
153
- 2. Preserve the original content structure while making your modifications
154
- 3. Handle errors gracefully to prevent breaking the documentation
155
- 4. Consider performance implications when transforming large examples
156
- 5. Use the provided options object to access relevant information for your transformations
@@ -1,87 +0,0 @@
1
- ---
2
- title: Multiple APIs
3
- sidebar_icon: file-stack
4
- ---
5
-
6
- APIToGo supports creating documentation and API references for multiple APIs and can work with as
7
- many OpenAPI documents as you need.
8
-
9
- In order to do this you will need to modify the
10
- [APIToGo Configuration](../configuration/overview.md) file to include additional APIs.
11
-
12
- ## Configuration
13
-
14
- Using multiple APIs is a configuration setting that you can add in the
15
- [APIToGo Configuration](../configuration/overview.md) file.
16
-
17
- ### Step 1: Add your APIs
18
-
19
- First, create a new array in your configuration file that lists each API you want to include:
20
-
21
- ```typescript
22
- const apis = [
23
- {
24
- type: "file",
25
- input: "apis/my-first-api.json",
26
- path: "/my-first-api",
27
- },
28
- {
29
- type: "file",
30
- input: "apis/my-second-api.json",
31
- path: "/my-second-api",
32
- },
33
- ] as const;
34
- ```
35
-
36
- ### Step 2: Add navigation
37
-
38
- Create a navigation array for your sidebar:
39
-
40
- ```typescript
41
- const navigation = [
42
- {
43
- type: "link",
44
- label: "My First API",
45
- to: "/my-first-api",
46
- },
47
- {
48
- type: "link",
49
- label: "My Second API",
50
- to: "/my-second-api",
51
- },
52
- ] as const;
53
- ```
54
-
55
- ### Step 3: Update your config
56
-
57
- Modify your [APIToGo Configuration](../configuration/overview.md) file to include these arrays:
58
-
59
- ```typescript
60
- import type { ApitogoConfig } from "@lukoweb/apitogo";
61
-
62
- const config: ApitogoConfig = {
63
- navigation: [
64
- {
65
- type: "category",
66
- label: "Overview",
67
- items: navigation,
68
- },
69
- ],
70
- redirects: [{ from: "/", to: "/overview" }],
71
- apis,
72
- docs: {
73
- files: "/pages/**/*.{md,mdx}",
74
- },
75
- };
76
-
77
- export default config;
78
- ```
79
-
80
- Make sure that:
81
-
82
- 1. The `path` in each API config matches the `href` in the navigation
83
- 2. Your OpenAPI files are placed in the correct location as specified in the `input` field
84
- 3. The `label` in navigation matches what you want to display in the sidebar
85
-
86
- You don't necessarily need to add the APIs to your sidebar, you can also put them into the top
87
- navigation or link to them from your docs.
package/docs/plugins.md DELETED
@@ -1,24 +0,0 @@
1
- ---
2
- title: APIToGo Plugins
3
- ---
4
-
5
- APIToGo is extended with **plugins** registered in your site config. JSON cannot hold React or
6
- functions.
7
-
8
- Common uses:
9
-
10
- - Search (Pagefind built-in; Algolia / Inkeep plugins) — [Search](./configuration/search.md)
11
- - Billing UI — `@lukoweb/apitogo-plugin-dev-portal-billing` with `buildApitogoConfig`
12
- - Custom behavior — [Custom plugins](./custom-plugins.md)
13
- - Config transforms — `transformConfig` on a plugin (slots, syntax highlighting, etc.)
14
-
15
- ```tsx title=config
16
- import { buildApitogoConfig } from "@lukoweb/apitogo";
17
- import { devPortalBillingPlugin } from "@lukoweb/apitogo-plugin-dev-portal-billing";
18
-
19
- export default buildApitogoConfig({
20
- plugins: [devPortalBillingPlugin()],
21
- });
22
- ```
23
-
24
- See also [Extending / events](./extending/events.md) and [Slots](./configuration/slots.mdx).