@hey-api/openapi-ts 0.71.1 → 0.72.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.
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema } from '@hey-api/json-schema-ref-parser';
2
- import { e as Config, I as IR, W as WatchValues } from './types.d-1-e85tL8.cjs';
3
- export { i as initConfigs } from './types.d-1-e85tL8.cjs';
2
+ import { e as Config, I as IR, W as WatchValues } from './types.d-DMy4lDbN.cjs';
3
+ export { i as initConfigs } from './types.d-DMy4lDbN.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 { e as Config, I as IR, W as WatchValues } from './types.d-1-e85tL8.js';
3
- export { i as initConfigs } from './types.d-1-e85tL8.js';
2
+ import { e as Config, I as IR, W as WatchValues } from './types.d-DMy4lDbN.js';
3
+ export { i as initConfigs } from './types.d-DMy4lDbN.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{p as getSpec,z as initConfigs,u as parseOpenApiSpec}from'./chunk-EZKCBI4J.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
1
+ import {createRequire}from'module';export{r as getSpec,F as initConfigs,A as parseOpenApiSpec}from'./chunk-LVVLHTNY.js';createRequire(import.meta.url);//# sourceMappingURL=internal.js.map
2
2
  //# sourceMappingURL=internal.js.map
@@ -6783,6 +6783,14 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6783
6783
  * This option has no effect if `sdk.asClass` is `false`.
6784
6784
  */
6785
6785
  classNameBuilder?: string | ((name: string) => string);
6786
+ /**
6787
+ * How should we structure your SDK? By default, we try to infer the ideal
6788
+ * structure using `operationId` keywords. If you prefer a flatter structure,
6789
+ * you can set `classStructure` to `off` to disable this behavior.
6790
+ *
6791
+ * @default 'auto'
6792
+ */
6793
+ classStructure?: 'auto' | 'off';
6786
6794
  /**
6787
6795
  * Use an internal client instance to send HTTP requests? This is useful if
6788
6796
  * you don't want to manually pass the client to each SDK function.
@@ -6817,7 +6825,8 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6817
6825
  */
6818
6826
  instance?: string | boolean;
6819
6827
  /**
6820
- * Customise the name of methods within the service. By default, {@link IR.OperationObject.id} or {@link Operation.name} is used.
6828
+ * Customise the name of methods within the service. By default,
6829
+ * {@link IR.OperationObject.id} or {@link Operation.name} is used.
6821
6830
  */
6822
6831
  methodNameBuilder?: (operation: IR.OperationObject | Operation) => string;
6823
6832
  // TODO: parser - rename operationId option to something like inferId?: boolean
@@ -8070,7 +8079,7 @@ declare class IRContext<Spec extends Record<string, any> = any> {
8070
8079
  /**
8071
8080
  * Register a new `event` listener.
8072
8081
  */
8073
- subscribe<T extends keyof Events>(event: T, callbackFn: Events[T]): void;
8082
+ subscribe<T extends keyof Events>(event: T, callbackFn: Events[T], pluginName?: string): void;
8074
8083
  }
8075
8084
 
8076
8085
  type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params' | 'octet-stream';
