@lukoweb/apitogo 0.1.120 → 0.1.126
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/LICENSE.md +18 -0
- package/dist/cli/cli.js +733 -396
- package/dist/declarations/config/local-manifest.d.ts +1 -1
- package/dist/declarations/lib/authentication/auth-header-nav.d.ts +5 -1
- package/dist/declarations/lib/authentication/hook.d.ts +25 -3
- package/dist/declarations/lib/authentication/state.d.ts +39 -3
- package/dist/declarations/lib/plugins/openapi/processors/injectApitogoGatewayServer.d.ts +1 -1
- package/docs/cli/go-live.md +21 -20
- package/docs/components/slot.mdx +2 -2
- package/docs/components.mdx +34 -34
- package/docs/concepts/auth-provider-api-identities.md +2 -2
- package/docs/configuration/authentication.md +16 -14
- package/docs/configuration/build-configuration.mdx +2 -2
- package/docs/configuration/make-config.mdx +5 -5
- package/docs/configuration/manifest.md +8 -14
- package/docs/configuration/navigation.mdx +4 -4
- package/docs/configuration/overview.md +6 -7
- package/docs/configuration/plans.md +19 -16
- package/docs/deploy/vercel.md +3 -4
- package/docs/deployment.md +5 -4
- package/docs/guides/custom-pages.md +2 -2
- package/docs/guides/environment-variables.md +19 -17
- package/docs/guides/managing-api-keys-and-identities.md +10 -18
- package/docs/mcp/go-live.md +12 -12
- package/docs/mcp/overview.md +10 -10
- package/docs/mcp/setup.md +9 -9
- package/docs/mcp/shape.md +4 -3
- package/docs/mcp/tools.md +61 -61
- package/docs/plugins.md +2 -2
- package/docs/quickstart.md +5 -6
- package/package.json +10 -155
- package/src/config/apitogo-config-core.ts +5 -1
- package/src/config/gateway-limits.ts +7 -2
- package/src/config/loader.ts +5 -7
- package/src/config/local-manifest.ts +7 -7
- package/src/config/resolve-modules.ts +5 -7
- package/src/lib/authentication/auth-header-nav.ts +3 -3
- package/src/lib/authentication/providers/dev-portal-auth-pages.tsx +2 -5
- package/src/lib/authentication/state.ts +1 -1
- package/src/lib/components/Layout.tsx +1 -4
- package/src/lib/components/SiteTitle.tsx +3 -1
- package/src/lib/plugins/openapi/processors/injectApitogoGatewayServer.ts +9 -3
- package/src/vite/config.ts +0 -21
- package/src/vite/plugin-api.ts +1 -1
- package/src/vite/plugin-modules.ts +1 -2
- package/src/vite/plugin-offroot-resolve.ts +2 -6
|
@@ -81,7 +81,10 @@ export function mergeLimitsSource<T extends object>(
|
|
|
81
81
|
): T {
|
|
82
82
|
const merged = prior ? { ...prior, ...patch } : { ...patch };
|
|
83
83
|
const patchSource = patch as GatewayLimitsSource;
|
|
84
|
-
if (
|
|
84
|
+
if (
|
|
85
|
+
patchSource.limits === undefined &&
|
|
86
|
+
patchSource.limitsJson !== undefined
|
|
87
|
+
) {
|
|
85
88
|
delete (merged as GatewayLimitsSource).limits;
|
|
86
89
|
}
|
|
87
90
|
return planForConfig(merged);
|
|
@@ -89,7 +92,9 @@ export function mergeLimitsSource<T extends object>(
|
|
|
89
92
|
|
|
90
93
|
/** Stringify for the platform HTTP/DB `limitsJson` field. */
|
|
91
94
|
export function planLimitsForPlatform(plan: object): string | undefined {
|
|
92
|
-
return stringifyGatewayLimits(
|
|
95
|
+
return stringifyGatewayLimits(
|
|
96
|
+
coerceGatewayLimits(plan as GatewayLimitsSource),
|
|
97
|
+
);
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
export function validateLimitsField(
|
package/src/config/loader.ts
CHANGED
|
@@ -167,7 +167,7 @@ async function loadZudokuConfigWithMeta(
|
|
|
167
167
|
dependencies,
|
|
168
168
|
configPath,
|
|
169
169
|
},
|
|
170
|
-
__resolvedModules: resolveModulesConfig(config
|
|
170
|
+
__resolvedModules: resolveModulesConfig(config),
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
return configWithMetadata;
|
|
@@ -213,9 +213,9 @@ function isWatchableConfigDependency(depPath: string): boolean {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
function getWatchableConfigDependencies(config: ConfigWithMeta): string[] {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
);
|
|
216
|
+
// Only called from dev-watch helpers (hasConfigChanged/updateModifiedTimes),
|
|
217
|
+
// which are meaningless outside the dev server, so always resolve dev paths.
|
|
218
|
+
const manifestEnv = resolveManifestEnv("development");
|
|
219
219
|
const { watchPaths } = manifestPathsForEnv(
|
|
220
220
|
config.__meta.rootDir,
|
|
221
221
|
manifestEnv,
|
|
@@ -327,9 +327,7 @@ export async function loadZudokuConfig(
|
|
|
327
327
|
...transformedConfig.__meta,
|
|
328
328
|
...configWithManifestMeta.__meta,
|
|
329
329
|
},
|
|
330
|
-
__resolvedModules: resolveModulesConfig(transformedConfig,
|
|
331
|
-
rootDir: transformedConfig.__meta.rootDir,
|
|
332
|
-
}),
|
|
330
|
+
__resolvedModules: resolveModulesConfig(transformedConfig),
|
|
333
331
|
};
|
|
334
332
|
|
|
335
333
|
if (!process.env.APITOGO_JSON_ONLY) {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import {
|
|
5
|
+
APITOGO_CONFIG_FILENAME,
|
|
6
|
+
extractManifest,
|
|
7
|
+
isBillingEnabled,
|
|
8
|
+
loadApitogoConfig,
|
|
9
|
+
readPlanCatalogItems,
|
|
10
|
+
} from "./apitogo-config-loader.js";
|
|
4
11
|
import {
|
|
5
12
|
type GatewayLimits,
|
|
6
13
|
coerceGatewayLimits,
|
|
@@ -9,13 +16,6 @@ import {
|
|
|
9
16
|
mergeLimitsSource,
|
|
10
17
|
planLimitsForPlatform,
|
|
11
18
|
} from "./gateway-limits.js";
|
|
12
|
-
import {
|
|
13
|
-
APITOGO_CONFIG_FILENAME,
|
|
14
|
-
extractManifest,
|
|
15
|
-
isBillingEnabled,
|
|
16
|
-
loadApitogoConfig,
|
|
17
|
-
readPlanCatalogItems,
|
|
18
|
-
} from "./apitogo-config-loader.js";
|
|
19
19
|
import {
|
|
20
20
|
type LandingManifestInput,
|
|
21
21
|
LandingManifestContentSchema,
|
|
@@ -112,10 +112,10 @@ export const resolveLandingContent = (
|
|
|
112
112
|
content?.hero?.titleAccent ??
|
|
113
113
|
(content?.hero?.title ? undefined : defaults.hero?.titleAccent),
|
|
114
114
|
},
|
|
115
|
-
featuresSection:
|
|
116
|
-
defaults.featuresSection
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
featuresSection:
|
|
116
|
+
defaults.featuresSection || content?.featuresSection
|
|
117
|
+
? { ...defaults.featuresSection, ...content?.featuresSection }
|
|
118
|
+
: undefined,
|
|
119
119
|
features: content?.features ?? defaults.features,
|
|
120
120
|
primaryAction: content?.primaryAction ?? defaults.primaryAction,
|
|
121
121
|
secondaryAction: content?.secondaryAction ?? defaults.secondaryAction,
|
|
@@ -150,9 +150,7 @@ export const resolveLandingContent = (
|
|
|
150
150
|
...content.hero,
|
|
151
151
|
title: content.hero?.title ?? siteTitle,
|
|
152
152
|
},
|
|
153
|
-
featuresSection: content.featuresSection
|
|
154
|
-
? mergeLandingSection(undefined, content.featuresSection)
|
|
155
|
-
: undefined,
|
|
153
|
+
featuresSection: content.featuresSection,
|
|
156
154
|
features: content.features,
|
|
157
155
|
primaryAction: content.primaryAction,
|
|
158
156
|
secondaryAction: content.secondaryAction,
|
|
@@ -17,9 +17,9 @@ export function withoutLoginNavigation(
|
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function applyAuthenticationHeaderNav<
|
|
21
|
-
|
|
22
|
-
): T {
|
|
20
|
+
export function applyAuthenticationHeaderNav<
|
|
21
|
+
T extends ZudokuConfig & { __meta?: { authenticationEnabled?: boolean } },
|
|
22
|
+
>(config: T): T {
|
|
23
23
|
if (!config.authentication) {
|
|
24
24
|
return config;
|
|
25
25
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Spinner } from "@lukoweb/apitogo/components";
|
|
2
|
-
import { Badge } from "@lukoweb/apitogo/ui/Badge.js";
|
|
3
2
|
import { Button } from "@lukoweb/apitogo/ui/Button.js";
|
|
4
3
|
import {
|
|
5
4
|
Card,
|
|
@@ -301,7 +300,7 @@ export function DevPortalLoginPage({
|
|
|
301
300
|
<div className="flex justify-center">
|
|
302
301
|
<Spinner />
|
|
303
302
|
</div>
|
|
304
|
-
) : config && !demoAuthAvailable ? (
|
|
303
|
+
) : config && !demoAuthAvailable && baseUrl ? (
|
|
305
304
|
<>
|
|
306
305
|
<OidcProviderButtons
|
|
307
306
|
apiBaseUrl={baseUrl}
|
|
@@ -372,9 +371,7 @@ export function DevPortalRegisterPage({
|
|
|
372
371
|
}
|
|
373
372
|
|
|
374
373
|
return (
|
|
375
|
-
<AuthPageShell
|
|
376
|
-
title="Create your account"
|
|
377
|
-
>
|
|
374
|
+
<AuthPageShell title="Create your account">
|
|
378
375
|
<form className="flex flex-col gap-4" onSubmit={onSubmit}>
|
|
379
376
|
<div className="space-y-2">
|
|
380
377
|
<Label htmlFor="displayName">Full name</Label>
|
|
@@ -4,10 +4,7 @@ import { Outlet } from "react-router";
|
|
|
4
4
|
import { cn } from "../util/cn.js";
|
|
5
5
|
import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
|
|
6
6
|
import { useScrollToTop } from "../util/useScrollToTop.js";
|
|
7
|
-
import {
|
|
8
|
-
useCurrentNavigation,
|
|
9
|
-
useZudoku,
|
|
10
|
-
} from "./context/ZudokuContext.js";
|
|
7
|
+
import { useCurrentNavigation, useZudoku } from "./context/ZudokuContext.js";
|
|
11
8
|
import { Footer } from "./Footer.js";
|
|
12
9
|
import { Header } from "./Header.js";
|
|
13
10
|
import { Main } from "./Main.js";
|
|
@@ -50,7 +50,9 @@ export const SiteTitle = ({ title, className }: SiteTitleProps) => {
|
|
|
50
50
|
style={{ color: "var(--foreground)" }}
|
|
51
51
|
>
|
|
52
52
|
{prefix}
|
|
53
|
-
{accent ?
|
|
53
|
+
{accent ? (
|
|
54
|
+
<span style={{ color: "var(--primary)" }}>{accent}</span>
|
|
55
|
+
) : null}
|
|
54
56
|
</span>
|
|
55
57
|
);
|
|
56
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Processor } from "
|
|
1
|
+
import type { Processor } from "../../../../config/validators/BuildSchema.js";
|
|
2
2
|
|
|
3
3
|
/** Env var set by APItoGo MCP publish/build to inject the project gateway into API Reference. */
|
|
4
4
|
export const APITOGO_GATEWAY_URL_ENV = "APITOGO_GATEWAY_URL";
|
|
@@ -13,11 +13,17 @@ export function injectApitogoGatewayServer(options?: {
|
|
|
13
13
|
disableEnv?: string;
|
|
14
14
|
}): Processor {
|
|
15
15
|
return ({ schema }) => {
|
|
16
|
-
if (
|
|
16
|
+
if (
|
|
17
|
+
process.env[
|
|
18
|
+
options?.disableEnv ?? "APITOGO_PUBLIC_DISABLE_INJECT_GATEWAY"
|
|
19
|
+
]
|
|
20
|
+
) {
|
|
17
21
|
return schema;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
const url = (
|
|
24
|
+
const url = (
|
|
25
|
+
options?.gatewayUrl ?? process.env[APITOGO_GATEWAY_URL_ENV]
|
|
26
|
+
)?.trim();
|
|
21
27
|
if (!url) {
|
|
22
28
|
return schema;
|
|
23
29
|
}
|
package/src/vite/config.ts
CHANGED
|
@@ -21,11 +21,6 @@ import { ensurePagefindDevStub } from "./pagefind-dev-stub.js";
|
|
|
21
21
|
import vitePlugin from "./plugin.js";
|
|
22
22
|
import { getZuploSystemConfigurations } from "./zuplo.js";
|
|
23
23
|
|
|
24
|
-
const browserConfigLoaderPath = path.join(
|
|
25
|
-
getZudokuRootDir(),
|
|
26
|
-
"src/config/apitogo-config-loader.browser.ts",
|
|
27
|
-
);
|
|
28
|
-
|
|
29
24
|
/** Resolved absolute public directory (Vite default: `<root>/public`). */
|
|
30
25
|
const resolveMergedPublicDir = (
|
|
31
26
|
rootDir: string,
|
|
@@ -119,22 +114,6 @@ export async function getViteConfig(
|
|
|
119
114
|
"@mdx-js/react": import.meta.resolve("@mdx-js/react"),
|
|
120
115
|
},
|
|
121
116
|
},
|
|
122
|
-
environments: {
|
|
123
|
-
client: {
|
|
124
|
-
resolve: {
|
|
125
|
-
alias: {
|
|
126
|
-
[path.join(
|
|
127
|
-
getZudokuRootDir(),
|
|
128
|
-
"src/config/apitogo-config-loader.node.ts",
|
|
129
|
-
)]: browserConfigLoaderPath,
|
|
130
|
-
[path.join(
|
|
131
|
-
getZudokuRootDir(),
|
|
132
|
-
"src/config/apitogo-config-loader.node.js",
|
|
133
|
-
)]: browserConfigLoaderPath,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
117
|
define: {
|
|
139
118
|
"process.env.ZUDOKU_VERSION": JSON.stringify(packageJson.version),
|
|
140
119
|
"process.env.IS_ZUPLO": ZuploEnv.isZuplo,
|
package/src/vite/plugin-api.ts
CHANGED
|
@@ -14,8 +14,8 @@ import type {
|
|
|
14
14
|
ApiCatalogItem,
|
|
15
15
|
ApiCatalogPluginOptions,
|
|
16
16
|
} from "../lib/plugins/api-catalog/index.js";
|
|
17
|
-
import { injectApitogoGatewayServer } from "../lib/plugins/openapi/processors/injectApitogoGatewayServer.js";
|
|
18
17
|
import type { VersionedInput } from "../lib/plugins/openapi/interfaces.js";
|
|
18
|
+
import { injectApitogoGatewayServer } from "../lib/plugins/openapi/processors/injectApitogoGatewayServer.js";
|
|
19
19
|
import { ensureArray } from "../lib/util/ensureArray.js";
|
|
20
20
|
import { SchemaManager } from "./api/SchemaManager.js";
|
|
21
21
|
import { reload } from "./plugin-config-reload.js";
|
|
@@ -98,8 +98,7 @@ const viteModulesPlugin = (): Plugin => {
|
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
const useBillingDashboard =
|
|
102
|
-
!dashboardPagePath && userPanel.plans.enabled;
|
|
101
|
+
const useBillingDashboard = !dashboardPagePath && userPanel.plans.enabled;
|
|
103
102
|
|
|
104
103
|
if (dashboardPagePath) {
|
|
105
104
|
code.push(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import type { Plugin
|
|
2
|
+
import type { Plugin } from "vite";
|
|
3
3
|
import { getCurrentConfig } from "../config/loader.js";
|
|
4
4
|
|
|
5
5
|
function stripQuery(id: string): string {
|
|
@@ -53,11 +53,7 @@ export default function viteOffrootResolvePlugin(): Plugin {
|
|
|
53
53
|
return {
|
|
54
54
|
name: "zudoku-offroot-resolve",
|
|
55
55
|
enforce: "pre",
|
|
56
|
-
async resolveId(
|
|
57
|
-
source: string,
|
|
58
|
-
importer: string | undefined,
|
|
59
|
-
options: ResolveIdOptions,
|
|
60
|
-
) {
|
|
56
|
+
async resolveId(source, importer, options) {
|
|
61
57
|
const rootDir = getCurrentConfig().__meta.rootDir;
|
|
62
58
|
if (!shouldResolveFromSiteRoot(source, importer, rootDir)) {
|
|
63
59
|
return;
|