twitter-openapi-typescript-generated 0.0.5 → 0.0.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.
Files changed (199) hide show
  1. package/.openapi-generator/FILES +7 -1
  2. package/README.md +2 -2
  3. package/dist/apis/DefaultApi.d.ts +1 -1
  4. package/dist/apis/DefaultApi.d.ts.map +1 -1
  5. package/dist/apis/DefaultApi.js +3 -6
  6. package/dist/apis/DefaultApi.js.map +1 -1
  7. package/dist/apis/PostApi.d.ts +6 -0
  8. package/dist/apis/PostApi.d.ts.map +1 -1
  9. package/dist/apis/PostApi.js +24 -6
  10. package/dist/apis/PostApi.js.map +1 -1
  11. package/dist/apis/TweetApi.d.ts +9 -9
  12. package/dist/apis/TweetApi.d.ts.map +1 -1
  13. package/dist/apis/TweetApi.js +27 -54
  14. package/dist/apis/TweetApi.js.map +1 -1
  15. package/dist/apis/UserApi.d.ts +1 -1
  16. package/dist/apis/UserApi.d.ts.map +1 -1
  17. package/dist/apis/UserApi.js +3 -6
  18. package/dist/apis/UserApi.js.map +1 -1
  19. package/dist/apis/UserListApi.d.ts +2 -2
  20. package/dist/apis/UserListApi.d.ts.map +1 -1
  21. package/dist/apis/UserListApi.js +6 -12
  22. package/dist/apis/UserListApi.js.map +1 -1
  23. package/dist/models/Entities.d.ts +3 -2
  24. package/dist/models/Entities.d.ts.map +1 -1
  25. package/dist/models/Entities.js +3 -2
  26. package/dist/models/Entities.js.map +1 -1
  27. package/dist/models/PostCreateRetweetRequest.d.ts +3 -3
  28. package/dist/models/PostCreateRetweetRequest.d.ts.map +1 -1
  29. package/dist/models/PostCreateRetweetRequest.js +3 -3
  30. package/dist/models/PostCreateRetweetRequest.js.map +1 -1
  31. package/dist/models/PostCreateRetweetRequestVariables.d.ts +38 -0
  32. package/dist/models/PostCreateRetweetRequestVariables.d.ts.map +1 -0
  33. package/dist/models/PostCreateRetweetRequestVariables.js +54 -0
  34. package/dist/models/PostCreateRetweetRequestVariables.js.map +1 -0
  35. package/dist/models/PostDeleteTweetRequest.d.ts +3 -3
  36. package/dist/models/PostDeleteTweetRequest.d.ts.map +1 -1
  37. package/dist/models/PostDeleteTweetRequest.js +3 -3
  38. package/dist/models/PostDeleteTweetRequest.js.map +1 -1
  39. package/dist/models/PostFavoriteTweetRequest.d.ts +3 -3
  40. package/dist/models/PostFavoriteTweetRequest.d.ts.map +1 -1
  41. package/dist/models/PostFavoriteTweetRequest.js +3 -3
  42. package/dist/models/PostFavoriteTweetRequest.js.map +1 -1
  43. package/dist/models/PostUnfavoriteTweetRequest.d.ts +3 -3
  44. package/dist/models/PostUnfavoriteTweetRequest.d.ts.map +1 -1
  45. package/dist/models/PostUnfavoriteTweetRequest.js +3 -3
  46. package/dist/models/PostUnfavoriteTweetRequest.js.map +1 -1
  47. package/dist/models/Tweet.d.ts +7 -0
  48. package/dist/models/Tweet.d.ts.map +1 -1
  49. package/dist/models/Tweet.js +3 -0
  50. package/dist/models/Tweet.js.map +1 -1
  51. package/dist/models/TweetCard.d.ts +39 -0
  52. package/dist/models/TweetCard.d.ts.map +1 -0
  53. package/dist/models/TweetCard.js +54 -0
  54. package/dist/models/TweetCard.js.map +1 -0
  55. package/dist/models/TweetCardLegacy.d.ts +45 -0
  56. package/dist/models/TweetCardLegacy.d.ts.map +1 -0
  57. package/dist/models/TweetCardLegacy.js +58 -0
  58. package/dist/models/TweetCardLegacy.js.map +1 -0
  59. package/dist/models/TweetCardLegacyBindingValuesInner.d.ts +39 -0
  60. package/dist/models/TweetCardLegacyBindingValuesInner.d.ts.map +1 -0
  61. package/dist/models/TweetCardLegacyBindingValuesInner.js +55 -0
  62. package/dist/models/TweetCardLegacyBindingValuesInner.js.map +1 -0
  63. package/dist/models/TweetCardLegacyBindingValuesInnerValue.d.ts +50 -0
  64. package/dist/models/TweetCardLegacyBindingValuesInnerValue.d.ts.map +1 -0
  65. package/dist/models/TweetCardLegacyBindingValuesInnerValue.js +58 -0
  66. package/dist/models/TweetCardLegacyBindingValuesInnerValue.js.map +1 -0
  67. package/dist/models/TweetLegacy.d.ts +7 -0
  68. package/dist/models/TweetLegacy.d.ts.map +1 -1
  69. package/dist/models/TweetLegacy.js +3 -0
  70. package/dist/models/TweetLegacy.js.map +1 -1
  71. package/dist/models/TweetLegacySelfThread.d.ts +32 -0
  72. package/dist/models/TweetLegacySelfThread.d.ts.map +1 -0
  73. package/dist/models/TweetLegacySelfThread.js +51 -0
  74. package/dist/models/TweetLegacySelfThread.js.map +1 -0
  75. package/dist/models/Url.d.ts +50 -0
  76. package/dist/models/Url.d.ts.map +1 -0
  77. package/dist/models/Url.js +60 -0
  78. package/dist/models/Url.js.map +1 -0
  79. package/dist/models/index.d.ts +7 -1
  80. package/dist/models/index.d.ts.map +1 -1
  81. package/dist/models/index.js +7 -1
  82. package/dist/models/index.js.map +1 -1
  83. package/package.json +1 -1
  84. package/src/apis/DefaultApi.ts +4 -8
  85. package/src/apis/PostApi.ts +36 -6
  86. package/src/apis/TweetApi.ts +36 -72
  87. package/src/apis/UserApi.ts +4 -8
  88. package/src/apis/UserListApi.ts +8 -16
  89. package/src/models/Entities.ts +10 -4
  90. package/src/models/PostCreateRetweetRequest.ts +9 -9
  91. package/src/models/{PostDeleteTweetRequestVariables.ts → PostCreateRetweetRequestVariables.ts} +10 -10
  92. package/src/models/PostDeleteTweetRequest.ts +9 -9
  93. package/src/models/PostFavoriteTweetRequest.ts +9 -9
  94. package/src/models/PostUnfavoriteTweetRequest.ts +9 -9
  95. package/src/models/Tweet.ts +14 -0
  96. package/src/models/TweetCard.ts +80 -0
  97. package/src/models/TweetCardLegacy.ts +91 -0
  98. package/src/models/TweetCardLegacyBindingValuesInner.ts +82 -0
  99. package/src/models/TweetCardLegacyBindingValuesInnerValue.ts +90 -0
  100. package/src/models/TweetLegacy.ts +14 -0
  101. package/src/models/TweetLegacySelfThread.ts +66 -0
  102. package/src/models/Url.ts +93 -0
  103. package/src/models/index.ts +7 -1
  104. package/tools/openapi-generator-config.yaml +2 -2
  105. package/tools/win/replace.py +20 -20
  106. package/twitter-openapi/README.md +4 -6
  107. package/twitter-openapi/dist/{test → compatible}/openapi-3.0.yaml +38 -38
  108. package/twitter-openapi/dist/{typescript → compatible}/paths/bookmarks.yaml +5 -5
  109. package/twitter-openapi/dist/{test → compatible}/paths/follow.yaml +14 -14
  110. package/twitter-openapi/dist/{typescript → compatible}/paths/post.yaml +135 -93
  111. package/twitter-openapi/dist/{test → compatible}/paths/profile.yaml +5 -5
  112. package/twitter-openapi/dist/{typescript → compatible}/paths/timeline.yaml +25 -25
  113. package/twitter-openapi/dist/{test → compatible}/paths/tweet.yaml +5 -5
  114. package/twitter-openapi/dist/{test → compatible}/paths/user.yaml +5 -5
  115. package/twitter-openapi/dist/{test → compatible}/paths/usertweets.yaml +36 -36
  116. package/twitter-openapi/dist/compatible/resources/parameters.yaml +13 -0
  117. package/twitter-openapi/dist/{dart → compatible}/schemas/tweet.yaml +65 -0
  118. package/twitter-openapi/dist/docs/openapi-3.0.yaml +38 -38
  119. package/twitter-openapi/dist/docs/paths/bookmarks.yaml +7 -56
  120. package/twitter-openapi/dist/docs/paths/follow.yaml +18 -116
  121. package/twitter-openapi/dist/docs/paths/post.yaml +124 -82
  122. package/twitter-openapi/dist/docs/paths/profile.yaml +7 -35
  123. package/twitter-openapi/dist/docs/paths/timeline.yaml +43 -192
  124. package/twitter-openapi/dist/docs/paths/tweet.yaml +7 -61
  125. package/twitter-openapi/dist/docs/paths/user.yaml +7 -41
  126. package/twitter-openapi/dist/docs/paths/usertweets.yaml +53 -263
  127. package/twitter-openapi/dist/docs/resources/parameters.yaml +13 -0
  128. package/twitter-openapi/dist/docs/schemas/tweet.yaml +65 -0
  129. package/twitter-openapi/src/openapi/paths/bookmarks.yaml +1 -1
  130. package/twitter-openapi/src/openapi/paths/follow.yaml +2 -2
  131. package/twitter-openapi/src/openapi/paths/post.yaml +6 -6
  132. package/twitter-openapi/src/openapi/paths/profile.yaml +1 -1
  133. package/twitter-openapi/src/openapi/paths/timeline.yaml +3 -3
  134. package/twitter-openapi/src/openapi/paths/tweet.yaml +1 -1
  135. package/twitter-openapi/src/openapi/paths/user.yaml +1 -1
  136. package/twitter-openapi/src/openapi/paths/usertweets.yaml +4 -4
  137. package/twitter-openapi/src/openapi/resources/parameters.yaml +15 -0
  138. package/twitter-openapi/src/openapi/schemas/tweet.yaml +66 -1
  139. package/twitter-openapi/tools/__pycache__/build_config.cpython-310.pyc +0 -0
  140. package/twitter-openapi/tools/__pycache__/hooks.cpython-310.pyc +0 -0
  141. package/twitter-openapi/tools/build_config.py +67 -190
  142. package/twitter-openapi/tools/hooks.py +58 -13
  143. package/dist/models/PostDeleteTweetRequestVariables.d.ts +0 -38
  144. package/dist/models/PostDeleteTweetRequestVariables.d.ts.map +0 -1
  145. package/dist/models/PostDeleteTweetRequestVariables.js +0 -54
  146. package/dist/models/PostDeleteTweetRequestVariables.js.map +0 -1
  147. package/twitter-openapi/dist/dart/openapi-3.0.yaml +0 -117
  148. package/twitter-openapi/dist/dart/paths/bookmarks.yaml +0 -134
  149. package/twitter-openapi/dist/dart/paths/follow.yaml +0 -262
  150. package/twitter-openapi/dist/dart/paths/post.yaml +0 -834
  151. package/twitter-openapi/dist/dart/paths/profile.yaml +0 -152
  152. package/twitter-openapi/dist/dart/paths/timeline.yaml +0 -380
  153. package/twitter-openapi/dist/dart/paths/tweet.yaml +0 -134
  154. package/twitter-openapi/dist/dart/paths/user.yaml +0 -112
  155. package/twitter-openapi/dist/dart/paths/usertweets.yaml +0 -484
  156. package/twitter-openapi/dist/dart/paths/v1.1-get.yaml +0 -300
  157. package/twitter-openapi/dist/dart/paths/v1.1-post.yaml +0 -295
  158. package/twitter-openapi/dist/dart/paths/v2.0-get.yaml +0 -331
  159. package/twitter-openapi/dist/test/paths/bookmarks.yaml +0 -105
  160. package/twitter-openapi/dist/test/paths/other.yaml +0 -96
  161. package/twitter-openapi/dist/test/paths/post.yaml +0 -485
  162. package/twitter-openapi/dist/test/paths/timeline.yaml +0 -293
  163. package/twitter-openapi/dist/test/paths/v1.1-get.yaml +0 -242
  164. package/twitter-openapi/dist/test/paths/v1.1-post.yaml +0 -277
  165. package/twitter-openapi/dist/test/paths/v2.0-get.yaml +0 -302
  166. package/twitter-openapi/dist/test/response/error.yaml +0 -90
  167. package/twitter-openapi/dist/test/schemas/content.yaml +0 -181
  168. package/twitter-openapi/dist/test/schemas/general.yaml +0 -13
  169. package/twitter-openapi/dist/test/schemas/instruction.yaml +0 -83
  170. package/twitter-openapi/dist/test/schemas/timeline.yaml +0 -25
  171. package/twitter-openapi/dist/test/schemas/tweet.yaml +0 -251
  172. package/twitter-openapi/dist/test/schemas/typename.yaml +0 -19
  173. package/twitter-openapi/dist/test/schemas/user.yaml +0 -206
  174. package/twitter-openapi/dist/typescript/openapi-3.0.yaml +0 -141
  175. package/twitter-openapi/dist/typescript/paths/follow.yaml +0 -204
  176. package/twitter-openapi/dist/typescript/paths/other.yaml +0 -96
  177. package/twitter-openapi/dist/typescript/paths/profile.yaml +0 -123
  178. package/twitter-openapi/dist/typescript/paths/tweet.yaml +0 -105
  179. package/twitter-openapi/dist/typescript/paths/user.yaml +0 -83
  180. package/twitter-openapi/dist/typescript/paths/usertweets.yaml +0 -368
  181. package/twitter-openapi/dist/typescript/response/error.yaml +0 -90
  182. package/twitter-openapi/dist/typescript/schemas/content.yaml +0 -181
  183. package/twitter-openapi/dist/typescript/schemas/general.yaml +0 -13
  184. package/twitter-openapi/dist/typescript/schemas/instruction.yaml +0 -83
  185. package/twitter-openapi/dist/typescript/schemas/timeline.yaml +0 -25
  186. package/twitter-openapi/dist/typescript/schemas/tweet.yaml +0 -251
  187. package/twitter-openapi/dist/typescript/schemas/typename.yaml +0 -19
  188. package/twitter-openapi/dist/typescript/schemas/user.yaml +0 -206
  189. /package/twitter-openapi/dist/{dart → compatible}/paths/other.yaml +0 -0
  190. /package/twitter-openapi/dist/{typescript → compatible}/paths/v1.1-get.yaml +0 -0
  191. /package/twitter-openapi/dist/{typescript → compatible}/paths/v1.1-post.yaml +0 -0
  192. /package/twitter-openapi/dist/{typescript → compatible}/paths/v2.0-get.yaml +0 -0
  193. /package/twitter-openapi/dist/{dart → compatible}/response/error.yaml +0 -0
  194. /package/twitter-openapi/dist/{dart → compatible}/schemas/content.yaml +0 -0
  195. /package/twitter-openapi/dist/{dart → compatible}/schemas/general.yaml +0 -0
  196. /package/twitter-openapi/dist/{dart → compatible}/schemas/instruction.yaml +0 -0
  197. /package/twitter-openapi/dist/{dart → compatible}/schemas/timeline.yaml +0 -0
  198. /package/twitter-openapi/dist/{dart → compatible}/schemas/typename.yaml +0 -0
  199. /package/twitter-openapi/dist/{dart → compatible}/schemas/user.yaml +0 -0
