@lukoweb/apitogo 0.1.68 → 0.1.70
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 +24 -2
- package/dist/declarations/lib/plugins/openapi/processors/injectApitogoGatewayServer.d.ts +6 -0
- package/docs/mcp/shape.md +1 -1
- package/docs/mcp/tools.md +1 -1
- package/package.json +1 -1
- package/src/lib/authentication/components/ProductionUnlockPage.tsx +4 -5
- package/src/lib/plugins/openapi/processors/injectApitogoGatewayServer.ts +30 -0
- package/src/vite/plugin-api.ts +6 -1
package/dist/cli/cli.js
CHANGED
|
@@ -5644,7 +5644,7 @@ import {
|
|
|
5644
5644
|
// package.json
|
|
5645
5645
|
var package_default = {
|
|
5646
5646
|
name: "@lukoweb/apitogo",
|
|
5647
|
-
version: "0.1.
|
|
5647
|
+
version: "0.1.70",
|
|
5648
5648
|
type: "module",
|
|
5649
5649
|
sideEffects: [
|
|
5650
5650
|
"**/*.css",
|
|
@@ -7295,6 +7295,24 @@ builder.queryType({
|
|
|
7295
7295
|
var schema = builder.toSchema();
|
|
7296
7296
|
var createGraphQLServer = (options) => createYoga({ schema, batching: true, ...options });
|
|
7297
7297
|
|
|
7298
|
+
// src/lib/plugins/openapi/processors/injectApitogoGatewayServer.ts
|
|
7299
|
+
var APITOGO_GATEWAY_URL_ENV = "APITOGO_GATEWAY_URL";
|
|
7300
|
+
function injectApitogoGatewayServer(options) {
|
|
7301
|
+
return ({ schema: schema2 }) => {
|
|
7302
|
+
if (process.env[options?.disableEnv ?? "APITOGO_PUBLIC_DISABLE_INJECT_GATEWAY"]) {
|
|
7303
|
+
return schema2;
|
|
7304
|
+
}
|
|
7305
|
+
const url = (options?.gatewayUrl ?? process.env[APITOGO_GATEWAY_URL_ENV])?.trim();
|
|
7306
|
+
if (!url) {
|
|
7307
|
+
return schema2;
|
|
7308
|
+
}
|
|
7309
|
+
return {
|
|
7310
|
+
...schema2,
|
|
7311
|
+
servers: [{ url: url.replace(/\/+$/, ""), description: "API gateway" }]
|
|
7312
|
+
};
|
|
7313
|
+
};
|
|
7314
|
+
}
|
|
7315
|
+
|
|
7298
7316
|
// src/lib/util/ensureArray.ts
|
|
7299
7317
|
var ensureArray = (value) => Array.isArray(value) ? value : [value];
|
|
7300
7318
|
|
|
@@ -8014,7 +8032,11 @@ var viteApiPlugin = async () => {
|
|
|
8014
8032
|
initialConfig.__meta.rootDir,
|
|
8015
8033
|
"node_modules/.apitogo/processed"
|
|
8016
8034
|
);
|
|
8017
|
-
const processors = [
|
|
8035
|
+
const processors = [
|
|
8036
|
+
...buildProcessors,
|
|
8037
|
+
...zuploProcessors,
|
|
8038
|
+
injectApitogoGatewayServer()
|
|
8039
|
+
];
|
|
8018
8040
|
const schemaManager = new SchemaManager({
|
|
8019
8041
|
storeDir: tmpStoreDir,
|
|
8020
8042
|
config: initialConfig,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Processor } from "../../../config/validators/BuildSchema.js";
|
|
2
|
+
export declare const APITOGO_GATEWAY_URL_ENV = "APITOGO_GATEWAY_URL";
|
|
3
|
+
export declare function injectApitogoGatewayServer(options?: {
|
|
4
|
+
gatewayUrl?: string;
|
|
5
|
+
disableEnv?: string;
|
|
6
|
+
}): Processor;
|
package/docs/mcp/shape.md
CHANGED
|
@@ -60,7 +60,7 @@ Ask only for what is missing:
|
|
|
60
60
|
|
|
61
61
|
Use MCP tools (see [Tools](./tools.md)):
|
|
62
62
|
|
|
63
|
-
- Pages → `add_dev_portal_page` / `update_dev_portal_page`
|
|
63
|
+
- Pages → `add_dev_portal_page` / `update_dev_portal_page` (TSX only; `template`: docs|guide|marketing)
|
|
64
64
|
- OpenAPI → `set_dev_portal_openapi`
|
|
65
65
|
- Plans / branding → `update_dev_portal_manifest`
|
|
66
66
|
- Theme → `set_dev_portal_theme`
|
package/docs/mcp/tools.md
CHANGED
|
@@ -27,7 +27,7 @@ go-live. Use granular tools for advanced edits, debugging, or CI.
|
|
|
27
27
|
| `update_dev_portal_manifest` | Plans, branding, backend, projectId |
|
|
28
28
|
| `set_dev_portal_openapi` | OpenAPI / API reference |
|
|
29
29
|
| `set_dev_portal_theme` | Colors and fonts |
|
|
30
|
-
| `add_dev_portal_page` | Add a docs page
|
|
30
|
+
| `add_dev_portal_page` | Add a TSX docs page (site components; `template`: docs\|guide\|marketing) |
|
|
31
31
|
| `update_dev_portal_page` | Edit a docs page |
|
|
32
32
|
| `scaffold_dev_portal_landing_page`| Scaffold missing landing file |
|
|
33
33
|
| `get_dev_portal_landing_guide` | Landing component catalog |
|
package/package.json
CHANGED
|
@@ -6,13 +6,12 @@ export const ProductionUnlockPage = () => (
|
|
|
6
6
|
<Layout>
|
|
7
7
|
<div className="mx-auto flex min-h-[50vh] max-w-lg flex-col items-center justify-center gap-4 px-4 text-center">
|
|
8
8
|
<h1 className="text-2xl font-semibold tracking-tight">
|
|
9
|
-
Account sign-in
|
|
9
|
+
Account sign-in is temporarily unavailable
|
|
10
10
|
</h1>
|
|
11
11
|
<p className="text-muted-foreground">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
production.
|
|
12
|
+
We couldn’t reach the developer portal API. Documentation stays
|
|
13
|
+
available; try again shortly, or contact the site owner if this
|
|
14
|
+
continues.
|
|
16
15
|
</p>
|
|
17
16
|
<div className="flex flex-wrap items-center justify-center gap-3">
|
|
18
17
|
<Button asChild variant="default">
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Processor } from "../../../config/validators/BuildSchema.js";
|
|
2
|
+
|
|
3
|
+
/** Env var set by APItoGo MCP publish/build to inject the project gateway into API Reference. */
|
|
4
|
+
export const APITOGO_GATEWAY_URL_ENV = "APITOGO_GATEWAY_URL";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* When APITOGO_GATEWAY_URL is set (production publish/build), replace OpenAPI
|
|
8
|
+
* `servers` with the project gateway so Try-it / API Reference use the live URL
|
|
9
|
+
* instead of localhost from the source spec.
|
|
10
|
+
*/
|
|
11
|
+
export function injectApitogoGatewayServer(options?: {
|
|
12
|
+
gatewayUrl?: string;
|
|
13
|
+
disableEnv?: string;
|
|
14
|
+
}): Processor {
|
|
15
|
+
return ({ schema }) => {
|
|
16
|
+
if (process.env[options?.disableEnv ?? "APITOGO_PUBLIC_DISABLE_INJECT_GATEWAY"]) {
|
|
17
|
+
return schema;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const url = (options?.gatewayUrl ?? process.env[APITOGO_GATEWAY_URL_ENV])?.trim();
|
|
21
|
+
if (!url) {
|
|
22
|
+
return schema;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
...schema,
|
|
27
|
+
servers: [{ url: url.replace(/\/+$/, ""), description: "API gateway" }],
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
package/src/vite/plugin-api.ts
CHANGED
|
@@ -14,6 +14,7 @@ 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";
|
|
17
18
|
import type { VersionedInput } from "../lib/plugins/openapi/interfaces.js";
|
|
18
19
|
import { ensureArray } from "../lib/util/ensureArray.js";
|
|
19
20
|
import { SchemaManager } from "./api/SchemaManager.js";
|
|
@@ -41,7 +42,11 @@ const viteApiPlugin = async (): Promise<Plugin> => {
|
|
|
41
42
|
"node_modules/.apitogo/processed",
|
|
42
43
|
);
|
|
43
44
|
|
|
44
|
-
const processors = [
|
|
45
|
+
const processors = [
|
|
46
|
+
...buildProcessors,
|
|
47
|
+
...zuploProcessors,
|
|
48
|
+
injectApitogoGatewayServer(),
|
|
49
|
+
];
|
|
45
50
|
const schemaManager = new SchemaManager({
|
|
46
51
|
storeDir: tmpStoreDir,
|
|
47
52
|
config: initialConfig,
|