@lukoweb/apitogo 0.1.121 → 0.1.127
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 +659 -402
- package/dist/declarations/cli/platform/client/platform-api.d.ts +6 -0
- package/dist/declarations/cli/platform/helpers/dev-portal-manifest.d.ts +2 -0
- package/dist/declarations/cli/platform/helpers/publish-preflight.d.ts +2 -0
- package/dist/declarations/cli/platform/tools/gateway.d.ts +6 -0
- package/dist/declarations/config/local-manifest.d.ts +21 -1
- package/dist/declarations/config/validators/ModulesSchema.d.ts +20 -0
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +5 -0
- 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/dist/flat-config.d.ts +32 -24
- 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 +45 -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 +1 -1
- package/src/config/apitogo-config-core.ts +7 -1
- package/src/config/gateway-limits.ts +7 -2
- package/src/config/loader.ts +5 -7
- package/src/config/local-manifest.ts +24 -7
- package/src/config/resolve-modules.ts +5 -7
- package/src/config/validators/ModulesSchema.ts +11 -0
- 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
package/docs/mcp/tools.md
CHANGED
|
@@ -9,88 +9,88 @@ go-live. Use granular tools for advanced edits, debugging, or CI.
|
|
|
9
9
|
|
|
10
10
|
## Lifecycle (prefer these)
|
|
11
11
|
|
|
12
|
-
| Tool
|
|
13
|
-
|
|
|
14
|
-
| `apply_product_intent`
|
|
15
|
-
| `create_dev_portal`
|
|
16
|
-
| `check_dev_portal_publish_readiness` | Pre-publish checklist
|
|
17
|
-
| `publish_dev_portal`
|
|
18
|
-
| `verify_dev_portal_live`
|
|
19
|
-
| `bootstrap_dev_portal`
|
|
20
|
-
| `bootstrap_project`
|
|
21
|
-
| `teardown_project`
|
|
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
22
|
|
|
23
23
|
## Site shaping
|
|
24
24
|
|
|
25
|
-
| Tool
|
|
26
|
-
|
|
|
27
|
-
| `update_dev_portal_manifest`
|
|
28
|
-
| `set_dev_portal_openapi`
|
|
29
|
-
| `set_dev_portal_theme`
|
|
30
|
-
| `add_dev_portal_page`
|
|
31
|
-
| `update_dev_portal_page`
|
|
32
|
-
| `scaffold_dev_portal_landing_page
|
|
33
|
-
| `get_dev_portal_landing_guide`
|
|
34
|
-
| `preview_dev_portal_site`
|
|
35
|
-
| `build_dev_portal_site`
|
|
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
36
|
|
|
37
37
|
Hosted page CRUD also exists (`list/create/delete/rename/reorder_dev_portal_pages`) for the platform
|
|
38
38
|
API surface.
|
|
39
39
|
|
|
40
40
|
## Projects and platform billing
|
|
41
41
|
|
|
42
|
-
| Tool
|
|
43
|
-
|
|
|
44
|
-
| `whoami`, `list_projects`, `get_project`, … | Tenant / project CRUD
|
|
45
|
-
| `list_platform_plans`
|
|
46
|
-
| `ensure_platform_plan`
|
|
47
|
-
| `wait_for_platform_plan`
|
|
48
|
-
| `get_subscription`
|
|
49
|
-
| `select_free_plan`
|
|
50
|
-
| `create_checkout_session`
|
|
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
51
|
|
|
52
52
|
## Backend and OpenAPI
|
|
53
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
|
|
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
63
|
|
|
64
64
|
## Gateway
|
|
65
65
|
|
|
66
|
-
| Tool
|
|
67
|
-
|
|
|
68
|
-
| `list/get/create/update/patch_gateway_plan`
|
|
69
|
-
| `add_actions_to_gateway_plan` / `remove_actions_from_gateway_plan` | Attach ops
|
|
70
|
-
| `set_action_public`
|
|
71
|
-
| `upsert_entitlement`
|
|
72
|
-
| `configure_gateway_baseline`
|
|
73
|
-
| `get/update_gateway_settings`
|
|
74
|
-
| `get/update_gateway_auth`
|
|
75
|
-
| `sync_gateway_plans_from_manifest`
|
|
76
|
-
| `reorder_gateway_plans_from_manifest`
|
|
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
77
|
|
|
78
78
|
## Infrastructure and deploy
|
|
79
79
|
|
|
80
|
-
| Tool
|
|
81
|
-
|
|
|
82
|
-
| `activate_module`
|
|
83
|
-
| `get_infrastructure_status` / Azure variants
|
|
84
|
-
| `list_provisioning_jobs`, `wait_for_job`
|
|
85
|
-
| `get_deployment_token`
|
|
86
|
-
| `get/set/delete_custom_domain`
|
|
87
|
-
| `get_dev_portal_deploy_config`, `deploy_dev_portal`, … | SWA deploy
|
|
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_deployment_token` | CLI deploy token |
|
|
86
|
+
| `get/set/delete_custom_domain` | Custom domain |
|
|
87
|
+
| `get_dev_portal_deploy_config`, `deploy_dev_portal`, … | SWA deploy |
|
|
88
88
|
|
|
89
89
|
## Hand-edit exceptions
|
|
90
90
|
|
|
91
|
-
| Change | Where
|
|
92
|
-
| ----------------- |
|
|
93
|
-
| Home page content | `landing/LandingPage.tsx`
|
|
91
|
+
| Change | Where |
|
|
92
|
+
| ----------------- | -------------------------------------------------------- |
|
|
93
|
+
| Home page content | `landing/LandingPage.tsx` |
|
|
94
94
|
| Site footer | `apitogo.config.json` → `modules.landing.content.footer` |
|
|
95
95
|
|
|
96
96
|
There is **no** `update_dev_portal_landing` tool for arbitrary home content.
|
package/docs/plugins.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
title: APIToGo Plugins
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
APIToGo is extended with **plugins** registered in your site config. JSON cannot
|
|
6
|
-
|
|
5
|
+
APIToGo is extended with **plugins** registered in your site config. JSON cannot hold React or
|
|
6
|
+
functions.
|
|
7
7
|
|
|
8
8
|
Common uses:
|
|
9
9
|
|
package/docs/quickstart.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Quickstart
|
|
3
|
-
description:
|
|
4
|
-
Get started with APIToGo MCP — connect your agent, shape a portal, and preview locally.
|
|
3
|
+
description: Get started with APIToGo MCP — connect your agent, shape a portal, and preview locally.
|
|
5
4
|
sidebar_icon: circle-play
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
Build an API product (developer portal, plans, gateway, backend) with an AI agent and the
|
|
9
|
-
|
|
7
|
+
Build an API product (developer portal, plans, gateway, backend) with an AI agent and the **APItoGo
|
|
8
|
+
MCP** server. Works with Cursor, Claude, Codex, and other MCP hosts.
|
|
10
9
|
|
|
11
10
|
## Prerequisites
|
|
12
11
|
|
|
@@ -54,8 +53,8 @@ Build an API product (developer portal, plans, gateway, backend) with an AI agen
|
|
|
54
53
|
|
|
55
54
|
1. **Go live when ready**
|
|
56
55
|
|
|
57
|
-
Save OIDC (and Stripe if you have paid plans) in the site `.env`, then ask the agent to publish
|
|
58
|
-
|
|
56
|
+
Save OIDC (and Stripe if you have paid plans) in the site `.env`, then ask the agent to publish —
|
|
57
|
+
see [Go live](./mcp/go-live.md). Never paste secrets into chat.
|
|
59
58
|
|
|
60
59
|
</Stepper>
|
|
61
60
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
gatewayForConfig,
|
|
3
|
+
mergeLimitsSource,
|
|
4
|
+
planForConfig,
|
|
5
|
+
} from "./gateway-limits.js";
|
|
2
6
|
|
|
3
7
|
export const APITOGO_CONFIG_FILENAME = "apitogo.config.json";
|
|
4
8
|
|
|
@@ -102,6 +106,8 @@ const COLLAPSED_UPPERCASE_ALIASES: Record<string, string> = {
|
|
|
102
106
|
DEMOMODE: "demoMode",
|
|
103
107
|
DISPLAYNAME: "displayName",
|
|
104
108
|
PRICEAMOUNT: "priceAmount",
|
|
109
|
+
PRICINGMODEL: "pricingModel",
|
|
110
|
+
PRICELABEL: "priceLabel",
|
|
105
111
|
PRICECURRENCY: "priceCurrency",
|
|
106
112
|
BILLINGPERIOD: "billingPeriod",
|
|
107
113
|
LIMITSJSON: "limitsJson",
|
|
@@ -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,
|
|
@@ -36,6 +36,10 @@ export type ApitogoManifestEnv = keyof typeof APITOGO_MANIFEST_ENV_FILES;
|
|
|
36
36
|
|
|
37
37
|
const BillingPeriodSchema = z.enum(["month", "year", "monthly", "annual"]);
|
|
38
38
|
|
|
39
|
+
export const PlanPricingModelSchema = z.enum(["fixed", "custom"]);
|
|
40
|
+
|
|
41
|
+
export type PlanPricingModel = z.infer<typeof PlanPricingModelSchema>;
|
|
42
|
+
|
|
39
43
|
const GatewayLimitsSchema = z
|
|
40
44
|
.object({
|
|
41
45
|
rateLimit: z
|
|
@@ -81,6 +85,9 @@ export const ManifestPlanInputSchema = z.object({
|
|
|
81
85
|
sku: z.string().min(1),
|
|
82
86
|
displayName: z.string().min(1),
|
|
83
87
|
priceAmount: z.number().default(0),
|
|
88
|
+
/** `custom` plans show a contact-sales form instead of checkout. */
|
|
89
|
+
pricingModel: PlanPricingModelSchema.optional(),
|
|
90
|
+
priceLabel: z.string().max(64).optional(),
|
|
84
91
|
priceCurrency: PriceCurrencySchema.optional(),
|
|
85
92
|
billingPeriod: BillingPeriodSchema.optional(),
|
|
86
93
|
limits: GatewayLimitsSchema.optional(),
|
|
@@ -89,6 +96,12 @@ export const ManifestPlanInputSchema = z.object({
|
|
|
89
96
|
includedActionKeys: z.array(z.string()).optional(),
|
|
90
97
|
});
|
|
91
98
|
|
|
99
|
+
export function isPlanCustomPriced(plan: {
|
|
100
|
+
pricingModel?: string | null;
|
|
101
|
+
}): boolean {
|
|
102
|
+
return plan.pricingModel === "custom";
|
|
103
|
+
}
|
|
104
|
+
|
|
92
105
|
/** Free plans have zero price; paid plans have priceAmount greater than zero. */
|
|
93
106
|
export function isPlanFree(plan: { priceAmount?: number }): boolean {
|
|
94
107
|
return (plan.priceAmount ?? 0) <= 0;
|
|
@@ -198,6 +211,8 @@ export type DevPortalPreviewPlan = {
|
|
|
198
211
|
sku: string;
|
|
199
212
|
displayName: string;
|
|
200
213
|
priceAmount: number;
|
|
214
|
+
pricingModel: PlanPricingModel;
|
|
215
|
+
priceLabel?: string;
|
|
201
216
|
priceCurrency: string;
|
|
202
217
|
billingPeriod: string;
|
|
203
218
|
limits: GatewayLimits | null;
|
|
@@ -272,6 +287,8 @@ export function plansToPreviewCatalog(
|
|
|
272
287
|
sku: plan.sku,
|
|
273
288
|
displayName: plan.displayName,
|
|
274
289
|
priceAmount: plan.priceAmount ?? 0,
|
|
290
|
+
pricingModel: plan.pricingModel ?? "fixed",
|
|
291
|
+
...(plan.priceLabel ? { priceLabel: plan.priceLabel } : {}),
|
|
275
292
|
priceCurrency: plan.priceCurrency ?? "usd",
|
|
276
293
|
billingPeriod: normalizeBillingPeriod(plan.billingPeriod),
|
|
277
294
|
limits: coerceGatewayLimits(plan) ?? null,
|
|
@@ -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,
|
|
@@ -264,6 +264,17 @@ const PlanCatalogItemSchema = z.object({
|
|
|
264
264
|
sku: z.string(),
|
|
265
265
|
displayName: z.string(),
|
|
266
266
|
priceAmount: z.number().default(0),
|
|
267
|
+
pricingModel: z
|
|
268
|
+
.enum(["fixed", "custom"])
|
|
269
|
+
.optional()
|
|
270
|
+
.describe(
|
|
271
|
+
'"custom" shows a contact-sales form instead of checkout; priceAmount must be 0.',
|
|
272
|
+
),
|
|
273
|
+
priceLabel: z
|
|
274
|
+
.string()
|
|
275
|
+
.max(64)
|
|
276
|
+
.optional()
|
|
277
|
+
.describe('Text shown instead of the price, e.g. "Custom".'),
|
|
267
278
|
priceCurrency: z
|
|
268
279
|
.string()
|
|
269
280
|
.trim()
|
|
@@ -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;
|