@kubb/plugin-oas 3.16.1 → 3.16.3

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.
Files changed (111) hide show
  1. package/dist/Oas-CuqAnIw-.js +60 -0
  2. package/dist/Oas-CuqAnIw-.js.map +1 -0
  3. package/dist/Oas-Cv_pyXRM.cjs +78 -0
  4. package/dist/Oas-Cv_pyXRM.cjs.map +1 -0
  5. package/dist/OperationGenerator-CgbXErhW.d.cts +900 -0
  6. package/dist/OperationGenerator-OtLcGk2y.d.ts +900 -0
  7. package/dist/Schema-DJshqHto.d.cts +38 -0
  8. package/dist/Schema-DOXGUW1m.d.ts +38 -0
  9. package/dist/SchemaGenerator-8205BXCp.cjs +942 -0
  10. package/dist/SchemaGenerator-8205BXCp.cjs.map +1 -0
  11. package/dist/SchemaGenerator-B8Io6kky.js +930 -0
  12. package/dist/SchemaGenerator-B8Io6kky.js.map +1 -0
  13. package/dist/SchemaMapper-BaZQKrQB.js +54 -0
  14. package/dist/SchemaMapper-BaZQKrQB.js.map +1 -0
  15. package/dist/SchemaMapper-BiagBQN4.d.cts +388 -0
  16. package/dist/SchemaMapper-C2J2d3o4.d.ts +388 -0
  17. package/dist/SchemaMapper-D8J0V9Pj.cjs +66 -0
  18. package/dist/SchemaMapper-D8J0V9Pj.cjs.map +1 -0
  19. package/dist/chunk-CUT6urMc.cjs +30 -0
  20. package/dist/components.cjs +4 -19
  21. package/dist/components.d.cts +42 -35
  22. package/dist/components.d.ts +42 -35
  23. package/dist/components.js +3 -3
  24. package/dist/generators-BhLMlRNk.js +137 -0
  25. package/dist/generators-BhLMlRNk.js.map +1 -0
  26. package/dist/generators-DLH2kvlh.cjs +155 -0
  27. package/dist/generators-DLH2kvlh.cjs.map +1 -0
  28. package/dist/generators.cjs +4 -13
  29. package/dist/generators.d.cts +5 -7
  30. package/dist/generators.d.ts +5 -7
  31. package/dist/generators.js +5 -5
  32. package/dist/getFooter-BChY2kC1.cjs +43 -0
  33. package/dist/getFooter-BChY2kC1.cjs.map +1 -0
  34. package/dist/getFooter-T7_pZ6f8.js +31 -0
  35. package/dist/getFooter-T7_pZ6f8.js.map +1 -0
  36. package/dist/getSchemas-D8mP129c.cjs +67 -0
  37. package/dist/getSchemas-D8mP129c.cjs.map +1 -0
  38. package/dist/getSchemas-WoSBIxG8.js +55 -0
  39. package/dist/getSchemas-WoSBIxG8.js.map +1 -0
  40. package/dist/hooks.cjs +213 -195
  41. package/dist/hooks.cjs.map +1 -1
  42. package/dist/hooks.d.cts +91 -86
  43. package/dist/hooks.d.ts +91 -86
  44. package/dist/hooks.js +212 -193
  45. package/dist/hooks.js.map +1 -1
  46. package/dist/index.cjs +280 -344
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +7 -10
  49. package/dist/index.d.ts +7 -10
  50. package/dist/index.js +274 -318
  51. package/dist/index.js.map +1 -1
  52. package/dist/mocks.cjs +802 -737
  53. package/dist/mocks.cjs.map +1 -1
  54. package/dist/mocks.d.cts +12 -11
  55. package/dist/mocks.d.ts +12 -11
  56. package/dist/mocks.js +802 -735
  57. package/dist/mocks.js.map +1 -1
  58. package/dist/parseFromConfig-CMNGsef2.cjs +33 -0
  59. package/dist/parseFromConfig-CMNGsef2.cjs.map +1 -0
  60. package/dist/parseFromConfig-yAiFK03V.js +27 -0
  61. package/dist/parseFromConfig-yAiFK03V.js.map +1 -0
  62. package/dist/utils.cjs +58 -74
  63. package/dist/utils.cjs.map +1 -1
  64. package/dist/utils.d.cts +96 -42
  65. package/dist/utils.d.ts +96 -42
  66. package/dist/utils.js +47 -46
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +28 -36
  69. package/src/SchemaGenerator.ts +6 -1
  70. package/src/components/Operation.tsx +1 -2
  71. package/src/mocks/schemas.ts +39 -0
  72. package/src/utils/getBanner.ts +5 -5
  73. package/src/utils/getFooter.ts +4 -4
  74. package/dist/OperationGenerator-C7NPZtOM.d.ts +0 -288
  75. package/dist/OperationGenerator-DJE2XQ83.d.cts +0 -288
  76. package/dist/Schema-AjebpeVY.d.ts +0 -32
  77. package/dist/Schema-M6983FL1.d.cts +0 -32
  78. package/dist/SchemaMapper-B21ZmWag.d.cts +0 -275
  79. package/dist/SchemaMapper-B21ZmWag.d.ts +0 -275
  80. package/dist/chunk-6S7YFY6F.js +0 -33
  81. package/dist/chunk-6S7YFY6F.js.map +0 -1
  82. package/dist/chunk-76E35IZ2.js +0 -56
  83. package/dist/chunk-76E35IZ2.js.map +0 -1
  84. package/dist/chunk-7RFNM43R.cjs +0 -41
  85. package/dist/chunk-7RFNM43R.cjs.map +0 -1
  86. package/dist/chunk-DTD4ZUDA.cjs +0 -36
  87. package/dist/chunk-DTD4ZUDA.cjs.map +0 -1
  88. package/dist/chunk-G3FDK7YW.js +0 -35
  89. package/dist/chunk-G3FDK7YW.js.map +0 -1
  90. package/dist/chunk-JNN4JPWK.js +0 -28
  91. package/dist/chunk-JNN4JPWK.js.map +0 -1
  92. package/dist/chunk-MBX66JAT.js +0 -93
  93. package/dist/chunk-MBX66JAT.js.map +0 -1
  94. package/dist/chunk-NFLZLRQS.cjs +0 -869
  95. package/dist/chunk-NFLZLRQS.cjs.map +0 -1
  96. package/dist/chunk-P2VXWGXZ.js +0 -862
  97. package/dist/chunk-P2VXWGXZ.js.map +0 -1
  98. package/dist/chunk-PORSNYI5.js +0 -47
  99. package/dist/chunk-PORSNYI5.js.map +0 -1
  100. package/dist/chunk-QJMOOF2A.cjs +0 -97
  101. package/dist/chunk-QJMOOF2A.cjs.map +0 -1
  102. package/dist/chunk-YWMMI3MO.cjs +0 -59
  103. package/dist/chunk-YWMMI3MO.cjs.map +0 -1
  104. package/dist/chunk-Z2NREI4X.cjs +0 -32
  105. package/dist/chunk-Z2NREI4X.cjs.map +0 -1
  106. package/dist/chunk-ZVFL3NXX.cjs +0 -50
  107. package/dist/chunk-ZVFL3NXX.cjs.map +0 -1
  108. package/dist/components.cjs.map +0 -1
  109. package/dist/components.js.map +0 -1
  110. package/dist/generators.cjs.map +0 -1
  111. package/dist/generators.js.map +0 -1
