@kubb/plugin-ts 3.0.0-alpha.21 → 3.0.0-alpha.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-ts",
3
- "version": "3.0.0-alpha.21",
3
+ "version": "3.0.0-alpha.23",
4
4
  "description": "Generator plugin-ts",
5
5
  "keywords": [
6
6
  "zod",
@@ -58,23 +58,23 @@
58
58
  "!/**/__tests__/**"
59
59
  ],
60
60
  "dependencies": {
61
- "@kubb/core": "3.0.0-alpha.21",
62
- "@kubb/fs": "3.0.0-alpha.21",
63
- "@kubb/oas": "3.0.0-alpha.21",
64
- "@kubb/parser-ts": "3.0.0-alpha.21",
65
- "@kubb/plugin-oas": "3.0.0-alpha.21",
66
- "@kubb/react": "3.0.0-alpha.21"
61
+ "@kubb/core": "3.0.0-alpha.23",
62
+ "@kubb/oas": "3.0.0-alpha.23",
63
+ "@kubb/parser-ts": "3.0.0-alpha.23",
64
+ "@kubb/plugin-oas": "3.0.0-alpha.23",
65
+ "@kubb/react": "3.0.0-alpha.23",
66
+ "@kubb/fs": "3.0.0-alpha.23"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/react": "^18.3.8",
70
70
  "react": "^18.3.1",
71
71
  "tsup": "^8.3.0",
72
72
  "typescript": "^5.6.2",
73
- "@kubb/config-ts": "3.0.0-alpha.21",
74
- "@kubb/config-tsup": "3.0.0-alpha.21"
73
+ "@kubb/config-ts": "3.0.0-alpha.23",
74
+ "@kubb/config-tsup": "3.0.0-alpha.23"
75
75
  },
76
76
  "peerDependencies": {
77
- "@kubb/react": "3.0.0-alpha.21"
77
+ "@kubb/react": "3.0.0-alpha.23"
78
78
  },
79
79
  "engines": {
80
80
  "node": ">=20"
@@ -1,7 +1,11 @@
1
- /**
1
+
2
+ /**
2
3
  * @description Null response
3
4
  */
4
5
  export type CreatePets201 = (error & {
6
+ /**
7
+ * @type object | undefined
8
+ */
5
9
  name?: errorCode;
6
10
  });
7
11
 
@@ -25,6 +29,9 @@ export type CreatePetsError = error;
25
29
  * @description Null response
26
30
  */
27
31
  export type CreatePetsMutationResponse = (error & {
32
+ /**
33
+ * @type object | undefined
34
+ */
28
35
  name?: errorCode;
29
36
  });
30
37
 
@@ -1,7 +1,11 @@
1
- /**
1
+
2
+ /**
2
3
  * @description Null response
3
4
  */
4
5
  export type CreatePets201 = (error & {
6
+ /**
7
+ * @type object | undefined
8
+ */
5
9
  name?: errorCode;
6
10
  });
7
11
 
@@ -25,6 +29,9 @@ export type CreatePetsError = error;
25
29
  * @description Null response
26
30
  */
27
31
  export type CreatePetsMutationResponse = (error & {
32
+ /**
33
+ * @type object | undefined
34
+ */
28
35
  name?: errorCode;
29
36
  });
30
37
 
@@ -1,4 +1,5 @@
1
- export type pet = {
1
+
2
+ export type pet = {
2
3
  /**
3
4
  * @type integer, int64
4
5
  */
@@ -11,5 +12,8 @@ export type pet = {
11
12
  * @type string | undefined
12
13
  */
13
14
  tag?: string;
15
+ /**
16
+ * @type object | undefined
17
+ */
14
18
  category?: category;
15
19
  };
@@ -1,4 +1,5 @@
1
- export type pet = {
1
+
2
+ export type pet = {
2
3
  /**
3
4
  * @type integer, int64
4
5
  */
@@ -11,5 +12,8 @@ export type pet = {
11
12
  * @type string | undefined
12
13
  */
13
14
  tag?: string | undefined;
15
+ /**
16
+ * @type object | undefined
17
+ */
14
18
  category?: category | undefined;
15
19
  };
@@ -1,4 +1,5 @@
1
- export type pet = {
1
+
2
+ export type pet = {
2
3
  /**
3
4
  * @type integer, int64
4
5
  */
@@ -11,5 +12,8 @@ export type pet = {
11
12
  * @type string | undefined
12
13
  */
13
14
  tag: string | undefined;
15
+ /**
16
+ * @type object | undefined
17
+ */
14
18
  category: category | undefined;
15
19
  };
@@ -0,0 +1,20 @@
1
+
2
+ export type demo = {
3
+ /**
4
+ * @type integer | undefined
5
+ */
6
+ readonly attribute_readonly?: number;
7
+ /**
8
+ * @description not required
9
+ * @type integer | undefined
10
+ */
11
+ attribute_writeOnly?: number;
12
+ /**
13
+ * @type integer | undefined
14
+ */
15
+ readonly attribute_with_ref?: attributeReadonly;
16
+ /**
17
+ * @type integer | undefined
18
+ */
19
+ attribute_with_ref_readonly?: attributeWriteOnly;
20
+ };
@@ -54,12 +54,20 @@ export const typeKeywordMapper = {
54
54
  nodes,
55
55
  })
56
56
  },
57
- const: (name?: string | number, format?: 'string' | 'number') => {
57
+ const: (name?: string | number | boolean, format?: 'string' | 'number' | 'boolean') => {
58
58
  if (!name) {
59
59
  return undefined
60
60
  }
61
61
 
62
- if (format === 'number') {
62
+ if (format === 'boolean') {
63
+ if (name === true) {
64
+ return factory.createLiteralTypeNode(factory.createTrue())
65
+ }
66
+
67
+ return factory.createLiteralTypeNode(factory.createFalse())
68
+ }
69
+
70
+ if (format === 'number' && typeof name === 'number') {
63
71
  return factory.createLiteralTypeNode(factory.createNumericLiteral(name))
64
72
  }
65
73
 
@@ -95,6 +103,7 @@ export const typeKeywordMapper = {
95
103
  password: undefined,
96
104
  phone: undefined,
97
105
  readOnly: undefined,
106
+ writeOnly: undefined,
98
107
  ref: (propertyName?: string) => {
99
108
  if (!propertyName) {
100
109
  return undefined