@forge-ts/api 0.2.0 → 0.3.0
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/README.md +42 -0
- package/dist/index.d.ts +7 -7
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @forge-ts/api
|
|
2
|
+
|
|
3
|
+
OpenAPI 3.2 spec and API reference generator for the [forge-ts](https://github.com/kryptobaseddev/forge-ts) toolchain.
|
|
4
|
+
|
|
5
|
+
## When to use this package
|
|
6
|
+
|
|
7
|
+
**Most users should install `@forge-ts/cli` instead** and use `npx forge-ts build`. This package is for programmatic use.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @forge-ts/api
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What it generates
|
|
14
|
+
|
|
15
|
+
- **OpenAPI 3.2 JSON** from your exported interfaces, types, classes, and enums
|
|
16
|
+
- **Typed schema mapping** - TypeScript signatures mapped to OpenAPI schemas
|
|
17
|
+
- **Visibility filtering** - `@internal` symbols never appear in specs
|
|
18
|
+
- **Structured API Reference** with full TSDoc metadata
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { loadConfig, createWalker } from "@forge-ts/core";
|
|
24
|
+
import { generateOpenAPISpec, extractSDKTypes } from "@forge-ts/api";
|
|
25
|
+
|
|
26
|
+
const config = await loadConfig();
|
|
27
|
+
const walker = createWalker(config);
|
|
28
|
+
const symbols = walker.walk();
|
|
29
|
+
const sdkTypes = extractSDKTypes(symbols);
|
|
30
|
+
const spec = generateOpenAPISpec(config, sdkTypes);
|
|
31
|
+
|
|
32
|
+
// spec is a fully typed OpenAPIDocument
|
|
33
|
+
console.log(JSON.stringify(spec, null, 2));
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Part of forge-ts
|
|
37
|
+
|
|
38
|
+
See the [main repo](https://github.com/kryptobaseddev/forge-ts) for full documentation.
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Visibility, ForgeSymbol, ForgeConfig, OpenAPIDocument, OpenAPISchemaObject, ForgeResult } from '@
|
|
2
|
-
export { OpenAPIDocument, OpenAPISchemaObject } from '@
|
|
1
|
+
import { Visibility, ForgeSymbol, ForgeConfig, OpenAPIDocument, OpenAPISchemaObject, ForgeResult } from '@forge-ts/core';
|
|
2
|
+
export { OpenAPIDocument, OpenAPISchemaObject } from '@forge-ts/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A single property extracted from an interface or class symbol.
|
|
@@ -53,7 +53,7 @@ interface SDKType {
|
|
|
53
53
|
declare function extractSDKTypes(symbols: ForgeSymbol[]): SDKType[];
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Generates a production-quality OpenAPI 3.
|
|
56
|
+
* Generates a production-quality OpenAPI 3.2 document from the extracted SDK
|
|
57
57
|
* types.
|
|
58
58
|
*
|
|
59
59
|
* The document is populated with:
|
|
@@ -135,12 +135,12 @@ interface ReferenceEntry {
|
|
|
135
135
|
declare function buildReference(symbols: ForgeSymbol[]): ReferenceEntry[];
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
* Utility for mapping TypeScript type signatures to OpenAPI 3.
|
|
138
|
+
* Utility for mapping TypeScript type signatures to OpenAPI 3.2 schemas.
|
|
139
139
|
* @public
|
|
140
140
|
*/
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* Maps a TypeScript type signature string to an OpenAPI 3.
|
|
143
|
+
* Maps a TypeScript type signature string to an OpenAPI 3.2 schema object.
|
|
144
144
|
*
|
|
145
145
|
* Handles common primitives, arrays, unions, `Record<K, V>`, and falls back
|
|
146
146
|
* to `{ type: "object" }` for anything it cannot parse.
|
|
@@ -153,10 +153,10 @@ declare function buildReference(symbols: ForgeSymbol[]): ReferenceEntry[];
|
|
|
153
153
|
declare function signatureToSchema(signature: string): OpenAPISchemaObject;
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
|
-
* @
|
|
156
|
+
* @forge-ts/api — OpenAPI spec and API reference generator.
|
|
157
157
|
*
|
|
158
158
|
* Extracts public SDK types from the symbol graph and generates an
|
|
159
|
-
* OpenAPI 3.
|
|
159
|
+
* OpenAPI 3.2 document and a structured API reference.
|
|
160
160
|
*
|
|
161
161
|
* @packageDocumentation
|
|
162
162
|
* @public
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/openapi.ts
|
|
2
|
-
import { Visibility } from "@
|
|
2
|
+
import { Visibility } from "@forge-ts/core";
|
|
3
3
|
|
|
4
4
|
// src/schema-mapper.ts
|
|
5
5
|
function signatureToSchema(signature) {
|
|
@@ -72,7 +72,7 @@ function generateOpenAPISpec(config, sdkTypes) {
|
|
|
72
72
|
const tagNames = deriveTagNames(visibleTypes);
|
|
73
73
|
const tags = tagNames.map((name) => ({ name }));
|
|
74
74
|
return {
|
|
75
|
-
openapi: "3.
|
|
75
|
+
openapi: "3.2.0",
|
|
76
76
|
info: buildInfo(config),
|
|
77
77
|
...tags.length > 0 ? { tags } : {},
|
|
78
78
|
paths: {},
|
|
@@ -170,7 +170,7 @@ function deriveTagNames(types) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
// src/reference.ts
|
|
173
|
-
import { Visibility as Visibility2 } from "@
|
|
173
|
+
import { Visibility as Visibility2 } from "@forge-ts/core";
|
|
174
174
|
function buildReference(symbols) {
|
|
175
175
|
return symbols.filter(
|
|
176
176
|
(s) => s.exported && s.visibility !== Visibility2.Internal && s.visibility !== Visibility2.Private
|
|
@@ -213,7 +213,7 @@ function symbolToEntry(symbol) {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// src/sdk-extractor.ts
|
|
216
|
-
import { Visibility as Visibility3 } from "@
|
|
216
|
+
import { Visibility as Visibility3 } from "@forge-ts/core";
|
|
217
217
|
function extractSDKTypes(symbols) {
|
|
218
218
|
return symbols.filter(
|
|
219
219
|
(s) => s.exported && (s.kind === "interface" || s.kind === "type" || s.kind === "class" || s.kind === "enum") && s.visibility !== Visibility3.Internal && s.visibility !== Visibility3.Private
|
|
@@ -260,7 +260,7 @@ function resolveChildType(child) {
|
|
|
260
260
|
// src/index.ts
|
|
261
261
|
import { mkdir, writeFile } from "fs/promises";
|
|
262
262
|
import { dirname } from "path";
|
|
263
|
-
import { createWalker } from "@
|
|
263
|
+
import { createWalker } from "@forge-ts/core";
|
|
264
264
|
async function generateApi(config) {
|
|
265
265
|
const start = Date.now();
|
|
266
266
|
const walker = createWalker(config);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/openapi.ts","../src/schema-mapper.ts","../src/reference.ts","../src/sdk-extractor.ts","../src/index.ts"],"sourcesContent":["import type {\n\tForgeConfig,\n\tOpenAPIDocument,\n\tOpenAPIInfoObject,\n\tOpenAPISchemaObject,\n} from \"@codluv/forge-core\";\nimport { Visibility } from \"@codluv/forge-core\";\nimport { signatureToSchema } from \"./schema-mapper.js\";\nimport type { SDKProperty, SDKType } from \"./sdk-extractor.js\";\n\nexport type { OpenAPIDocument };\n\n/**\n * Generates a production-quality OpenAPI 3.1 document from the extracted SDK\n * types.\n *\n * The document is populated with:\n * - An `info` block sourced from the config or reasonable defaults.\n * - A `components.schemas` section with one schema per exported type.\n * - `tags` derived from unique source file paths (grouping by file).\n * - Visibility filtering: `@internal` symbols are never emitted.\n *\n * HTTP paths are not yet emitted (`paths` is always `{}`); route extraction\n * will be added in a future release.\n *\n * @param config - The resolved {@link ForgeConfig}.\n * @param sdkTypes - SDK types to include as component schemas.\n * @returns An {@link OpenAPIDocument} object.\n * @public\n */\nexport function generateOpenAPISpec(config: ForgeConfig, sdkTypes: SDKType[]): OpenAPIDocument {\n\t// Visibility filtering: never emit @internal or @private symbols.\n\tconst visibleTypes = sdkTypes.filter(\n\t\t(t) => t.visibility !== Visibility.Internal && t.visibility !== Visibility.Private,\n\t);\n\n\tconst schemas: Record<string, OpenAPISchemaObject> = {};\n\tfor (const t of visibleTypes) {\n\t\tschemas[t.name] = buildSchema(t);\n\t}\n\n\t// Derive tags from unique source files (basename without extension).\n\tconst tagNames = deriveTagNames(visibleTypes);\n\tconst tags = tagNames.map((name) => ({ name }));\n\n\treturn {\n\t\topenapi: \"3.1.0\",\n\t\tinfo: buildInfo(config),\n\t\t...(tags.length > 0 ? { tags } : {}),\n\t\tpaths: {},\n\t\tcomponents: { schemas },\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Info block\n// ---------------------------------------------------------------------------\n\n/**\n * Builds the OpenAPI `info` block from the config.\n *\n * @param config - The resolved {@link ForgeConfig}.\n * @returns An info object with title, version, and description.\n * @internal\n */\nfunction buildInfo(_config: ForgeConfig): OpenAPIInfoObject {\n\t// We attempt to read name/version from the project root's package.json at\n\t// runtime. If unavailable, fall back to safe defaults.\n\treturn {\n\t\ttitle: \"API Reference\",\n\t\tversion: \"0.0.0\",\n\t\tdescription: \"Generated by forge-ts\",\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Schema builders\n// ---------------------------------------------------------------------------\n\n/**\n * Converts an {@link SDKType} to an OpenAPI schema object.\n *\n * - `interface` / `class` → object schema with `properties` and `required`\n * - `enum` → schema with `enum` array and `type: \"string\"`\n * - `type` alias → schema derived from signature parsing\n *\n * @param sdkType - The type descriptor to convert.\n * @returns An OpenAPI schema object.\n * @internal\n */\nfunction buildSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tconst base: OpenAPISchemaObject = {};\n\n\tif (sdkType.description) {\n\t\tbase.description = sdkType.description;\n\t}\n\n\tif (sdkType.deprecated) {\n\t\tbase.deprecated = true;\n\t}\n\n\tswitch (sdkType.kind) {\n\t\tcase \"interface\":\n\t\tcase \"class\":\n\t\t\treturn { ...base, ...buildObjectSchema(sdkType) };\n\t\tcase \"enum\":\n\t\t\treturn { ...base, ...buildEnumSchema(sdkType) };\n\t\tcase \"type\":\n\t\t\treturn { ...base, ...buildTypeAliasSchema(sdkType) };\n\t\tdefault:\n\t\t\treturn { ...base, type: \"object\" };\n\t}\n}\n\n/**\n * Builds an object schema for an interface or class type.\n *\n * @param sdkType - An interface or class {@link SDKType}.\n * @returns An OpenAPI object schema.\n * @internal\n */\nfunction buildObjectSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tif (sdkType.properties.length === 0) {\n\t\treturn { type: \"object\" };\n\t}\n\n\tconst properties: Record<string, OpenAPISchemaObject> = {};\n\tconst required: string[] = [];\n\n\tfor (const prop of sdkType.properties) {\n\t\tproperties[prop.name] = buildPropertySchema(prop);\n\t\tif (prop.required) {\n\t\t\trequired.push(prop.name);\n\t\t}\n\t}\n\n\tconst schema: OpenAPISchemaObject = { type: \"object\", properties };\n\tif (required.length > 0) {\n\t\tschema.required = required;\n\t}\n\n\treturn schema;\n}\n\n/**\n * Builds the schema for a single property.\n *\n * @param prop - The {@link SDKProperty} to convert.\n * @returns A partial OpenAPI schema for the property.\n * @internal\n */\nfunction buildPropertySchema(prop: SDKProperty): OpenAPISchemaObject {\n\tconst schema: OpenAPISchemaObject = { ...signatureToSchema(prop.type) };\n\n\tif (prop.description) {\n\t\tschema.description = prop.description;\n\t}\n\n\tif (prop.deprecated) {\n\t\tschema.deprecated = true;\n\t}\n\n\treturn schema;\n}\n\n/**\n * Builds an enum schema for an enum type.\n *\n * If the enum has properties (members), their names are used as the enum\n * values. The type defaults to `\"string\"` unless a member type suggests\n * otherwise.\n *\n * @param sdkType - An enum {@link SDKType}.\n * @returns An OpenAPI schema with `enum` values.\n * @internal\n */\nfunction buildEnumSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tif (sdkType.properties.length === 0) {\n\t\treturn { type: \"string\", enum: [] };\n\t}\n\n\tconst values = sdkType.properties.map((p) => {\n\t\t// Use the type value if it looks like a string literal; otherwise use name.\n\t\tconst t = p.type.trim();\n\t\tif (t.startsWith('\"') || t.startsWith(\"'\")) {\n\t\t\treturn t.replace(/^['\"]|['\"]$/g, \"\");\n\t\t}\n\t\treturn p.name;\n\t});\n\n\t// Detect numeric enums: if all values are parseable numbers use \"number\".\n\tconst allNumeric = values.every((v) => !Number.isNaN(Number(v)));\n\n\treturn {\n\t\ttype: allNumeric ? \"number\" : \"string\",\n\t\tenum: allNumeric ? values.map(Number) : values,\n\t};\n}\n\n/**\n * Builds a schema for a type alias.\n *\n * Attempts to parse the signature string directly; falls back to\n * `{ type: \"object\" }` for complex generics or intersections.\n *\n * @param sdkType - A type alias {@link SDKType}.\n * @returns An OpenAPI schema.\n * @internal\n */\nfunction buildTypeAliasSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tif (!sdkType.signature) {\n\t\treturn { type: \"object\" };\n\t}\n\n\t// The signature for a type alias is often `type Name = ActualType`.\n\t// Strip the leading declaration if present.\n\tconst equalsIndex = sdkType.signature.indexOf(\"=\");\n\tconst rawType =\n\t\tequalsIndex !== -1 ? sdkType.signature.slice(equalsIndex + 1).trim() : sdkType.signature;\n\n\treturn signatureToSchema(rawType);\n}\n\n// ---------------------------------------------------------------------------\n// Tag derivation\n// ---------------------------------------------------------------------------\n\n/**\n * Derives OpenAPI tag names from the unique source file basenames of the\n * provided types (without directory path or extension).\n *\n * @param types - The visible SDK types.\n * @returns A sorted, deduplicated array of tag name strings.\n * @internal\n */\nfunction deriveTagNames(types: SDKType[]): string[] {\n\tconst seen = new Set<string>();\n\tfor (const t of types) {\n\t\tconst basename = t.sourceFile.split(\"/\").pop() ?? t.sourceFile;\n\t\tconst withoutExt = basename.replace(/\\.[^.]+$/, \"\");\n\t\tseen.add(withoutExt);\n\t}\n\treturn Array.from(seen).sort();\n}\n","/**\n * Utility for mapping TypeScript type signatures to OpenAPI 3.1 schemas.\n * @public\n */\n\nimport type { OpenAPISchemaObject } from \"@codluv/forge-core\";\n\nexport type { OpenAPISchemaObject };\n\n/**\n * Maps a TypeScript type signature string to an OpenAPI 3.1 schema object.\n *\n * Handles common primitives, arrays, unions, `Record<K, V>`, and falls back\n * to `{ type: \"object\" }` for anything it cannot parse.\n *\n * @param signature - A TypeScript type signature string, e.g. `\"string\"`, `\"number[]\"`,\n * `\"string | number\"`, `\"Record<string, boolean>\"`.\n * @returns An OpenAPI schema object.\n * @public\n */\nexport function signatureToSchema(signature: string): OpenAPISchemaObject {\n\tconst trimmed = signature.trim();\n\n\t// Strip trailing `| undefined` or `| null` for optional detection — callers\n\t// handle the required array separately; here we just produce the base schema.\n\tconst withoutUndefined = trimmed\n\t\t.replace(/\\s*\\|\\s*undefined/g, \"\")\n\t\t.replace(/\\s*\\|\\s*null/g, \"\")\n\t\t.trim();\n\n\t// Union type: A | B\n\tif (withoutUndefined.includes(\" | \")) {\n\t\tconst parts = splitUnion(withoutUndefined);\n\t\tif (parts.length > 1) {\n\t\t\treturn { oneOf: parts.map((p) => signatureToSchema(p)) };\n\t\t}\n\t}\n\n\t// Array shorthand: T[]\n\tconst arrayShorthand = /^(.+)\\[\\]$/.exec(withoutUndefined);\n\tif (arrayShorthand) {\n\t\treturn { type: \"array\", items: signatureToSchema(arrayShorthand[1]) };\n\t}\n\n\t// Generic Array<T>\n\tconst genericArray = /^Array<(.+)>$/.exec(withoutUndefined);\n\tif (genericArray) {\n\t\treturn { type: \"array\", items: signatureToSchema(genericArray[1]) };\n\t}\n\n\t// Record<string, V>\n\tconst record = /^Record<[^,]+,\\s*(.+)>$/.exec(withoutUndefined);\n\tif (record) {\n\t\treturn { type: \"object\", additionalProperties: signatureToSchema(record[1]) };\n\t}\n\n\t// Primitives\n\tswitch (withoutUndefined) {\n\t\tcase \"string\":\n\t\t\treturn { type: \"string\" };\n\t\tcase \"number\":\n\t\t\treturn { type: \"number\" };\n\t\tcase \"boolean\":\n\t\t\treturn { type: \"boolean\" };\n\t\tcase \"null\":\n\t\t\treturn { type: \"null\" };\n\t\tcase \"unknown\":\n\t\tcase \"any\":\n\t\t\treturn {};\n\t\tcase \"void\":\n\t\t\treturn { type: \"null\" };\n\t\tdefault:\n\t\t\treturn { type: \"object\" };\n\t}\n}\n\n/**\n * Splits a union type string by top-level `|` separators (ignoring `|` inside\n * angle brackets or parentheses).\n *\n * @param signature - A union type string such as `\"string | number | boolean\"`.\n * @returns An array of trimmed member type strings.\n * @internal\n */\nfunction splitUnion(signature: string): string[] {\n\tconst parts: string[] = [];\n\tlet depth = 0;\n\tlet start = 0;\n\n\tfor (let i = 0; i < signature.length; i++) {\n\t\tconst ch = signature[i];\n\t\tif (ch === \"<\" || ch === \"(\" || ch === \"{\") {\n\t\t\tdepth++;\n\t\t} else if (ch === \">\" || ch === \")\" || ch === \"}\") {\n\t\t\tdepth--;\n\t\t} else if (ch === \"|\" && depth === 0) {\n\t\t\tparts.push(signature.slice(start, i).trim());\n\t\t\tstart = i + 1;\n\t\t}\n\t}\n\n\tparts.push(signature.slice(start).trim());\n\treturn parts.filter(Boolean);\n}\n","import type { ForgeSymbol } from \"@codluv/forge-core\";\nimport { Visibility } from \"@codluv/forge-core\";\n\n/**\n * A single entry in the generated API reference.\n * @public\n */\nexport interface ReferenceEntry {\n\t/** Symbol name. */\n\tname: string;\n\t/** Symbol kind. */\n\tkind: ForgeSymbol[\"kind\"];\n\t/** TSDoc summary. */\n\tsummary?: string;\n\t/** Human-readable type signature. */\n\tsignature?: string;\n\t/** Resolved visibility level. */\n\tvisibility: Visibility;\n\t/** Deprecation notice, if present. */\n\tdeprecated?: string;\n\t/** Documented parameters. */\n\tparams?: Array<{ name: string; description: string; type?: string }>;\n\t/** Documented return value. */\n\treturns?: { description: string; type?: string };\n\t/** Documented thrown exceptions. */\n\tthrows?: Array<{ type?: string; description: string }>;\n\t/** Code examples from TSDoc `@example` tags. */\n\texamples?: Array<{ code: string; language: string }>;\n\t/** Nested child symbols (class methods, interface properties, enum members). */\n\tchildren?: ReferenceEntry[];\n\t/** Source file location. */\n\tlocation: { filePath: string; line: number };\n}\n\n/**\n * Builds a structured API reference from a list of exported symbols.\n *\n * Unlike the minimal stub, this version includes nested children (class\n * methods, interface properties) and all available TSDoc metadata.\n *\n * Symbols with {@link Visibility.Internal} or {@link Visibility.Private} are\n * excluded from the top-level results. Children with private/internal\n * visibility are also filtered out.\n *\n * @param symbols - All symbols from the AST walker.\n * @returns An array of {@link ReferenceEntry} objects sorted by name.\n * @public\n */\nexport function buildReference(symbols: ForgeSymbol[]): ReferenceEntry[] {\n\treturn symbols\n\t\t.filter(\n\t\t\t(s) =>\n\t\t\t\ts.exported && s.visibility !== Visibility.Internal && s.visibility !== Visibility.Private,\n\t\t)\n\t\t.map(symbolToEntry)\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n}\n\n/**\n * Converts a single {@link ForgeSymbol} to a {@link ReferenceEntry}.\n *\n * @param symbol - The symbol to convert.\n * @returns A populated {@link ReferenceEntry}.\n * @internal\n */\nfunction symbolToEntry(symbol: ForgeSymbol): ReferenceEntry {\n\tconst entry: ReferenceEntry = {\n\t\tname: symbol.name,\n\t\tkind: symbol.kind,\n\t\tsummary: symbol.documentation?.summary,\n\t\tsignature: symbol.signature,\n\t\tvisibility: symbol.visibility,\n\t\tdeprecated: symbol.documentation?.deprecated,\n\t\tlocation: { filePath: symbol.filePath, line: symbol.line },\n\t};\n\n\tif (symbol.documentation?.params && symbol.documentation.params.length > 0) {\n\t\tentry.params = symbol.documentation.params;\n\t}\n\n\tif (symbol.documentation?.returns) {\n\t\tentry.returns = symbol.documentation.returns;\n\t}\n\n\tif (symbol.documentation?.throws && symbol.documentation.throws.length > 0) {\n\t\tentry.throws = symbol.documentation.throws;\n\t}\n\n\tif (symbol.documentation?.examples && symbol.documentation.examples.length > 0) {\n\t\tentry.examples = symbol.documentation.examples.map((ex) => ({\n\t\t\tcode: ex.code,\n\t\t\tlanguage: ex.language,\n\t\t}));\n\t}\n\n\tif (symbol.children && symbol.children.length > 0) {\n\t\tconst visibleChildren = symbol.children.filter(\n\t\t\t(c) => c.visibility !== Visibility.Internal && c.visibility !== Visibility.Private,\n\t\t);\n\t\tif (visibleChildren.length > 0) {\n\t\t\tentry.children = visibleChildren.map(symbolToEntry);\n\t\t}\n\t}\n\n\treturn entry;\n}\n","import type { ForgeSymbol } from \"@codluv/forge-core\";\nimport { Visibility } from \"@codluv/forge-core\";\n\n/**\n * A single property extracted from an interface or class symbol.\n * @public\n */\nexport interface SDKProperty {\n\t/** The property name. */\n\tname: string;\n\t/** The TypeScript type string of the property. */\n\ttype: string;\n\t/** TSDoc summary for this property. */\n\tdescription?: string;\n\t/** Whether the property is required (not optional). */\n\trequired: boolean;\n\t/** Deprecation notice, if present. */\n\tdeprecated?: string;\n}\n\n/**\n * An SDK type descriptor extracted from the symbol graph.\n * @public\n */\nexport interface SDKType {\n\t/** The symbol name. */\n\tname: string;\n\t/** Syntactic kind of the type. */\n\tkind: \"interface\" | \"type\" | \"class\" | \"enum\";\n\t/** Human-readable type signature. */\n\tsignature?: string;\n\t/** TSDoc summary. */\n\tdescription?: string;\n\t/** Deprecation notice, if present. */\n\tdeprecated?: string;\n\t/** Resolved visibility level. */\n\tvisibility: Visibility;\n\t/** Extracted properties (for interfaces, classes) or values (for enums). */\n\tproperties: SDKProperty[];\n\t/** Absolute path to the source file. */\n\tsourceFile: string;\n}\n\n/**\n * Extracts SDK-relevant types (interfaces, type aliases, classes, enums) from\n * a list of {@link ForgeSymbol} objects.\n *\n * Only exported symbols whose visibility is not {@link Visibility.Internal} or\n * {@link Visibility.Private} are included.\n *\n * @param symbols - The symbols produced by the core AST walker.\n * @returns An array of {@link SDKType} objects for public-facing type definitions.\n * @public\n */\nexport function extractSDKTypes(symbols: ForgeSymbol[]): SDKType[] {\n\treturn symbols\n\t\t.filter(\n\t\t\t(s) =>\n\t\t\t\ts.exported &&\n\t\t\t\t(s.kind === \"interface\" || s.kind === \"type\" || s.kind === \"class\" || s.kind === \"enum\") &&\n\t\t\t\ts.visibility !== Visibility.Internal &&\n\t\t\t\ts.visibility !== Visibility.Private,\n\t\t)\n\t\t.map((s) => ({\n\t\t\tname: s.name,\n\t\t\tkind: s.kind as SDKType[\"kind\"],\n\t\t\tsignature: s.signature,\n\t\t\tdescription: s.documentation?.summary,\n\t\t\tdeprecated: s.documentation?.deprecated,\n\t\t\tvisibility: s.visibility,\n\t\t\tproperties: extractProperties(s),\n\t\t\tsourceFile: s.filePath,\n\t\t}));\n}\n\n/**\n * Extracts the property list from a symbol's children.\n *\n * For interfaces and classes, children with kind `\"property\"` are mapped to\n * {@link SDKProperty}. For enums, children with kind `\"property\"` (enum\n * members) are also included. Method children are excluded.\n *\n * @param symbol - The parent symbol whose children to extract from.\n * @returns An array of {@link SDKProperty} objects.\n * @internal\n */\nfunction extractProperties(symbol: ForgeSymbol): SDKProperty[] {\n\tif (!symbol.children || symbol.children.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn symbol.children\n\t\t.filter(\n\t\t\t(child) =>\n\t\t\t\tchild.kind === \"property\" &&\n\t\t\t\tchild.visibility !== Visibility.Private &&\n\t\t\t\tchild.visibility !== Visibility.Internal,\n\t\t)\n\t\t.map((child) => {\n\t\t\tconst isOptional = child.signature ? child.signature.includes(\"?\") : false;\n\t\t\tconst rawType = resolveChildType(child);\n\t\t\treturn {\n\t\t\t\tname: child.name,\n\t\t\t\ttype: rawType,\n\t\t\t\tdescription: child.documentation?.summary,\n\t\t\t\trequired: !isOptional,\n\t\t\t\tdeprecated: child.documentation?.deprecated,\n\t\t\t};\n\t\t});\n}\n\n/**\n * Resolves the type string for a child symbol.\n *\n * Uses the signature if present; otherwise falls back to `\"unknown\"`.\n *\n * @param child - A child {@link ForgeSymbol}.\n * @returns A TypeScript type string.\n * @internal\n */\nfunction resolveChildType(child: ForgeSymbol): string {\n\tif (!child.signature) {\n\t\treturn \"unknown\";\n\t}\n\n\t// Signatures for properties often look like `name: type` or `name?: type`.\n\t// Strip the leading `name:` or `name?:` prefix to get the bare type.\n\tconst colonIndex = child.signature.indexOf(\":\");\n\tif (colonIndex !== -1) {\n\t\treturn child.signature.slice(colonIndex + 1).trim();\n\t}\n\n\treturn child.signature;\n}\n","/**\n * @codluv/forge-api — OpenAPI spec and API reference generator.\n *\n * Extracts public SDK types from the symbol graph and generates an\n * OpenAPI 3.1 document and a structured API reference.\n *\n * @packageDocumentation\n * @public\n */\n\nexport { generateOpenAPISpec, type OpenAPIDocument } from \"./openapi.js\";\nexport { buildReference, type ReferenceEntry } from \"./reference.js\";\nexport { type OpenAPISchemaObject, signatureToSchema } from \"./schema-mapper.js\";\nexport { extractSDKTypes, type SDKProperty, type SDKType } from \"./sdk-extractor.js\";\n\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport { createWalker, type ForgeConfig, type ForgeResult } from \"@codluv/forge-core\";\nimport { generateOpenAPISpec } from \"./openapi.js\";\nimport { extractSDKTypes } from \"./sdk-extractor.js\";\n\n/**\n * Runs the API generation pipeline: walk → extract → generate → write.\n *\n * @param config - The resolved {@link ForgeConfig} for the project.\n * @returns A {@link ForgeResult} with success/failure and any diagnostics.\n * @public\n */\nexport async function generateApi(config: ForgeConfig): Promise<ForgeResult> {\n\tconst start = Date.now();\n\n\tconst walker = createWalker(config);\n\tconst symbols = walker.walk();\n\tconst sdkTypes = extractSDKTypes(symbols);\n\tconst spec = generateOpenAPISpec(config, sdkTypes);\n\n\tawait mkdir(dirname(config.api.openapiPath), { recursive: true });\n\tawait writeFile(config.api.openapiPath, JSON.stringify(spec, null, 2), \"utf8\");\n\n\treturn {\n\t\tsuccess: true,\n\t\tsymbols,\n\t\terrors: [],\n\t\twarnings: [],\n\t\tduration: Date.now() - start,\n\t};\n}\n"],"mappings":";AAMA,SAAS,kBAAkB;;;ACcpB,SAAS,kBAAkB,WAAwC;AACzE,QAAM,UAAU,UAAU,KAAK;AAI/B,QAAM,mBAAmB,QACvB,QAAQ,sBAAsB,EAAE,EAChC,QAAQ,iBAAiB,EAAE,EAC3B,KAAK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,IACT;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,UAAU,CAAC;AAAA,IACX,UAAU,KAAK,IAAI,IAAI;AAAA,EACxB;AACD;","names":["Visibility","Visibility"]}
|
|
1
|
+
{"version":3,"sources":["../src/openapi.ts","../src/schema-mapper.ts","../src/reference.ts","../src/sdk-extractor.ts","../src/index.ts"],"sourcesContent":["import type {\n\tForgeConfig,\n\tOpenAPIDocument,\n\tOpenAPIInfoObject,\n\tOpenAPISchemaObject,\n} from \"@forge-ts/core\";\nimport { Visibility } from \"@forge-ts/core\";\nimport { signatureToSchema } from \"./schema-mapper.js\";\nimport type { SDKProperty, SDKType } from \"./sdk-extractor.js\";\n\nexport type { OpenAPIDocument };\n\n/**\n * Generates a production-quality OpenAPI 3.2 document from the extracted SDK\n * types.\n *\n * The document is populated with:\n * - An `info` block sourced from the config or reasonable defaults.\n * - A `components.schemas` section with one schema per exported type.\n * - `tags` derived from unique source file paths (grouping by file).\n * - Visibility filtering: `@internal` symbols are never emitted.\n *\n * HTTP paths are not yet emitted (`paths` is always `{}`); route extraction\n * will be added in a future release.\n *\n * @param config - The resolved {@link ForgeConfig}.\n * @param sdkTypes - SDK types to include as component schemas.\n * @returns An {@link OpenAPIDocument} object.\n * @public\n */\nexport function generateOpenAPISpec(config: ForgeConfig, sdkTypes: SDKType[]): OpenAPIDocument {\n\t// Visibility filtering: never emit @internal or @private symbols.\n\tconst visibleTypes = sdkTypes.filter(\n\t\t(t) => t.visibility !== Visibility.Internal && t.visibility !== Visibility.Private,\n\t);\n\n\tconst schemas: Record<string, OpenAPISchemaObject> = {};\n\tfor (const t of visibleTypes) {\n\t\tschemas[t.name] = buildSchema(t);\n\t}\n\n\t// Derive tags from unique source files (basename without extension).\n\tconst tagNames = deriveTagNames(visibleTypes);\n\tconst tags = tagNames.map((name) => ({ name }));\n\n\treturn {\n\t\topenapi: \"3.2.0\",\n\t\tinfo: buildInfo(config),\n\t\t...(tags.length > 0 ? { tags } : {}),\n\t\tpaths: {},\n\t\tcomponents: { schemas },\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Info block\n// ---------------------------------------------------------------------------\n\n/**\n * Builds the OpenAPI `info` block from the config.\n *\n * @param config - The resolved {@link ForgeConfig}.\n * @returns An info object with title, version, and description.\n * @internal\n */\nfunction buildInfo(_config: ForgeConfig): OpenAPIInfoObject {\n\t// We attempt to read name/version from the project root's package.json at\n\t// runtime. If unavailable, fall back to safe defaults.\n\treturn {\n\t\ttitle: \"API Reference\",\n\t\tversion: \"0.0.0\",\n\t\tdescription: \"Generated by forge-ts\",\n\t};\n}\n\n// ---------------------------------------------------------------------------\n// Schema builders\n// ---------------------------------------------------------------------------\n\n/**\n * Converts an {@link SDKType} to an OpenAPI schema object.\n *\n * - `interface` / `class` → object schema with `properties` and `required`\n * - `enum` → schema with `enum` array and `type: \"string\"`\n * - `type` alias → schema derived from signature parsing\n *\n * @param sdkType - The type descriptor to convert.\n * @returns An OpenAPI schema object.\n * @internal\n */\nfunction buildSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tconst base: OpenAPISchemaObject = {};\n\n\tif (sdkType.description) {\n\t\tbase.description = sdkType.description;\n\t}\n\n\tif (sdkType.deprecated) {\n\t\tbase.deprecated = true;\n\t}\n\n\tswitch (sdkType.kind) {\n\t\tcase \"interface\":\n\t\tcase \"class\":\n\t\t\treturn { ...base, ...buildObjectSchema(sdkType) };\n\t\tcase \"enum\":\n\t\t\treturn { ...base, ...buildEnumSchema(sdkType) };\n\t\tcase \"type\":\n\t\t\treturn { ...base, ...buildTypeAliasSchema(sdkType) };\n\t\tdefault:\n\t\t\treturn { ...base, type: \"object\" };\n\t}\n}\n\n/**\n * Builds an object schema for an interface or class type.\n *\n * @param sdkType - An interface or class {@link SDKType}.\n * @returns An OpenAPI object schema.\n * @internal\n */\nfunction buildObjectSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tif (sdkType.properties.length === 0) {\n\t\treturn { type: \"object\" };\n\t}\n\n\tconst properties: Record<string, OpenAPISchemaObject> = {};\n\tconst required: string[] = [];\n\n\tfor (const prop of sdkType.properties) {\n\t\tproperties[prop.name] = buildPropertySchema(prop);\n\t\tif (prop.required) {\n\t\t\trequired.push(prop.name);\n\t\t}\n\t}\n\n\tconst schema: OpenAPISchemaObject = { type: \"object\", properties };\n\tif (required.length > 0) {\n\t\tschema.required = required;\n\t}\n\n\treturn schema;\n}\n\n/**\n * Builds the schema for a single property.\n *\n * @param prop - The {@link SDKProperty} to convert.\n * @returns A partial OpenAPI schema for the property.\n * @internal\n */\nfunction buildPropertySchema(prop: SDKProperty): OpenAPISchemaObject {\n\tconst schema: OpenAPISchemaObject = { ...signatureToSchema(prop.type) };\n\n\tif (prop.description) {\n\t\tschema.description = prop.description;\n\t}\n\n\tif (prop.deprecated) {\n\t\tschema.deprecated = true;\n\t}\n\n\treturn schema;\n}\n\n/**\n * Builds an enum schema for an enum type.\n *\n * If the enum has properties (members), their names are used as the enum\n * values. The type defaults to `\"string\"` unless a member type suggests\n * otherwise.\n *\n * @param sdkType - An enum {@link SDKType}.\n * @returns An OpenAPI schema with `enum` values.\n * @internal\n */\nfunction buildEnumSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tif (sdkType.properties.length === 0) {\n\t\treturn { type: \"string\", enum: [] };\n\t}\n\n\tconst values = sdkType.properties.map((p) => {\n\t\t// Use the type value if it looks like a string literal; otherwise use name.\n\t\tconst t = p.type.trim();\n\t\tif (t.startsWith('\"') || t.startsWith(\"'\")) {\n\t\t\treturn t.replace(/^['\"]|['\"]$/g, \"\");\n\t\t}\n\t\treturn p.name;\n\t});\n\n\t// Detect numeric enums: if all values are parseable numbers use \"number\".\n\tconst allNumeric = values.every((v) => !Number.isNaN(Number(v)));\n\n\treturn {\n\t\ttype: allNumeric ? \"number\" : \"string\",\n\t\tenum: allNumeric ? values.map(Number) : values,\n\t};\n}\n\n/**\n * Builds a schema for a type alias.\n *\n * Attempts to parse the signature string directly; falls back to\n * `{ type: \"object\" }` for complex generics or intersections.\n *\n * @param sdkType - A type alias {@link SDKType}.\n * @returns An OpenAPI schema.\n * @internal\n */\nfunction buildTypeAliasSchema(sdkType: SDKType): OpenAPISchemaObject {\n\tif (!sdkType.signature) {\n\t\treturn { type: \"object\" };\n\t}\n\n\t// The signature for a type alias is often `type Name = ActualType`.\n\t// Strip the leading declaration if present.\n\tconst equalsIndex = sdkType.signature.indexOf(\"=\");\n\tconst rawType =\n\t\tequalsIndex !== -1 ? sdkType.signature.slice(equalsIndex + 1).trim() : sdkType.signature;\n\n\treturn signatureToSchema(rawType);\n}\n\n// ---------------------------------------------------------------------------\n// Tag derivation\n// ---------------------------------------------------------------------------\n\n/**\n * Derives OpenAPI tag names from the unique source file basenames of the\n * provided types (without directory path or extension).\n *\n * @param types - The visible SDK types.\n * @returns A sorted, deduplicated array of tag name strings.\n * @internal\n */\nfunction deriveTagNames(types: SDKType[]): string[] {\n\tconst seen = new Set<string>();\n\tfor (const t of types) {\n\t\tconst basename = t.sourceFile.split(\"/\").pop() ?? t.sourceFile;\n\t\tconst withoutExt = basename.replace(/\\.[^.]+$/, \"\");\n\t\tseen.add(withoutExt);\n\t}\n\treturn Array.from(seen).sort();\n}\n","/**\n * Utility for mapping TypeScript type signatures to OpenAPI 3.2 schemas.\n * @public\n */\n\nimport type { OpenAPISchemaObject } from \"@forge-ts/core\";\n\nexport type { OpenAPISchemaObject };\n\n/**\n * Maps a TypeScript type signature string to an OpenAPI 3.2 schema object.\n *\n * Handles common primitives, arrays, unions, `Record<K, V>`, and falls back\n * to `{ type: \"object\" }` for anything it cannot parse.\n *\n * @param signature - A TypeScript type signature string, e.g. `\"string\"`, `\"number[]\"`,\n * `\"string | number\"`, `\"Record<string, boolean>\"`.\n * @returns An OpenAPI schema object.\n * @public\n */\nexport function signatureToSchema(signature: string): OpenAPISchemaObject {\n\tconst trimmed = signature.trim();\n\n\t// Strip trailing `| undefined` or `| null` for optional detection — callers\n\t// handle the required array separately; here we just produce the base schema.\n\tconst withoutUndefined = trimmed\n\t\t.replace(/\\s*\\|\\s*undefined/g, \"\")\n\t\t.replace(/\\s*\\|\\s*null/g, \"\")\n\t\t.trim();\n\n\t// Union type: A | B\n\tif (withoutUndefined.includes(\" | \")) {\n\t\tconst parts = splitUnion(withoutUndefined);\n\t\tif (parts.length > 1) {\n\t\t\treturn { oneOf: parts.map((p) => signatureToSchema(p)) };\n\t\t}\n\t}\n\n\t// Array shorthand: T[]\n\tconst arrayShorthand = /^(.+)\\[\\]$/.exec(withoutUndefined);\n\tif (arrayShorthand) {\n\t\treturn { type: \"array\", items: signatureToSchema(arrayShorthand[1]) };\n\t}\n\n\t// Generic Array<T>\n\tconst genericArray = /^Array<(.+)>$/.exec(withoutUndefined);\n\tif (genericArray) {\n\t\treturn { type: \"array\", items: signatureToSchema(genericArray[1]) };\n\t}\n\n\t// Record<string, V>\n\tconst record = /^Record<[^,]+,\\s*(.+)>$/.exec(withoutUndefined);\n\tif (record) {\n\t\treturn { type: \"object\", additionalProperties: signatureToSchema(record[1]) };\n\t}\n\n\t// Primitives\n\tswitch (withoutUndefined) {\n\t\tcase \"string\":\n\t\t\treturn { type: \"string\" };\n\t\tcase \"number\":\n\t\t\treturn { type: \"number\" };\n\t\tcase \"boolean\":\n\t\t\treturn { type: \"boolean\" };\n\t\tcase \"null\":\n\t\t\treturn { type: \"null\" };\n\t\tcase \"unknown\":\n\t\tcase \"any\":\n\t\t\treturn {};\n\t\tcase \"void\":\n\t\t\treturn { type: \"null\" };\n\t\tdefault:\n\t\t\treturn { type: \"object\" };\n\t}\n}\n\n/**\n * Splits a union type string by top-level `|` separators (ignoring `|` inside\n * angle brackets or parentheses).\n *\n * @param signature - A union type string such as `\"string | number | boolean\"`.\n * @returns An array of trimmed member type strings.\n * @internal\n */\nfunction splitUnion(signature: string): string[] {\n\tconst parts: string[] = [];\n\tlet depth = 0;\n\tlet start = 0;\n\n\tfor (let i = 0; i < signature.length; i++) {\n\t\tconst ch = signature[i];\n\t\tif (ch === \"<\" || ch === \"(\" || ch === \"{\") {\n\t\t\tdepth++;\n\t\t} else if (ch === \">\" || ch === \")\" || ch === \"}\") {\n\t\t\tdepth--;\n\t\t} else if (ch === \"|\" && depth === 0) {\n\t\t\tparts.push(signature.slice(start, i).trim());\n\t\t\tstart = i + 1;\n\t\t}\n\t}\n\n\tparts.push(signature.slice(start).trim());\n\treturn parts.filter(Boolean);\n}\n","import type { ForgeSymbol } from \"@forge-ts/core\";\nimport { Visibility } from \"@forge-ts/core\";\n\n/**\n * A single entry in the generated API reference.\n * @public\n */\nexport interface ReferenceEntry {\n\t/** Symbol name. */\n\tname: string;\n\t/** Symbol kind. */\n\tkind: ForgeSymbol[\"kind\"];\n\t/** TSDoc summary. */\n\tsummary?: string;\n\t/** Human-readable type signature. */\n\tsignature?: string;\n\t/** Resolved visibility level. */\n\tvisibility: Visibility;\n\t/** Deprecation notice, if present. */\n\tdeprecated?: string;\n\t/** Documented parameters. */\n\tparams?: Array<{ name: string; description: string; type?: string }>;\n\t/** Documented return value. */\n\treturns?: { description: string; type?: string };\n\t/** Documented thrown exceptions. */\n\tthrows?: Array<{ type?: string; description: string }>;\n\t/** Code examples from TSDoc `@example` tags. */\n\texamples?: Array<{ code: string; language: string }>;\n\t/** Nested child symbols (class methods, interface properties, enum members). */\n\tchildren?: ReferenceEntry[];\n\t/** Source file location. */\n\tlocation: { filePath: string; line: number };\n}\n\n/**\n * Builds a structured API reference from a list of exported symbols.\n *\n * Unlike the minimal stub, this version includes nested children (class\n * methods, interface properties) and all available TSDoc metadata.\n *\n * Symbols with {@link Visibility.Internal} or {@link Visibility.Private} are\n * excluded from the top-level results. Children with private/internal\n * visibility are also filtered out.\n *\n * @param symbols - All symbols from the AST walker.\n * @returns An array of {@link ReferenceEntry} objects sorted by name.\n * @public\n */\nexport function buildReference(symbols: ForgeSymbol[]): ReferenceEntry[] {\n\treturn symbols\n\t\t.filter(\n\t\t\t(s) =>\n\t\t\t\ts.exported && s.visibility !== Visibility.Internal && s.visibility !== Visibility.Private,\n\t\t)\n\t\t.map(symbolToEntry)\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n}\n\n/**\n * Converts a single {@link ForgeSymbol} to a {@link ReferenceEntry}.\n *\n * @param symbol - The symbol to convert.\n * @returns A populated {@link ReferenceEntry}.\n * @internal\n */\nfunction symbolToEntry(symbol: ForgeSymbol): ReferenceEntry {\n\tconst entry: ReferenceEntry = {\n\t\tname: symbol.name,\n\t\tkind: symbol.kind,\n\t\tsummary: symbol.documentation?.summary,\n\t\tsignature: symbol.signature,\n\t\tvisibility: symbol.visibility,\n\t\tdeprecated: symbol.documentation?.deprecated,\n\t\tlocation: { filePath: symbol.filePath, line: symbol.line },\n\t};\n\n\tif (symbol.documentation?.params && symbol.documentation.params.length > 0) {\n\t\tentry.params = symbol.documentation.params;\n\t}\n\n\tif (symbol.documentation?.returns) {\n\t\tentry.returns = symbol.documentation.returns;\n\t}\n\n\tif (symbol.documentation?.throws && symbol.documentation.throws.length > 0) {\n\t\tentry.throws = symbol.documentation.throws;\n\t}\n\n\tif (symbol.documentation?.examples && symbol.documentation.examples.length > 0) {\n\t\tentry.examples = symbol.documentation.examples.map((ex) => ({\n\t\t\tcode: ex.code,\n\t\t\tlanguage: ex.language,\n\t\t}));\n\t}\n\n\tif (symbol.children && symbol.children.length > 0) {\n\t\tconst visibleChildren = symbol.children.filter(\n\t\t\t(c) => c.visibility !== Visibility.Internal && c.visibility !== Visibility.Private,\n\t\t);\n\t\tif (visibleChildren.length > 0) {\n\t\t\tentry.children = visibleChildren.map(symbolToEntry);\n\t\t}\n\t}\n\n\treturn entry;\n}\n","import type { ForgeSymbol } from \"@forge-ts/core\";\nimport { Visibility } from \"@forge-ts/core\";\n\n/**\n * A single property extracted from an interface or class symbol.\n * @public\n */\nexport interface SDKProperty {\n\t/** The property name. */\n\tname: string;\n\t/** The TypeScript type string of the property. */\n\ttype: string;\n\t/** TSDoc summary for this property. */\n\tdescription?: string;\n\t/** Whether the property is required (not optional). */\n\trequired: boolean;\n\t/** Deprecation notice, if present. */\n\tdeprecated?: string;\n}\n\n/**\n * An SDK type descriptor extracted from the symbol graph.\n * @public\n */\nexport interface SDKType {\n\t/** The symbol name. */\n\tname: string;\n\t/** Syntactic kind of the type. */\n\tkind: \"interface\" | \"type\" | \"class\" | \"enum\";\n\t/** Human-readable type signature. */\n\tsignature?: string;\n\t/** TSDoc summary. */\n\tdescription?: string;\n\t/** Deprecation notice, if present. */\n\tdeprecated?: string;\n\t/** Resolved visibility level. */\n\tvisibility: Visibility;\n\t/** Extracted properties (for interfaces, classes) or values (for enums). */\n\tproperties: SDKProperty[];\n\t/** Absolute path to the source file. */\n\tsourceFile: string;\n}\n\n/**\n * Extracts SDK-relevant types (interfaces, type aliases, classes, enums) from\n * a list of {@link ForgeSymbol} objects.\n *\n * Only exported symbols whose visibility is not {@link Visibility.Internal} or\n * {@link Visibility.Private} are included.\n *\n * @param symbols - The symbols produced by the core AST walker.\n * @returns An array of {@link SDKType} objects for public-facing type definitions.\n * @public\n */\nexport function extractSDKTypes(symbols: ForgeSymbol[]): SDKType[] {\n\treturn symbols\n\t\t.filter(\n\t\t\t(s) =>\n\t\t\t\ts.exported &&\n\t\t\t\t(s.kind === \"interface\" || s.kind === \"type\" || s.kind === \"class\" || s.kind === \"enum\") &&\n\t\t\t\ts.visibility !== Visibility.Internal &&\n\t\t\t\ts.visibility !== Visibility.Private,\n\t\t)\n\t\t.map((s) => ({\n\t\t\tname: s.name,\n\t\t\tkind: s.kind as SDKType[\"kind\"],\n\t\t\tsignature: s.signature,\n\t\t\tdescription: s.documentation?.summary,\n\t\t\tdeprecated: s.documentation?.deprecated,\n\t\t\tvisibility: s.visibility,\n\t\t\tproperties: extractProperties(s),\n\t\t\tsourceFile: s.filePath,\n\t\t}));\n}\n\n/**\n * Extracts the property list from a symbol's children.\n *\n * For interfaces and classes, children with kind `\"property\"` are mapped to\n * {@link SDKProperty}. For enums, children with kind `\"property\"` (enum\n * members) are also included. Method children are excluded.\n *\n * @param symbol - The parent symbol whose children to extract from.\n * @returns An array of {@link SDKProperty} objects.\n * @internal\n */\nfunction extractProperties(symbol: ForgeSymbol): SDKProperty[] {\n\tif (!symbol.children || symbol.children.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn symbol.children\n\t\t.filter(\n\t\t\t(child) =>\n\t\t\t\tchild.kind === \"property\" &&\n\t\t\t\tchild.visibility !== Visibility.Private &&\n\t\t\t\tchild.visibility !== Visibility.Internal,\n\t\t)\n\t\t.map((child) => {\n\t\t\tconst isOptional = child.signature ? child.signature.includes(\"?\") : false;\n\t\t\tconst rawType = resolveChildType(child);\n\t\t\treturn {\n\t\t\t\tname: child.name,\n\t\t\t\ttype: rawType,\n\t\t\t\tdescription: child.documentation?.summary,\n\t\t\t\trequired: !isOptional,\n\t\t\t\tdeprecated: child.documentation?.deprecated,\n\t\t\t};\n\t\t});\n}\n\n/**\n * Resolves the type string for a child symbol.\n *\n * Uses the signature if present; otherwise falls back to `\"unknown\"`.\n *\n * @param child - A child {@link ForgeSymbol}.\n * @returns A TypeScript type string.\n * @internal\n */\nfunction resolveChildType(child: ForgeSymbol): string {\n\tif (!child.signature) {\n\t\treturn \"unknown\";\n\t}\n\n\t// Signatures for properties often look like `name: type` or `name?: type`.\n\t// Strip the leading `name:` or `name?:` prefix to get the bare type.\n\tconst colonIndex = child.signature.indexOf(\":\");\n\tif (colonIndex !== -1) {\n\t\treturn child.signature.slice(colonIndex + 1).trim();\n\t}\n\n\treturn child.signature;\n}\n","/**\n * @forge-ts/api — OpenAPI spec and API reference generator.\n *\n * Extracts public SDK types from the symbol graph and generates an\n * OpenAPI 3.2 document and a structured API reference.\n *\n * @packageDocumentation\n * @public\n */\n\nexport { generateOpenAPISpec, type OpenAPIDocument } from \"./openapi.js\";\nexport { buildReference, type ReferenceEntry } from \"./reference.js\";\nexport { type OpenAPISchemaObject, signatureToSchema } from \"./schema-mapper.js\";\nexport { extractSDKTypes, type SDKProperty, type SDKType } from \"./sdk-extractor.js\";\n\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport { createWalker, type ForgeConfig, type ForgeResult } from \"@forge-ts/core\";\nimport { generateOpenAPISpec } from \"./openapi.js\";\nimport { extractSDKTypes } from \"./sdk-extractor.js\";\n\n/**\n * Runs the API generation pipeline: walk → extract → generate → write.\n *\n * @param config - The resolved {@link ForgeConfig} for the project.\n * @returns A {@link ForgeResult} with success/failure and any diagnostics.\n * @public\n */\nexport async function generateApi(config: ForgeConfig): Promise<ForgeResult> {\n\tconst start = Date.now();\n\n\tconst walker = createWalker(config);\n\tconst symbols = walker.walk();\n\tconst sdkTypes = extractSDKTypes(symbols);\n\tconst spec = generateOpenAPISpec(config, sdkTypes);\n\n\tawait mkdir(dirname(config.api.openapiPath), { recursive: true });\n\tawait writeFile(config.api.openapiPath, JSON.stringify(spec, null, 2), \"utf8\");\n\n\treturn {\n\t\tsuccess: true,\n\t\tsymbols,\n\t\terrors: [],\n\t\twarnings: [],\n\t\tduration: Date.now() - start,\n\t};\n}\n"],"mappings":";AAMA,SAAS,kBAAkB;;;ACcpB,SAAS,kBAAkB,WAAwC;AACzE,QAAM,UAAU,UAAU,KAAK;AAI/B,QAAM,mBAAmB,QACvB,QAAQ,sBAAsB,EAAE,EAChC,QAAQ,iBAAiB,EAAE,EAC3B,KAAK;AAGP,MAAI,iBAAiB,SAAS,KAAK,GAAG;AACrC,UAAM,QAAQ,WAAW,gBAAgB;AACzC,QAAI,MAAM,SAAS,GAAG;AACrB,aAAO,EAAE,OAAO,MAAM,IAAI,CAAC,MAAM,kBAAkB,CAAC,CAAC,EAAE;AAAA,IACxD;AAAA,EACD;AAGA,QAAM,iBAAiB,aAAa,KAAK,gBAAgB;AACzD,MAAI,gBAAgB;AACnB,WAAO,EAAE,MAAM,SAAS,OAAO,kBAAkB,eAAe,CAAC,CAAC,EAAE;AAAA,EACrE;AAGA,QAAM,eAAe,gBAAgB,KAAK,gBAAgB;AAC1D,MAAI,cAAc;AACjB,WAA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,MACZ,MAAM;AAAA,MACN,aAAa,MAAM,eAAe;AAAA,MAClC,UAAU,CAAC;AAAA,MACX,YAAY,MAAM,eAAe;AAAA,IAClC;AAAA,EACD,CAAC;AACH;AAWA,SAAS,iBAAiB,OAA4B;AACrD,MAAI,CAAC,MAAM,WAAW;AACrB,WAAO;AAAA,EACR;AAIA,QAAM,aAAa,MAAM,UAAU,QAAQ,GAAG;AAC9C,MAAI,eAAe,IAAI;AACtB,WAAO,MAAM,UAAU,MAAM,aAAa,CAAC,EAAE,KAAK;AAAA,EACnD;AAEA,SAAO,MAAM;AACd;;;ACtHA,SAAS,OAAO,iBAAiB;AACjC,SAAS,eAAe;AACxB,SAAS,oBAAwD;AAWjE,eAAsB,YAAY,QAA2C;AAC5E,QAAM,QAAQ,KAAK,IAAI;AAEvB,QAAM,SAAS,aAAa,MAAM;AAClC,QAAM,UAAU,OAAO,KAAK;AAC5B,QAAM,WAAW,gBAAgB,OAAO;AACxC,QAAM,OAAO,oBAAoB,QAAQ,QAAQ;AAEjD,QAAM,MAAM,QAAQ,OAAO,IAAI,WAAW,GAAG,EAAE,WAAW,KAAK,CAAC;AAChE,QAAM,UAAU,OAAO,IAAI,aAAa,KAAK,UAAU,MAAM,MAAM,CAAC,GAAG,MAAM;AAE7E,SAAO;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,UAAU,CAAC;AAAA,IACX,UAAU,KAAK,IAAI,IAAI;AAAA,EACxB;AACD;","names":["Visibility","Visibility"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge-ts/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenAPI spec and API reference generator for forge-ts",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/kryptobaseddev/forge-ts"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
27
|
+
"@forge-ts/core": "0.3.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"tsup": "^8.3.5",
|