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.
- package/.openapi-generator/FILES +7 -1
- package/README.md +2 -2
- package/dist/apis/DefaultApi.d.ts +1 -1
- package/dist/apis/DefaultApi.d.ts.map +1 -1
- package/dist/apis/DefaultApi.js +3 -6
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/apis/PostApi.d.ts +6 -0
- package/dist/apis/PostApi.d.ts.map +1 -1
- package/dist/apis/PostApi.js +24 -6
- package/dist/apis/PostApi.js.map +1 -1
- package/dist/apis/TweetApi.d.ts +9 -9
- package/dist/apis/TweetApi.d.ts.map +1 -1
- package/dist/apis/TweetApi.js +27 -54
- package/dist/apis/TweetApi.js.map +1 -1
- package/dist/apis/UserApi.d.ts +1 -1
- package/dist/apis/UserApi.d.ts.map +1 -1
- package/dist/apis/UserApi.js +3 -6
- package/dist/apis/UserApi.js.map +1 -1
- package/dist/apis/UserListApi.d.ts +2 -2
- package/dist/apis/UserListApi.d.ts.map +1 -1
- package/dist/apis/UserListApi.js +6 -12
- package/dist/apis/UserListApi.js.map +1 -1
- package/dist/models/Entities.d.ts +3 -2
- package/dist/models/Entities.d.ts.map +1 -1
- package/dist/models/Entities.js +3 -2
- package/dist/models/Entities.js.map +1 -1
- package/dist/models/PostCreateRetweetRequest.d.ts +3 -3
- package/dist/models/PostCreateRetweetRequest.d.ts.map +1 -1
- package/dist/models/PostCreateRetweetRequest.js +3 -3
- package/dist/models/PostCreateRetweetRequest.js.map +1 -1
- package/dist/models/PostCreateRetweetRequestVariables.d.ts +38 -0
- package/dist/models/PostCreateRetweetRequestVariables.d.ts.map +1 -0
- package/dist/models/PostCreateRetweetRequestVariables.js +54 -0
- package/dist/models/PostCreateRetweetRequestVariables.js.map +1 -0
- package/dist/models/PostDeleteTweetRequest.d.ts +3 -3
- package/dist/models/PostDeleteTweetRequest.d.ts.map +1 -1
- package/dist/models/PostDeleteTweetRequest.js +3 -3
- package/dist/models/PostDeleteTweetRequest.js.map +1 -1
- package/dist/models/PostFavoriteTweetRequest.d.ts +3 -3
- package/dist/models/PostFavoriteTweetRequest.d.ts.map +1 -1
- package/dist/models/PostFavoriteTweetRequest.js +3 -3
- package/dist/models/PostFavoriteTweetRequest.js.map +1 -1
- package/dist/models/PostUnfavoriteTweetRequest.d.ts +3 -3
- package/dist/models/PostUnfavoriteTweetRequest.d.ts.map +1 -1
- package/dist/models/PostUnfavoriteTweetRequest.js +3 -3
- package/dist/models/PostUnfavoriteTweetRequest.js.map +1 -1
- package/dist/models/Tweet.d.ts +7 -0
- package/dist/models/Tweet.d.ts.map +1 -1
- package/dist/models/Tweet.js +3 -0
- package/dist/models/Tweet.js.map +1 -1
- package/dist/models/TweetCard.d.ts +39 -0
- package/dist/models/TweetCard.d.ts.map +1 -0
- package/dist/models/TweetCard.js +54 -0
- package/dist/models/TweetCard.js.map +1 -0
- package/dist/models/TweetCardLegacy.d.ts +45 -0
- package/dist/models/TweetCardLegacy.d.ts.map +1 -0
- package/dist/models/TweetCardLegacy.js +58 -0
- package/dist/models/TweetCardLegacy.js.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.d.ts +39 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.d.ts.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.js +55 -0
- package/dist/models/TweetCardLegacyBindingValuesInner.js.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.d.ts +50 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.d.ts.map +1 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.js +58 -0
- package/dist/models/TweetCardLegacyBindingValuesInnerValue.js.map +1 -0
- package/dist/models/TweetLegacy.d.ts +7 -0
- package/dist/models/TweetLegacy.d.ts.map +1 -1
- package/dist/models/TweetLegacy.js +3 -0
- package/dist/models/TweetLegacy.js.map +1 -1
- package/dist/models/TweetLegacySelfThread.d.ts +32 -0
- package/dist/models/TweetLegacySelfThread.d.ts.map +1 -0
- package/dist/models/TweetLegacySelfThread.js +51 -0
- package/dist/models/TweetLegacySelfThread.js.map +1 -0
- package/dist/models/Url.d.ts +50 -0
- package/dist/models/Url.d.ts.map +1 -0
- package/dist/models/Url.js +60 -0
- package/dist/models/Url.js.map +1 -0
- package/dist/models/index.d.ts +7 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +7 -1
- package/dist/models/index.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/DefaultApi.ts +4 -8
- package/src/apis/PostApi.ts +36 -6
- package/src/apis/TweetApi.ts +36 -72
- package/src/apis/UserApi.ts +4 -8
- package/src/apis/UserListApi.ts +8 -16
- package/src/models/Entities.ts +10 -4
- package/src/models/PostCreateRetweetRequest.ts +9 -9
- package/src/models/{PostDeleteTweetRequestVariables.ts → PostCreateRetweetRequestVariables.ts} +10 -10
- package/src/models/PostDeleteTweetRequest.ts +9 -9
- package/src/models/PostFavoriteTweetRequest.ts +9 -9
- package/src/models/PostUnfavoriteTweetRequest.ts +9 -9
- package/src/models/Tweet.ts +14 -0
- package/src/models/TweetCard.ts +80 -0
- package/src/models/TweetCardLegacy.ts +91 -0
- package/src/models/TweetCardLegacyBindingValuesInner.ts +82 -0
- package/src/models/TweetCardLegacyBindingValuesInnerValue.ts +90 -0
- package/src/models/TweetLegacy.ts +14 -0
- package/src/models/TweetLegacySelfThread.ts +66 -0
- package/src/models/Url.ts +93 -0
- package/src/models/index.ts +7 -1
- package/tools/openapi-generator-config.yaml +2 -2
- package/tools/win/replace.py +20 -20
- package/twitter-openapi/README.md +4 -6
- package/twitter-openapi/dist/{test → compatible}/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/{typescript → compatible}/paths/bookmarks.yaml +5 -5
- package/twitter-openapi/dist/{test → compatible}/paths/follow.yaml +14 -14
- package/twitter-openapi/dist/{typescript → compatible}/paths/post.yaml +135 -93
- package/twitter-openapi/dist/{test → compatible}/paths/profile.yaml +5 -5
- package/twitter-openapi/dist/{typescript → compatible}/paths/timeline.yaml +25 -25
- package/twitter-openapi/dist/{test → compatible}/paths/tweet.yaml +5 -5
- package/twitter-openapi/dist/{test → compatible}/paths/user.yaml +5 -5
- package/twitter-openapi/dist/{test → compatible}/paths/usertweets.yaml +36 -36
- package/twitter-openapi/dist/compatible/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/{dart → compatible}/schemas/tweet.yaml +65 -0
- package/twitter-openapi/dist/docs/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/docs/paths/bookmarks.yaml +7 -56
- package/twitter-openapi/dist/docs/paths/follow.yaml +18 -116
- package/twitter-openapi/dist/docs/paths/post.yaml +124 -82
- package/twitter-openapi/dist/docs/paths/profile.yaml +7 -35
- package/twitter-openapi/dist/docs/paths/timeline.yaml +43 -192
- package/twitter-openapi/dist/docs/paths/tweet.yaml +7 -61
- package/twitter-openapi/dist/docs/paths/user.yaml +7 -41
- package/twitter-openapi/dist/docs/paths/usertweets.yaml +53 -263
- package/twitter-openapi/dist/docs/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/docs/schemas/tweet.yaml +65 -0
- package/twitter-openapi/src/openapi/paths/bookmarks.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/follow.yaml +2 -2
- package/twitter-openapi/src/openapi/paths/post.yaml +6 -6
- package/twitter-openapi/src/openapi/paths/profile.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/timeline.yaml +3 -3
- package/twitter-openapi/src/openapi/paths/tweet.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/user.yaml +1 -1
- package/twitter-openapi/src/openapi/paths/usertweets.yaml +4 -4
- package/twitter-openapi/src/openapi/resources/parameters.yaml +15 -0
- package/twitter-openapi/src/openapi/schemas/tweet.yaml +66 -1
- package/twitter-openapi/tools/__pycache__/build_config.cpython-310.pyc +0 -0
- package/twitter-openapi/tools/__pycache__/hooks.cpython-310.pyc +0 -0
- package/twitter-openapi/tools/build_config.py +67 -190
- package/twitter-openapi/tools/hooks.py +58 -13
- package/dist/models/PostDeleteTweetRequestVariables.d.ts +0 -38
- package/dist/models/PostDeleteTweetRequestVariables.d.ts.map +0 -1
- package/dist/models/PostDeleteTweetRequestVariables.js +0 -54
- package/dist/models/PostDeleteTweetRequestVariables.js.map +0 -1
- package/twitter-openapi/dist/dart/openapi-3.0.yaml +0 -117
- package/twitter-openapi/dist/dart/paths/bookmarks.yaml +0 -134
- package/twitter-openapi/dist/dart/paths/follow.yaml +0 -262
- package/twitter-openapi/dist/dart/paths/post.yaml +0 -834
- package/twitter-openapi/dist/dart/paths/profile.yaml +0 -152
- package/twitter-openapi/dist/dart/paths/timeline.yaml +0 -380
- package/twitter-openapi/dist/dart/paths/tweet.yaml +0 -134
- package/twitter-openapi/dist/dart/paths/user.yaml +0 -112
- package/twitter-openapi/dist/dart/paths/usertweets.yaml +0 -484
- package/twitter-openapi/dist/dart/paths/v1.1-get.yaml +0 -300
- package/twitter-openapi/dist/dart/paths/v1.1-post.yaml +0 -295
- package/twitter-openapi/dist/dart/paths/v2.0-get.yaml +0 -331
- package/twitter-openapi/dist/test/paths/bookmarks.yaml +0 -105
- package/twitter-openapi/dist/test/paths/other.yaml +0 -96
- package/twitter-openapi/dist/test/paths/post.yaml +0 -485
- package/twitter-openapi/dist/test/paths/timeline.yaml +0 -293
- package/twitter-openapi/dist/test/paths/v1.1-get.yaml +0 -242
- package/twitter-openapi/dist/test/paths/v1.1-post.yaml +0 -277
- package/twitter-openapi/dist/test/paths/v2.0-get.yaml +0 -302
- package/twitter-openapi/dist/test/response/error.yaml +0 -90
- package/twitter-openapi/dist/test/schemas/content.yaml +0 -181
- package/twitter-openapi/dist/test/schemas/general.yaml +0 -13
- package/twitter-openapi/dist/test/schemas/instruction.yaml +0 -83
- package/twitter-openapi/dist/test/schemas/timeline.yaml +0 -25
- package/twitter-openapi/dist/test/schemas/tweet.yaml +0 -251
- package/twitter-openapi/dist/test/schemas/typename.yaml +0 -19
- package/twitter-openapi/dist/test/schemas/user.yaml +0 -206
- package/twitter-openapi/dist/typescript/openapi-3.0.yaml +0 -141
- package/twitter-openapi/dist/typescript/paths/follow.yaml +0 -204
- package/twitter-openapi/dist/typescript/paths/other.yaml +0 -96
- package/twitter-openapi/dist/typescript/paths/profile.yaml +0 -123
- package/twitter-openapi/dist/typescript/paths/tweet.yaml +0 -105
- package/twitter-openapi/dist/typescript/paths/user.yaml +0 -83
- package/twitter-openapi/dist/typescript/paths/usertweets.yaml +0 -368
- package/twitter-openapi/dist/typescript/response/error.yaml +0 -90
- package/twitter-openapi/dist/typescript/schemas/content.yaml +0 -181
- package/twitter-openapi/dist/typescript/schemas/general.yaml +0 -13
- package/twitter-openapi/dist/typescript/schemas/instruction.yaml +0 -83
- package/twitter-openapi/dist/typescript/schemas/timeline.yaml +0 -25
- package/twitter-openapi/dist/typescript/schemas/tweet.yaml +0 -251
- package/twitter-openapi/dist/typescript/schemas/typename.yaml +0 -19
- package/twitter-openapi/dist/typescript/schemas/user.yaml +0 -206
- /package/twitter-openapi/dist/{dart → compatible}/paths/other.yaml +0 -0
- /package/twitter-openapi/dist/{typescript → compatible}/paths/v1.1-get.yaml +0 -0
- /package/twitter-openapi/dist/{typescript → compatible}/paths/v1.1-post.yaml +0 -0
- /package/twitter-openapi/dist/{typescript → compatible}/paths/v2.0-get.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/response/error.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/content.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/general.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/instruction.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/timeline.yaml +0 -0
- /package/twitter-openapi/dist/{dart → compatible}/schemas/typename.yaml +0 -0
- /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
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -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/
|
|
1
|
+
inputSpec: twitter-openapi/dist/compatible/openapi-3.0.yaml
|
|
2
2
|
outputDir: .
|
|
3
3
|
npmName: twitter-openapi-typescript-generated
|
|
4
|
-
npmVersion: 0.0.
|
|
4
|
+
npmVersion: 0.0.7
|
|
5
5
|
|
|
6
6
|
# withoutRuntimeChecks: false
|
|
7
7
|
legacyDiscriminatorBehavior: false
|
package/tools/win/replace.py
CHANGED
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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/
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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/
|
|
72
|
-
$ref: ./paths/
|
|
73
|
-
/graphql/
|
|
74
|
-
$ref: ./paths/
|
|
75
|
-
/graphql/
|
|
76
|
-
$ref: ./paths/
|
|
77
|
-
/graphql/
|
|
78
|
-
$ref: ./paths/
|
|
79
|
-
/graphql/
|
|
80
|
-
$ref: ./paths/
|
|
81
|
-
/graphql/
|
|
82
|
-
$ref: ./paths/
|
|
83
|
-
/graphql/
|
|
84
|
-
$ref: ./paths/follow.yaml#/paths/~1graphql~
|
|
85
|
-
/graphql/
|
|
86
|
-
$ref: ./paths/
|
|
87
|
-
/graphql/
|
|
88
|
-
$ref: ./paths/
|
|
89
|
-
/graphql/
|
|
90
|
-
$ref: ./paths/
|
|
91
|
-
/graphql/
|
|
92
|
-
$ref: ./paths/
|
|
93
|
-
/graphql/
|
|
94
|
-
$ref: ./paths/
|
|
95
|
-
/graphql/
|
|
96
|
-
$ref: ./paths/
|
|
97
|
-
/graphql/
|
|
98
|
-
$ref: ./paths/
|
|
99
|
-
/graphql/
|
|
100
|
-
$ref: ./paths/post.yaml#/paths/~1graphql~
|
|
101
|
-
/graphql/
|
|
102
|
-
$ref: ./paths/user.yaml#/paths/~1graphql~
|
|
103
|
-
/graphql/
|
|
104
|
-
$ref: ./paths/
|
|
105
|
-
/graphql/
|
|
106
|
-
$ref: ./paths/
|
|
107
|
-
/graphql/
|
|
108
|
-
$ref: ./paths/
|
|
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/
|
|
26
|
+
/graphql/{pathQueryId}/Bookmarks:
|
|
27
27
|
get:
|
|
28
28
|
description: get bookmarks
|
|
29
29
|
operationId: getBookmarks
|
|
30
30
|
parameters:
|
|
31
|
-
- in:
|
|
32
|
-
name:
|
|
31
|
+
- in: path
|
|
32
|
+
name: pathQueryId
|
|
33
33
|
required: true
|
|
34
34
|
schema:
|
|
35
|
-
default:
|
|
36
|
-
example:
|
|
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/
|
|
41
|
+
/graphql/{pathQueryId}/Followers:
|
|
42
42
|
get:
|
|
43
|
-
description: get user list of
|
|
44
|
-
operationId:
|
|
43
|
+
description: get user list of followers
|
|
44
|
+
operationId: getFollowers
|
|
45
45
|
parameters:
|
|
46
|
-
- in:
|
|
47
|
-
name:
|
|
46
|
+
- in: path
|
|
47
|
+
name: pathQueryId
|
|
48
48
|
required: true
|
|
49
49
|
schema:
|
|
50
|
-
default:
|
|
51
|
-
example:
|
|
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/
|
|
123
|
+
/graphql/{pathQueryId}/Following:
|
|
124
124
|
get:
|
|
125
|
-
description: get user list of
|
|
126
|
-
operationId:
|
|
125
|
+
description: get user list of following
|
|
126
|
+
operationId: getFollowing
|
|
127
127
|
parameters:
|
|
128
|
-
- in:
|
|
129
|
-
name:
|
|
128
|
+
- in: path
|
|
129
|
+
name: pathQueryId
|
|
130
130
|
required: true
|
|
131
131
|
schema:
|
|
132
|
-
default:
|
|
133
|
-
example:
|
|
132
|
+
default: IWP6Zt14sARO29lJT35bBw
|
|
133
|
+
example: IWP6Zt14sARO29lJT35bBw
|
|
134
134
|
type: string
|
|
135
135
|
- in: query
|
|
136
136
|
name: variables
|