@kubb/swagger-ts 2.0.0-alpha.5 → 2.0.0-alpha.7

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/src/plugin.ts CHANGED
@@ -19,16 +19,17 @@ export const pluginKey: PluginOptions['key'] = ['schema', pluginName] satisfies
19
19
  export const definePlugin = createPlugin<PluginOptions>((options) => {
20
20
  const {
21
21
  output = 'types',
22
- groupBy,
23
- skipBy = [],
24
- overrideBy = [],
22
+ group,
23
+ exclude = [],
24
+ include,
25
+ override = [],
25
26
  enumType = 'asConst',
26
27
  dateType = 'string',
27
28
  optionalType = 'questionToken',
28
29
  transformers = {},
29
30
  exportAs,
30
31
  } = options
31
- const template = groupBy?.output ? groupBy.output : `${output}/{{tag}}Controller`
32
+ const template = group?.output ? group.output : `${output}/{{tag}}Controller`
32
33
  let pluginsOptions: [KubbPlugin<SwaggerPluginOptions>]
33
34
 
34
35
  return {
@@ -52,7 +53,7 @@ export const definePlugin = createPlugin<PluginOptions>((options) => {
52
53
  return path.resolve(root, output)
53
54
  }
54
55
 
55
- if (options?.tag && groupBy?.type === 'tag') {
56
+ if (options?.tag && group?.type === 'tag') {
56
57
  const tag = camelCase(options.tag, { delimiter: '', transform: camelCaseTransformMerge })
57
58
 
58
59
  return path.resolve(root, renderTemplate(template, { tag }), baseName)
@@ -179,8 +180,9 @@ export const definePlugin = createPlugin<PluginOptions>((options) => {
179
180
  pluginManager: this.pluginManager,
180
181
  plugin: this.plugin,
181
182
  contentType: swaggerPlugin.api.contentType,
182
- skipBy,
183
- overrideBy,
183
+ exclude,
184
+ include,
185
+ override,
184
186
  },
185
187
  )
186
188
 
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { KubbPlugin, PluginFactoryOptions } from '@kubb/core'
2
- import type { OverrideBy, ResolvePathOptions, SkipBy } from '@kubb/swagger'
2
+ import type { Exclude, Include, Override, ResolvePathOptions } from '@kubb/swagger'
3
3
 
4
4
  export type Options = {
5
5
  /**
@@ -11,7 +11,7 @@ export type Options = {
11
11
  /**
12
12
  * Group the TypeScript types based on the provided name.
13
13
  */
14
- groupBy?: {
14
+ group?: {
15
15
  /**
16
16
  * Tag will group based on the operation tag inside the Swagger file.
17
17
  */
@@ -30,13 +30,17 @@ export type Options = {
30
30
  */
31
31
  exportAs?: string
32
32
  /**
33
- * Array containing skipBy paramaters to exclude/skip tags/operations/methods/paths.
33
+ * Array containing exclude paramaters to exclude/skip tags/operations/methods/paths.
34
34
  */
35
- skipBy?: Array<SkipBy>
35
+ exclude?: Array<Exclude>
36
36
  /**
37
- * Array containing overrideBy paramaters to override `options` based on tags/operations/methods/paths.
37
+ * Array containing include paramaters to include tags/operations/methods/paths.
38
38
  */
39
- overrideBy?: Array<OverrideBy<Options>>
39
+ include?: Array<Include>
40
+ /**
41
+ * Array containing override paramaters to override `options` based on tags/operations/methods/paths.
42
+ */
43
+ override?: Array<Override<Options>>
40
44
  /**
41
45
  * Choose to use `enum` or `as const` for enums
42
46
  * @default 'asConst'