@hey-api/openapi-ts 0.68.1 → 0.69.1

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.
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
2
- import { c as Config, I as IR, W as WatchValues } from './types.d-Il3OF6kK.cjs';
3
- export { i as initConfigs } from './types.d-Il3OF6kK.cjs';
2
+ import { c as Config, I as IR, W as WatchValues } from './types.d-DewPnfre.cjs';
3
+ export { i as initConfigs } from './types.d-DewPnfre.cjs';
4
4
  import 'node:fs';
5
5
  import 'typescript';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
2
- import { c as Config, I as IR, W as WatchValues } from './types.d-Il3OF6kK.js';
3
- export { i as initConfigs } from './types.d-Il3OF6kK.js';
2
+ import { c as Config, I as IR, W as WatchValues } from './types.d-DewPnfre.js';
3
+ export { i as initConfigs } from './types.d-DewPnfre.js';
4
4
  import 'node:fs';
5
5
  import 'typescript';
6
6
 
package/dist/internal.js CHANGED
@@ -1,2 +1,2 @@
1
- import {createRequire}from'module';export{o as getSpec,x as initConfigs,r as parseOpenApiSpec}from'./chunk-TUGP7QO5.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
1
+ import {createRequire}from'module';export{o as getSpec,x as initConfigs,r as parseOpenApiSpec}from'./chunk-QYTRELTS.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
2
2
  //# sourceMappingURL=internal.js.map
@@ -6666,17 +6666,21 @@ interface Config$c extends Plugin.Name<'@hey-api/schemas'> {
6666
6666
  * Customise the schema name. By default, `{{name}}Schema` is used. `name` is a
6667
6667
  * valid JavaScript/TypeScript identifier, e.g. if your schema name is
6668
6668
  * "Foo-Bar", `name` value would be "FooBar".
6669
+ *
6670
+ * @default '{{name}}Schema'
6669
6671
  */
6670
- nameBuilder?: (
6671
- name: string,
6672
- schema:
6673
- | OpenApiSchema
6674
- | OpenApiSchema$1
6675
- | SchemaObject$1
6676
- | ReferenceObject
6677
- | SchemaObject
6678
- | SchemaObject$2,
6679
- ) => string;
6672
+ nameBuilder?:
6673
+ | string
6674
+ | ((
6675
+ name: string,
6676
+ schema:
6677
+ | OpenApiSchema
6678
+ | OpenApiSchema$1
6679
+ | SchemaObject$1
6680
+ | ReferenceObject
6681
+ | SchemaObject
6682
+ | SchemaObject$2,
6683
+ ) => string);
6680
6684
  /**
6681
6685
  * Name of the generated file.
6682
6686
  *
@@ -6764,7 +6768,7 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6764
6768
  *
6765
6769
  * @default '{{name}}Service'
6766
6770
  */
6767
- serviceNameBuilder?: string;
6771
+ serviceNameBuilder?: string | ((name: string) => string);
6768
6772
  /**
6769
6773
  * Transform response data before returning. This is useful if you want to
6770
6774
  * convert for example ISO strings into Date objects. However, transformation
@@ -7889,6 +7893,12 @@ declare class IRContext<Spec extends Record<string, any> = any> {
7889
7893
  * to the newly created file.
7890
7894
  */
7891
7895
  createFile(file: ContextFile): TypeScriptFile;
7896
+ /**
7897
+ * Returns a resolved and dereferenced schema from `spec`.
7898
+ */
7899
+ dereference<T>(schema: {
7900
+ $ref: string;
7901
+ }): T;
7892
7902
  /**
7893
7903
  * Returns a specific file by ID from `files`.
7894
7904
  */
@@ -6666,17 +6666,21 @@ interface Config$c extends Plugin.Name<'@hey-api/schemas'> {
6666
6666
  * Customise the schema name. By default, `{{name}}Schema` is used. `name` is a
6667
6667
  * valid JavaScript/TypeScript identifier, e.g. if your schema name is
6668
6668
  * "Foo-Bar", `name` value would be "FooBar".
6669
+ *
6670
+ * @default '{{name}}Schema'
6669
6671
  */
6670
- nameBuilder?: (
6671
- name: string,
6672
- schema:
6673
- | OpenApiSchema
6674
- | OpenApiSchema$1
6675
- | SchemaObject$1
6676
- | ReferenceObject
6677
- | SchemaObject
6678
- | SchemaObject$2,
6679
- ) => string;
6672
+ nameBuilder?:
6673
+ | string
6674
+ | ((
6675
+ name: string,
6676
+ schema:
6677
+ | OpenApiSchema
6678
+ | OpenApiSchema$1
6679
+ | SchemaObject$1
6680
+ | ReferenceObject
6681
+ | SchemaObject
6682
+ | SchemaObject$2,
6683
+ ) => string);
6680
6684
  /**
6681
6685
  * Name of the generated file.
6682
6686
  *
@@ -6764,7 +6768,7 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6764
6768
  *
6765
6769
  * @default '{{name}}Service'
6766
6770
  */
6767
- serviceNameBuilder?: string;
6771
+ serviceNameBuilder?: string | ((name: string) => string);
6768
6772
  /**
6769
6773
  * Transform response data before returning. This is useful if you want to
6770
6774
  * convert for example ISO strings into Date objects. However, transformation
@@ -7889,6 +7893,12 @@ declare class IRContext<Spec extends Record<string, any> = any> {
7889
7893
  * to the newly created file.
7890
7894
  */
7891
7895
  createFile(file: ContextFile): TypeScriptFile;
7896
+ /**
7897
+ * Returns a resolved and dereferenced schema from `spec`.
7898
+ */
7899
+ dereference<T>(schema: {
7900
+ $ref: string;
7901
+ }): T;
7892
7902
  /**
7893
7903
  * Returns a specific file by ID from `files`.
7894
7904
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hey-api/openapi-ts",
3
- "version": "0.68.1",
3
+ "version": "0.69.1",
4
4
  "description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.",
5
5
  "homepage": "https://heyapi.dev/",
6
6
  "repository": {
@@ -97,8 +97,8 @@
97
97
  "ts-node": "10.9.2",
98
98
  "tslib": "2.8.1",
99
99
  "typescript": "5.8.3",
100
- "@hey-api/client-core": "0.1.4",
101
- "@config/vite-base": "0.0.1"
100
+ "@config/vite-base": "0.0.1",
101
+ "@hey-api/client-core": "0.1.4"
102
102
  },
103
103
  "scripts": {
104
104
  "build": "tsup && pnpm check-exports",