@@ -8099,6 +8108,7 @@ interface IROperationObject {
8099
8108
  description?: string;
8100
8109
  id: string;
8101
8110
  method: keyof IRPathItemObject;
8111
+ operationId?: string;
8102
8112
  parameters?: IRParametersObject;
8103
8113
  path: keyof IRPathsObject;
8104
8114
  responses?: IRResponsesObject;
@@ -8245,6 +8255,13 @@ interface IRSchemaObject
8245
8255
  * When type is `object`, `properties` will contain a map of its properties.
8246
8256
  */
8247
8257
  properties?: Record<string, IRSchemaObject>;
8258
+ /**
8259
+ * The names of `properties` can be validated against a schema, irrespective
8260
+ * of their values. This can be useful if you don't want to enforce specific
8261
+ * properties, but you want to make sure that the names of those properties
8262
+ * follow a specific convention.
8263
+ */
8264
+ propertyNames?: IRSchemaObject;
8248
8265
  /**
8249
8266
  * Each schema eventually resolves into `type`.
8250
8267
  */
@@ -6783,6 +6783,14 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6783
6783
  * This option has no effect if `sdk.asClass` is `false`.
6784
6784
  */
6785
6785
  classNameBuilder?: string | ((name: string) => string);
6786
+ /**
6787
+ * How should we structure your SDK? By default, we try to infer the ideal
6788
+ * structure using `operationId` keywords. If you prefer a flatter structure,
6789
+ * you can set `classStructure` to `off` to disable this behavior.
6790
+ *
6791
+ * @default 'auto'
6792
+ */
6793
+ classStructure?: 'auto' | 'off';
6786
6794
  /**
6787
6795
  * Use an internal client instance to send HTTP requests? This is useful if
6788
6796
  * you don't want to manually pass the client to each SDK function.
@@ -6817,7 +6825,8 @@ interface Config$b extends Plugin.Name<'@hey-api/sdk'> {
6817
6825
  */
6818
6826
  instance?: string | boolean;
6819
6827
  /**
6820
- * Customise the name of methods within the service. By default, {@link IR.OperationObject.id} or {@link Operation.name} is used.
6828
+ * Customise the name of methods within the service. By default,
6829
+ * {@link IR.OperationObject.id} or {@link Operation.name} is used.
6821
6830
  */
6822
6831
  methodNameBuilder?: (operation: IR.OperationObject | Operation) => string;
6823
6832
  // TODO: parser - rename operationId option to something like inferId?: boolean
@@ -8070,7 +8079,7 @@ declare class IRContext<Spec extends Record<string, any> = any> {
8070
8079
  /**
8071
8080
  * Register a new `event` listener.
8072
8081
  */
8073
- subscribe<T extends keyof Events>(event: T, callbackFn: Events[T]): void;
8082
+ subscribe<T extends keyof Events>(event: T, callbackFn: Events[T], pluginName?: string): void;
8074
8083
  }
8075
8084
 
8076
8085
  type IRMediaType = 'form-data' | 'json' | 'text' | 'url-search-params' | 'octet-stream';
@@ -8099,6 +8108,7 @@ interface IROperationObject {
8099
8108
  description?: string;
8100
8109
  id: string;
8101
8110
  method: keyof IRPathItemObject;
8111
+ operationId?: string;
8102
8112
  parameters?: IRParametersObject;
8103
8113
  path: keyof IRPathsObject;
8104
8114
  responses?: IRResponsesObject;
@@ -8245,6 +8255,13 @@ interface IRSchemaObject
8245
8255
  * When type is `object`, `properties` will contain a map of its properties.
8246
8256
  */
8247
8257
  properties?: Record<string, IRSchemaObject>;
8258
+ /**
8259
+ * The names of `properties` can be validated against a schema, irrespective
8260
+ * of their values. This can be useful if you don't want to enforce specific
8261
+ * properties, but you want to make sure that the names of those properties
8262
+ * follow a specific convention.
8263
+ */
8264
+ propertyNames?: IRSchemaObject;
8248
8265
  /**
8249
8266
  * Each schema eventually resolves into `type`.
8250
8267
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hey-api/openapi-ts",
3
- "version": "0.71.1",
3
+ "version": "0.72.0",
4
4
  "description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.",
5
5
  "homepage": "https://heyapi.dev/",
6
6
  "repository": {
@@ -81,7 +81,8 @@
81
81
  "c12": "2.0.1",
82
82
  "color-support": "1.1.3",
83
83
  "commander": "13.0.0",
84
- "handlebars": "4.7.8"
84
+ "handlebars": "4.7.8",
85
+ "open": "10.1.2"
85
86
  },
86
87
  "peerDependencies": {
87
88
  "typescript": "^5.5.3"
@@ -101,7 +102,7 @@
101
102
  "typescript": "5.8.3",
102
103
  "yaml": "2.8.0",
103
104
  "@config/vite-base": "0.0.1",
104
- "@hey-api/client-core": "0.1.4"
105
+ "@hey-api/client-core": "0.2.0"
105
106
  },
106
107
  "scripts": {
107
108
  "build": "tsup && pnpm check-exports",