@hey-api/openapi-ts 0.52.11 → 0.53.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/LICENSE.md +110 -0
- package/bin/index.cjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.ts +75 -5
- package/package.json +7 -6
- package/LICENSE +0 -21
package/dist/node/index.d.ts
CHANGED
|
@@ -5,12 +5,77 @@ interface Dictionary<T = unknown> {
|
|
|
5
5
|
[key: string]: T;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#external-documentation-object
|
|
10
|
+
*/
|
|
11
|
+
interface OpenApiExternalDocs$1 {
|
|
12
|
+
description?: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
interface WithEnumExtension {
|
|
9
17
|
'x-enum-descriptions'?: ReadonlyArray<string>;
|
|
10
18
|
'x-enum-varnames'?: ReadonlyArray<string>;
|
|
11
19
|
'x-enumNames'?: ReadonlyArray<string>;
|
|
12
20
|
}
|
|
13
21
|
|
|
22
|
+
interface WithNullableExtension {
|
|
23
|
+
'x-nullable'?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#reference-object
|
|
28
|
+
*/
|
|
29
|
+
interface OpenApiReference$1 {
|
|
30
|
+
$ref?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#xml-object
|
|
35
|
+
*/
|
|
36
|
+
interface OpenApiXml$1 {
|
|
37
|
+
attribute?: boolean;
|
|
38
|
+
name?: string;
|
|
39
|
+
namespace?: string;
|
|
40
|
+
prefix?: string;
|
|
41
|
+
wrapped?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#schema-object
|
|
46
|
+
*/
|
|
47
|
+
interface OpenApiSchema$1 extends OpenApiReference$1, WithEnumExtension, WithNullableExtension {
|
|
48
|
+
additionalProperties?: boolean | OpenApiSchema$1;
|
|
49
|
+
allOf?: OpenApiSchema$1[];
|
|
50
|
+
default?: unknown;
|
|
51
|
+
description?: string;
|
|
52
|
+
discriminator?: string;
|
|
53
|
+
enum?: (string | number)[];
|
|
54
|
+
example?: unknown;
|
|
55
|
+
exclusiveMaximum?: boolean;
|
|
56
|
+
exclusiveMinimum?: boolean;
|
|
57
|
+
externalDocs?: OpenApiExternalDocs$1;
|
|
58
|
+
format?: 'int32' | 'int64' | 'float' | 'double' | 'string' | 'boolean' | 'byte' | 'binary' | 'date' | 'date-time' | 'password';
|
|
59
|
+
items?: OpenApiSchema$1;
|
|
60
|
+
maxItems?: number;
|
|
61
|
+
maxLength?: number;
|
|
62
|
+
maxProperties?: number;
|
|
63
|
+
maximum?: number;
|
|
64
|
+
minItems?: number;
|
|
65
|
+
minLength?: number;
|
|
66
|
+
minProperties?: number;
|
|
67
|
+
minimum?: number;
|
|
68
|
+
multipleOf?: number;
|
|
69
|
+
pattern?: string;
|
|
70
|
+
properties?: Dictionary<OpenApiSchema$1>;
|
|
71
|
+
readOnly?: boolean;
|
|
72
|
+
required?: string[];
|
|
73
|
+
title?: string;
|
|
74
|
+
type?: string;
|
|
75
|
+
uniqueItems?: boolean;
|
|
76
|
+
xml?: OpenApiXml$1;
|
|
77
|
+
}
|
|
78
|
+
|
|
14
79
|
/**
|
|
15
80
|
* {@link} https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#external-documentation-object
|
|
16
81
|
*/
|
|
@@ -433,7 +498,7 @@ interface PluginTanStackVueQuery extends PluginDefinition {
|
|
|
433
498
|
|
|
434
499
|
type Plugins = PluginTanStackReactQuery | PluginTanStackSolidQuery | PluginTanStackSvelteQuery | PluginTanStackVueQuery;
|
|
435
500
|
|
|
436
|
-
type Client = '@hey-api/client-axios' | '@hey-api/client-fetch' | 'angular' | 'axios' | 'fetch' | 'node' | 'xhr' | '';
|
|
501
|
+
type Client = '@hey-api/client-axios' | '@hey-api/client-fetch' | 'legacy/angular' | 'legacy/axios' | 'legacy/fetch' | 'legacy/node' | 'legacy/xhr' | '';
|
|
437
502
|
interface ClientConfig {
|
|
438
503
|
/**
|
|
439
504
|
* Manually set base in OpenAPI config instead of inferring from server value
|
|
@@ -442,7 +507,6 @@ interface ClientConfig {
|
|
|
442
507
|
base?: string;
|
|
443
508
|
/**
|
|
444
509
|
* HTTP client to generate
|
|
445
|
-
* @default 'fetch'
|
|
446
510
|
*/
|
|
447
511
|
client?: Client | {
|
|
448
512
|
/**
|
|
@@ -457,7 +521,6 @@ interface ClientConfig {
|
|
|
457
521
|
bundle?: boolean;
|
|
458
522
|
/**
|
|
459
523
|
* HTTP client to generate
|
|
460
|
-
* @default 'fetch'
|
|
461
524
|
*/
|
|
462
525
|
name: Client;
|
|
463
526
|
};
|
|
@@ -533,6 +596,12 @@ interface ClientConfig {
|
|
|
533
596
|
* @default true
|
|
534
597
|
*/
|
|
535
598
|
export?: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* Customise the schema name. By default, `{{name}}Schema` is used. `name` is a
|
|
601
|
+
* valid JavaScript/TypeScript identifier, e.g. if your schema name is
|
|
602
|
+
* "Foo-Bar", `name` value would be "FooBar".
|
|
603
|
+
*/
|
|
604
|
+
name?: (name: string, schema: OpenApiSchema$1 | OpenApiSchema) => string;
|
|
536
605
|
/**
|
|
537
606
|
* Choose schema type to generate. Select 'form' if you don't want
|
|
538
607
|
* descriptions to reduce bundle size and you plan to use schemas
|
|
@@ -577,7 +646,7 @@ interface ClientConfig {
|
|
|
577
646
|
*/
|
|
578
647
|
include?: string;
|
|
579
648
|
/**
|
|
580
|
-
* Customise the
|
|
649
|
+
* Customise the name of methods within the service. By default, {@link Operation.name} is used.
|
|
581
650
|
*/
|
|
582
651
|
methodNameBuilder?: (operation: Operation) => string;
|
|
583
652
|
/**
|
|
@@ -642,7 +711,8 @@ interface ClientConfig {
|
|
|
642
711
|
*/
|
|
643
712
|
useOptions?: boolean;
|
|
644
713
|
}
|
|
645
|
-
|
|
714
|
+
interface UserConfig extends ClientConfig {
|
|
715
|
+
}
|
|
646
716
|
type Config = Omit<Required<ClientConfig>, 'base' | 'client' | 'name' | 'output' | 'plugins' | 'request' | 'schemas' | 'services' | 'types'> & Pick<ClientConfig, 'base' | 'name' | 'request'> & {
|
|
647
717
|
client: Extract<Required<ClientConfig>['client'], object>;
|
|
648
718
|
output: Extract<Required<ClientConfig>['output'], object>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hey-api/openapi-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Turn your OpenAPI specification into a beautiful TypeScript client",
|
|
6
6
|
"homepage": "https://heyapi.vercel.app/",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"bin",
|
|
39
|
-
"dist"
|
|
39
|
+
"dist",
|
|
40
|
+
"LICENSE.md"
|
|
40
41
|
],
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": "^18.0.0 || >=20.0.0"
|
|
@@ -64,13 +65,13 @@
|
|
|
64
65
|
"@angular/router": "17.3.9",
|
|
65
66
|
"@rollup/plugin-json": "6.1.0",
|
|
66
67
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
67
|
-
"@tanstack/react-query": "5.
|
|
68
|
+
"@tanstack/react-query": "5.53.2",
|
|
68
69
|
"@tanstack/solid-query": "5.51.21",
|
|
69
|
-
"@tanstack/svelte-query": "5.
|
|
70
|
-
"@tanstack/vue-query": "5.
|
|
70
|
+
"@tanstack/svelte-query": "5.53.2",
|
|
71
|
+
"@tanstack/vue-query": "5.53.2",
|
|
71
72
|
"@types/cross-spawn": "6.0.6",
|
|
72
73
|
"@types/express": "4.17.21",
|
|
73
|
-
"axios": "1.7.
|
|
74
|
+
"axios": "1.7.7",
|
|
74
75
|
"cross-spawn": "7.0.3",
|
|
75
76
|
"eslint": "9.6.0",
|
|
76
77
|
"express": "4.19.2",
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Hey API
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|