package/dist/hooks.d.cts CHANGED
@@ -1,121 +1,126 @@
1
- import { Oas, Operation, HttpMethod } from '@kubb/oas';
2
- import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
3
- import { KubbFile } from '@kubb/core/fs';
4
- import { o as OperationSchemas } from './OperationGenerator-DJE2XQ83.cjs';
5
- import { a as SchemaContextProps } from './Schema-M6983FL1.cjs';
6
- import { S as Schema } from './SchemaMapper-B21ZmWag.cjs';
7
- import '@kubb/react/types';
8
- import 'react';
1
+ import { FileMetaBase, HttpMethod, Oas, Operation, OperationSchemas, Plugin, ResolveNameParams } from "./OperationGenerator-CgbXErhW.cjs";
2
+ import { Extname, File, Import, Mode, Schema } from "./SchemaMapper-BiagBQN4.cjs";
3
+ import { SchemaContextProps } from "./Schema-DJshqHto.cjs";
9
4
 
5
+ //#region src/hooks/useOas.d.ts
10
6
  declare function useOas(): Oas;
11
-
7
+ //#endregion
8
+ //#region src/hooks/useOperation.d.ts
12
9
  /**
13
10
  * `useOperation` will return the current `Operation`
14
11
  */
15
12
  declare function useOperation(): Operation;
