@hey-api/openapi-ts 0.56.3 → 0.57.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/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  type PluginNames =
2
2
  | '@hey-api/schemas'
3
- | '@hey-api/services'
3
+ | '@hey-api/sdk'
4
4
  | '@hey-api/transformers'
5
- | '@hey-api/types'
5
+ | '@hey-api/typescript'
6
6
  | '@tanstack/angular-query-experimental'
7
7
  | '@tanstack/react-query'
8
8
  | '@tanstack/solid-query'
@@ -3984,24 +3984,24 @@ interface IRSchemaObject
3984
3984
  | 'void';
3985
3985
  }
3986
3986
 
3987
- interface Config$9 extends PluginName<'@hey-api/services'> {
3987
+ interface Config$9 extends PluginName<'@hey-api/sdk'> {
3988
3988
  /**
3989
- * Group operation methods into service classes? When enabled, you can
3990
- * select which classes to export with `services.include` and/or
3991
- * transform their names with `services.name`.
3989
+ * Group operation methods into classes? When enabled, you can
3990
+ * select which classes to export with `sdk.include` and/or
3991
+ * transform their names with `sdk.serviceNameBuilder`.
3992
3992
  *
3993
- * Note that by enabling this option, your services will **NOT**
3993
+ * Note that by enabling this option, your SDKs will **NOT**
3994
3994
  * support {@link https://developer.mozilla.org/docs/Glossary/Tree_shaking tree-shaking}.
3995
3995
  * For this reason, it is disabled by default.
3996
3996
  * @default false
3997
3997
  */
3998
3998
  asClass?: boolean;
3999
3999
  /**
4000
- * Filter endpoints to be included in the generated services.
4001
- * The provided string should be a regular expression where matched
4002
- * results will be included in the output. The input pattern this
4003
- * string will be tested against is `{method} {path}`. For example,
4004
- * you can match `POST /api/v1/foo` with `^POST /api/v1/foo$`.
4000
+ * Filter endpoints to be included in the generated SDK. The provided
4001
+ * string should be a regular expression where matched results will be
4002
+ * included in the output. The input pattern this string will be tested
4003
+ * against is `{method} {path}`. For example, you can match
4004
+ * `POST /api/v1/foo` with `^POST /api/v1/foo$`.
4005
4005
  *
4006
4006
  * This option does not work with the experimental parser.
4007
4007
  *
@@ -4011,7 +4011,7 @@ interface Config$9 extends PluginName<'@hey-api/services'> {
4011
4011
  /**
4012
4012
  * Include only service classes with names matching regular expression
4013
4013
  *
4014
- * This option has no effect if `services.asClass` is `false`.
4014
+ * This option has no effect if `sdk.asClass` is `false`.
4015
4015
  */
4016
4016
  include?: string;
4017
4017
  /**
@@ -4026,7 +4026,7 @@ interface Config$9 extends PluginName<'@hey-api/services'> {
4026
4026
  operationId?: boolean;
4027
4027
  /**
4028
4028
  * Name of the generated file.
4029
- * @default 'services'
4029
+ * @default 'sdk'
4030
4030
  */
4031
4031
  output?: string;
4032
4032
  /**
@@ -4039,7 +4039,7 @@ interface Config$9 extends PluginName<'@hey-api/services'> {
4039
4039
  * Customize the generated service class names. The name variable is
4040
4040
  * obtained from your OpenAPI specification tags.
4041
4041
  *
4042
- * This option has no effect if `services.asClass` is `false`.
4042
+ * This option has no effect if `sdk.asClass` is `false`.
4043
4043
  * @default '{{name}}Service'
4044
4044
  */
4045
4045
  serviceNameBuilder?: string;
@@ -4058,12 +4058,25 @@ interface Config$8 extends PluginName<'@hey-api/transformers'> {
4058
4058
  output?: string;
4059
4059
  }
4060
4060
 
4061
- interface Config$7 extends PluginName<'@hey-api/types'> {
4061
+ interface Config$7 extends PluginName<'@hey-api/typescript'> {
4062
4062
  /**
4063
- * Generate enum definitions?
4063
+ * By default, enums are generated as TypeScript types. In addition to that,
4064
+ * you can choose to generate them as JavaScript objects, TypeScript enums,
4065
+ * or TypeScript enums contained within namespaces.
4064
4066
  * @default false
4065
4067
  */
4066
4068
  enums?: 'javascript' | 'typescript' | 'typescript+namespace' | false;
4069
+ /**
4070
+ * By default, inline enums (enums not defined as reusable components in
4071
+ * the input file) are generated as inlined union types. You can set
4072
+ * `exportInlineEnums` to `true` to treat inline enums as reusable components.
4073
+ * When `true`, the exported enums will follow the style defined in `enums`.
4074
+ *
4075
+ * This option works only with the experimental parser.
4076
+ *
4077
+ * @default false
4078
+ */
4079
+ exportInlineEnums?: boolean;
4067
4080
  /**
4068
4081
  * Include only types matching regular expression.
4069
4082
  *
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  type PluginNames =
2
2
  | '@hey-api/schemas'
3
- | '@hey-api/services'
3
+ | '@hey-api/sdk'
4
4
  | '@hey-api/transformers'
5
- | '@hey-api/types'
5
+ | '@hey-api/typescript'
6
6
  | '@tanstack/angular-query-experimental'
7
7
  | '@tanstack/react-query'
8
8
  | '@tanstack/solid-query'
@@ -3984,24 +3984,24 @@ interface IRSchemaObject
3984
3984
  | 'void';
3985
3985
  }
3986
3986
 
3987
- interface Config$9 extends PluginName<'@hey-api/services'> {
3987
+ interface Config$9 extends PluginName<'@hey-api/sdk'> {
3988
3988
  /**
3989
- * Group operation methods into service classes? When enabled, you can
3990
- * select which classes to export with `services.include` and/or
3991
- * transform their names with `services.name`.
3989
+ * Group operation methods into classes? When enabled, you can
3990
+ * select which classes to export with `sdk.include` and/or
3991
+ * transform their names with `sdk.serviceNameBuilder`.
3992
3992
  *
3993
- * Note that by enabling this option, your services will **NOT**
3993
+ * Note that by enabling this option, your SDKs will **NOT**
3994
3994
  * support {@link https://developer.mozilla.org/docs/Glossary/Tree_shaking tree-shaking}.
3995
3995
  * For this reason, it is disabled by default.
3996
3996
  * @default false
3997
3997
  */
3998
3998
  asClass?: boolean;
3999
3999
  /**
4000
- * Filter endpoints to be included in the generated services.
4001
- * The provided string should be a regular expression where matched
4002
- * results will be included in the output. The input pattern this
4003
- * string will be tested against is `{method} {path}`. For example,
4004
- * you can match `POST /api/v1/foo` with `^POST /api/v1/foo$`.
4000
+ * Filter endpoints to be included in the generated SDK. The provided
4001
+ * string should be a regular expression where matched results will be
4002
+ * included in the output. The input pattern this string will be tested
4003
+ * against is `{method} {path}`. For example, you can match
4004
+ * `POST /api/v1/foo` with `^POST /api/v1/foo$`.
4005
4005
  *
4006
4006
  * This option does not work with the experimental parser.
4007
4007
  *
@@ -4011,7 +4011,7 @@ interface Config$9 extends PluginName<'@hey-api/services'> {
4011
4011
  /**
4012
4012
  * Include only service classes with names matching regular expression
4013
4013
  *
4014
- * This option has no effect if `services.asClass` is `false`.
4014
+ * This option has no effect if `sdk.asClass` is `false`.
4015
4015
  */
4016
4016
  include?: string;
4017
4017
  /**
@@ -4026,7 +4026,7 @@ interface Config$9 extends PluginName<'@hey-api/services'> {
4026
4026
  operationId?: boolean;
4027
4027
  /**
4028
4028
  * Name of the generated file.
4029
- * @default 'services'
4029
+ * @default 'sdk'
4030
4030
  */
4031
4031
  output?: string;
4032
4032
  /**
@@ -4039,7 +4039,7 @@ interface Config$9 extends PluginName<'@hey-api/services'> {
4039
4039
  * Customize the generated service class names. The name variable is
4040
4040
  * obtained from your OpenAPI specification tags.
4041
4041
  *
4042
- * This option has no effect if `services.asClass` is `false`.
4042
+ * This option has no effect if `sdk.asClass` is `false`.
4043
4043
  * @default '{{name}}Service'
4044
4044
  */
4045
4045
  serviceNameBuilder?: string;
@@ -4058,12 +4058,25 @@ interface Config$8 extends PluginName<'@hey-api/transformers'> {
4058
4058
  output?: string;
4059
4059
  }
4060
4060
 
4061
- interface Config$7 extends PluginName<'@hey-api/types'> {
4061
+ interface Config$7 extends PluginName<'@hey-api/typescript'> {
4062
4062
  /**
4063
- * Generate enum definitions?
4063
+ * By default, enums are generated as TypeScript types. In addition to that,
4064
+ * you can choose to generate them as JavaScript objects, TypeScript enums,
4065
+ * or TypeScript enums contained within namespaces.
4064
4066
  * @default false
4065
4067
  */
4066
4068
  enums?: 'javascript' | 'typescript' | 'typescript+namespace' | false;
4069
+ /**
4070
+ * By default, inline enums (enums not defined as reusable components in
4071
+ * the input file) are generated as inlined union types. You can set
4072
+ * `exportInlineEnums` to `true` to treat inline enums as reusable components.
4073
+ * When `true`, the exported enums will follow the style defined in `enums`.
4074
+ *
4075
+ * This option works only with the experimental parser.
4076
+ *
4077
+ * @default false
4078
+ */
4079
+ exportInlineEnums?: boolean;
4067
4080
  /**
4068
4081
  * Include only types matching regular expression.
4069
4082
  *