@@ -0,0 +1,90 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Twitter OpenAPI
5
+ * Twitter OpenAPI(Swagger) specification
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: yuki@yuki0311.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface TweetCardLegacyBindingValuesInnerValue
20
+ */
21
+ export interface TweetCardLegacyBindingValuesInnerValue {
22
+ /**
23
+ *
24
+ * @type {boolean}
25
+ * @memberof TweetCardLegacyBindingValuesInnerValue
26
+ */
27
+ booleanValue?: boolean;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof TweetCardLegacyBindingValuesInnerValue
32
+ */
33
+ scribeKey?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof TweetCardLegacyBindingValuesInnerValue
38
+ */
39
+ stringValue?: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof TweetCardLegacyBindingValuesInnerValue
44
+ */
45
+ type: string;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the TweetCardLegacyBindingValuesInnerValue interface.
50
+ */
51
+ export function instanceOfTweetCardLegacyBindingValuesInnerValue(value: object): boolean {
52
+ let isInstance = true;
53
+ isInstance = isInstance && "type" in value;
54
+
55
+ return isInstance;
56
+ }
57
+
58
+ export function TweetCardLegacyBindingValuesInnerValueFromJSON(json: any): TweetCardLegacyBindingValuesInnerValue {
59
+ return TweetCardLegacyBindingValuesInnerValueFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function TweetCardLegacyBindingValuesInnerValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetCardLegacyBindingValuesInnerValue {
63
+ if ((json === undefined) || (json === null)) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'booleanValue': !exists(json, 'boolean_value') ? undefined : json['boolean_value'],
69
+ 'scribeKey': !exists(json, 'scribe_key') ? undefined : json['scribe_key'],
70
+ 'stringValue': !exists(json, 'string_value') ? undefined : json['string_value'],
71
+ 'type': json['type'],
72
+ };
73
+ }
74
+
75
+ export function TweetCardLegacyBindingValuesInnerValueToJSON(value?: TweetCardLegacyBindingValuesInnerValue | null): any {
76
+ if (value === undefined) {
77
+ return undefined;
78
+ }
79
+ if (value === null) {
80
+ return null;
81
+ }
82
+ return {
83
+
84
+ 'boolean_value': value.booleanValue,
85
+ 'scribe_key': value.scribeKey,
86
+ 'string_value': value.stringValue,
87
+ 'type': value.type,
88
+ };
89
+ }
90
+
@@ -31,6 +31,12 @@ import {
31
31
  ItemResultFromJSONTyped,
32
32
  ItemResultToJSON,
33
33
  } from './ItemResult';
34
+ import type { TweetLegacySelfThread } from './TweetLegacySelfThread';
35
+ import {
36
+ TweetLegacySelfThreadFromJSON,
37
+ TweetLegacySelfThreadFromJSONTyped,
38
+ TweetLegacySelfThreadToJSON,
39
+ } from './TweetLegacySelfThread';
34
40
 
35
41
  /**
36
42
  *
@@ -158,6 +164,12 @@ export interface TweetLegacy {
158
164
  * @memberof TweetLegacy
159
165
  */
160
166
  retweetedStatusResult?: ItemResult;
167
+ /**
168
+ *
169
+ * @type {TweetLegacySelfThread}
170
+ * @memberof TweetLegacy
171
+ */
172
+ selfThread?: TweetLegacySelfThread;
161
173
  /**
162
174
  *
163
175
  * @type {string}
@@ -222,6 +234,7 @@ export function TweetLegacyFromJSONTyped(json: any, ignoreDiscriminator: boolean
222
234
  'retweetCount': json['retweet_count'],
223
235
  'retweeted': json['retweeted'],
224
236
  'retweetedStatusResult': !exists(json, 'retweeted_status_result') ? undefined : ItemResultFromJSON(json['retweeted_status_result']),
237
+ 'selfThread': !exists(json, 'self_thread') ? undefined : TweetLegacySelfThreadFromJSON(json['self_thread']),
225
238
  'userIdStr': json['user_id_str'],
226
239
  };
227
240
  }
@@ -255,6 +268,7 @@ export function TweetLegacyToJSON(value?: TweetLegacy | null): any {
255
268
  'retweet_count': value.retweetCount,
256
269
  'retweeted': value.retweeted,
257
270
  'retweeted_status_result': ItemResultToJSON(value.retweetedStatusResult),
271
+ 'self_thread': TweetLegacySelfThreadToJSON(value.selfThread),
258
272
  'user_id_str': value.userIdStr,
259
273
  };
260
274
  }
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Twitter OpenAPI
5
+ * Twitter OpenAPI(Swagger) specification
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: yuki@yuki0311.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface TweetLegacySelfThread
20
+ */
21
+ export interface TweetLegacySelfThread {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof TweetLegacySelfThread
26
+ */
27
+ idStr: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the TweetLegacySelfThread interface.
32
+ */
33
+ export function instanceOfTweetLegacySelfThread(value: object): boolean {
34
+ let isInstance = true;
35
+ isInstance = isInstance && "idStr" in value;
36
+
37
+ return isInstance;
38
+ }
39
+
40
+ export function TweetLegacySelfThreadFromJSON(json: any): TweetLegacySelfThread {
41
+ return TweetLegacySelfThreadFromJSONTyped(json, false);
42
+ }
43
+
44
+ export function TweetLegacySelfThreadFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetLegacySelfThread {
45
+ if ((json === undefined) || (json === null)) {
46
+ return json;
47
+ }
48
+ return {
49
+
50
+ 'idStr': json['id_str'],
51
+ };
52
+ }
53
+
54
+ export function TweetLegacySelfThreadToJSON(value?: TweetLegacySelfThread | null): any {
55
+ if (value === undefined) {
56
+ return undefined;
57
+ }
58
+ if (value === null) {
59
+ return null;
60
+ }
61
+ return {
62
+
63
+ 'id_str': value.idStr,
64
+ };
65
+ }
66
+
@@ -0,0 +1,93 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Twitter OpenAPI
5
+ * Twitter OpenAPI(Swagger) specification
6
+ *
7
+ * The version of the OpenAPI document: 0.0.1
8
+ * Contact: yuki@yuki0311.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface Url
20
+ */
21
+ export interface Url {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof Url
26
+ */
27
+ displayUrl: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof Url
32
+ */
33
+ expandedUrl: string;
34
+ /**
35
+ *
36
+ * @type {Array<number>}
37
+ * @memberof Url
38
+ */
39
+ indices: Array<number>;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof Url
44
+ */
45
+ url: string;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the Url interface.
50
+ */
51
+ export function instanceOfUrl(value: object): boolean {
52
+ let isInstance = true;
53
+ isInstance = isInstance && "displayUrl" in value;
54
+ isInstance = isInstance && "expandedUrl" in value;
55
+ isInstance = isInstance && "indices" in value;
56
+ isInstance = isInstance && "url" in value;
57
+
58
+ return isInstance;
59
+ }
60
+
61
+ export function UrlFromJSON(json: any): Url {
62
+ return UrlFromJSONTyped(json, false);
63
+ }
64
+
65
+ export function UrlFromJSONTyped(json: any, ignoreDiscriminator: boolean): Url {
66
+ if ((json === undefined) || (json === null)) {
67
+ return json;
68
+ }
69
+ return {
70
+
71
+ 'displayUrl': json['display_url'],
72
+ 'expandedUrl': json['expanded_url'],
73
+ 'indices': json['indices'],
74
+ 'url': json['url'],
75
+ };
76
+ }
77
+
78
+ export function UrlToJSON(value?: Url | null): any {
79
+ if (value === undefined) {
80
+ return undefined;
81
+ }
82
+ if (value === null) {
83
+ return null;
84
+ }
85
+ return {
86
+
87
+ 'display_url': value.displayUrl,
88
+ 'expanded_url': value.expandedUrl,
89
+ 'indices': value.indices,
90
+ 'url': value.url,
91
+ };
92
+ }
93
+
@@ -46,6 +46,7 @@ export * from './ModuleItem';
46
46
  export * from './OneFactorLoginEligibility';
47
47
  export * from './OtherResponse';
48
48
  export * from './PostCreateRetweetRequest';
49
+ export * from './PostCreateRetweetRequestVariables';
49
50
  export * from './PostCreateTweetRequest';
50
51
  export * from './PostCreateTweetRequestFeatures';
51
52
  export * from './PostCreateTweetRequestVariables';
@@ -53,7 +54,6 @@ export * from './PostCreateTweetRequestVariablesMedia';
53
54
  export * from './PostDeleteRetweetRequest';
54
55
  export * from './PostDeleteRetweetRequestVariables';
55
56
  export * from './PostDeleteTweetRequest';
56
- export * from './PostDeleteTweetRequestVariables';
57
57
  export * from './PostFavoriteTweetRequest';
58
58
  export * from './PostUnfavoriteTweetRequest';
59
59
  export * from './ProfileResponse';
@@ -76,11 +76,16 @@ export * from './TimelineTweet';
76
76
  export * from './TimelineUser';
77
77
  export * from './TimelineV2';
78
78
  export * from './Tweet';
79
+ export * from './TweetCard';
80
+ export * from './TweetCardLegacy';
81
+ export * from './TweetCardLegacyBindingValuesInner';
82
+ export * from './TweetCardLegacyBindingValuesInnerValue';
79
83
  export * from './TweetDetailResponse';
80
84
  export * from './TweetDetailResponseData';
81
85
  export * from './TweetEditControl';
82
86
  export * from './TweetEditPrespective';
83
87
  export * from './TweetLegacy';
88
+ export * from './TweetLegacySelfThread';
84
89
  export * from './TweetTombstone';
85
90
  export * from './TweetUnion';
86
91
  export * from './TweetViews';
@@ -88,6 +93,7 @@ export * from './TweetWithVisibilityResults';
88
93
  export * from './TypeName';
89
94
  export * from './UnfavoriteTweet';
90
95
  export * from './UnfavoriteTweetResponseData';
96
+ export * from './Url';
91
97
  export * from './User';
92
98
  export * from './UserFeatures';
93
99
  export * from './UserLegacy';
@@ -1,7 +1,7 @@
1
- inputSpec: twitter-openapi/dist/typescript/openapi-3.0.yaml
1
+ inputSpec: twitter-openapi/dist/compatible/openapi-3.0.yaml
2
2
  outputDir: .
3
3
  npmName: twitter-openapi-typescript-generated
4
- npmVersion: 0.0.5
4
+ npmVersion: 0.0.7
5
5
 
6
6
  # withoutRuntimeChecks: false
7
7
  legacyDiscriminatorBehavior: false
@@ -6,6 +6,7 @@ for file in glob.glob("src/**/*.ts", recursive=True):
6
6
  with open(file, mode="r", encoding="utf-8") as f:
7
7
  text = f.read()
8
8
 
9
+ # https://github.com/OpenAPITools/openapi-generator/pull/15668
9
10
  text = text.replace("json['typename']", "json['__typename']")
10
11
  text = text.replace("json['typename']", "json['__typename']")
11
12
 
@@ -13,7 +14,6 @@ for file in glob.glob("src/**/*.ts", recursive=True):
13
14
  f.write(text)
14
15
 
15
16
 
16
-
17
17
  with open(file, mode="r", encoding="utf-8") as f:
18
18
  text = f.read()
19
19
 
@@ -21,19 +21,17 @@ with open(file, mode="r", encoding="utf-8") as f:
21
21
  with open("package.json", mode="r", encoding="utf-8") as f:
22
22
  package = json.load(f)
23
23
 
24
- package.update({
25
- "author": "fa0311",
26
- "license": "LGPL-3.0-only",
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/fa0311/twitter-openapi-typescript.git"
30
- },
31
- "keywords": [
32
- "twitter",
33
- "api",
34
- "typescript"
35
- ],
36
- })
24
+ package.update(
25
+ {
26
+ "author": "fa0311",
27
+ "license": "LGPL-3.0-only",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/fa0311/twitter-openapi-typescript.git",
31
+ },
32
+ "keywords": ["twitter", "api", "typescript"],
33
+ }
34
+ )
37
35
 
38
36
 
39
37
  with open("package.json", mode="w", encoding="utf-8") as f:
@@ -42,12 +40,14 @@ with open("package.json", mode="w", encoding="utf-8") as f:
42
40
 
43
41
  with open("tsconfig.json", mode="r", encoding="utf-8") as f:
44
42
  package = json.load(f)
45
- package["compilerOptions"].update({
46
- "declaration": True,
47
- "declarationMap": True,
48
- "sourceMap": True,
49
- })
43
+ package["compilerOptions"].update(
44
+ {
45
+ "declaration": True,
46
+ "declarationMap": True,
47
+ "sourceMap": True,
48
+ }
49
+ )
50
50
 
51
51
 
52
52
  with open("tsconfig.json", mode="w", encoding="utf-8") as f:
53
- json.dump(package, f, ensure_ascii=False, indent=2)
53
+ json.dump(package, f, ensure_ascii=False, indent=2)
@@ -9,14 +9,12 @@ Twitter OpenAPI(Swagger) specification
9
9
  ## Usage
10
10
 
11
11
  ```shell
12
- openapi-generator-cli generate -g <language> -i https://raw.githubusercontent.com/fa0311/twitter-openapi/main/dist/typescript/openapi-3.0.yaml -o ./generated
12
+ openapi-generator-cli generate -g <language> -i https://raw.githubusercontent.com/fa0311/twitter-openapi/main/dist/docs/openapi-3.0.yaml -o ./generated
13
13
  ```
14
14
 
15
- If the language supports variable-length arguments.
16
-
17
- ```shell
18
- openapi-generator-cli generate -g <language> -i https://raw.githubusercontent.com/fa0311/twitter-openapi/main/dist/dart/openapi-3.0.yaml -o ./generated
19
- ```
15
+ There are several outputs, but the one that best follows the OpenAPI specification is `dist/docs`.
16
+ However, some Generators may use a syntax that is not supported.
17
+ You can also modify the hook to make the generated results more user-friendly. [build_config.py](./tools/build_config.py)
20
18
 
21
19
  Note that the license also inherits to the output.
22
20
 
@@ -68,44 +68,44 @@ paths:
68
68
  $ref: ./paths/v1.1-get.yaml#/paths/~11.1~1search~1typeahead.json
69
69
  /2/search/adaptive.json:
70
70
  $ref: ./paths/v2.0-get.yaml#/paths/~12~1search~1adaptive.json
71
- /graphql/1RyAhNwby-gzGCRVsMxKbQ/CreateTweet:
72
- $ref: ./paths/post.yaml#/paths/~1graphql~11RyAhNwby-gzGCRVsMxKbQ~1CreateTweet
73
- /graphql/2TemLyqrMpTeAmysdbnVqw/ListLatestTweetsTimeline:
74
- $ref: ./paths/timeline.yaml#/paths/~1graphql~12TemLyqrMpTeAmysdbnVqw~1ListLatestTweetsTimeline
75
- /graphql/5fmEkRT-1AdHqEsbVgehMg/Likes:
76
- $ref: ./paths/usertweets.yaml#/paths/~1graphql~15fmEkRT-1AdHqEsbVgehMg~1Likes
77
- /graphql/9zwVLJ48lmVUk8u_Gh9DmA/ProfileSpotlightsQuery:
78
- $ref: ./paths/profile.yaml#/paths/~1graphql~19zwVLJ48lmVUk8u_Gh9DmA~1ProfileSpotlightsQuery
79
- /graphql/HCosKfLNW1AcOo3la3mMgg/HomeTimeline:
80
- $ref: ./paths/timeline.yaml#/paths/~1graphql~1HCosKfLNW1AcOo3la3mMgg~1HomeTimeline
81
- /graphql/HuTx74BxAnezK1gWvYY7zg/UserTweets:
82
- $ref: ./paths/usertweets.yaml#/paths/~1graphql~1HuTx74BxAnezK1gWvYY7zg~1UserTweets
83
- /graphql/IWP6Zt14sARO29lJT35bBw/Following:
84
- $ref: ./paths/follow.yaml#/paths/~1graphql~1IWP6Zt14sARO29lJT35bBw~1Following
85
- /graphql/RIWc55YCNyUJ-U3HHGYkdg/UserTweetsAndReplies:
86
- $ref: ./paths/usertweets.yaml#/paths/~1graphql~1RIWc55YCNyUJ-U3HHGYkdg~1UserTweetsAndReplies
87
- /graphql/VaenaVgh5q5ih7kvyVjgtg/DeleteTweet:
88
- $ref: ./paths/post.yaml#/paths/~1graphql~1VaenaVgh5q5ih7kvyVjgtg~1DeleteTweet
89
- /graphql/YqiE3JL1KNgf9nSljYdxaA/UserMedia:
90
- $ref: ./paths/usertweets.yaml#/paths/~1graphql~1YqiE3JL1KNgf9nSljYdxaA~1UserMedia
91
- /graphql/ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet:
92
- $ref: ./paths/post.yaml#/paths/~1graphql~1ZYKSe-w7KEslx3JhSIk5LA~1UnfavoriteTweet
93
- /graphql/djdTXDIk2qhd4OStqlUFeQ/Followers:
94
- $ref: ./paths/follow.yaml#/paths/~1graphql~1djdTXDIk2qhd4OStqlUFeQ~1Followers
95
- /graphql/iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet:
96
- $ref: ./paths/post.yaml#/paths/~1graphql~1iQtK4dl5hBmXewYZuEOKVw~1DeleteRetweet
97
- /graphql/lI07N6Otwv1PhnEgXILM7A/FavoriteTweet:
98
- $ref: ./paths/post.yaml#/paths/~1graphql~1lI07N6Otwv1PhnEgXILM7A~1FavoriteTweet
99
- /graphql/ojPdsZsimiJrUGLR1sjUtA/CreateRetweet:
100
- $ref: ./paths/post.yaml#/paths/~1graphql~1ojPdsZsimiJrUGLR1sjUtA~1CreateRetweet
101
- /graphql/sLVLhk0bGj3MVFEKTdax1w/UserByScreenName:
102
- $ref: ./paths/user.yaml#/paths/~1graphql~1sLVLhk0bGj3MVFEKTdax1w~1UserByScreenName
103
- /graphql/tmd4ifV8RHltzn8ymGg1aw/Bookmarks:
104
- $ref: ./paths/bookmarks.yaml#/paths/~1graphql~1tmd4ifV8RHltzn8ymGg1aw~1Bookmarks
105
- /graphql/wNNG8DBB8EaXw1lq4vFWGA/TweetDetail:
106
- $ref: ./paths/tweet.yaml#/paths/~1graphql~1wNNG8DBB8EaXw1lq4vFWGA~1TweetDetail
107
- /graphql/zhX91JE87mWvfprhYE97xA/HomeLatestTimeline:
108
- $ref: ./paths/timeline.yaml#/paths/~1graphql~1zhX91JE87mWvfprhYE97xA~1HomeLatestTimeline
71
+ /graphql/{pathQueryId}/Bookmarks:
72
+ $ref: ./paths/bookmarks.yaml#/paths/~1graphql~1{pathQueryId}~1Bookmarks
73
+ /graphql/{pathQueryId}/CreateRetweet:
74
+ $ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1CreateRetweet
75
+ /graphql/{pathQueryId}/CreateTweet:
76
+ $ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1CreateTweet
77
+ /graphql/{pathQueryId}/DeleteRetweet:
78
+ $ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1DeleteRetweet
79
+ /graphql/{pathQueryId}/DeleteTweet:
80
+ $ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1DeleteTweet
81
+ /graphql/{pathQueryId}/FavoriteTweet:
82
+ $ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1FavoriteTweet
83
+ /graphql/{pathQueryId}/Followers:
84
+ $ref: ./paths/follow.yaml#/paths/~1graphql~1{pathQueryId}~1Followers
85
+ /graphql/{pathQueryId}/Following:
86
+ $ref: ./paths/follow.yaml#/paths/~1graphql~1{pathQueryId}~1Following
87
+ /graphql/{pathQueryId}/HomeLatestTimeline:
88
+ $ref: ./paths/timeline.yaml#/paths/~1graphql~1{pathQueryId}~1HomeLatestTimeline
89
+ /graphql/{pathQueryId}/HomeTimeline:
90
+ $ref: ./paths/timeline.yaml#/paths/~1graphql~1{pathQueryId}~1HomeTimeline
91
+ /graphql/{pathQueryId}/Likes:
92
+ $ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1Likes
93
+ /graphql/{pathQueryId}/ListLatestTweetsTimeline:
94
+ $ref: ./paths/timeline.yaml#/paths/~1graphql~1{pathQueryId}~1ListLatestTweetsTimeline
95
+ /graphql/{pathQueryId}/ProfileSpotlightsQuery:
96
+ $ref: ./paths/profile.yaml#/paths/~1graphql~1{pathQueryId}~1ProfileSpotlightsQuery
97
+ /graphql/{pathQueryId}/TweetDetail:
98
+ $ref: ./paths/tweet.yaml#/paths/~1graphql~1{pathQueryId}~1TweetDetail
99
+ /graphql/{pathQueryId}/UnfavoriteTweet:
100
+ $ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1UnfavoriteTweet
101
+ /graphql/{pathQueryId}/UserByScreenName:
102
+ $ref: ./paths/user.yaml#/paths/~1graphql~1{pathQueryId}~1UserByScreenName
103
+ /graphql/{pathQueryId}/UserMedia:
104
+ $ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1UserMedia
105
+ /graphql/{pathQueryId}/UserTweets:
106
+ $ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1UserTweets
107
+ /graphql/{pathQueryId}/UserTweetsAndReplies:
108
+ $ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1UserTweetsAndReplies
109
109
  /other:
110
110
  $ref: ./paths/other.yaml#/paths/~1other
111
111
  security:
@@ -23,17 +23,17 @@ info:
23
23
  version: 0.0.1
24
24
  openapi: 3.0.3
25
25
  paths:
26
- /graphql/tmd4ifV8RHltzn8ymGg1aw/Bookmarks:
26
+ /graphql/{pathQueryId}/Bookmarks:
27
27
  get:
28
28
  description: get bookmarks
29
29
  operationId: getBookmarks
30
30
  parameters:
31
- - in: query
32
- name: queryId
31
+ - in: path
32
+ name: pathQueryId
33
33
  required: true
34
34
  schema:
35
- default: '"tmd4ifV8RHltzn8ymGg1aw"'
36
- example: '"tmd4ifV8RHltzn8ymGg1aw"'
35
+ default: tmd4ifV8RHltzn8ymGg1aw
36
+ example: tmd4ifV8RHltzn8ymGg1aw
37
37
  type: string
38
38
  - in: query
39
39
  name: variables
@@ -38,17 +38,17 @@ info:
38
38
  version: 0.0.1
39
39
  openapi: 3.0.3
40
40
  paths:
41
- /graphql/IWP6Zt14sARO29lJT35bBw/Following:
41
+ /graphql/{pathQueryId}/Followers:
42
42
  get:
43
- description: get user list of following
44
- operationId: getFollowing
43
+ description: get user list of followers
44
+ operationId: getFollowers
45
45
  parameters:
46
- - in: query
47
- name: queryId
46
+ - in: path
47
+ name: pathQueryId
48
48
  required: true
49
49
  schema:
50
- default: '"IWP6Zt14sARO29lJT35bBw"'
51
- example: '"IWP6Zt14sARO29lJT35bBw"'
50
+ default: djdTXDIk2qhd4OStqlUFeQ
51
+ example: djdTXDIk2qhd4OStqlUFeQ
52
52
  type: string
53
53
  - in: query
54
54
  name: variables
@@ -120,17 +120,17 @@ paths:
120
120
  type: string
121
121
  tags:
122
122
  - user-list
123
- /graphql/djdTXDIk2qhd4OStqlUFeQ/Followers:
123
+ /graphql/{pathQueryId}/Following:
124
124
  get:
125
- description: get user list of followers
126
- operationId: getFollowers
125
+ description: get user list of following
126
+ operationId: getFollowing
127
127
  parameters:
128
- - in: query
129
- name: queryId
128
+ - in: path
129
+ name: pathQueryId
130
130
  required: true
131
131
  schema:
132
- default: '"djdTXDIk2qhd4OStqlUFeQ"'
133
- example: '"djdTXDIk2qhd4OStqlUFeQ"'
132
+ default: IWP6Zt14sARO29lJT35bBw
133
+ example: IWP6Zt14sARO29lJT35bBw
134
134
  type: string
135
135
  - in: query
136
136
  name: variables