16
-
13
+ //#endregion
14
+ //#region src/hooks/useOperationManager.d.ts
17
15
  type FileMeta$1 = FileMetaBase & {
18
- pluginKey: Plugin['key'];
19
- name: string;
20
- group?: {
21
- tag?: string;
22
- path?: string;
23
- };
16
+ pluginKey: Plugin['key'];
17
+ name: string;
18
+ group?: {
19
+ tag?: string;
20
+ path?: string;
21
+ };
24
22
  };
25
23
  type SchemaNames = {
26
- request: string | undefined;
27
- parameters: {
28
- path: string | undefined;
29
- query: string | undefined;
30
- header: string | undefined;
31
- };
32
- responses: {
33
- default?: string;
34
- } & Record<number | string, string>;
35
- errors: Record<number | string, string>;
24
+ request: string | undefined;
25
+ parameters: {
26
+ path: string | undefined;
27
+ query: string | undefined;
28
+ header: string | undefined;
29
+ };
30
+ responses: {
31
+ default?: string;
32
+ } & Record<number | string, string>;
33
+ errors: Record<number | string, string>;
36
34
  };
37
35
  type UseOperationManagerResult = {
38
- getName: (operation: Operation, params: {
39
- prefix?: string;
40
- suffix?: string;
41
- pluginKey?: Plugin['key'];
42
- type: ResolveNameParams['type'];
43
- }) => string;
44
- getFile: (operation: Operation, params?: {
45
- prefix?: string;
46
- suffix?: string;
47
- pluginKey?: Plugin['key'];
48
- extname?: KubbFile.Extname;
49
- group?: {
50
- tag?: string;
51
- path?: string;
52
- };
53
- }) => KubbFile.File<FileMeta$1>;
54
- groupSchemasByName: (operation: Operation, params: {
55
- pluginKey?: Plugin['key'];
56
- type: ResolveNameParams['type'];
57
- }) => SchemaNames;
58
- getSchemas: (operation: Operation, params?: {
59
- pluginKey?: Plugin['key'];
60
- type?: ResolveNameParams['type'];
61
- }) => OperationSchemas;
62
- getGroup: (operation: Operation) => FileMeta$1['group'] | undefined;
36
+ getName: (operation: Operation, params: {
37
+ prefix?: string;
38
+ suffix?: string;
39
+ pluginKey?: Plugin['key'];
40
+ type: ResolveNameParams['type'];
41
+ }) => string;
42
+ getFile: (operation: Operation, params?: {
43
+ prefix?: string;
44
+ suffix?: string;
45
+ pluginKey?: Plugin['key'];
46
+ extname?: Extname;
47
+ group?: {
48
+ tag?: string;
49
+ path?: string;
50
+ };
51
+ }) => File<FileMeta$1>;
52
+ groupSchemasByName: (operation: Operation, params: {
53
+ pluginKey?: Plugin['key'];
54
+ type: ResolveNameParams['type'];
55
+ }) => SchemaNames;
56
+ getSchemas: (operation: Operation, params?: {
57
+ pluginKey?: Plugin['key'];
58
+ type?: ResolveNameParams['type'];
59
+ }) => OperationSchemas;
60
+ getGroup: (operation: Operation) => FileMeta$1['group'] | undefined;
63
61
  };
