@hey-api/openapi-ts 0.78.1 → 0.78.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4AJU36PO.js → chunk-YJGQGZQU.js} +11 -11
- package/dist/chunk-YJGQGZQU.js.map +1 -0
- package/dist/index.cjs +54 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -4
- package/dist/index.d.ts +345 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +8 -8
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/{types.d-DtZlpeRE.d.cts → types.d-CaH9PF-K.d.cts} +40 -8
- package/dist/{types.d-DtZlpeRE.d.ts → types.d-CaH9PF-K.d.ts} +40 -8
- package/package.json +1 -1
- package/dist/chunk-4AJU36PO.js.map +0 -1
package/dist/internal.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as Config, c as IR, U as UserConfig, W as WatchValues } from './types.d-CaH9PF-K.cjs';
|
|
2
2
|
import { JSONSchema } from '@hey-api/json-schema-ref-parser';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'typescript';
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as Config, c as IR, U as UserConfig, W as WatchValues } from './types.d-CaH9PF-K.js';
|
|
2
2
|
import { JSONSchema } from '@hey-api/json-schema-ref-parser';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'typescript';
|
package/dist/internal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {createRequire}from'module';export{I as getSpec,H as initConfigs,F as parseOpenApiSpec}from'./chunk-
|
|
1
|
+
import {createRequire}from'module';export{I as getSpec,H as initConfigs,F as parseOpenApiSpec}from'./chunk-YJGQGZQU.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
|
|
2
2
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import ts__default from 'typescript';
|
|
3
3
|
|
|
4
4
|
interface EnumExtensions {
|
|
5
5
|
/**
|
|
@@ -2499,6 +2499,27 @@ interface ImportExportItemObject {
|
|
|
2499
2499
|
asType?: boolean;
|
|
2500
2500
|
name: string;
|
|
2501
2501
|
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Print a TypeScript node to a string.
|
|
2504
|
+
* @param node the node to print
|
|
2505
|
+
* @returns string
|
|
2506
|
+
*/
|
|
2507
|
+
declare function tsNodeToString({ node, unescape, }: {
|
|
2508
|
+
node: ts__default.Node;
|
|
2509
|
+
unescape?: boolean;
|
|
2510
|
+
}): string;
|
|
2511
|
+
/**
|
|
2512
|
+
* Convert a string to a TypeScript Node
|
|
2513
|
+
* @param value the string to convert.
|
|
2514
|
+
* @returns ts.Node
|
|
2515
|
+
*/
|
|
2516
|
+
declare function stringToTsNodes(value: string): ts__default.Node;
|
|
2517
|
+
type CommentLines = Array<string | null | false | undefined>;
|
|
2518
|
+
type CommentObject = {
|
|
2519
|
+
jsdoc?: boolean;
|
|
2520
|
+
lines: CommentLines;
|
|
2521
|
+
};
|
|
2522
|
+
type Comments = CommentLines | Array<CommentObject>;
|
|
2502
2523
|
|
|
2503
2524
|
type StringCase =
|
|
2504
2525
|
| 'camelCase'
|
|
@@ -2588,7 +2609,7 @@ declare class TypeScriptFile {
|
|
|
2588
2609
|
identifierCase?: StringCase;
|
|
2589
2610
|
name: string;
|
|
2590
2611
|
});
|
|
2591
|
-
add(...nodes: Array<
|
|
2612
|
+
add(...nodes: Array<ts__default.Node | string>): void;
|
|
2592
2613
|
/**
|
|
2593
2614
|
* Prevents a specific identifier from being created. This is useful for
|
|
2594
2615
|
* transformers where we know a certain transformer won't be needed, and
|
|
@@ -2624,7 +2645,7 @@ declare class TypeScriptFile {
|
|
|
2624
2645
|
removeNode(): void;
|
|
2625
2646
|
private _setName;
|
|
2626
2647
|
private _toString;
|
|
2627
|
-
write(separator?: string, tsConfig?:
|
|
2648
|
+
write(separator?: string, tsConfig?: ts__default.ParsedCommandLine | null): void;
|
|
2628
2649
|
}
|
|
2629
2650
|
interface EnsureUniqueIdentifierData {
|
|
2630
2651
|
$ref: string;
|
|
@@ -8219,6 +8240,13 @@ type ResolvedConfig$8 = Plugin.Name<'@hey-api/sdk'> & {
|
|
|
8219
8240
|
|
|
8220
8241
|
type HeyApiSdkPlugin = DefinePlugin<Config$a, ResolvedConfig$8>;
|
|
8221
8242
|
|
|
8243
|
+
type ExpressionTransformer = ({ config, dataExpression, file, schema, }: {
|
|
8244
|
+
config: Omit<Config$9, 'name'>;
|
|
8245
|
+
dataExpression?: ts__default.Expression | string;
|
|
8246
|
+
file: TypeScriptFile;
|
|
8247
|
+
schema: IR.SchemaObject;
|
|
8248
|
+
}) => Array<ts__default.Expression> | undefined;
|
|
8249
|
+
|
|
8222
8250
|
type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
8223
8251
|
/**
|
|
8224
8252
|
* Convert long integers into BigInt values?
|
|
@@ -8245,6 +8273,10 @@ type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
|
8245
8273
|
* @default 'transformers'
|
|
8246
8274
|
*/
|
|
8247
8275
|
output?: string;
|
|
8276
|
+
/**
|
|
8277
|
+
* Custom transforms to apply to the generated code.
|
|
8278
|
+
*/
|
|
8279
|
+
transformers?: ReadonlyArray<ExpressionTransformer>;
|
|
8248
8280
|
};
|
|
8249
8281
|
|
|
8250
8282
|
type HeyApiTransformersPlugin = DefinePlugin<Config$9>;
|
|
@@ -9782,12 +9814,12 @@ type Api$1 = {
|
|
|
9782
9814
|
file: TypeScriptFile;
|
|
9783
9815
|
operation: IR.OperationObject;
|
|
9784
9816
|
plugin: ValibotPlugin['Instance'];
|
|
9785
|
-
}) =>
|
|
9817
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
9786
9818
|
createResponseValidator: (args: {
|
|
9787
9819
|
file: TypeScriptFile;
|
|
9788
9820
|
operation: IR.OperationObject;
|
|
9789
9821
|
plugin: ValibotPlugin['Instance'];
|
|
9790
|
-
}) =>
|
|
9822
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
9791
9823
|
};
|
|
9792
9824
|
|
|
9793
9825
|
type Config = Plugin.Name<'zod'> & {
|
|
@@ -10089,12 +10121,12 @@ type Api = {
|
|
|
10089
10121
|
file: TypeScriptFile;
|
|
10090
10122
|
operation: IR.OperationObject;
|
|
10091
10123
|
plugin: ZodPlugin['Instance'];
|
|
10092
|
-
}) =>
|
|
10124
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
10093
10125
|
createResponseValidator: (args: {
|
|
10094
10126
|
file: TypeScriptFile;
|
|
10095
10127
|
operation: IR.OperationObject;
|
|
10096
10128
|
plugin: ZodPlugin['Instance'];
|
|
10097
|
-
}) =>
|
|
10129
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
10098
10130
|
};
|
|
10099
10131
|
|
|
10100
10132
|
interface PluginConfigMap {
|
|
@@ -10457,4 +10489,4 @@ interface WatchValues {
|
|
|
10457
10489
|
lastValue?: string;
|
|
10458
10490
|
}
|
|
10459
10491
|
|
|
10460
|
-
export { type
|
|
10492
|
+
export { type Comments as C, type DefinePlugin as D, type ExpressionTransformer as E, type ImportExportItemObject as I, LegacyIR as L, OpenApi$3 as O, type PluginHandler as P, type StringCase as S, type UserConfig as U, type WatchValues as W, Plugin as a, type Client$1 as b, IR as c, OpenApiMetaObject as d, OpenApiOperationObject as e, OpenApiParameterObject as f, OpenApiRequestBodyObject as g, OpenApiResponseObject as h, OpenApiSchemaObject as i, Client as j, type Config$l as k, stringToTsNodes as s, tsNodeToString as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import
|
|
2
|
+
import ts__default from 'typescript';
|
|
3
3
|
|
|
4
4
|
interface EnumExtensions {
|
|
5
5
|
/**
|
|
@@ -2499,6 +2499,27 @@ interface ImportExportItemObject {
|
|
|
2499
2499
|
asType?: boolean;
|
|
2500
2500
|
name: string;
|
|
2501
2501
|
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Print a TypeScript node to a string.
|
|
2504
|
+
* @param node the node to print
|
|
2505
|
+
* @returns string
|
|
2506
|
+
*/
|
|
2507
|
+
declare function tsNodeToString({ node, unescape, }: {
|
|
2508
|
+
node: ts__default.Node;
|
|
2509
|
+
unescape?: boolean;
|
|
2510
|
+
}): string;
|
|
2511
|
+
/**
|
|
2512
|
+
* Convert a string to a TypeScript Node
|
|
2513
|
+
* @param value the string to convert.
|
|
2514
|
+
* @returns ts.Node
|
|
2515
|
+
*/
|
|
2516
|
+
declare function stringToTsNodes(value: string): ts__default.Node;
|
|
2517
|
+
type CommentLines = Array<string | null | false | undefined>;
|
|
2518
|
+
type CommentObject = {
|
|
2519
|
+
jsdoc?: boolean;
|
|
2520
|
+
lines: CommentLines;
|
|
2521
|
+
};
|
|
2522
|
+
type Comments = CommentLines | Array<CommentObject>;
|
|
2502
2523
|
|
|
2503
2524
|
type StringCase =
|
|
2504
2525
|
| 'camelCase'
|
|
@@ -2588,7 +2609,7 @@ declare class TypeScriptFile {
|
|
|
2588
2609
|
identifierCase?: StringCase;
|
|
2589
2610
|
name: string;
|
|
2590
2611
|
});
|
|
2591
|
-
add(...nodes: Array<
|
|
2612
|
+
add(...nodes: Array<ts__default.Node | string>): void;
|
|
2592
2613
|
/**
|
|
2593
2614
|
* Prevents a specific identifier from being created. This is useful for
|
|
2594
2615
|
* transformers where we know a certain transformer won't be needed, and
|
|
@@ -2624,7 +2645,7 @@ declare class TypeScriptFile {
|
|
|
2624
2645
|
removeNode(): void;
|
|
2625
2646
|
private _setName;
|
|
2626
2647
|
private _toString;
|
|
2627
|
-
write(separator?: string, tsConfig?:
|
|
2648
|
+
write(separator?: string, tsConfig?: ts__default.ParsedCommandLine | null): void;
|
|
2628
2649
|
}
|
|
2629
2650
|
interface EnsureUniqueIdentifierData {
|
|
2630
2651
|
$ref: string;
|
|
@@ -8219,6 +8240,13 @@ type ResolvedConfig$8 = Plugin.Name<'@hey-api/sdk'> & {
|
|
|
8219
8240
|
|
|
8220
8241
|
type HeyApiSdkPlugin = DefinePlugin<Config$a, ResolvedConfig$8>;
|
|
8221
8242
|
|
|
8243
|
+
type ExpressionTransformer = ({ config, dataExpression, file, schema, }: {
|
|
8244
|
+
config: Omit<Config$9, 'name'>;
|
|
8245
|
+
dataExpression?: ts__default.Expression | string;
|
|
8246
|
+
file: TypeScriptFile;
|
|
8247
|
+
schema: IR.SchemaObject;
|
|
8248
|
+
}) => Array<ts__default.Expression> | undefined;
|
|
8249
|
+
|
|
8222
8250
|
type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
8223
8251
|
/**
|
|
8224
8252
|
* Convert long integers into BigInt values?
|
|
@@ -8245,6 +8273,10 @@ type Config$9 = Plugin.Name<'@hey-api/transformers'> & {
|
|
|
8245
8273
|
* @default 'transformers'
|
|
8246
8274
|
*/
|
|
8247
8275
|
output?: string;
|
|
8276
|
+
/**
|
|
8277
|
+
* Custom transforms to apply to the generated code.
|
|
8278
|
+
*/
|
|
8279
|
+
transformers?: ReadonlyArray<ExpressionTransformer>;
|
|
8248
8280
|
};
|
|
8249
8281
|
|
|
8250
8282
|
type HeyApiTransformersPlugin = DefinePlugin<Config$9>;
|
|
@@ -9782,12 +9814,12 @@ type Api$1 = {
|
|
|
9782
9814
|
file: TypeScriptFile;
|
|
9783
9815
|
operation: IR.OperationObject;
|
|
9784
9816
|
plugin: ValibotPlugin['Instance'];
|
|
9785
|
-
}) =>
|
|
9817
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
9786
9818
|
createResponseValidator: (args: {
|
|
9787
9819
|
file: TypeScriptFile;
|
|
9788
9820
|
operation: IR.OperationObject;
|
|
9789
9821
|
plugin: ValibotPlugin['Instance'];
|
|
9790
|
-
}) =>
|
|
9822
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
9791
9823
|
};
|
|
9792
9824
|
|
|
9793
9825
|
type Config = Plugin.Name<'zod'> & {
|
|
@@ -10089,12 +10121,12 @@ type Api = {
|
|
|
10089
10121
|
file: TypeScriptFile;
|
|
10090
10122
|
operation: IR.OperationObject;
|
|
10091
10123
|
plugin: ZodPlugin['Instance'];
|
|
10092
|
-
}) =>
|
|
10124
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
10093
10125
|
createResponseValidator: (args: {
|
|
10094
10126
|
file: TypeScriptFile;
|
|
10095
10127
|
operation: IR.OperationObject;
|
|
10096
10128
|
plugin: ZodPlugin['Instance'];
|
|
10097
|
-
}) =>
|
|
10129
|
+
}) => ts__default.ArrowFunction | undefined;
|
|
10098
10130
|
};
|
|
10099
10131
|
|
|
10100
10132
|
interface PluginConfigMap {
|
|
@@ -10457,4 +10489,4 @@ interface WatchValues {
|
|
|
10457
10489
|
lastValue?: string;
|
|
10458
10490
|
}
|
|
10459
10491
|
|
|
10460
|
-
export { type
|
|
10492
|
+
export { type Comments as C, type DefinePlugin as D, type ExpressionTransformer as E, type ImportExportItemObject as I, LegacyIR as L, OpenApi$3 as O, type PluginHandler as P, type StringCase as S, type UserConfig as U, type WatchValues as W, Plugin as a, type Client$1 as b, IR as c, OpenApiMetaObject as d, OpenApiOperationObject as e, OpenApiParameterObject as f, OpenApiRequestBodyObject as g, OpenApiResponseObject as h, OpenApiSchemaObject as i, Client as j, type Config$l as k, stringToTsNodes as s, tsNodeToString as t };
|