twitter-openapi-typescript-generated 0.0.5 → 0.0.6
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 +6 -1
- package/README.md +2 -2
- package/dist/apis/DefaultApi.d.ts +1 -0
- package/dist/apis/DefaultApi.d.ts.map +1 -1
- package/dist/apis/DefaultApi.js +4 -1
- 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 -0
- package/dist/apis/TweetApi.d.ts.map +1 -1
- package/dist/apis/TweetApi.js +36 -9
- package/dist/apis/TweetApi.js.map +1 -1
- package/dist/apis/UserApi.d.ts +1 -0
- package/dist/apis/UserApi.d.ts.map +1 -1
- package/dist/apis/UserApi.js +4 -1
- package/dist/apis/UserApi.js.map +1 -1
- package/dist/apis/UserListApi.d.ts +2 -0
- package/dist/apis/UserListApi.d.ts.map +1 -1
- package/dist/apis/UserListApi.js +8 -2
- 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/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 +6 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +6 -1
- package/dist/models/index.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/DefaultApi.ts +6 -1
- package/src/apis/PostApi.ts +36 -6
- package/src/apis/TweetApi.ts +54 -9
- package/src/apis/UserApi.ts +6 -1
- package/src/apis/UserListApi.ts +12 -2
- 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/Url.ts +93 -0
- package/src/models/index.ts +6 -1
- package/tools/openapi-generator-config.yaml +1 -1
- package/tools/win/replace.py +20 -20
- package/twitter-openapi/README.md +4 -6
- package/twitter-openapi/dist/dart/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/dart/paths/bookmarks.yaml +8 -1
- package/twitter-openapi/dist/dart/paths/follow.yaml +24 -10
- package/twitter-openapi/dist/dart/paths/post.yaml +157 -115
- package/twitter-openapi/dist/dart/paths/profile.yaml +8 -1
- package/twitter-openapi/dist/dart/paths/timeline.yaml +38 -17
- package/twitter-openapi/dist/dart/paths/tweet.yaml +8 -1
- package/twitter-openapi/dist/dart/paths/user.yaml +8 -1
- package/twitter-openapi/dist/dart/paths/usertweets.yaml +54 -26
- package/twitter-openapi/dist/dart/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/dart/schemas/tweet.yaml +57 -0
- package/twitter-openapi/dist/docs/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/docs/paths/bookmarks.yaml +8 -1
- package/twitter-openapi/dist/docs/paths/follow.yaml +60 -46
- package/twitter-openapi/dist/docs/paths/post.yaml +124 -82
- package/twitter-openapi/dist/docs/paths/profile.yaml +8 -1
- package/twitter-openapi/dist/docs/paths/timeline.yaml +92 -71
- package/twitter-openapi/dist/docs/paths/tweet.yaml +8 -1
- package/twitter-openapi/dist/docs/paths/user.yaml +8 -1
- package/twitter-openapi/dist/docs/paths/usertweets.yaml +122 -94
- package/twitter-openapi/dist/docs/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/docs/schemas/tweet.yaml +57 -0
- package/twitter-openapi/dist/test/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/test/paths/bookmarks.yaml +8 -1
- package/twitter-openapi/dist/test/paths/follow.yaml +24 -10
- package/twitter-openapi/dist/test/paths/post.yaml +108 -66
- package/twitter-openapi/dist/test/paths/profile.yaml +8 -1
- package/twitter-openapi/dist/test/paths/timeline.yaml +38 -17
- package/twitter-openapi/dist/test/paths/tweet.yaml +8 -1
- package/twitter-openapi/dist/test/paths/user.yaml +8 -1
- package/twitter-openapi/dist/test/paths/usertweets.yaml +54 -26
- package/twitter-openapi/dist/test/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/test/schemas/tweet.yaml +57 -0
- package/twitter-openapi/dist/typescript/openapi-3.0.yaml +38 -38
- package/twitter-openapi/dist/typescript/paths/bookmarks.yaml +8 -1
- package/twitter-openapi/dist/typescript/paths/follow.yaml +24 -10
- package/twitter-openapi/dist/typescript/paths/post.yaml +135 -93
- package/twitter-openapi/dist/typescript/paths/profile.yaml +8 -1
- package/twitter-openapi/dist/typescript/paths/timeline.yaml +38 -17
- package/twitter-openapi/dist/typescript/paths/tweet.yaml +8 -1
- package/twitter-openapi/dist/typescript/paths/user.yaml +8 -1
- package/twitter-openapi/dist/typescript/paths/usertweets.yaml +54 -26
- package/twitter-openapi/dist/typescript/resources/parameters.yaml +13 -0
- package/twitter-openapi/dist/typescript/schemas/tweet.yaml +57 -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 +58 -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 +12 -12
- package/twitter-openapi/tools/hooks.py +30 -6
- 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
|
@@ -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
|
+
|
|
@@ -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,6 +76,10 @@ 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';
|
|
@@ -88,6 +92,7 @@ export * from './TweetWithVisibilityResults';
|
|
|
88
92
|
export * from './TypeName';
|
|
89
93
|
export * from './UnfavoriteTweet';
|
|
90
94
|
export * from './UnfavoriteTweetResponseData';
|
|
95
|
+
export * from './Url';
|
|
91
96
|
export * from './User';
|
|
92
97
|
export * from './UserFeatures';
|
|
93
98
|
export * from './UserLegacy';
|
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
|
|
|
@@ -48,44 +48,44 @@ paths:
|
|
|
48
48
|
$ref: ./paths/v1.1-get.yaml#/paths/~11.1~1search~1typeahead.json
|
|
49
49
|
/2/search/adaptive.json:
|
|
50
50
|
$ref: ./paths/v2.0-get.yaml#/paths/~12~1search~1adaptive.json
|
|
51
|
-
/graphql/
|
|
52
|
-
$ref: ./paths/
|
|
53
|
-
/graphql/
|
|
54
|
-
$ref: ./paths/
|
|
55
|
-
/graphql/
|
|
56
|
-
$ref: ./paths/
|
|
57
|
-
/graphql/
|
|
58
|
-
$ref: ./paths/
|
|
59
|
-
/graphql/
|
|
60
|
-
$ref: ./paths/
|
|
61
|
-
/graphql/
|
|
62
|
-
$ref: ./paths/
|
|
63
|
-
/graphql/
|
|
64
|
-
$ref: ./paths/follow.yaml#/paths/~1graphql~
|
|
65
|
-
/graphql/
|
|
66
|
-
$ref: ./paths/
|
|
67
|
-
/graphql/
|
|
68
|
-
$ref: ./paths/
|
|
69
|
-
/graphql/
|
|
70
|
-
$ref: ./paths/
|
|
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/post.yaml#/paths/~1graphql~
|
|
81
|
-
/graphql/
|
|
82
|
-
$ref: ./paths/user.yaml#/paths/~1graphql~
|
|
83
|
-
/graphql/
|
|
84
|
-
$ref: ./paths/
|
|
85
|
-
/graphql/
|
|
86
|
-
$ref: ./paths/
|
|
87
|
-
/graphql/
|
|
88
|
-
$ref: ./paths/
|
|
51
|
+
/graphql/{pathQueryId}/Bookmarks:
|
|
52
|
+
$ref: ./paths/bookmarks.yaml#/paths/~1graphql~1{pathQueryId}~1Bookmarks
|
|
53
|
+
/graphql/{pathQueryId}/CreateRetweet:
|
|
54
|
+
$ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1CreateRetweet
|
|
55
|
+
/graphql/{pathQueryId}/CreateTweet:
|
|
56
|
+
$ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1CreateTweet
|
|
57
|
+
/graphql/{pathQueryId}/DeleteRetweet:
|
|
58
|
+
$ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1DeleteRetweet
|
|
59
|
+
/graphql/{pathQueryId}/DeleteTweet:
|
|
60
|
+
$ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1DeleteTweet
|
|
61
|
+
/graphql/{pathQueryId}/FavoriteTweet:
|
|
62
|
+
$ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1FavoriteTweet
|
|
63
|
+
/graphql/{pathQueryId}/Followers:
|
|
64
|
+
$ref: ./paths/follow.yaml#/paths/~1graphql~1{pathQueryId}~1Followers
|
|
65
|
+
/graphql/{pathQueryId}/Following:
|
|
66
|
+
$ref: ./paths/follow.yaml#/paths/~1graphql~1{pathQueryId}~1Following
|
|
67
|
+
/graphql/{pathQueryId}/HomeLatestTimeline:
|
|
68
|
+
$ref: ./paths/timeline.yaml#/paths/~1graphql~1{pathQueryId}~1HomeLatestTimeline
|
|
69
|
+
/graphql/{pathQueryId}/HomeTimeline:
|
|
70
|
+
$ref: ./paths/timeline.yaml#/paths/~1graphql~1{pathQueryId}~1HomeTimeline
|
|
71
|
+
/graphql/{pathQueryId}/Likes:
|
|
72
|
+
$ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1Likes
|
|
73
|
+
/graphql/{pathQueryId}/ListLatestTweetsTimeline:
|
|
74
|
+
$ref: ./paths/timeline.yaml#/paths/~1graphql~1{pathQueryId}~1ListLatestTweetsTimeline
|
|
75
|
+
/graphql/{pathQueryId}/ProfileSpotlightsQuery:
|
|
76
|
+
$ref: ./paths/profile.yaml#/paths/~1graphql~1{pathQueryId}~1ProfileSpotlightsQuery
|
|
77
|
+
/graphql/{pathQueryId}/TweetDetail:
|
|
78
|
+
$ref: ./paths/tweet.yaml#/paths/~1graphql~1{pathQueryId}~1TweetDetail
|
|
79
|
+
/graphql/{pathQueryId}/UnfavoriteTweet:
|
|
80
|
+
$ref: ./paths/post.yaml#/paths/~1graphql~1{pathQueryId}~1UnfavoriteTweet
|
|
81
|
+
/graphql/{pathQueryId}/UserByScreenName:
|
|
82
|
+
$ref: ./paths/user.yaml#/paths/~1graphql~1{pathQueryId}~1UserByScreenName
|
|
83
|
+
/graphql/{pathQueryId}/UserMedia:
|
|
84
|
+
$ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1UserMedia
|
|
85
|
+
/graphql/{pathQueryId}/UserTweets:
|
|
86
|
+
$ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1UserTweets
|
|
87
|
+
/graphql/{pathQueryId}/UserTweetsAndReplies:
|
|
88
|
+
$ref: ./paths/usertweets.yaml#/paths/~1graphql~1{pathQueryId}~1UserTweetsAndReplies
|
|
89
89
|
/other:
|
|
90
90
|
$ref: ./paths/other.yaml#/paths/~1other
|
|
91
91
|
security:
|
|
@@ -23,7 +23,7 @@ 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
|
|
@@ -57,6 +57,13 @@ paths:
|
|
|
57
57
|
default: en
|
|
58
58
|
description: language code.
|
|
59
59
|
type: string
|
|
60
|
+
- in: path
|
|
61
|
+
name: pathQueryId
|
|
62
|
+
required: true
|
|
63
|
+
schema:
|
|
64
|
+
default: tmd4ifV8RHltzn8ymGg1aw
|
|
65
|
+
example: tmd4ifV8RHltzn8ymGg1aw
|
|
66
|
+
type: string
|
|
60
67
|
- in: query
|
|
61
68
|
name: queryId
|
|
62
69
|
required: true
|
|
@@ -38,10 +38,10 @@ 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
46
|
- in: header
|
|
47
47
|
name: user-agent
|
|
@@ -72,12 +72,19 @@ paths:
|
|
|
72
72
|
default: en
|
|
73
73
|
description: language code.
|
|
74
74
|
type: string
|
|
75
|
+
- in: path
|
|
76
|
+
name: pathQueryId
|
|
77
|
+
required: true
|
|
78
|
+
schema:
|
|
79
|
+
default: djdTXDIk2qhd4OStqlUFeQ
|
|
80
|
+
example: djdTXDIk2qhd4OStqlUFeQ
|
|
81
|
+
type: string
|
|
75
82
|
- in: query
|
|
76
83
|
name: queryId
|
|
77
84
|
required: true
|
|
78
85
|
schema:
|
|
79
|
-
default: '"
|
|
80
|
-
example: '"
|
|
86
|
+
default: '"djdTXDIk2qhd4OStqlUFeQ"'
|
|
87
|
+
example: '"djdTXDIk2qhd4OStqlUFeQ"'
|
|
81
88
|
type: string
|
|
82
89
|
- in: query
|
|
83
90
|
name: variables
|
|
@@ -149,10 +156,10 @@ paths:
|
|
|
149
156
|
type: string
|
|
150
157
|
tags:
|
|
151
158
|
- user-list
|
|
152
|
-
/graphql/
|
|
159
|
+
/graphql/{pathQueryId}/Following:
|
|
153
160
|
get:
|
|
154
|
-
description: get user list of
|
|
155
|
-
operationId:
|
|
161
|
+
description: get user list of following
|
|
162
|
+
operationId: getFollowing
|
|
156
163
|
parameters:
|
|
157
164
|
- in: header
|
|
158
165
|
name: user-agent
|
|
@@ -183,12 +190,19 @@ paths:
|
|
|
183
190
|
default: en
|
|
184
191
|
description: language code.
|
|
185
192
|
type: string
|
|
193
|
+
- in: path
|
|
194
|
+
name: pathQueryId
|
|
195
|
+
required: true
|
|
196
|
+
schema:
|
|
197
|
+
default: IWP6Zt14sARO29lJT35bBw
|
|
198
|
+
example: IWP6Zt14sARO29lJT35bBw
|
|
199
|
+
type: string
|
|
186
200
|
- in: query
|
|
187
201
|
name: queryId
|
|
188
202
|
required: true
|
|
189
203
|
schema:
|
|
190
|
-
default: '"
|
|
191
|
-
example: '"
|
|
204
|
+
default: '"IWP6Zt14sARO29lJT35bBw"'
|
|
205
|
+
example: '"IWP6Zt14sARO29lJT35bBw"'
|
|
192
206
|
type: string
|
|
193
207
|
- in: query
|
|
194
208
|
name: variables
|