64
62
  /**
65
63
  * `useOperationManager` will return some helper functions that can be used to get the operation file, get the operation name.
66
64
  */
67
65
  declare function useOperationManager(): UseOperationManagerResult;
68
-
66
+ //#endregion
67
+ //#region src/hooks/useOperations.d.ts
69
68
  type UseOperationsProps = {
70
- /**
71
- * Filter based on path
72
- * Weight: 2
73
- */
74
- path?: string;
75
- /**
76
- * Filter based on method
77
- * Weight: 1
78
- */
79
- method?: HttpMethod;
69
+ /**
70
+ * Filter based on path
71
+ * Weight: 2
72
+ */
73
+ path?: string;
74
+ /**
75
+ * Filter based on method
76
+ * Weight: 1
77
+ */
78
+ method?: HttpMethod;
80
79
  };
81
80
  /**
82
81
  * `useOperations` will return all the Operations
83
82
  */
84
- declare function useOperations({ method, path }?: UseOperationsProps): Operation[];
85
-
83
+ declare function useOperations({
84
+ method,
85
+ path
86
+ }?: UseOperationsProps): Operation[];
87
+ //#endregion
88
+ //#region src/hooks/useSchema.d.ts
86
89
  type UseSchemaResult = SchemaContextProps;
87
90
  /**
88
91
  * `useSchema` will return the current `schema properties`
89
92
  */
90
93
  declare function useSchema(): UseSchemaResult;
91
-
94
+ //#endregion
95
+ //#region src/hooks/useSchemaManager.d.ts
92
96
  type FileMeta = FileMetaBase & {
93
- pluginKey: Plugin['key'];
94
- name: string;
95
- group?: {
96
- tag?: string;
97
- path?: string;
98
- };
97
+ pluginKey: Plugin['key'];
98
+ name: string;
99
+ group?: {
100
+ tag?: string;
101
+ path?: string;
102
+ };
99
103
  };
100
104
  type UseSchemaManagerResult = {
101
- getName: (name: string, params: {
102
- pluginKey?: Plugin['key'];
103
- type: ResolveNameParams['type'];
104
- }) => string;
105
- getFile: (name: string, params?: {
106
- pluginKey?: Plugin['key'];
107
- mode?: KubbFile.Mode;
108
- extname?: KubbFile.Extname;
109
- group?: {
110
- tag?: string;
111
- path?: string;
112
- };
113
- }) => KubbFile.File<FileMeta>;
114
- getImports: (tree: Array<Schema>) => Array<KubbFile.Import>;
105
+ getName: (name: string, params: {
106
+ pluginKey?: Plugin['key'];
107
+ type: ResolveNameParams['type'];
108
+ }) => string;
109
+ getFile: (name: string, params?: {
110
+ pluginKey?: Plugin['key'];
111
+ mode?: Mode;
112
+ extname?: Extname;
113
+ group?: {
114
+ tag?: string;
115
+ path?: string;
116
+ };
117
+ }) => File<FileMeta>;
118
+ getImports: (tree: Array<Schema>) => Array<Import>;
115
119
  };
116
120
  /**
117
121
  * `useSchemaManager` will return some helper functions that can be used to get the schema file, get the schema name.
118
122
  */
119
123
  declare function useSchemaManager(): UseSchemaManagerResult;
120
-
124
+ //#endregion
121
125
  export { type SchemaNames, useOas, useOperation, useOperationManager, useOperations, useSchema, useSchemaManager };
