fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'main' of https://github.com/hey-api/openapi-ts into feat/zod-4

Lubos ad17c246 669824b1

+201 -18
+1
docs/partials/contributors-list.md
··· 1 1 - [Alessandro](https://github.com/ale18V) 2 2 - [Alex Sarychev](https://github.com/Freddis) 3 + - [Alex Vukadinov](https://github.com/alexvuka1) 3 4 - [Alex Yang](https://github.com/himself65) 4 5 - [Alexander Horner](https://github.com/alexanderhorner) 5 6 - [Alexander Skvortcov](https://github.com/askvortcov)
+5 -1
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/types.gen.ts
··· 3 3 export type Foo = { 4 4 bar?: number; 5 5 foo: bigint; 6 - id: string; 6 + id: UserId; 7 7 }; 8 8 9 9 export type Bar = { ··· 26 26 }; 27 27 28 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type TypeID<T extends string> = `${T}_${string}`; 31 + 32 + export type UserId = TypeID<'user'>; 29 33 30 34 export type ClientOptions = { 31 35 baseUrl: string;
+5 -1
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/types.gen.ts
··· 3 3 export type Foo = { 4 4 bar?: number; 5 5 foo: bigint; 6 - id: string; 6 + id: UserId; 7 7 }; 8 8 9 9 export type Bar = { ··· 26 26 }; 27 27 28 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type TypeID<T extends string> = `${T}_${string}`; 31 + 32 + export type UserId = TypeID<'user'>; 29 33 30 34 export type ClientOptions = { 31 35 baseUrl: string;
+5 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/types.gen.ts
··· 3 3 export type Foo = { 4 4 bar?: number; 5 5 foo: bigint; 6 - id: string; 6 + id: UserId; 7 7 }; 8 8 9 9 export type Bar = { ··· 26 26 }; 27 27 28 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type TypeID<T extends string> = `${T}_${string}`; 31 + 32 + export type UserId = TypeID<'user'>; 29 33 30 34 export type ClientOptions = { 31 35 baseUrl: `${string}://${string}` | (string & {});
+5 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/types.gen.ts
··· 3 3 export type Foo = { 4 4 bar?: number; 5 5 foo: bigint; 6 - id: string; 6 + id: UserId; 7 7 }; 8 8 9 9 export type Bar = { ··· 26 26 }; 27 27 28 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type TypeID<T extends string> = `${T}_${string}`; 31 + 32 + export type UserId = TypeID<'user'>; 29 33 30 34 export type ClientOptions = { 31 35 baseUrl: `${string}://${string}` | (string & {});
+5 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/types.gen.ts
··· 3 3 export type Foo = { 4 4 bar?: number; 5 5 foo: bigint; 6 - id: string; 6 + id: UserId; 7 7 }; 8 8 9 9 export type Bar = { ··· 26 26 }; 27 27 28 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type TypeID<T extends string> = `${T}_${string}`; 31 + 32 + export type UserId = TypeID<'user'>; 29 33 30 34 export type ClientOptions = { 31 35 baseUrl: `${string}://${string}` | (string & {});
+5 -1
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/types.gen.ts
··· 3 3 export type Foo = { 4 4 bar?: number; 5 5 foo: bigint; 6 - id: string; 6 + id: UserId; 7 7 }; 8 8 9 9 export type Bar = { ··· 26 26 }; 27 27 28 28 export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type TypeID<T extends string> = `${T}_${string}`; 31 + 32 + export type UserId = TypeID<'user'>; 29 33 30 34 export type ClientOptions = { 31 35 baseUrl: `${string}://${string}` | (string & {});
+2
packages/openapi-ts-tests/specs/2.0.x/type-format.yaml
··· 24 24 type: integer 25 25 id: 26 26 type: string 27 + format: typeid 28 + example: 'user_123' 27 29 required: 28 30 - id 29 31 - foo
+2
packages/openapi-ts-tests/specs/3.0.x/type-format.yaml
··· 25 25 type: integer 26 26 id: 27 27 type: string 28 + format: typeid 29 + example: 'user_123' 28 30 required: 29 31 - id 30 32 - foo
+2
packages/openapi-ts-tests/specs/3.1.x/type-format.yaml
··· 25 25 type: integer 26 26 id: 27 27 type: string 28 + format: typeid 29 + example: 'user_123' 28 30 required: 29 31 - id 30 32 - foo
+8
packages/openapi-ts/CHANGELOG.md
··· 1 1 # @hey-api/openapi-ts 2 2 3 + ## 0.79.2 4 + 5 + ### Patch Changes 6 + 7 + - [#2034](https://github.com/hey-api/openapi-ts/pull/2034) [`257dd07`](https://github.com/hey-api/openapi-ts/commit/257dd0711f81221c49d26dc57c079f1ae956ca6e) Thanks [@Le0Developer](https://github.com/Le0Developer)! - fix(typescript): add support for TypeID types 8 + 9 + - [#2041](https://github.com/hey-api/openapi-ts/pull/2041) [`2755be9`](https://github.com/hey-api/openapi-ts/commit/2755be939376227969d2b216f556666cef67f01a) Thanks [@alexvuka1](https://github.com/alexvuka1)! - fix(parser): respect `output.case` when generating operation id 10 + 3 11 ## 0.79.1 4 12 5 13 ### Patch Changes
+1 -1
packages/openapi-ts/package.json
··· 1 1 { 2 2 "name": "@hey-api/openapi-ts", 3 - "version": "0.79.1", 3 + "version": "0.79.2", 4 4 "description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.", 5 5 "homepage": "https://heyapi.dev/", 6 6 "repository": {
+1
packages/openapi-ts/src/ir/types.d.ts
··· 139 139 | 'pattern' 140 140 | 'required' 141 141 | 'title' 142 + | 'example' 142 143 > { 143 144 /** 144 145 * If the schema is intended to be used as an object property, it can be
+4
packages/openapi-ts/src/openApi/2.0.x/parser/schema.ts
··· 34 34 irSchema: IR.SchemaObject; 35 35 schema: SchemaObject; 36 36 }) => { 37 + if (schema.example) { 38 + irSchema.example = schema.example; 39 + } 40 + 37 41 if (schema.description) { 38 42 irSchema.description = schema.description; 39 43 }
+4
packages/openapi-ts/src/openApi/3.0.x/parser/schema.ts
··· 38 38 irSchema.deprecated = schema.deprecated; 39 39 } 40 40 41 + if (schema.example) { 42 + irSchema.example = schema.example; 43 + } 44 + 41 45 if (schema.description) { 42 46 irSchema.description = schema.description; 43 47 }
+4
packages/openapi-ts/src/openApi/3.1.x/parser/schema.ts
··· 41 41 irSchema.deprecated = schema.deprecated; 42 42 } 43 43 44 + if (schema.example) { 45 + irSchema.example = schema.example; 46 + } 47 + 44 48 if (schema.description) { 45 49 irSchema.description = schema.description; 46 50 }
+7 -2
packages/openapi-ts/src/openApi/shared/utils/operation.ts
··· 37 37 }): string => { 38 38 let result: string; 39 39 40 + const { output } = context.config; 41 + const targetCase = 42 + (output !== undefined && 'case' in output ? output.case : undefined) ?? 43 + 'camelCase'; 44 + 40 45 if ( 41 46 id && 42 47 (!context.config.plugins['@hey-api/sdk'] || 43 48 context.config.plugins['@hey-api/sdk'].config.operationId) 44 49 ) { 45 50 result = stringCase({ 46 - case: 'camelCase', 51 + case: targetCase, 47 52 value: sanitizeNamespaceIdentifier(id), 48 53 }); 49 54 } else { ··· 53 58 .replace(/[/:+]/g, '-'); 54 59 55 60 result = stringCase({ 56 - case: 'camelCase', 61 + case: targetCase, 57 62 value: `${method}-${pathWithoutPlaceholders}`, 58 63 }); 59 64 }
+7
packages/openapi-ts/src/plugins/@hey-api/sdk/operation.ts
··· 18 18 transformersId, 19 19 } from '../transformers/plugin'; 20 20 import { typesId } from '../typescript/ref'; 21 + import type { PluginState } from '../typescript/types'; 21 22 import { operationAuth } from './auth'; 22 23 import { nuxtTypeComposable, nuxtTypeDefault, sdkId } from './constants'; 23 24 import type { HeyApiSdkPlugin } from './types'; ··· 211 212 }; 212 213 213 214 const pluginTypeScript = plugin.getPlugin('@hey-api/typescript')!; 215 + const typescriptState: PluginState = { 216 + usedTypeIDs: new Set<string>(), 217 + }; 214 218 const client = getClientPlugin(plugin.context.config); 215 219 const isNuxtClient = client.name === '@hey-api/client-nuxt'; 216 220 ··· 243 247 }, 244 248 plugin: pluginTypeScript, 245 249 schema: parameter.schema, 250 + state: typescriptState, 246 251 }), 247 252 }); 248 253 } ··· 274 279 }, 275 280 plugin: pluginTypeScript, 276 281 schema: parameter.schema, 282 + state: typescriptState, 277 283 }), 278 284 }); 279 285 } ··· 300 306 }, 301 307 plugin: pluginTypeScript, 302 308 schema: operation.body.schema, 309 + state: typescriptState, 303 310 }), 304 311 }); 305 312 }
+9 -2
packages/openapi-ts/src/plugins/@hey-api/typescript/operation.ts
··· 7 7 import { buildName } from '../../../openApi/shared/utils/name'; 8 8 import { schemaToType } from './plugin'; 9 9 import { typesId } from './ref'; 10 - import type { HeyApiTypeScriptPlugin } from './types'; 10 + import type { HeyApiTypeScriptPlugin, PluginState } from './types'; 11 11 12 12 const irParametersToIrSchema = ({ 13 13 parameters, ··· 48 48 const operationToDataType = ({ 49 49 operation, 50 50 plugin, 51 + state, 51 52 }: { 52 53 operation: IR.OperationObject; 53 54 plugin: HeyApiTypeScriptPlugin['Instance']; 55 + state: PluginState; 54 56 }) => { 55 57 const file = plugin.context.file({ id: typesId })!; 56 58 const data: IR.SchemaObject = { ··· 138 140 onRef: undefined, 139 141 plugin, 140 142 schema: data, 143 + state, 141 144 }); 142 145 const node = compiler.typeAliasDeclaration({ 143 146 exportType: nodeInfo.exported, ··· 150 153 export const operationToType = ({ 151 154 operation, 152 155 plugin, 156 + state, 153 157 }: { 154 158 operation: IR.OperationObject; 155 159 plugin: HeyApiTypeScriptPlugin['Instance']; 160 + state: PluginState; 156 161 }) => { 157 - operationToDataType({ operation, plugin }); 162 + operationToDataType({ operation, plugin, state }); 158 163 159 164 const file = plugin.context.file({ id: typesId })!; 160 165 ··· 177 182 onRef: undefined, 178 183 plugin, 179 184 schema: errors, 185 + state, 180 186 }); 181 187 const node = compiler.typeAliasDeclaration({ 182 188 exportType: nodeInfo.exported, ··· 232 238 onRef: undefined, 233 239 plugin, 234 240 schema: responses, 241 + state, 235 242 }); 236 243 const node = compiler.typeAliasDeclaration({ 237 244 exportType: nodeInfo.exported,
+111 -7
packages/openapi-ts/src/plugins/@hey-api/typescript/plugin.ts
··· 4 4 import { compiler } from '../../../compiler'; 5 5 import { deduplicateSchema } from '../../../ir/schema'; 6 6 import type { IR } from '../../../ir/types'; 7 + import { ensureValidIdentifier } from '../../../openApi/shared/utils/identifier'; 7 8 import { buildName } from '../../../openApi/shared/utils/name'; 8 9 import { refToName } from '../../../utils/ref'; 9 10 import { numberRegExp } from '../../../utils/regexp'; ··· 13 14 import { createClientOptions } from './clientOptions'; 14 15 import { operationToType } from './operation'; 15 16 import { typesId } from './ref'; 16 - import type { HeyApiTypeScriptPlugin } from './types'; 17 + import type { HeyApiTypeScriptPlugin, PluginState } from './types'; 17 18 18 19 export type OnRef = (id: string) => void; 19 20 ··· 97 98 onRef, 98 99 plugin, 99 100 schema, 101 + state, 100 102 }: { 101 103 onRef: OnRef | undefined; 102 104 plugin: HeyApiTypeScriptPlugin['Instance']; 103 105 schema: SchemaWithType<'array'>; 106 + state: PluginState; 104 107 }): ts.TypeNode => { 105 108 if (!schema.items) { 106 109 return compiler.typeArrayNode( ··· 119 122 onRef, 120 123 plugin, 121 124 schema: item, 125 + state, 122 126 }); 123 127 itemTypes.push(type); 124 128 } ··· 156 160 onRef, 157 161 plugin, 158 162 schema, 163 + state, 159 164 }: { 160 165 onRef: OnRef | undefined; 161 166 plugin: HeyApiTypeScriptPlugin['Instance']; 162 167 schema: SchemaWithType<'enum'>; 168 + state: PluginState; 163 169 }): ts.TypeNode => { 164 170 const type = schemaToType({ 165 171 onRef, ··· 168 174 ...schema, 169 175 type: undefined, 170 176 }, 177 + state, 171 178 }); 172 179 return type; 173 180 }; ··· 201 208 onRef, 202 209 plugin, 203 210 schema, 211 + state, 204 212 }: { 205 213 onRef: OnRef | undefined; 206 214 plugin: HeyApiTypeScriptPlugin['Instance']; 207 215 schema: SchemaWithType<'object'>; 216 + state: PluginState; 208 217 }): ts.TypeNode => { 209 218 // TODO: parser - handle constants 210 219 let indexKey: ts.TypeReferenceNode | undefined; ··· 216 225 217 226 for (const name in schema.properties) { 218 227 const property = schema.properties[name]!; 219 - const propertyType = schemaToType({ onRef, plugin, schema: property }); 228 + const propertyType = schemaToType({ 229 + onRef, 230 + plugin, 231 + schema: property, 232 + state, 233 + }); 220 234 const isRequired = required.includes(name); 221 235 schemaProperties.push({ 222 236 comment: createSchemaComment({ schema: property }), ··· 261 275 items: indexPropertyItems, 262 276 logicalOperator: 'or', 263 277 }, 278 + state, 264 279 }), 265 280 }; 266 281 ··· 271 286 schema: { 272 287 $ref: schema.propertyNames.$ref, 273 288 }, 289 + state, 274 290 }) as ts.TypeReferenceNode; 275 291 } 276 292 } ··· 286 302 const stringTypeToIdentifier = ({ 287 303 plugin, 288 304 schema, 305 + state, 289 306 }: { 290 307 plugin: HeyApiTypeScriptPlugin['Instance']; 291 308 schema: SchemaWithType<'string'>; 309 + state: PluginState; 292 310 }): ts.TypeNode => { 293 311 if (schema.const !== undefined) { 294 312 return compiler.literalTypeNode({ ··· 316 334 return compiler.typeReferenceNode({ typeName: 'Date' }); 317 335 } 318 336 } 337 + 338 + if (schema.format === 'typeid' && typeof schema.example === 'string') { 339 + const parts = String(schema.example).split('_'); 340 + parts.pop(); // remove the ID part 341 + const type = parts.join('_'); 342 + state.usedTypeIDs.add(type); 343 + const typeName = ensureValidIdentifier( 344 + stringCase({ 345 + case: plugin.config.case, 346 + value: type + '_id', 347 + }), 348 + ); 349 + return compiler.typeReferenceNode({ 350 + typeName, 351 + }); 352 + } 319 353 } 320 354 321 355 return compiler.keywordTypeNode({ ··· 327 361 onRef, 328 362 plugin, 329 363 schema, 364 + state, 330 365 }: { 331 366 onRef: OnRef | undefined; 332 367 plugin: HeyApiTypeScriptPlugin['Instance']; 333 368 schema: SchemaWithType<'tuple'>; 369 + state: PluginState; 334 370 }): ts.TypeNode => { 335 371 let itemTypes: Array<ts.Expression | ts.TypeNode> = []; 336 372 ··· 345 381 onRef, 346 382 plugin, 347 383 schema: item, 384 + state, 348 385 }); 349 386 itemTypes.push(type); 350 387 } ··· 359 396 onRef, 360 397 plugin, 361 398 schema, 399 + state, 362 400 }: { 363 401 onRef: OnRef | undefined; 364 402 plugin: HeyApiTypeScriptPlugin['Instance']; 365 403 schema: IR.SchemaObject; 404 + state: PluginState; 366 405 }): ts.TypeNode => { 367 406 switch (schema.type as Required<IR.SchemaObject>['type']) { 368 407 case 'array': ··· 370 409 onRef, 371 410 plugin, 372 411 schema: schema as SchemaWithType<'array'>, 412 + state, 373 413 }); 374 414 case 'boolean': 375 415 return booleanTypeToIdentifier({ ··· 380 420 onRef, 381 421 plugin, 382 422 schema: schema as SchemaWithType<'enum'>, 423 + state, 383 424 }); 384 425 case 'integer': 385 426 case 'number': ··· 400 441 onRef, 401 442 plugin, 402 443 schema: schema as SchemaWithType<'object'>, 444 + state, 403 445 }); 404 446 case 'string': 405 447 return stringTypeToIdentifier({ 406 448 plugin, 407 449 schema: schema as SchemaWithType<'string'>, 450 + state, 408 451 }); 409 452 case 'tuple': 410 453 return tupleTypeToIdentifier({ 411 454 onRef, 412 455 plugin, 413 456 schema: schema as SchemaWithType<'tuple'>, 457 + state, 414 458 }); 415 459 case 'undefined': 416 460 return compiler.keywordTypeNode({ ··· 431 475 onRef, 432 476 plugin, 433 477 schema, 478 + state, 434 479 }: { 435 480 /** 436 481 * Callback that can be used to perform side-effects when we encounter a ··· 439 484 onRef: OnRef | undefined; 440 485 plugin: HeyApiTypeScriptPlugin['Instance']; 441 486 schema: IR.SchemaObject; 487 + state: PluginState; 442 488 }): ts.TypeNode => { 443 489 const file = plugin.context.file({ id: typesId })!; 444 490 ··· 451 497 } 452 498 453 499 if (schema.type) { 454 - return schemaTypeToIdentifier({ onRef, plugin, schema }); 500 + return schemaTypeToIdentifier({ onRef, plugin, schema, state }); 455 501 } 456 502 457 503 if (schema.items) { ··· 460 506 const itemTypes: Array<ts.TypeNode> = []; 461 507 462 508 for (const item of schema.items) { 463 - const type = schemaToType({ onRef, plugin, schema: item }); 509 + const type = schemaToType({ onRef, plugin, schema: item, state }); 464 510 itemTypes.push(type); 465 511 } 466 512 ··· 469 515 : compiler.typeUnionNode({ types: itemTypes }); 470 516 } 471 517 472 - return schemaToType({ onRef, plugin, schema }); 518 + return schemaToType({ onRef, plugin, schema, state }); 473 519 } 474 520 475 521 // catch-all fallback for failed schemas ··· 479 525 schema: { 480 526 type: 'unknown', 481 527 }, 528 + state, 482 529 }); 483 530 }; 484 531 ··· 571 618 id, 572 619 plugin, 573 620 schema, 621 + state, 574 622 }: { 575 623 id: string; 576 624 plugin: HeyApiTypeScriptPlugin['Instance']; 577 625 schema: IR.SchemaObject; 626 + state: PluginState; 578 627 }) => { 579 628 const file = plugin.context.file({ id: typesId })!; 580 - const type = schemaToType({ onRef: undefined, plugin, schema }); 629 + const type = schemaToType({ onRef: undefined, plugin, schema, state }); 581 630 const name = buildName({ 582 631 config: plugin.config.definitions, 583 632 name: refToName(id), ··· 595 644 }; 596 645 597 646 export const handler: HeyApiTypeScriptPlugin['Handler'] = ({ plugin }) => { 647 + const state: PluginState = { 648 + usedTypeIDs: new Set(), 649 + }; 650 + 598 651 const file = plugin.createFile({ 599 652 case: plugin.config.case, 600 653 id: typesId, ··· 626 679 'server', 627 680 (event) => { 628 681 if (event.type === 'operation') { 629 - operationToType({ operation: event.operation, plugin }); 682 + operationToType({ operation: event.operation, plugin, state }); 630 683 } else if (event.type === 'parameter') { 631 684 handleComponent({ 632 685 id: event.$ref, 633 686 plugin, 634 687 schema: event.parameter.schema, 688 + state, 635 689 }); 636 690 } else if (event.type === 'requestBody') { 637 691 handleComponent({ 638 692 id: event.$ref, 639 693 plugin, 640 694 schema: event.requestBody.schema, 695 + state, 641 696 }); 642 697 } else if (event.type === 'schema') { 643 698 handleComponent({ 644 699 id: event.$ref, 645 700 plugin, 646 701 schema: event.schema, 702 + state, 647 703 }); 648 704 } else if (event.type === 'server') { 649 705 servers.push(event.server); 650 706 } 651 707 }, 652 708 ); 709 + 710 + if (state.usedTypeIDs.size) { 711 + const typeParameter = compiler.typeParameterDeclaration({ 712 + constraint: compiler.keywordTypeNode({ 713 + keyword: 'string', 714 + }), 715 + name: 'T', 716 + }); 717 + const node = compiler.typeAliasDeclaration({ 718 + exportType: true, 719 + name: 'TypeID', 720 + type: compiler.templateLiteralType({ 721 + value: [ 722 + compiler.typeReferenceNode({ 723 + typeName: 'T', 724 + }), 725 + '_', 726 + compiler.keywordTypeNode({ 727 + keyword: 'string', 728 + }), 729 + ], 730 + }), 731 + typeParameters: [typeParameter], 732 + }); 733 + file.add(node); 734 + 735 + for (const name of state.usedTypeIDs.values()) { 736 + const typeName = ensureValidIdentifier( 737 + stringCase({ 738 + case: plugin.config.case, 739 + value: name + '_id', 740 + }), 741 + ); 742 + const node = compiler.typeAliasDeclaration({ 743 + exportType: true, 744 + name: typeName, 745 + type: compiler.typeReferenceNode({ 746 + typeArguments: [ 747 + compiler.literalTypeNode({ 748 + literal: compiler.stringLiteral({ text: name }), 749 + }), 750 + ], 751 + typeName: 'TypeID', 752 + }), 753 + }); 754 + file.add(node); 755 + } 756 + } 653 757 654 758 createClientOptions({ nodeInfo: clientOptionsNodeInfo, plugin, servers }); 655 759 };
+4
packages/openapi-ts/src/plugins/@hey-api/typescript/types.d.ts
··· 425 425 tree: boolean; 426 426 }; 427 427 428 + export interface PluginState { 429 + usedTypeIDs: Set<string>; 430 + } 431 + 428 432 export type HeyApiTypeScriptPlugin = DefinePlugin<UserConfig, Config, Api>;
+4
packages/openapi-ts/src/plugins/@tanstack/query-core/infiniteQueryOptions.ts
··· 295 295 const pluginTypeScript = plugin.getPlugin('@hey-api/typescript')!; 296 296 // TODO: parser - this is a bit clunky, need to compile type to string because 297 297 // `compiler.returnFunctionCall()` accepts only strings, should be cleaned up 298 + const typescriptState = { 299 + usedTypeIDs: new Set<string>(), 300 + }; 298 301 const type = pluginTypeScript.api.schemaToType({ 299 302 plugin: pluginTypeScript, 300 303 schema: pagination.schema, 304 + state: typescriptState, 301 305 }); 302 306 const typePageParam = `${tsNodeToString({ 303 307 node: type,