@apollo-deploy/tesseract 1.6.0 → 1.8.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 +127 -33
- package/dist/collector.d.ts +50 -0
- package/dist/collector.d.ts.map +1 -1
- package/dist/collector.js +97 -2
- package/dist/collector.js.map +1 -1
- package/dist/fastify.d.ts +25 -0
- package/dist/fastify.d.ts.map +1 -1
- package/dist/fastify.js +22 -13
- package/dist/fastify.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Tesseract
|
|
2
2
|
|
|
3
|
-
Manifest-first SDK generator — turns `sdk-manifold/v1` manifests into production-ready
|
|
3
|
+
Manifest-first SDK generator — turns `sdk-manifold/v1` manifests into production-ready SDKs.
|
|
4
4
|
|
|
5
|
-
Tesseract is **not** an OpenAPI parser. It consumes a purpose-built manifest format designed specifically for SDK generation, producing fully typed, batteries-included
|
|
5
|
+
Tesseract is **not** an OpenAPI parser. It consumes a purpose-built manifest format designed specifically for SDK generation, producing fully typed, batteries-included packages across multiple target languages.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ bun add -g @apollo-deploy/tesseract
|
|
|
18
18
|
tesseract generate -i manifest.json -o ./sdk
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
This reads your manifest and produces a complete npm-ready SDK in `./sdk/`.
|
|
21
|
+
This reads your manifest and produces a complete npm-ready TypeScript SDK in `./sdk/`.
|
|
22
22
|
|
|
23
23
|
## CLI
|
|
24
24
|
|
|
@@ -30,6 +30,7 @@ Generate an SDK from a static manifest file.
|
|
|
30
30
|
|------|----------|-------------|
|
|
31
31
|
| `-i, --input <path>` | Yes | Path to the `sdk-manifold/v1` manifest JSON file |
|
|
32
32
|
| `-o, --output <dir>` | Yes | Output directory for the generated SDK |
|
|
33
|
+
| `-l, --language <lang>` | No | Target language: `typescript` (default), `python`, `ruby`, `php`, `go`, `rust`, `kotlin`, `csharp` |
|
|
33
34
|
| `-n, --name <name>` | No | Override the npm package name |
|
|
34
35
|
| `--package-version <version>` | No | Override the generated package version |
|
|
35
36
|
| `--client-name <name>` | No | Override the generated client class name |
|
|
@@ -49,7 +50,39 @@ Boot an instrumented Fastify app with `TESSERACT_GENERATE=1` to collect annotate
|
|
|
49
50
|
tesseract run dist/app.js
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
The app must register `tesseractPlugin` from `@apollo-deploy/tesseract/fastify`. See [Fastify Integration](#fastify
|
|
53
|
+
The app must register `tesseractPlugin` from `@apollo-deploy/tesseract/fastify`. See [Fastify Integration](#fastify) below.
|
|
54
|
+
|
|
55
|
+
## Target Languages
|
|
56
|
+
|
|
57
|
+
Tesseract ships adapters for multiple target languages. Pass `-l <lang>` to `tesseract generate`, set `language` in `CollectorOptions`, or use `additionalTargets` to emit multiple languages in a single run.
|
|
58
|
+
|
|
59
|
+
| Language | Value | Output |
|
|
60
|
+
|----------|-------|--------|
|
|
61
|
+
| TypeScript | `typescript` | npm-ready package with Axios transport |
|
|
62
|
+
| Python | `python` | pip-ready package |
|
|
63
|
+
| Ruby | `ruby` | gem-ready package |
|
|
64
|
+
| PHP | `php` | Composer package |
|
|
65
|
+
| Go | `go` | Go module |
|
|
66
|
+
| Rust | `rust` | Cargo crate |
|
|
67
|
+
| Kotlin | `kotlin` | Gradle project with Ktor + kotlinx.serialization |
|
|
68
|
+
| C# | `csharp` | NuGet package |
|
|
69
|
+
|
|
70
|
+
### Multiple targets in one run
|
|
71
|
+
|
|
72
|
+
Use `additionalTargets` on any collector or the Fastify plugin to emit multiple languages simultaneously without running the generator twice:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
const collector = new SDKCollector({
|
|
76
|
+
info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
77
|
+
output: './sdk/typescript', // primary — TypeScript
|
|
78
|
+
additionalTargets: [
|
|
79
|
+
{ language: 'kotlin', output: './sdk/java' },
|
|
80
|
+
{ language: 'python', output: './sdk/python', packageName: 'my-api' },
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Each additional target inherits `clientType`, `packageName`, `packageVersion`, and `sdkStyle` from the primary options unless overridden per-target.
|
|
53
86
|
|
|
54
87
|
## Input: The Manifest
|
|
55
88
|
|
|
@@ -124,17 +157,13 @@ Tesseract ships adapters for every major Node.js API framework. Each adapter is
|
|
|
124
157
|
| **NestJS** | `@apollo-deploy/tesseract/nestjs` |
|
|
125
158
|
| **Generic / any framework** | `import { SDKCollector } from '@apollo-deploy/tesseract'` |
|
|
126
159
|
|
|
127
|
-
All
|
|
128
|
-
|
|
129
|
-
1. Create an `SDKCollector` (or framework-specific subclass) with your API metadata.
|
|
130
|
-
2. Register domains and routes with the collector alongside your framework route definitions.
|
|
131
|
-
3. Call `collector.tryGenerate()` (or let a plugin do it) — it only runs when `TESSERACT_GENERATE=1`.
|
|
160
|
+
All adapters share the same `CollectorOptions` interface, which means `language` and `additionalTargets` work identically across every framework.
|
|
132
161
|
|
|
133
162
|
---
|
|
134
163
|
|
|
135
164
|
### Fastify
|
|
136
165
|
|
|
137
|
-
The Fastify adapter hooks into `onRoute` to collect routes automatically at boot time — no manual registration needed.
|
|
166
|
+
The Fastify adapter hooks into `onRoute` to collect routes automatically at boot time — no manual registration needed. Internally it delegates to `SDKCollector`, so all `CollectorOptions` including `language` and `additionalTargets` are supported.
|
|
138
167
|
|
|
139
168
|
```ts
|
|
140
169
|
// app.ts
|
|
@@ -143,6 +172,10 @@ import { tesseractPlugin } from '@apollo-deploy/tesseract/fastify';
|
|
|
143
172
|
app.register(tesseractPlugin, {
|
|
144
173
|
info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
145
174
|
output: './packages/api-sdk',
|
|
175
|
+
// Generate a Kotlin SDK alongside the primary TypeScript one:
|
|
176
|
+
additionalTargets: [
|
|
177
|
+
{ language: 'kotlin', output: './sdk/java' },
|
|
178
|
+
],
|
|
146
179
|
// Optional: import types from a shared package instead of regenerating them
|
|
147
180
|
schemaPackage: { name: '@my-org/schemas', version: '^2.0.0' },
|
|
148
181
|
sdkStyle: 'functional', // or 'class'
|
|
@@ -209,6 +242,9 @@ const app = express();
|
|
|
209
242
|
const collector = new ExpressSDKCollector({
|
|
210
243
|
info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
211
244
|
output: './packages/api-sdk',
|
|
245
|
+
additionalTargets: [
|
|
246
|
+
{ language: 'kotlin', output: './sdk/java' },
|
|
247
|
+
],
|
|
212
248
|
});
|
|
213
249
|
|
|
214
250
|
collector.domain('/users', { domain: 'users', description: 'User management' });
|
|
@@ -357,6 +393,9 @@ async function bootstrap() {
|
|
|
357
393
|
const collector = new SDKCollector({
|
|
358
394
|
info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
359
395
|
output: './packages/api-sdk',
|
|
396
|
+
additionalTargets: [
|
|
397
|
+
{ language: 'kotlin', output: './sdk/java' },
|
|
398
|
+
],
|
|
360
399
|
});
|
|
361
400
|
collectFromNestControllers([UsersController], collector);
|
|
362
401
|
await collector.generate();
|
|
@@ -385,6 +424,10 @@ import { SDKCollector } from '@apollo-deploy/tesseract';
|
|
|
385
424
|
const collector = new SDKCollector({
|
|
386
425
|
info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
387
426
|
output: './packages/api-sdk',
|
|
427
|
+
additionalTargets: [
|
|
428
|
+
{ language: 'kotlin', output: './sdk/java' },
|
|
429
|
+
{ language: 'python', output: './sdk/python', packageName: 'my-api' },
|
|
430
|
+
],
|
|
388
431
|
});
|
|
389
432
|
|
|
390
433
|
collector.domain('/users', { domain: 'users', description: 'User management' });
|
|
@@ -397,7 +440,9 @@ if (await collector.tryGenerate()) process.exit(0);
|
|
|
397
440
|
|
|
398
441
|
## Output
|
|
399
442
|
|
|
400
|
-
Tesseract generates a complete, publishable
|
|
443
|
+
Tesseract generates a complete, publishable package. Structure varies by `sdkStyle` and target language.
|
|
444
|
+
|
|
445
|
+
### TypeScript (default)
|
|
401
446
|
|
|
402
447
|
**Functional style** (default — `createMyClient(config)`):
|
|
403
448
|
|
|
@@ -408,27 +453,51 @@ sdk/
|
|
|
408
453
|
├── README.md
|
|
409
454
|
├── index.ts
|
|
410
455
|
└── src/
|
|
411
|
-
├── client.ts
|
|
456
|
+
├── client.ts
|
|
412
457
|
├── transport/
|
|
413
|
-
│ ├── axios.ts
|
|
414
|
-
│ └── sse.ts
|
|
458
|
+
│ ├── axios.ts
|
|
459
|
+
│ └── sse.ts
|
|
415
460
|
├── domain/
|
|
416
|
-
│
|
|
417
|
-
│ └── ...
|
|
461
|
+
│ └── users.ts
|
|
418
462
|
├── types/
|
|
419
|
-
│ ├── models.ts
|
|
420
|
-
│ ├── common.ts
|
|
421
|
-
│ ├── errors.ts
|
|
422
|
-
│ └── index.ts
|
|
463
|
+
│ ├── models.ts
|
|
464
|
+
│ ├── common.ts
|
|
465
|
+
│ ├── errors.ts
|
|
466
|
+
│ └── index.ts
|
|
423
467
|
├── utils/
|
|
424
|
-
│ └── query.ts
|
|
468
|
+
│ └── query.ts
|
|
425
469
|
└── webhooks/
|
|
426
|
-
└── handler.ts
|
|
470
|
+
└── handler.ts
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**Class style** (`--sdk-style class` — `new MySDK('api_key', options?)`): generates `client-class.ts`, `domain-class/` files, and a matching `index.ts`.
|
|
474
|
+
|
|
475
|
+
### Kotlin
|
|
476
|
+
|
|
477
|
+
Generates a Gradle project using Ktor HTTP client, kotlinx.serialization, and coroutines:
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
sdk/java/
|
|
481
|
+
├── build.gradle.kts
|
|
482
|
+
├── settings.gradle.kts
|
|
483
|
+
├── gradle.properties
|
|
484
|
+
├── gradle/wrapper/gradle-wrapper.properties
|
|
485
|
+
├── .gitignore
|
|
486
|
+
├── README.md
|
|
487
|
+
└── src/main/kotlin/<package>/
|
|
488
|
+
├── Client.kt
|
|
489
|
+
├── internal/Transport.kt
|
|
490
|
+
├── exceptions/SdkException.kt
|
|
491
|
+
├── models/Types.kt
|
|
492
|
+
└── api/
|
|
493
|
+
└── UsersAPI.kt
|
|
427
494
|
```
|
|
428
495
|
|
|
429
|
-
|
|
496
|
+
### Other languages
|
|
497
|
+
|
|
498
|
+
Python, Ruby, PHP, Go, Rust, and C# each generate idiomatic project scaffolding with appropriate package manager files and typed client code.
|
|
430
499
|
|
|
431
|
-
### Generated SDK Features
|
|
500
|
+
### Generated TypeScript SDK Features
|
|
432
501
|
|
|
433
502
|
- **Typed client** with grouped domain methods
|
|
434
503
|
- **Automatic retries** with exponential backoff, jitter, and customizable retry logic
|
|
@@ -442,7 +511,7 @@ sdk/
|
|
|
442
511
|
- **AbortSignal support** for request cancellation
|
|
443
512
|
- **Per-request overrides** — timeout, headers, retry config
|
|
444
513
|
|
|
445
|
-
### Example Usage of Generated SDK
|
|
514
|
+
### Example Usage of Generated TypeScript SDK
|
|
446
515
|
|
|
447
516
|
```typescript
|
|
448
517
|
import { createMyApiClient } from './sdk';
|
|
@@ -500,7 +569,7 @@ Tesseract uses a dual strategy:
|
|
|
500
569
|
- **[ts-morph](https://ts-morph.com/)** (AST-based) for type definitions — interfaces, enums, type aliases
|
|
501
570
|
- **[Handlebars](https://handlebarsjs.com/)** templates for everything else — client, transport, domain methods, utilities
|
|
502
571
|
|
|
503
|
-
|
|
572
|
+
TypeScript output is formatted with Prettier.
|
|
504
573
|
|
|
505
574
|
## Programmatic API
|
|
506
575
|
|
|
@@ -510,15 +579,13 @@ import { generate } from '@apollo-deploy/tesseract';
|
|
|
510
579
|
await generate({
|
|
511
580
|
input: './manifest.json',
|
|
512
581
|
output: './sdk',
|
|
513
|
-
language: '
|
|
582
|
+
language: 'kotlin',
|
|
514
583
|
packageName: '@my-org/api-sdk',
|
|
515
584
|
packageVersion: '1.2.3',
|
|
516
|
-
clientName: 'MyApi',
|
|
517
|
-
baseUrl: 'https://api.example.com',
|
|
518
585
|
});
|
|
519
586
|
```
|
|
520
587
|
|
|
521
|
-
You can also pass a pre-parsed manifest object
|
|
588
|
+
You can also pass a pre-parsed manifest object:
|
|
522
589
|
|
|
523
590
|
```typescript
|
|
524
591
|
import { generate } from '@apollo-deploy/tesseract';
|
|
@@ -526,7 +593,7 @@ import type { BackendManifest } from '@apollo-deploy/tesseract';
|
|
|
526
593
|
|
|
527
594
|
const manifest: BackendManifest = { /* ... */ };
|
|
528
595
|
|
|
529
|
-
await generate({ manifest, output: './sdk' });
|
|
596
|
+
await generate({ manifest, output: './sdk', language: 'kotlin' });
|
|
530
597
|
```
|
|
531
598
|
|
|
532
599
|
### Configuration
|
|
@@ -538,8 +605,8 @@ Either `input` or `manifest` must be provided.
|
|
|
538
605
|
| `input` | `string?` | Path to the manifest file. Required if `manifest` is not provided. |
|
|
539
606
|
| `manifest` | `BackendManifest?` | Pre-parsed manifest object. Alternative to `input`. |
|
|
540
607
|
| `output` | `string` | Output directory |
|
|
541
|
-
| `language` | `
|
|
542
|
-
| `packageName` | `string?` | Override npm
|
|
608
|
+
| `language` | `TargetLanguage?` | Target language (default: `typescript`). One of: `typescript`, `python`, `ruby`, `php`, `go`, `rust`, `kotlin`, `csharp` |
|
|
609
|
+
| `packageName` | `string?` | Override npm/package name |
|
|
543
610
|
| `packageVersion` | `string?` | Override generated package version; defaults to `info.version` from the manifest |
|
|
544
611
|
| `clientName` | `string?` | Override client class name |
|
|
545
612
|
| `baseUrl` | `string?` | Override default base URL |
|
|
@@ -550,6 +617,33 @@ Either `input` or `manifest` must be provided.
|
|
|
550
617
|
| `check` | `boolean?` | Compare output without writing |
|
|
551
618
|
| `prettier` | `boolean?` | Toggle formatting (default: `true`) |
|
|
552
619
|
|
|
620
|
+
### `CollectorOptions`
|
|
621
|
+
|
|
622
|
+
Shared by all framework adapters and `SDKCollector`. Extends the programmatic API config with `additionalTargets`.
|
|
623
|
+
|
|
624
|
+
| Option | Type | Description |
|
|
625
|
+
|--------|------|-------------|
|
|
626
|
+
| `info` | `object` | API metadata: `title`, `version`, `baseUrl?`, `description?` |
|
|
627
|
+
| `output` | `string` | Primary output directory |
|
|
628
|
+
| `language` | `TargetLanguage?` | Primary target language (default: `typescript`) |
|
|
629
|
+
| `additionalTargets` | `AdditionalTarget[]?` | Extra languages to emit alongside the primary output |
|
|
630
|
+
| `schemaPackage` | `object?` | External type package: `name`, `version?`, `importPath?` |
|
|
631
|
+
| `sdkStyle` | `'functional' \| 'class'?` | SDK style |
|
|
632
|
+
| `clientType` | `'internal' \| 'public'?` | Client type |
|
|
633
|
+
| `packageName` | `string?` | Override package name |
|
|
634
|
+
| `packageVersion` | `string?` | Override package version |
|
|
635
|
+
|
|
636
|
+
Each `AdditionalTarget` entry:
|
|
637
|
+
|
|
638
|
+
| Field | Type | Description |
|
|
639
|
+
|-------|------|-------------|
|
|
640
|
+
| `language` | `TargetLanguage` | Required. Target language for this output |
|
|
641
|
+
| `output` | `string` | Required. Output directory |
|
|
642
|
+
| `packageName` | `string?` | Overrides primary `packageName` for this target |
|
|
643
|
+
| `packageVersion` | `string?` | Overrides primary `packageVersion` for this target |
|
|
644
|
+
| `clientType` | `'internal' \| 'public'?` | Overrides primary `clientType` for this target |
|
|
645
|
+
| `sdkStyle` | `'functional' \| 'class'?` | Overrides primary `sdkStyle` for this target |
|
|
646
|
+
|
|
553
647
|
## Requirements
|
|
554
648
|
|
|
555
649
|
- Node.js ≥ 18 or Bun ≥ 1.0
|
package/dist/collector.d.ts
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { BackendManifest, ManifestRouteSchema } from './types/manifest.js';
|
|
30
30
|
import type { SDKModuleConfig, SDKRouteConfig } from './types/sdk-module.js';
|
|
31
|
+
import type { TargetLanguage } from './types/ir.js';
|
|
31
32
|
export interface CollectorOptions {
|
|
32
33
|
/** API metadata written into the generated package.json and README. */
|
|
33
34
|
info: {
|
|
@@ -57,6 +58,55 @@ export interface CollectorOptions {
|
|
|
57
58
|
packageName?: string;
|
|
58
59
|
/** Override the generated package version. */
|
|
59
60
|
packageVersion?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Target SDK language for the primary output. Defaults to `'typescript'`.
|
|
63
|
+
* Use `additionalTargets` to emit multiple languages simultaneously.
|
|
64
|
+
*/
|
|
65
|
+
language?: TargetLanguage;
|
|
66
|
+
/**
|
|
67
|
+
* Additional SDK targets to generate alongside the primary output.
|
|
68
|
+
*
|
|
69
|
+
* Each entry runs a full generation pass with its own language adapter and
|
|
70
|
+
* output directory. The primary SDK is unaffected.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const collector = new SDKCollector({
|
|
75
|
+
* info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
76
|
+
* output: './packages/api-sdk',
|
|
77
|
+
* additionalTargets: [
|
|
78
|
+
* { language: 'kotlin', output: './sdk/java' },
|
|
79
|
+
* { language: 'python', output: './sdk/python', packageName: 'my-api' },
|
|
80
|
+
* ],
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
additionalTargets?: Array<{
|
|
85
|
+
language: TargetLanguage;
|
|
86
|
+
output: string;
|
|
87
|
+
packageName?: string;
|
|
88
|
+
packageVersion?: string;
|
|
89
|
+
clientType?: 'internal' | 'public';
|
|
90
|
+
sdkStyle?: 'functional' | 'class';
|
|
91
|
+
/**
|
|
92
|
+
* Override the schema package for this target.
|
|
93
|
+
*
|
|
94
|
+
* Set to `null` to disable external type imports for this target, causing
|
|
95
|
+
* all types to be generated inline. Useful when the primary output imports
|
|
96
|
+
* from a shared TypeScript package but an additional target (e.g. Kotlin)
|
|
97
|
+
* needs self-contained inline types.
|
|
98
|
+
*
|
|
99
|
+
* Omit to inherit the primary `schemaPackage`.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* additionalTargets: [
|
|
104
|
+
* { language: 'kotlin', output: './sdk/java', schemaPackage: null },
|
|
105
|
+
* ]
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
schemaPackage?: CollectorOptions['schemaPackage'] | null;
|
|
109
|
+
}>;
|
|
60
110
|
}
|
|
61
111
|
export interface CollectorRouteConfig {
|
|
62
112
|
/** JSON Schemas for params, querystring, body, headers, and response. */
|
package/dist/collector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAiB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAiB,mBAAmB,EAAc,MAAM,qBAAqB,CAAC;AAC3G,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,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IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBAE9B,IAAI,EAAE,gBAAgB;IAIlC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG,IAAI;IAKtE;;;;;;;;OAQG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAYtE,sFAAsF;IACtF,aAAa,IAAI,eAAe;IAIhC,4DAA4D;IACtD,QAAQ,IAAI,OAAO,CAAC,OAAO,YAAY,EAAE,cAAc,CAAC;IAiD9D;;;;;;;;;;OAUG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAUtC;AAID;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,GAAG,EAAE,cAAc,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC,EACF,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EAC9C,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC9B,aAAa,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,GAChD,eAAe,CAwCjB"}
|
package/dist/collector.js
CHANGED
|
@@ -79,14 +79,40 @@ export class SDKCollector {
|
|
|
79
79
|
async generate() {
|
|
80
80
|
const { generate } = await import('./index.js');
|
|
81
81
|
const manifest = this.buildManifest();
|
|
82
|
-
|
|
82
|
+
const primary = await generate({
|
|
83
83
|
manifest,
|
|
84
84
|
output: this.opts.output,
|
|
85
|
+
language: this.opts.language,
|
|
85
86
|
clientType: this.opts.clientType,
|
|
86
87
|
packageName: this.opts.packageName,
|
|
87
88
|
packageVersion: this.opts.packageVersion,
|
|
88
89
|
sdkStyle: this.opts.sdkStyle,
|
|
89
90
|
});
|
|
91
|
+
for (const target of this.opts.additionalTargets ?? []) {
|
|
92
|
+
// If the target overrides schemaPackage (including null to disable it),
|
|
93
|
+
// rebuild the manifest with the target-specific schemaPackage so that
|
|
94
|
+
// intake resolves types correctly for this language.
|
|
95
|
+
const hasSchemaPackageOverride = Object.prototype.hasOwnProperty.call(target, 'schemaPackage');
|
|
96
|
+
const targetManifest = hasSchemaPackageOverride
|
|
97
|
+
? buildManifestFromRoutes(this._routes, this._registry, this.opts.info, target.schemaPackage ?? undefined)
|
|
98
|
+
: manifest;
|
|
99
|
+
const extra = await generate({
|
|
100
|
+
manifest: targetManifest,
|
|
101
|
+
output: target.output,
|
|
102
|
+
language: target.language,
|
|
103
|
+
clientType: target.clientType ?? this.opts.clientType,
|
|
104
|
+
packageName: target.packageName ?? this.opts.packageName,
|
|
105
|
+
packageVersion: target.packageVersion ?? this.opts.packageVersion,
|
|
106
|
+
sdkStyle: target.sdkStyle ?? this.opts.sdkStyle,
|
|
107
|
+
});
|
|
108
|
+
// Merge warnings and counts back into the primary result so callers
|
|
109
|
+
// get a single aggregated result regardless of target count.
|
|
110
|
+
primary.filesWritten += extra.filesWritten;
|
|
111
|
+
primary.filesSkipped += extra.filesSkipped;
|
|
112
|
+
primary.warnings.push(...extra.warnings);
|
|
113
|
+
primary.changedFiles.push(...extra.changedFiles);
|
|
114
|
+
}
|
|
115
|
+
return primary;
|
|
90
116
|
}
|
|
91
117
|
/**
|
|
92
118
|
* Check if `TESSERACT_GENERATE=1` is set and generate the SDK if so.
|
|
@@ -107,7 +133,8 @@ export class SDKCollector {
|
|
|
107
133
|
for (const w of result.warnings)
|
|
108
134
|
console.warn(` ⚠ ${w}`);
|
|
109
135
|
}
|
|
110
|
-
|
|
136
|
+
const targets = [this.opts.output, ...(this.opts.additionalTargets ?? []).map((t) => t.output)];
|
|
137
|
+
console.log(`[tesseract] ✓ ${result.filesWritten} files written → ${targets.join(', ')}`);
|
|
111
138
|
return true;
|
|
112
139
|
}
|
|
113
140
|
}
|
|
@@ -149,6 +176,7 @@ export function buildManifestFromRoutes(routes, registry, info, schemaPackage) {
|
|
|
149
176
|
},
|
|
150
177
|
...(schemaPackage && { schemaPackage }),
|
|
151
178
|
domains: [...domainMap.values()].map(({ config, routes }) => ({ ...config, routes })),
|
|
179
|
+
...buildDefinitionsFromDefs(routes),
|
|
152
180
|
};
|
|
153
181
|
}
|
|
154
182
|
/** Derives a domain prefix from the first non-parameter URL segment. */
|
|
@@ -156,4 +184,71 @@ function derivePrefix(url) {
|
|
|
156
184
|
const first = url.split('/').find((s) => s.length > 0 && !s.startsWith(':'));
|
|
157
185
|
return first ? '/' + first : '/';
|
|
158
186
|
}
|
|
187
|
+
// ── $defs extraction ──────────────────────────────────────────────────────────
|
|
188
|
+
/**
|
|
189
|
+
* Walk every schema value in every route and collect all `$defs` blocks.
|
|
190
|
+
* When `toJSONSchema` (e.g. Zod v4) produces a schema with `$defs`, those
|
|
191
|
+
* named definitions are lifted into `manifest.definitions` so that intake
|
|
192
|
+
* can generate named data classes (e.g. Kotlin `data class`) rather than
|
|
193
|
+
* expanding every reference inline.
|
|
194
|
+
*
|
|
195
|
+
* Returns `{ definitions }` only when at least one def is found, so the
|
|
196
|
+
* spread into the manifest is a no-op for manifests that have none.
|
|
197
|
+
*/
|
|
198
|
+
function buildDefinitionsFromDefs(routes) {
|
|
199
|
+
const defs = {};
|
|
200
|
+
for (const route of routes) {
|
|
201
|
+
const s = route.schema;
|
|
202
|
+
if (!s)
|
|
203
|
+
continue;
|
|
204
|
+
const fields = [
|
|
205
|
+
s.params,
|
|
206
|
+
s.querystring,
|
|
207
|
+
s.query,
|
|
208
|
+
s.body,
|
|
209
|
+
s.headers,
|
|
210
|
+
...(s.response ? Object.values(s.response) : []),
|
|
211
|
+
];
|
|
212
|
+
for (const field of fields) {
|
|
213
|
+
if (field)
|
|
214
|
+
collectDefs(field, defs);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return Object.keys(defs).length > 0 ? { definitions: defs } : {};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Recursively collect all `$defs` entries found anywhere in a JSON Schema
|
|
221
|
+
* object into the `out` accumulator. Entries already present are not
|
|
222
|
+
* overwritten (first-write wins, matching JSON Schema semantics).
|
|
223
|
+
*/
|
|
224
|
+
function collectDefs(schema, out) {
|
|
225
|
+
if (!schema || typeof schema !== 'object')
|
|
226
|
+
return;
|
|
227
|
+
if (schema.$defs && typeof schema.$defs === 'object' && !Array.isArray(schema.$defs)) {
|
|
228
|
+
for (const [key, val] of Object.entries(schema.$defs)) {
|
|
229
|
+
if (!(key in out))
|
|
230
|
+
out[key] = val;
|
|
231
|
+
// Recurse into the def itself — it may contain nested $defs
|
|
232
|
+
if (val && typeof val === 'object')
|
|
233
|
+
collectDefs(val, out);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Recurse into all schema fields that may contain nested schemas
|
|
237
|
+
for (const key of Object.keys(schema)) {
|
|
238
|
+
if (key === '$defs')
|
|
239
|
+
continue;
|
|
240
|
+
const val = schema[key];
|
|
241
|
+
if (!val || typeof val !== 'object')
|
|
242
|
+
continue;
|
|
243
|
+
if (Array.isArray(val)) {
|
|
244
|
+
for (const item of val) {
|
|
245
|
+
if (item && typeof item === 'object')
|
|
246
|
+
collectDefs(item, out);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
collectDefs(val, out);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
159
254
|
//# sourceMappingURL=collector.js.map
|
package/dist/collector.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../src/collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;
|
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot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S;QAC9B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,SAAS;QAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;gBACvB,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;oBAAE,WAAW,CAAC,IAA+B,EAAE,GAAG,CAAC,CAAC;YAC1F,CAAC;QACH,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,GAA8B,EAAE,GAAG,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/fastify.d.ts
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { FastifyInstance, FastifyPluginAsync } from 'fastify';
|
|
21
21
|
import type { SDKModuleConfig, SDKRouteConfig } from './types/sdk-module.js';
|
|
22
|
+
import type { TargetLanguage } from './types/ir.js';
|
|
23
|
+
import type { CollectorOptions } from './collector.js';
|
|
22
24
|
declare module 'fastify' {
|
|
23
25
|
interface RouteOptions {
|
|
24
26
|
/** SDK generation configuration for this route. Sibling to `schema`. */
|
|
@@ -104,6 +106,29 @@ export interface TesseractPluginOptions {
|
|
|
104
106
|
packageVersion?: string;
|
|
105
107
|
/** `'functional'` (default) or `'class'` (Resend-style `new MySDK('key')`). */
|
|
106
108
|
sdkStyle?: 'functional' | 'class';
|
|
109
|
+
/**
|
|
110
|
+
* Additional SDK targets to generate alongside the primary output.
|
|
111
|
+
*
|
|
112
|
+
* Each entry runs a full generation pass with its own language adapter and
|
|
113
|
+
* output directory. The primary SDK is unaffected.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* app.register(tesseractPlugin, {
|
|
118
|
+
* info: { title: 'My API', version: '1.0.0', baseUrl: 'https://api.example.com' },
|
|
119
|
+
* output: './packages/api-sdk',
|
|
120
|
+
* additionalTargets: [
|
|
121
|
+
* { language: 'kotlin', output: './sdk/java' },
|
|
122
|
+
* { language: 'python', output: './sdk/python', packageName: 'my-api' },
|
|
123
|
+
* ],
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
additionalTargets?: CollectorOptions['additionalTargets'];
|
|
128
|
+
/**
|
|
129
|
+
* Target SDK language. Defaults to `'typescript'` when omitted.
|
|
130
|
+
*/
|
|
131
|
+
language?: TargetLanguage;
|
|
107
132
|
}
|
|
108
133
|
/**
|
|
109
134
|
* Declare SDK domain metadata for the current Fastify plugin scope.
|
package/dist/fastify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOvD,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,YAAY;QACpB,wEAAwE;QACxE,GAAG,CAAC,EAAE,cAAc,CAAC;KACtB;IACD,UAAU,qBAAqB;QAC7B,wEAAwE;QACxE,GAAG,CA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AG,CAAC,MAAM,EAAE,OAAO,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAClD,2DAA2D;IAC3D,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AA8ND;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,4CAG1B,CAAC"}
|
package/dist/fastify.js
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import fp from 'fastify-plugin';
|
|
21
21
|
import { _domainRegistry } from './types/sdk-module.js';
|
|
22
|
-
import { buildManifestFromRoutes } from './collector.js';
|
|
23
22
|
// ── Domain registration helper ────────────────────────────────────────────────
|
|
24
23
|
/**
|
|
25
24
|
* Declare SDK domain metadata for the current Fastify plugin scope.
|
|
@@ -216,20 +215,30 @@ const _tesseractPlugin = async (fastify, opts) => {
|
|
|
216
215
|
// zod not available — schemas stay as-is (JSON Schema passed directly)
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
|
-
|
|
218
|
+
// Build a collector from the resolved routes so we can delegate to
|
|
219
|
+
// collector.generate() — this gives us additionalTargets support for free.
|
|
220
|
+
const { SDKCollector } = await import('./collector.js');
|
|
221
|
+
const collector = new SDKCollector({
|
|
222
|
+
info: opts.info,
|
|
223
|
+
output: opts.output,
|
|
224
|
+
language: opts.language,
|
|
225
|
+
schemaPackage: opts.schemaPackage,
|
|
226
|
+
clientType: opts.clientType,
|
|
227
|
+
packageName: opts.packageName,
|
|
228
|
+
packageVersion: opts.packageVersion,
|
|
229
|
+
sdkStyle: opts.sdkStyle,
|
|
230
|
+
additionalTargets: opts.additionalTargets,
|
|
231
|
+
});
|
|
232
|
+
for (const [prefix, domainConfig] of _domainRegistry) {
|
|
233
|
+
collector.domain(prefix, domainConfig);
|
|
234
|
+
}
|
|
235
|
+
for (const r of resolvedRoutes) {
|
|
236
|
+
collector.route(r.url, r.method, { sdk: r.sdk, schema: r.schema, sse: r.sse });
|
|
237
|
+
}
|
|
238
|
+
const manifest = collector.buildManifest();
|
|
220
239
|
console.log(`\n[tesseract] ${manifest.domains.length} domain(s), ${collectedRoutes.length} route(s) → ${opts.output}`);
|
|
221
|
-
// Dynamic import keeps the generation pipeline out of the user's app bundle
|
|
222
|
-
// when TESSERACT_GENERATE is not set (the plugin returns early above).
|
|
223
240
|
try {
|
|
224
|
-
const
|
|
225
|
-
const result = await generate({
|
|
226
|
-
manifest,
|
|
227
|
-
output: opts.output,
|
|
228
|
-
clientType: opts.clientType,
|
|
229
|
-
packageName: opts.packageName,
|
|
230
|
-
packageVersion: opts.packageVersion,
|
|
231
|
-
sdkStyle: opts.sdkStyle,
|
|
232
|
-
});
|
|
241
|
+
const result = await collector.generate();
|
|
233
242
|
for (const w of result.warnings) {
|
|
234
243
|
console.warn(` ⚠ ${w}`);
|
|
235
244
|
}
|
package/dist/fastify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAMhC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA+HxD,iFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,SAAS,CACvB,OAAwB,EACxB,MAA6D;IAE7D,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC;IACtD,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;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