126
+ //# sourceMappingURL=hooks.d.cts.map
package/dist/hooks.d.ts CHANGED
@@ -1,121 +1,126 @@
1
- import { Oas, Operation, HttpMethod } from '@kubb/oas';
2
- import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
3
- import { KubbFile } from '@kubb/core/fs';
4
- import { o as OperationSchemas } from './OperationGenerator-C7NPZtOM.js';
5
- import { a as SchemaContextProps } from './Schema-AjebpeVY.js';
6
- import { S as Schema } from './SchemaMapper-B21ZmWag.js';
7
- import '@kubb/react/types';
8
- import 'react';
1
+ import { FileMetaBase, HttpMethod, Oas, Operation, OperationSchemas, Plugin, ResolveNameParams } from "./OperationGenerator-OtLcGk2y.js";
2
+ import { Extname, File, Import, Mode, Schema } from "./SchemaMapper-C2J2d3o4.js";
3
+ import { SchemaContextProps } from "./Schema-DOXGUW1m.js";
9
4
 
5
+ //#region src/hooks/useOas.d.ts
10
6
  declare function useOas(): Oas;
11
-
7
+ //#endregion
8
+ //#region src/hooks/useOperation.d.ts
12
9
  /**
13
10
  * `useOperation` will return the current `Operation`
14
11
  */
15
12
  declare function useOperation(): Operation;
16
-
13
+ //#endregion
14
+ //#region src/hooks/useOperationManager.d.ts
17
15
  type FileMeta$1 = FileMetaBase & {
18
- pluginKey: Plugin['key'];
19
- name: string;
20
- group?: {
21
- tag?: string;
22
- path?: string;
23
- };
16
+ pluginKey: Plugin['key'];
17
+ name: string;
18
+ group?: {
19
+ tag?: string;
20
+ path?: string;
21
+ };
24
22
  };
25
23
  type SchemaNames = {
26
- request: string | undefined;
27
- parameters: {
28
- path: string | undefined;
29
- query: string | undefined;
30
- header: string | undefined;
31
- };
32
- responses: {
33
- default?: string;
34
- } & Record<number | string, string>;
35
- errors: Record<number | string, string>;
24
+ request: string | undefined;
25
+ parameters: {
26
+ path: string | undefined;
27
+ query: string | undefined;
28
+ header: string | undefined;
29
+ };
30
+ responses: {
31
+ default?: string;
32
+ } & Record<number | string, string>;
33
+ errors: Record<number | string, string>;
36
34
  };
37
35
  type UseOperationManagerResult = {
38
- getName: (operation: Operation, params: {
39
- prefix?: string;
40
- suffix?: string;
41
- pluginKey?: Plugin['key'];
42
- type: ResolveNameParams['type'];
43
- }) => string;
44
- getFile: (operation: Operation, params?: {
45
- prefix?: string;
46
- suffix?: string;
47
- pluginKey?: Plugin['key'];
48
- extname?: KubbFile.Extname;
49
- group?: {
50
- tag?: string;
51
- path?: string;
52
- };
53
- }) => KubbFile.File<FileMeta$1>;
54
- groupSchemasByName: (operation: Operation, params: {
55
- pluginKey?: Plugin['key'];
56
- type: ResolveNameParams['type'];
57
- }) => SchemaNames;
58
- getSchemas: (operation: Operation, params?: {
59
- pluginKey?: Plugin['key'];
60
- type?: ResolveNameParams['type'];
61
- }) => OperationSchemas;
62
- getGroup: (operation: Operation) => FileMeta$1['group'] | undefined;
36
+ getName: (operation: Operation, params: {
37
+ prefix?: string;
38
+ suffix?: string;
39
+ pluginKey?: Plugin['key'];
40
+ type: ResolveNameParams['type'];
41
+ }) => string;
42
+ getFile: (operation: Operation, params?: {
43
+ prefix?: string;
44
+ suffix?: string;
45
+ pluginKey?: Plugin['key'];
46
+ extname?: Extname;
47
+ group?: {
48
+ tag?: string;
49
+ path?: string;
50
+ };
51
+ }) => File<FileMeta$1>;
52
+ groupSchemasByName: (operation: Operation, params: {
53
+ pluginKey?: Plugin['key'];
54
+ type: ResolveNameParams['type'];
55
+ }) => SchemaNames;
56
+ getSchemas: (operation: Operation, params?: {
57
+ pluginKey?: Plugin['key'];
58
+ type?: ResolveNameParams['type'];
59
+ }) => OperationSchemas;
60
+ getGroup: (operation: Operation) => FileMeta$1['group'] | undefined;
63
61
  };
64
62
  /**
65
63
  * `useOperationManager` will return some helper functions that can be used to get the operation file, get the operation name.
66
64
  */
67
65
  declare function useOperationManager(): UseOperationManagerResult;
68
-
66
+ //#endregion
67
+ //#region src/hooks/useOperations.d.ts
69
68
  type UseOperationsProps = {
70
- /**
71
- * Filter based on path
72
- * Weight: 2
73
- */
74
- path?: string;
75
- /**
76
- * Filter based on method
77
- * Weight: 1
78
- */
79
- method?: HttpMethod;
69
+ /**
70
+ * Filter based on path
71
+ * Weight: 2
72
+ */
73
+ path?: string;
74
+ /**
75
+ * Filter based on method
76
+ * Weight: 1
77
+ */
78
+ method?: HttpMethod;
80
79
  };
81
80
  /**
82
81
  * `useOperations` will return all the Operations
83
82
  */
84
- declare function useOperations({ method, path }?: UseOperationsProps): Operation[];
85
-
83
+ declare function useOperations({
84
+ method,
85
+ path
86
+ }?: UseOperationsProps): Operation[];
87
+ //#endregion
88
+ //#region src/hooks/useSchema.d.ts
86
89
  type UseSchemaResult = SchemaContextProps;
87
90
  /**
88
91
  * `useSchema` will return the current `schema properties`
89
92
  */
90
93
  declare function useSchema(): UseSchemaResult;
91
-
94
+ //#endregion
95
+ //#region src/hooks/useSchemaManager.d.ts
92
96
  type FileMeta = FileMetaBase & {
93
- pluginKey: Plugin['key'];
94
- name: string;
95
- group?: {
96
- tag?: string;
97
- path?: string;
98
- };
97
+ pluginKey: Plugin['key'];
98
+ name: string;
99
+ group?: {
100
+ tag?: string;
101
+ path?: string;
102
+ };
99
103
  };
100
104
  type UseSchemaManagerResult = {
101
- getName: (name: string, params: {
102
- pluginKey?: Plugin['key'];
103
- type: ResolveNameParams['type'];
104
- }) => string;
105
- getFile: (name: string, params?: {
106
- pluginKey?: Plugin['key'];
107
- mode?: KubbFile.Mode;
108
- extname?: KubbFile.Extname;
109
- group?: {
110
- tag?: string;
111
- path?: string;
112
- };
113
- }) => KubbFile.File<FileMeta>;
114
- getImports: (tree: Array<Schema>) => Array<KubbFile.Import>;
105
+ getName: (name: string, params: {
106
+ pluginKey?: Plugin['key'];
107
+ type: ResolveNameParams['type'];
108
+ }) => string;
109
+ getFile: (name: string, params?: {
110
+ pluginKey?: Plugin['key'];
111
+ mode?: Mode;
112
+ extname?: Extname;
113
+ group?: {
114
+ tag?: string;
115
+ path?: string;
116
+ };
117
+ }) => File<FileMeta>;
118
+ getImports: (tree: Array<Schema>) => Array<Import>;
115
119
  };
116
120
  /**
117
121
  * `useSchemaManager` will return some helper functions that can be used to get the schema file, get the schema name.
118
122
  */
119
123
  declare function useSchemaManager(): UseSchemaManagerResult;
120
-
124
+ //#endregion
121
125
  export { type SchemaNames, useOas, useOperation, useOperationManager, useOperations, useSchema, useSchemaManager };
126
+ //# sourceMappingURL=hooks.d.ts.map