From 749668901f7b10824f86ce2c4403b2c188f548fe Mon Sep 17 00:00:00 2001 From: Lutwidse Date: Wed, 26 Apr 2023 19:38:27 +0900 Subject: [PATCH 1/8] add post API (temporal) --- src/config/placeholder_post.json | 77 ++++++++++++ src/openapi/paths/post.yaml | 193 +++++++++++++++++++++++++++++++ src/openapi/schemas/post.yaml | 71 ++++++++++++ 3 files changed, 341 insertions(+) create mode 100644 src/config/placeholder_post.json create mode 100644 src/openapi/paths/post.yaml create mode 100644 src/openapi/schemas/post.yaml diff --git a/src/config/placeholder_post.json b/src/config/placeholder_post.json new file mode 100644 index 0000000..3bdb108 --- /dev/null +++ b/src/config/placeholder_post.json @@ -0,0 +1,77 @@ +{ + "FavoriteTweet": { + "Query": "lI07N6Otwv1PhnEgXILM7A", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": { + } + }, + "UnfavoriteTweet": { + "Query": "ZYKSe-w7KEslx3JhSIk5LA", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": { + } + }, + "CreateRetweet": { + "Query": "ojPdsZsimiJrUGLR1sjUtA", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": { + } + }, + "DeleteRetweet": { + "Query": "iQtK4dl5hBmXewYZuEOKVw", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": { + } + }, + + "CreateTweet": { + "Query": "1RyAhNwby-gzGCRVsMxKbQ", + "Variables": { + "tweet_text": "test", + "media": { + "media_entities":[], + "possibly_sensitive": false + }, + "semantic_annotation_ids":[] + }, + "Features": { + "tweetypie_unmention_optimization_enabled": true, + "vibe_api_enabled": true,"responsive_web_edit_tweet_api_enabled": true, + "graphql_is_translatable_rweb_tweet_is_translatable_enabled": true, + "view_counts_everywhere_api_enabled": true,"longform_notetweets_consumption_enabled": true, + "tweet_awards_web_tipping_enabled": false,"interactive_text_enabled": true, + "responsive_web_text_conversations_enabled": false, + "longform_notetweets_rich_text_read_enabled": true, + "blue_business_profile_image_shape_enabled": true, + "responsive_web_graphql_exclude_directive_enabled": true, + "verified_phone_label_enabled": false, + "freedom_of_speech_not_reach_fetch_enabled": true, + "standardized_nudges_misinfo": true, + "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": false, + "responsive_web_graphql_skip_user_profile_image_extensions_enabled": false, + "responsive_web_graphql_timeline_navigation_enabled": true, + "responsive_web_enhance_cards_enabled": false + } + }, + "DeleteTweet": { + "Query": "VaenaVgh5q5ih7kvyVjgtg", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": { + } + }, + "Template": { + "Query": "", + "Variables": {}, + "Features": {} + } +} \ No newline at end of file diff --git a/src/openapi/paths/post.yaml b/src/openapi/paths/post.yaml new file mode 100644 index 0000000..06725f2 --- /dev/null +++ b/src/openapi/paths/post.yaml @@ -0,0 +1,193 @@ +openapi: 3.0.3 +info: + title: Twitter OpenAPI + version: 0.0.1 + +paths: + /{{FavoriteTweetQuery}}/FavoriteTweet: + post: + operationId: favoriteTweet + description: favorite Tweet + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/FavoriteTweetResponseData" + tags: + - "Post" + + /{{UnfavoriteTweetQuery}}/UnfavoriteTweet: + post: + operationId: unfavoriteTweet + description: unfavorite Tweet + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/UnfavoriteTweetResponseData" + tags: + - "Post" + + /{{CreateRetweetQuery}}/CreateRetweet: + post: + operationId: createRetweet + description: create Retweet + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/CreateRetweetResponse" + tags: + - "Post" + + /{{DeleteRetweetQuery}}/DeleteRetweet: + post: + operationId: deleteRetweet + description: delete Retweet + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteRetweetResponse" + tags: + - "Post" + + /{{CreateTweetQuery}}/CreateTweet: + post: + operationId: createTweet + description: create Tweet + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTweetResponse" + tags: + - "Post" + + /{{DeleteTweetQuery}}/DeleteTweet: + post: + operationId: deleteTweet + description: delete Retweet + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/DeleteTweetResponse" + tags: + - "Post" + +components: + schemas: + FavoriteTweetResponseData: + required: + - "data" + properties: + data: + $ref: "./../schemas/post.yaml#/components/schemas/FavoriteTweet" + + UnfavoriteTweetResponseData: + required: + - "data" + properties: + data: + $ref: "./../schemas/post.yaml#/components/schemas/UnfavoriteTweet" + + # ---Retweet--- + + CreateRetweetResponse: + required: + - "data" + properties: + data: + $ref: "#/components/schemas/CreateRetweetResponseData" + + CreateRetweetResponseData: + required: + - "create_retweet" + properties: + create_retweet: + $ref: "#/components/schemas/CreateRetweetResponseResult" + + CreateRetweetResponseResult: + required: + - "retweet_results" + properties: + retweet_results: + $ref: "./../schemas/post.yaml#/components/schemas/CreateRetweet" + + DeleteRetweetResponse: + required: + - "data" + properties: + data: + $ref: "#/components/schemas/DeleteRetweetResponseData" + + DeleteRetweetResponseData: + required: + - "unretweet" + properties: + create_retweet: + $ref: "#/components/schemas/CreateRetweetResponseResult" + + DeleteRetweetResponseResult: + required: + - "source_tweet_results" + properties: + retweet_results: + $ref: "./../schemas/post.yaml#/components/schemas/DeleteRetweet" + + # ---Tweet--- + + CreateTweetResponse: + required: + - "data" + properties: + data: + $ref: "#/components/schemas/CreateTweetResponseData" + + CreateTweetResponseData: + required: + - "create_tweet" + properties: + create_retweet: + $ref: "#/components/schemas/CreateTweetResponseResult" + + CreateTweetResponseResult: + required: + - "tweet_results" + properties: + tweet_results: + $ref: "./../schemas/post.yaml#/components/schemas/CreateTweet" + + DeleteTweetResponse: + required: + - "data" + properties: + data: + $ref: "#/components/schemas/DeleteTweetResponseData" + + DeleteTweetResponseData: + required: + - "delete_tweet" + properties: + delete_retweet: + $ref: "#/components/schemas/DeleteTweetResponseResult" + + DeleteTweetResponseResult: + required: + - "tweet_results" + properties: + tweet_results: + $ref: "./../schemas/post.yaml#/components/schemas/DeleteTweet" \ No newline at end of file diff --git a/src/openapi/schemas/post.yaml b/src/openapi/schemas/post.yaml new file mode 100644 index 0000000..27509bb --- /dev/null +++ b/src/openapi/schemas/post.yaml @@ -0,0 +1,71 @@ +openapi: 3.0.3 +info: + title: Twitter OpenAPI + version: 0.0.1 + +paths: {} +components: + schemas: + FavoriteTweet: + required: + - "favorite_tweet" + properties: + favorite_tweet: + type: string + + UnfavoriteTweet: + required: + - "unfavorite_tweet" + properties: + unfavorite_tweet: + type: string + + # ---Retweet--- + + CreateRetweet: + required: + - "result" + properties: + result: + type: object + items: + $ref: "#/components/schemas/Retweet" + + DeleteRetweet: + required: + - "result" + properties: + result: + type: object + items: + $ref: "#/components/schemas/Retweet" + + Retweet: + required: + - "rest_id" + - "legacy" + properties: + rest_id: + type: string + legacy: + type: object + items: + properties: + full_text: + type: string + + # ---Tweet--- + + CreateTweet: + required: + - "result" + properties: + result: + type: object + items: + $ref: "./tweet.yaml#/components/schemas/Tweet" + + DeleteTweet: + properties: + type: object + nullable: true \ No newline at end of file From 1361660774dd2a4ca5f1302a8e4206d538a3a1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Wed, 26 Apr 2023 20:10:49 +0900 Subject: [PATCH 2/8] add support build other method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- tools/build.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/build.py b/tools/build.py index 339b1a4..3421c3a 100644 --- a/tools/build.py +++ b/tools/build.py @@ -40,6 +40,7 @@ class placeholder_manager: OUTPUT_DIR = "dist/{0}" INPUT_DIR = "src/openapi" +METHODS = ["get", "put", "post", "delete", "options", "head", "patch", "trace"] try: shutil.rmtree("dist") @@ -96,15 +97,18 @@ for lang in variable.keys(): for key in load["paths"].keys(): append = get_yaml(parameters, key.split("/")[-1]) - req = load["paths"][key]["get"] - req["parameters"] = append["paths"]["/parameters"]["get"]["parameters"] + param = append["paths"]["/parameters"] + for method in METHODS: + if load["paths"][key].get(method, None) is not None: + req = load["paths"][key][method] + req["parameters"] = param["get"]["parameters"] - append = get_yaml(header, key.split("/")[-1]) - req = load["paths"][key]["get"] - req["responses"]["200"]["headers"] = append["components"]["headers"] + append = get_yaml(header, key.split("/")[-1]) + req = load["paths"][key][method] + req["responses"]["200"]["headers"] = append["components"]["headers"] - escape = key.replace("/", "~1") - paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}}) + escape = key.replace("/", "~1") + paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}}) write(file, yaml.dump(load)) file = "src/openapi/openapi-3.0.yaml" From 8594830875694e3d1d4e3747264c6206e9f00c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Wed, 26 Apr 2023 20:22:43 +0900 Subject: [PATCH 3/8] move placeholder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/config/placeholder.json | 67 +++++++++++++++++++++++++++ src/config/placeholder_post.json | 77 -------------------------------- 2 files changed, 67 insertions(+), 77 deletions(-) delete mode 100644 src/config/placeholder_post.json diff --git a/src/config/placeholder.json b/src/config/placeholder.json index f8bf078..0743e8b 100644 --- a/src/config/placeholder.json +++ b/src/config/placeholder.json @@ -360,6 +360,73 @@ "responsive_web_enhance_cards_enabled": false } }, + "FavoriteTweet": { + "Query": "lI07N6Otwv1PhnEgXILM7A", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": {} + }, + "UnfavoriteTweet": { + "Query": "ZYKSe-w7KEslx3JhSIk5LA", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": {} + }, + "CreateRetweet": { + "Query": "ojPdsZsimiJrUGLR1sjUtA", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": {} + }, + "DeleteRetweet": { + "Query": "iQtK4dl5hBmXewYZuEOKVw", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": {} + }, + "CreateTweet": { + "Query": "1RyAhNwby-gzGCRVsMxKbQ", + "Variables": { + "tweet_text": "test", + "media": { + "media_entities": [], + "possibly_sensitive": false + }, + "semantic_annotation_ids": [] + }, + "Features": { + "tweetypie_unmention_optimization_enabled": true, + "vibe_api_enabled": true, + "responsive_web_edit_tweet_api_enabled": true, + "graphql_is_translatable_rweb_tweet_is_translatable_enabled": true, + "view_counts_everywhere_api_enabled": true, + "longform_notetweets_consumption_enabled": true, + "tweet_awards_web_tipping_enabled": false, + "interactive_text_enabled": true, + "responsive_web_text_conversations_enabled": false, + "longform_notetweets_rich_text_read_enabled": true, + "blue_business_profile_image_shape_enabled": true, + "responsive_web_graphql_exclude_directive_enabled": true, + "verified_phone_label_enabled": false, + "freedom_of_speech_not_reach_fetch_enabled": true, + "standardized_nudges_misinfo": true, + "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": false, + "responsive_web_graphql_skip_user_profile_image_extensions_enabled": false, + "responsive_web_graphql_timeline_navigation_enabled": true, + "responsive_web_enhance_cards_enabled": false + } + }, + "DeleteTweet": { + "Query": "VaenaVgh5q5ih7kvyVjgtg", + "Variables": { + "tweet_id": "1349129669258448897" + }, + "Features": {} + }, "Template": { "Query": "", "Variables": {}, diff --git a/src/config/placeholder_post.json b/src/config/placeholder_post.json deleted file mode 100644 index 3bdb108..0000000 --- a/src/config/placeholder_post.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "FavoriteTweet": { - "Query": "lI07N6Otwv1PhnEgXILM7A", - "Variables": { - "tweet_id": "1349129669258448897" - }, - "Features": { - } - }, - "UnfavoriteTweet": { - "Query": "ZYKSe-w7KEslx3JhSIk5LA", - "Variables": { - "tweet_id": "1349129669258448897" - }, - "Features": { - } - }, - "CreateRetweet": { - "Query": "ojPdsZsimiJrUGLR1sjUtA", - "Variables": { - "tweet_id": "1349129669258448897" - }, - "Features": { - } - }, - "DeleteRetweet": { - "Query": "iQtK4dl5hBmXewYZuEOKVw", - "Variables": { - "tweet_id": "1349129669258448897" - }, - "Features": { - } - }, - - "CreateTweet": { - "Query": "1RyAhNwby-gzGCRVsMxKbQ", - "Variables": { - "tweet_text": "test", - "media": { - "media_entities":[], - "possibly_sensitive": false - }, - "semantic_annotation_ids":[] - }, - "Features": { - "tweetypie_unmention_optimization_enabled": true, - "vibe_api_enabled": true,"responsive_web_edit_tweet_api_enabled": true, - "graphql_is_translatable_rweb_tweet_is_translatable_enabled": true, - "view_counts_everywhere_api_enabled": true,"longform_notetweets_consumption_enabled": true, - "tweet_awards_web_tipping_enabled": false,"interactive_text_enabled": true, - "responsive_web_text_conversations_enabled": false, - "longform_notetweets_rich_text_read_enabled": true, - "blue_business_profile_image_shape_enabled": true, - "responsive_web_graphql_exclude_directive_enabled": true, - "verified_phone_label_enabled": false, - "freedom_of_speech_not_reach_fetch_enabled": true, - "standardized_nudges_misinfo": true, - "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": false, - "responsive_web_graphql_skip_user_profile_image_extensions_enabled": false, - "responsive_web_graphql_timeline_navigation_enabled": true, - "responsive_web_enhance_cards_enabled": false - } - }, - "DeleteTweet": { - "Query": "VaenaVgh5q5ih7kvyVjgtg", - "Variables": { - "tweet_id": "1349129669258448897" - }, - "Features": { - } - }, - "Template": { - "Query": "", - "Variables": {}, - "Features": {} - } -} \ No newline at end of file From 01eee8484d3f5d7c1aca60718ee3c7aad93aa051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Wed, 26 Apr 2023 20:22:49 +0900 Subject: [PATCH 4/8] build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/dart/openapi-3.0.yaml | 12 + dist/dart/paths/post.yaml | 678 ++++++++++++++++++++++++++++++ dist/dart/schemas/post.yaml | 60 +++ dist/typescript/openapi-3.0.yaml | 12 + dist/typescript/paths/post.yaml | 504 ++++++++++++++++++++++ dist/typescript/schemas/post.yaml | 60 +++ src/openapi/paths/post.yaml | 8 +- 7 files changed, 1330 insertions(+), 4 deletions(-) create mode 100644 dist/dart/paths/post.yaml create mode 100644 dist/dart/schemas/post.yaml create mode 100644 dist/typescript/paths/post.yaml create mode 100644 dist/typescript/schemas/post.yaml diff --git a/dist/dart/openapi-3.0.yaml b/dist/dart/openapi-3.0.yaml index 13e48f5..0300b26 100644 --- a/dist/dart/openapi-3.0.yaml +++ b/dist/dart/openapi-3.0.yaml @@ -33,6 +33,8 @@ info: version: 0.0.1 openapi: 3.0.3 paths: + /1RyAhNwby-gzGCRVsMxKbQ/CreateTweet: + $ref: ./paths/post.yaml#/paths/~11RyAhNwby-gzGCRVsMxKbQ~1CreateTweet /2TemLyqrMpTeAmysdbnVqw/ListLatestTweetsTimeline: $ref: ./paths/timeline.yaml#/paths/~12TemLyqrMpTeAmysdbnVqw~1ListLatestTweetsTimeline /5fmEkRT-1AdHqEsbVgehMg/Likes: @@ -47,10 +49,20 @@ paths: $ref: ./paths/follow.yaml#/paths/~1IWP6Zt14sARO29lJT35bBw~1Following /RIWc55YCNyUJ-U3HHGYkdg/UserTweetsAndReplies: $ref: ./paths/usertweets.yaml#/paths/~1RIWc55YCNyUJ-U3HHGYkdg~1UserTweetsAndReplies + /VaenaVgh5q5ih7kvyVjgtg/DeleteTweet: + $ref: ./paths/post.yaml#/paths/~1VaenaVgh5q5ih7kvyVjgtg~1DeleteTweet /YqiE3JL1KNgf9nSljYdxaA/UserMedia: $ref: ./paths/usertweets.yaml#/paths/~1YqiE3JL1KNgf9nSljYdxaA~1UserMedia + /ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet: + $ref: ./paths/post.yaml#/paths/~1ZYKSe-w7KEslx3JhSIk5LA~1UnfavoriteTweet /djdTXDIk2qhd4OStqlUFeQ/Followers: $ref: ./paths/follow.yaml#/paths/~1djdTXDIk2qhd4OStqlUFeQ~1Followers + /iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet: + $ref: ./paths/post.yaml#/paths/~1iQtK4dl5hBmXewYZuEOKVw~1DeleteRetweet + /lI07N6Otwv1PhnEgXILM7A/FavoriteTweet: + $ref: ./paths/post.yaml#/paths/~1lI07N6Otwv1PhnEgXILM7A~1FavoriteTweet + /ojPdsZsimiJrUGLR1sjUtA/CreateRetweet: + $ref: ./paths/post.yaml#/paths/~1ojPdsZsimiJrUGLR1sjUtA~1CreateRetweet /sLVLhk0bGj3MVFEKTdax1w/UserByScreenName: $ref: ./paths/user.yaml#/paths/~1sLVLhk0bGj3MVFEKTdax1w~1UserByScreenName /tmd4ifV8RHltzn8ymGg1aw/Bookmarks: diff --git a/dist/dart/paths/post.yaml b/dist/dart/paths/post.yaml new file mode 100644 index 0000000..ad507a8 --- /dev/null +++ b/dist/dart/paths/post.yaml @@ -0,0 +1,678 @@ +components: + schemas: + CreateRetweetResponse: + properties: + data: + $ref: '#/components/schemas/CreateRetweetResponseData' + required: + - data + CreateRetweetResponseData: + properties: + create_retweet: + $ref: '#/components/schemas/CreateRetweetResponseResult' + required: + - create_retweet + CreateRetweetResponseResult: + properties: + retweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/CreateRetweet + required: + - retweet_results + CreateTweetResponse: + properties: + data: + $ref: '#/components/schemas/CreateTweetResponseData' + required: + - data + CreateTweetResponseData: + properties: + create_retweet: + $ref: '#/components/schemas/CreateTweetResponseResult' + required: + - create_tweet + CreateTweetResponseResult: + properties: + tweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/CreateTweet + required: + - tweet_results + DeleteRetweetResponse: + properties: + data: + $ref: '#/components/schemas/DeleteRetweetResponseData' + required: + - data + DeleteRetweetResponseData: + properties: + create_retweet: + $ref: '#/components/schemas/CreateRetweetResponseResult' + required: + - unretweet + DeleteRetweetResponseResult: + properties: + retweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/DeleteRetweet + required: + - source_tweet_results + DeleteTweetResponse: + properties: + data: + $ref: '#/components/schemas/DeleteTweetResponseData' + required: + - data + DeleteTweetResponseData: + properties: + delete_retweet: + $ref: '#/components/schemas/DeleteTweetResponseResult' + required: + - delete_tweet + DeleteTweetResponseResult: + properties: + tweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/DeleteTweet + required: + - tweet_results + FavoriteTweetResponseData: + properties: + data: + $ref: ./../schemas/post.yaml#/components/schemas/FavoriteTweet + required: + - data + UnfavoriteTweetResponseData: + properties: + data: + $ref: ./../schemas/post.yaml#/components/schemas/UnfavoriteTweet + required: + - data +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: + /1RyAhNwby-gzGCRVsMxKbQ/CreateTweet: + post: + description: create Tweet + operationId: createTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_text": "test", "media": {"media_entities": [], "possibly_sensitive": + false}, "semantic_annotation_ids": []}' + type: string + - in: query + name: features + required: true + schema: + example: '{"tweetypie_unmention_optimization_enabled": true, "vibe_api_enabled": + true, "responsive_web_edit_tweet_api_enabled": true, "graphql_is_translatable_rweb_tweet_is_translatable_enabled": + true, "view_counts_everywhere_api_enabled": true, "longform_notetweets_consumption_enabled": + true, "tweet_awards_web_tipping_enabled": false, "interactive_text_enabled": + true, "responsive_web_text_conversations_enabled": false, "longform_notetweets_rich_text_read_enabled": + true, "blue_business_profile_image_shape_enabled": true, "responsive_web_graphql_exclude_directive_enabled": + true, "verified_phone_label_enabled": false, "freedom_of_speech_not_reach_fetch_enabled": + true, "standardized_nudges_misinfo": true, "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": + false, "responsive_web_graphql_skip_user_profile_image_extensions_enabled": + false, "responsive_web_graphql_timeline_navigation_enabled": true, "responsive_web_enhance_cards_enabled": + false}' + type: string + - in: query + name: queryId + required: true + schema: + default: 1RyAhNwby-gzGCRVsMxKbQ + example: 1RyAhNwby-gzGCRVsMxKbQ + type: string + - in: header + name: authorization + required: true + schema: + default: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA + description: It is a constant value and does not need to be changed. + type: string + - in: header + name: x-twitter-active-user + required: true + schema: + default: 'yes' + description: Unknown what this value means. + type: string + - in: header + name: x-twitter-client-language + required: true + schema: + default: en + description: language code. + type: string + - in: header + name: user-agent + required: true + schema: + default: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/112.0.0.0 Safari/537.36 + description: UserAgent, some APIs may be rejected if changed. + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /VaenaVgh5q5ih7kvyVjgtg/DeleteTweet: + post: + description: delete Retweet + operationId: deleteTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: VaenaVgh5q5ih7kvyVjgtg + example: VaenaVgh5q5ih7kvyVjgtg + type: string + - in: header + name: authorization + required: true + schema: + default: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA + description: It is a constant value and does not need to be changed. + type: string + - in: header + name: x-twitter-active-user + required: true + schema: + default: 'yes' + description: Unknown what this value means. + type: string + - in: header + name: x-twitter-client-language + required: true + schema: + default: en + description: language code. + type: string + - in: header + name: user-agent + required: true + schema: + default: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/112.0.0.0 Safari/537.36 + description: UserAgent, some APIs may be rejected if changed. + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteTweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet: + post: + description: unfavorite Tweet + operationId: unfavoriteTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: ZYKSe-w7KEslx3JhSIk5LA + example: ZYKSe-w7KEslx3JhSIk5LA + type: string + - in: header + name: authorization + required: true + schema: + default: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA + description: It is a constant value and does not need to be changed. + type: string + - in: header + name: x-twitter-active-user + required: true + schema: + default: 'yes' + description: Unknown what this value means. + type: string + - in: header + name: x-twitter-client-language + required: true + schema: + default: en + description: language code. + type: string + - in: header + name: user-agent + required: true + schema: + default: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/112.0.0.0 Safari/537.36 + description: UserAgent, some APIs may be rejected if changed. + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UnfavoriteTweetResponseData' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet: + post: + description: delete Retweet + operationId: deleteRetweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: iQtK4dl5hBmXewYZuEOKVw + example: iQtK4dl5hBmXewYZuEOKVw + type: string + - in: header + name: authorization + required: true + schema: + default: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA + description: It is a constant value and does not need to be changed. + type: string + - in: header + name: x-twitter-active-user + required: true + schema: + default: 'yes' + description: Unknown what this value means. + type: string + - in: header + name: x-twitter-client-language + required: true + schema: + default: en + description: language code. + type: string + - in: header + name: user-agent + required: true + schema: + default: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/112.0.0.0 Safari/537.36 + description: UserAgent, some APIs may be rejected if changed. + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteRetweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /lI07N6Otwv1PhnEgXILM7A/FavoriteTweet: + post: + description: favorite Tweet + operationId: favoriteTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: lI07N6Otwv1PhnEgXILM7A + example: lI07N6Otwv1PhnEgXILM7A + type: string + - in: header + name: authorization + required: true + schema: + default: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA + description: It is a constant value and does not need to be changed. + type: string + - in: header + name: x-twitter-active-user + required: true + schema: + default: 'yes' + description: Unknown what this value means. + type: string + - in: header + name: x-twitter-client-language + required: true + schema: + default: en + description: language code. + type: string + - in: header + name: user-agent + required: true + schema: + default: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/112.0.0.0 Safari/537.36 + description: UserAgent, some APIs may be rejected if changed. + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FavoriteTweetResponseData' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /ojPdsZsimiJrUGLR1sjUtA/CreateRetweet: + post: + description: create Retweet + operationId: createRetweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: ojPdsZsimiJrUGLR1sjUtA + example: ojPdsZsimiJrUGLR1sjUtA + type: string + - in: header + name: authorization + required: true + schema: + default: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA + description: It is a constant value and does not need to be changed. + type: string + - in: header + name: x-twitter-active-user + required: true + schema: + default: 'yes' + description: Unknown what this value means. + type: string + - in: header + name: x-twitter-client-language + required: true + schema: + default: en + description: language code. + type: string + - in: header + name: user-agent + required: true + schema: + default: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, + like Gecko) Chrome/112.0.0.0 Safari/537.36 + description: UserAgent, some APIs may be rejected if changed. + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateRetweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post diff --git a/dist/dart/schemas/post.yaml b/dist/dart/schemas/post.yaml new file mode 100644 index 0000000..cf686ef --- /dev/null +++ b/dist/dart/schemas/post.yaml @@ -0,0 +1,60 @@ +components: + schemas: + CreateRetweet: + properties: + result: + items: + $ref: '#/components/schemas/Retweet' + type: object + required: + - result + CreateTweet: + properties: + result: + items: + $ref: ./tweet.yaml#/components/schemas/Tweet + type: object + required: + - result + DeleteRetweet: + properties: + result: + items: + $ref: '#/components/schemas/Retweet' + type: object + required: + - result + DeleteTweet: + properties: + nullable: true + type: object + FavoriteTweet: + properties: + favorite_tweet: + type: string + required: + - favorite_tweet + Retweet: + properties: + legacy: + items: + properties: + full_text: + type: string + type: object + rest_id: + type: string + required: + - rest_id + - legacy + UnfavoriteTweet: + properties: + unfavorite_tweet: + type: string + required: + - unfavorite_tweet +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: {} diff --git a/dist/typescript/openapi-3.0.yaml b/dist/typescript/openapi-3.0.yaml index 2d55929..0b1141b 100644 --- a/dist/typescript/openapi-3.0.yaml +++ b/dist/typescript/openapi-3.0.yaml @@ -53,6 +53,8 @@ info: version: 0.0.1 openapi: 3.0.3 paths: + /1RyAhNwby-gzGCRVsMxKbQ/CreateTweet: + $ref: ./paths/post.yaml#/paths/~11RyAhNwby-gzGCRVsMxKbQ~1CreateTweet /2TemLyqrMpTeAmysdbnVqw/ListLatestTweetsTimeline: $ref: ./paths/timeline.yaml#/paths/~12TemLyqrMpTeAmysdbnVqw~1ListLatestTweetsTimeline /5fmEkRT-1AdHqEsbVgehMg/Likes: @@ -67,10 +69,20 @@ paths: $ref: ./paths/follow.yaml#/paths/~1IWP6Zt14sARO29lJT35bBw~1Following /RIWc55YCNyUJ-U3HHGYkdg/UserTweetsAndReplies: $ref: ./paths/usertweets.yaml#/paths/~1RIWc55YCNyUJ-U3HHGYkdg~1UserTweetsAndReplies + /VaenaVgh5q5ih7kvyVjgtg/DeleteTweet: + $ref: ./paths/post.yaml#/paths/~1VaenaVgh5q5ih7kvyVjgtg~1DeleteTweet /YqiE3JL1KNgf9nSljYdxaA/UserMedia: $ref: ./paths/usertweets.yaml#/paths/~1YqiE3JL1KNgf9nSljYdxaA~1UserMedia + /ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet: + $ref: ./paths/post.yaml#/paths/~1ZYKSe-w7KEslx3JhSIk5LA~1UnfavoriteTweet /djdTXDIk2qhd4OStqlUFeQ/Followers: $ref: ./paths/follow.yaml#/paths/~1djdTXDIk2qhd4OStqlUFeQ~1Followers + /iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet: + $ref: ./paths/post.yaml#/paths/~1iQtK4dl5hBmXewYZuEOKVw~1DeleteRetweet + /lI07N6Otwv1PhnEgXILM7A/FavoriteTweet: + $ref: ./paths/post.yaml#/paths/~1lI07N6Otwv1PhnEgXILM7A~1FavoriteTweet + /ojPdsZsimiJrUGLR1sjUtA/CreateRetweet: + $ref: ./paths/post.yaml#/paths/~1ojPdsZsimiJrUGLR1sjUtA~1CreateRetweet /sLVLhk0bGj3MVFEKTdax1w/UserByScreenName: $ref: ./paths/user.yaml#/paths/~1sLVLhk0bGj3MVFEKTdax1w~1UserByScreenName /tmd4ifV8RHltzn8ymGg1aw/Bookmarks: diff --git a/dist/typescript/paths/post.yaml b/dist/typescript/paths/post.yaml new file mode 100644 index 0000000..a14c6df --- /dev/null +++ b/dist/typescript/paths/post.yaml @@ -0,0 +1,504 @@ +components: + schemas: + CreateRetweetResponse: + properties: + data: + $ref: '#/components/schemas/CreateRetweetResponseData' + required: + - data + CreateRetweetResponseData: + properties: + create_retweet: + $ref: '#/components/schemas/CreateRetweetResponseResult' + required: + - create_retweet + CreateRetweetResponseResult: + properties: + retweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/CreateRetweet + required: + - retweet_results + CreateTweetResponse: + properties: + data: + $ref: '#/components/schemas/CreateTweetResponseData' + required: + - data + CreateTweetResponseData: + properties: + create_retweet: + $ref: '#/components/schemas/CreateTweetResponseResult' + required: + - create_tweet + CreateTweetResponseResult: + properties: + tweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/CreateTweet + required: + - tweet_results + DeleteRetweetResponse: + properties: + data: + $ref: '#/components/schemas/DeleteRetweetResponseData' + required: + - data + DeleteRetweetResponseData: + properties: + create_retweet: + $ref: '#/components/schemas/CreateRetweetResponseResult' + required: + - unretweet + DeleteRetweetResponseResult: + properties: + retweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/DeleteRetweet + required: + - source_tweet_results + DeleteTweetResponse: + properties: + data: + $ref: '#/components/schemas/DeleteTweetResponseData' + required: + - data + DeleteTweetResponseData: + properties: + delete_retweet: + $ref: '#/components/schemas/DeleteTweetResponseResult' + required: + - delete_tweet + DeleteTweetResponseResult: + properties: + tweet_results: + $ref: ./../schemas/post.yaml#/components/schemas/DeleteTweet + required: + - tweet_results + FavoriteTweetResponseData: + properties: + data: + $ref: ./../schemas/post.yaml#/components/schemas/FavoriteTweet + required: + - data + UnfavoriteTweetResponseData: + properties: + data: + $ref: ./../schemas/post.yaml#/components/schemas/UnfavoriteTweet + required: + - data +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: + /1RyAhNwby-gzGCRVsMxKbQ/CreateTweet: + post: + description: create Tweet + operationId: createTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_text": "test", "media": {"media_entities": [], "possibly_sensitive": + false}, "semantic_annotation_ids": []}' + type: string + - in: query + name: features + required: true + schema: + example: '{"tweetypie_unmention_optimization_enabled": true, "vibe_api_enabled": + true, "responsive_web_edit_tweet_api_enabled": true, "graphql_is_translatable_rweb_tweet_is_translatable_enabled": + true, "view_counts_everywhere_api_enabled": true, "longform_notetweets_consumption_enabled": + true, "tweet_awards_web_tipping_enabled": false, "interactive_text_enabled": + true, "responsive_web_text_conversations_enabled": false, "longform_notetweets_rich_text_read_enabled": + true, "blue_business_profile_image_shape_enabled": true, "responsive_web_graphql_exclude_directive_enabled": + true, "verified_phone_label_enabled": false, "freedom_of_speech_not_reach_fetch_enabled": + true, "standardized_nudges_misinfo": true, "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": + false, "responsive_web_graphql_skip_user_profile_image_extensions_enabled": + false, "responsive_web_graphql_timeline_navigation_enabled": true, "responsive_web_enhance_cards_enabled": + false}' + type: string + - in: query + name: queryId + required: true + schema: + default: 1RyAhNwby-gzGCRVsMxKbQ + example: 1RyAhNwby-gzGCRVsMxKbQ + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /VaenaVgh5q5ih7kvyVjgtg/DeleteTweet: + post: + description: delete Retweet + operationId: deleteTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: VaenaVgh5q5ih7kvyVjgtg + example: VaenaVgh5q5ih7kvyVjgtg + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteTweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet: + post: + description: unfavorite Tweet + operationId: unfavoriteTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: ZYKSe-w7KEslx3JhSIk5LA + example: ZYKSe-w7KEslx3JhSIk5LA + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UnfavoriteTweetResponseData' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet: + post: + description: delete Retweet + operationId: deleteRetweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: iQtK4dl5hBmXewYZuEOKVw + example: iQtK4dl5hBmXewYZuEOKVw + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteRetweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /lI07N6Otwv1PhnEgXILM7A/FavoriteTweet: + post: + description: favorite Tweet + operationId: favoriteTweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: lI07N6Otwv1PhnEgXILM7A + example: lI07N6Otwv1PhnEgXILM7A + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FavoriteTweetResponseData' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post + /ojPdsZsimiJrUGLR1sjUtA/CreateRetweet: + post: + description: create Retweet + operationId: createRetweet + parameters: + - in: query + name: variables + required: true + schema: + example: '{"tweet_id": "1349129669258448897"}' + type: string + - in: query + name: features + required: true + schema: + example: '{}' + type: string + - in: query + name: queryId + required: true + schema: + default: ojPdsZsimiJrUGLR1sjUtA + example: ojPdsZsimiJrUGLR1sjUtA + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateRetweetResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-content-type-options: + schema: + type: string + x-frame-options: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + x-xss-protection: + schema: + type: integer + tags: + - Post diff --git a/dist/typescript/schemas/post.yaml b/dist/typescript/schemas/post.yaml new file mode 100644 index 0000000..cf686ef --- /dev/null +++ b/dist/typescript/schemas/post.yaml @@ -0,0 +1,60 @@ +components: + schemas: + CreateRetweet: + properties: + result: + items: + $ref: '#/components/schemas/Retweet' + type: object + required: + - result + CreateTweet: + properties: + result: + items: + $ref: ./tweet.yaml#/components/schemas/Tweet + type: object + required: + - result + DeleteRetweet: + properties: + result: + items: + $ref: '#/components/schemas/Retweet' + type: object + required: + - result + DeleteTweet: + properties: + nullable: true + type: object + FavoriteTweet: + properties: + favorite_tweet: + type: string + required: + - favorite_tweet + Retweet: + properties: + legacy: + items: + properties: + full_text: + type: string + type: object + rest_id: + type: string + required: + - rest_id + - legacy + UnfavoriteTweet: + properties: + unfavorite_tweet: + type: string + required: + - unfavorite_tweet +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: {} diff --git a/src/openapi/paths/post.yaml b/src/openapi/paths/post.yaml index 06725f2..93655ff 100644 --- a/src/openapi/paths/post.yaml +++ b/src/openapi/paths/post.yaml @@ -17,7 +17,7 @@ paths: $ref: "#/components/schemas/FavoriteTweetResponseData" tags: - "Post" - + /{{UnfavoriteTweetQuery}}/UnfavoriteTweet: post: operationId: unfavoriteTweet @@ -147,7 +147,7 @@ components: properties: retweet_results: $ref: "./../schemas/post.yaml#/components/schemas/DeleteRetweet" - + # ---Tweet--- CreateTweetResponse: @@ -170,7 +170,7 @@ components: properties: tweet_results: $ref: "./../schemas/post.yaml#/components/schemas/CreateTweet" - + DeleteTweetResponse: required: - "data" @@ -190,4 +190,4 @@ components: - "tweet_results" properties: tweet_results: - $ref: "./../schemas/post.yaml#/components/schemas/DeleteTweet" \ No newline at end of file + $ref: "./../schemas/post.yaml#/components/schemas/DeleteTweet" From 36554cc1a9ead671805be4839b55234e48a755c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 27 Apr 2023 11:49:08 +0900 Subject: [PATCH 5/8] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/config/parameters.yaml | 55 +++++++++++++++++++++++++++++++++++ src/openapi/schemas/post.yaml | 12 ++++---- tools/build.py | 2 +- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/config/parameters.yaml b/src/config/parameters.yaml index fa60c78..166bfb8 100644 --- a/src/config/parameters.yaml +++ b/src/config/parameters.yaml @@ -59,6 +59,61 @@ paths: # {% endif %} + post: + parameters: + - name: variables + in: query + required: true + schema: + type: object + example: "{{Variables}}" + - name: features + in: query + required: true + schema: + type: object + example: "{{Features}}" + - name: queryId + in: query + required: true + schema: + type: string + default: "{{Query}}" + example: "{{Query}}" + + # {% if header == parameters %} + + - name: authorization + in: header + required: true + schema: + type: string + default: "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA" + description: "It is a constant value and does not need to be changed." + - name: x-twitter-active-user + in: header + required: true + schema: + type: string + default: "yes" + description: "Unknown what this value means." + - name: x-twitter-client-language + in: header + required: true + schema: + type: string + default: "en" + description: "language code." + - name: user-agent + in: header + required: true + schema: + type: string + default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" + description: "UserAgent, some APIs may be rejected if changed." + + # {% endif %} + responses: "200": description: "" diff --git a/src/openapi/schemas/post.yaml b/src/openapi/schemas/post.yaml index 27509bb..69a1f94 100644 --- a/src/openapi/schemas/post.yaml +++ b/src/openapi/schemas/post.yaml @@ -21,7 +21,7 @@ components: type: string # ---Retweet--- - + CreateRetweet: required: - "result" @@ -30,7 +30,7 @@ components: type: object items: $ref: "#/components/schemas/Retweet" - + DeleteRetweet: required: - "result" @@ -53,7 +53,7 @@ components: properties: full_text: type: string - + # ---Tweet--- CreateTweet: @@ -64,8 +64,8 @@ components: type: object items: $ref: "./tweet.yaml#/components/schemas/Tweet" - + DeleteTweet: properties: - type: object - nullable: true \ No newline at end of file + result: + type: object diff --git a/tools/build.py b/tools/build.py index 3421c3a..87e64f6 100644 --- a/tools/build.py +++ b/tools/build.py @@ -101,7 +101,7 @@ for lang in variable.keys(): for method in METHODS: if load["paths"][key].get(method, None) is not None: req = load["paths"][key][method] - req["parameters"] = param["get"]["parameters"] + req["parameters"] = param[method]["parameters"] append = get_yaml(header, key.split("/")[-1]) req = load["paths"][key][method] From 2d0a071c0bd29a5fbfda568d51966680ea700020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 27 Apr 2023 19:29:02 +0900 Subject: [PATCH 6/8] fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/paths/post.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openapi/paths/post.yaml b/src/openapi/paths/post.yaml index 93655ff..6985d4c 100644 --- a/src/openapi/paths/post.yaml +++ b/src/openapi/paths/post.yaml @@ -161,7 +161,7 @@ components: required: - "create_tweet" properties: - create_retweet: + create_tweet: $ref: "#/components/schemas/CreateTweetResponseResult" CreateTweetResponseResult: @@ -190,4 +190,4 @@ components: - "tweet_results" properties: tweet_results: - $ref: "./../schemas/post.yaml#/components/schemas/DeleteTweet" + type: object From a69d2fa7d8ac2a8fbaa65609bb9a1c55c08dffd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 27 Apr 2023 20:07:08 +0900 Subject: [PATCH 7/8] update build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- tools/build.py | 89 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 10 deletions(-) diff --git a/tools/build.py b/tools/build.py index 87e64f6..ca71029 100644 --- a/tools/build.py +++ b/tools/build.py @@ -38,6 +38,38 @@ class placeholder_manager: return file +def placeholder_to_yaml(obj): + if type(obj) is dict: + return { + "type": "object", + "required": [i for i in obj], + "properties": {i: placeholder_to_yaml(obj[i]) for i in obj}, + # "default": {i: placeholder_to_yaml(obj[i]) for i in obj}, + # "example": {i: placeholder_to_yaml(obj[i]) for i in obj}, + } + elif type(obj) is list: + if len(obj) == 0: + return { + "type": "array", + "items": {"type": "object"}, + # "default": [], + # "example": [], + } + return { + "type": "array", + "items": placeholder_to_yaml(obj[0]), + # "default": placeholder_to_yaml(obj[0]), + # "example": placeholder_to_yaml(obj[0]), + } + elif type(obj) is str: + return {"type": "string", "example": obj, "default": obj} + elif type(obj) is bool: + return {"type": "boolean", "example": obj, "default": obj} + elif type(obj) is int: + return {"type": "integer", "example": obj, "default": obj} + + +print("=== Build Start ===") OUTPUT_DIR = "dist/{0}" INPUT_DIR = "src/openapi" METHODS = ["get", "put", "post", "delete", "options", "head", "patch", "trace"] @@ -51,6 +83,8 @@ with open("src/config/variable.json", mode="r", encoding="utf-8") as f: variable = json.load(f) +placeholder = placeholder_manager() + for lang in variable.keys(): def read(file: str): @@ -84,7 +118,6 @@ for lang in variable.keys(): for dir in glob.glob(os.path.join(INPUT_DIR, "**/")): os.makedirs(dir.replace(INPUT_DIR, OUTPUT_DIR.format(lang), 1), exist_ok=True) - placeholder = placeholder_manager() parameters = read("src/config/parameters.yaml") header = read("src/config/header.yaml") @@ -98,17 +131,51 @@ for lang in variable.keys(): for key in load["paths"].keys(): append = get_yaml(parameters, key.split("/")[-1]) param = append["paths"]["/parameters"] - for method in METHODS: - if load["paths"][key].get(method, None) is not None: - req = load["paths"][key][method] - req["parameters"] = param[method]["parameters"] + for method in load["paths"][key].keys(): + req = load["paths"][key][method] - append = get_yaml(header, key.split("/")[-1]) - req = load["paths"][key][method] - req["responses"]["200"]["headers"] = append["components"]["headers"] + req["parameters"] = req.get("parameters", []) + req["parameters"] += param[method].get("parameters", []) - escape = key.replace("/", "~1") - paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}}) + if param[method].get("requestBody") is not None: + req["requestBody"] = param[method].get("requestBody") + + if variable[lang].get(method + "_parameters") == "schema_parameters": + for p_key in placeholder.data[key.split("/")[-1]].keys(): + if p_key.lower() == "query": + continue + req["parameters"].append( + { + "name": p_key.lower(), + "in": "query", + "schema": placeholder_to_yaml( + placeholder.data[key.split("/")[-1]][p_key] + ), + } + ) + + if variable[lang].get(method + "_parameters") == "schema_request_body": + data = placeholder.data[key.split("/")[-1]] + schema = {i: placeholder_to_yaml(data[i]) for i in data.keys()} + + req["requestBody"] = { + "description": key.split("/")[-1] + "body", + "required": True, + "content": { + "application/json": { + "schema": { + "properties": schema, + }, + } + }, + } + + append = get_yaml(header, key.split("/")[-1]) + req = load["paths"][key][method] + req["responses"]["200"]["headers"] = append["components"]["headers"] + + escape = key.replace("/", "~1") + paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}}) write(file, yaml.dump(load)) file = "src/openapi/openapi-3.0.yaml" @@ -118,3 +185,5 @@ for lang in variable.keys(): load["paths"] = paths write(file, yaml.dump(load)) + +print("=== Build End ===") From 5eedd4146d4bf2babd8da86b0b600e8fd5eac1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 27 Apr 2023 20:18:39 +0900 Subject: [PATCH 8/8] update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/config/parameters.yaml | 172 +++++++++++++++++++------------- src/config/placeholder.json | 18 ++-- src/config/variable.json | 13 ++- src/openapi/paths/post.yaml | 75 ++++++++++++-- src/openapi/response/error.yaml | 97 ++++++++++++++++++ src/openapi/schemas/post.yaml | 71 ------------- 6 files changed, 283 insertions(+), 163 deletions(-) create mode 100644 src/openapi/response/error.yaml delete mode 100644 src/openapi/schemas/post.yaml diff --git a/src/config/parameters.yaml b/src/config/parameters.yaml index 166bfb8..c59eea3 100644 --- a/src/config/parameters.yaml +++ b/src/config/parameters.yaml @@ -6,18 +6,6 @@ paths: /parameters: get: parameters: - - name: variables - in: query - required: true - schema: - type: string - example: "{{Variables}}" - - name: features - in: query - required: true - schema: - type: string - example: "{{Features}}" - name: queryId in: query required: true @@ -26,6 +14,45 @@ paths: default: "{{Query}}" example: "{{Query}}" + # {% if get_parameters == string %} + + - name: variables + in: query + required: true + schema: + type: string + default: "{{Variables}}" + example: "{{Variables}}" + - name: features + in: query + required: true + schema: + type: string + default: "{{Features}}" + example: "{{Features}}" + + # {% endif %} + + # {% if get_parameters == object %} + + - name: variables + in: query + required: true + schema: + type: object + - name: features + in: query + required: true + schema: + type: object + - name: queryId + in: query + required: true + schema: + type: object + + # {% endif %} + # {% if header == parameters %} - name: authorization @@ -58,62 +85,71 @@ paths: description: "UserAgent, some APIs may be rejected if changed." # {% endif %} - - post: - parameters: - - name: variables - in: query - required: true - schema: - type: object - example: "{{Variables}}" - - name: features - in: query - required: true - schema: - type: object - example: "{{Features}}" - - name: queryId - in: query - required: true - schema: - type: string - default: "{{Query}}" - example: "{{Query}}" - - # {% if header == parameters %} - - - name: authorization - in: header - required: true - schema: - type: string - default: "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA" - description: "It is a constant value and does not need to be changed." - - name: x-twitter-active-user - in: header - required: true - schema: - type: string - default: "yes" - description: "Unknown what this value means." - - name: x-twitter-client-language - in: header - required: true - schema: - type: string - default: "en" - description: "language code." - - name: user-agent - in: header - required: true - schema: - type: string - default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" - description: "UserAgent, some APIs may be rejected if changed." - - # {% endif %} - + responses: + "200": + description: "" + + post: + # {% if header == parameters %} + + parameters: + - name: authorization + in: header + required: true + schema: + type: string + default: "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA" + description: "It is a constant value and does not need to be changed." + - name: x-twitter-active-user + in: header + required: true + schema: + type: string + default: "yes" + description: "Unknown what this value means." + - name: x-twitter-client-language + in: header + required: true + schema: + type: string + default: "en" + description: "language code." + - name: user-agent + in: header + required: true + schema: + type: string + default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36" + description: "UserAgent, some APIs may be rejected if changed." + + # {% endif %} + + # {% if post_parameters == object %} + + requestBody: + required: true + content: + application/json: + schema: + required: + - "queryId" + - "variables" + - "features" + properties: + queryId: + type: string + default: "{{Query}}" + example: "{{Query}}" + variables: + type: object + # default: "{{Variables}}" + example: "{{Variables}}" + features: + type: object + # default: "{{Features}}" + example: "{{Features}}" + + # {% endif %} responses: "200": description: "" diff --git a/src/config/placeholder.json b/src/config/placeholder.json index 0743e8b..8d3c7aa 100644 --- a/src/config/placeholder.json +++ b/src/config/placeholder.json @@ -364,29 +364,25 @@ "Query": "lI07N6Otwv1PhnEgXILM7A", "Variables": { "tweet_id": "1349129669258448897" - }, - "Features": {} + } }, "UnfavoriteTweet": { "Query": "ZYKSe-w7KEslx3JhSIk5LA", "Variables": { "tweet_id": "1349129669258448897" - }, - "Features": {} + } }, "CreateRetweet": { "Query": "ojPdsZsimiJrUGLR1sjUtA", "Variables": { "tweet_id": "1349129669258448897" - }, - "Features": {} + } }, "DeleteRetweet": { "Query": "iQtK4dl5hBmXewYZuEOKVw", "Variables": { "tweet_id": "1349129669258448897" - }, - "Features": {} + } }, "CreateTweet": { "Query": "1RyAhNwby-gzGCRVsMxKbQ", @@ -396,7 +392,8 @@ "media_entities": [], "possibly_sensitive": false }, - "semantic_annotation_ids": [] + "semantic_annotation_ids": [], + "dark_request": false }, "Features": { "tweetypie_unmention_optimization_enabled": true, @@ -424,8 +421,7 @@ "Query": "VaenaVgh5q5ih7kvyVjgtg", "Variables": { "tweet_id": "1349129669258448897" - }, - "Features": {} + } }, "Template": { "Query": "", diff --git a/src/config/variable.json b/src/config/variable.json index 63f623d..f178ee8 100644 --- a/src/config/variable.json +++ b/src/config/variable.json @@ -1,8 +1,17 @@ { "dart": { - "header": "parameters" + "header": "parameters", + "get_parameters": "string", + "post_parameters": "object" }, "typescript": { - "header": "securitySchemes" + "header": "securitySchemes", + "get_parameters": "string", + "post_parameters": "object" + }, + "test": { + "header": "securitySchemes", + "get_parameters": "string", + "post_parameters": "string" } } \ No newline at end of file diff --git a/src/openapi/paths/post.yaml b/src/openapi/paths/post.yaml index 6985d4c..b24e344 100644 --- a/src/openapi/paths/post.yaml +++ b/src/openapi/paths/post.yaml @@ -6,7 +6,7 @@ info: paths: /{{FavoriteTweetQuery}}/FavoriteTweet: post: - operationId: favoriteTweet + operationId: postFavoriteTweet description: favorite Tweet responses: "200": @@ -20,7 +20,7 @@ paths: /{{UnfavoriteTweetQuery}}/UnfavoriteTweet: post: - operationId: unfavoriteTweet + operationId: postUnfavoriteTweet description: unfavorite Tweet responses: "200": @@ -34,7 +34,7 @@ paths: /{{CreateRetweetQuery}}/CreateRetweet: post: - operationId: createRetweet + operationId: postCreateRetweet description: create Retweet responses: "200": @@ -48,7 +48,7 @@ paths: /{{DeleteRetweetQuery}}/DeleteRetweet: post: - operationId: deleteRetweet + operationId: postDeleteRetweet description: delete Retweet responses: "200": @@ -62,7 +62,7 @@ paths: /{{CreateTweetQuery}}/CreateTweet: post: - operationId: createTweet + operationId: postCreateTweet description: create Tweet responses: "200": @@ -76,7 +76,7 @@ paths: /{{DeleteTweetQuery}}/DeleteTweet: post: - operationId: deleteTweet + operationId: postDeleteTweet description: delete Retweet responses: "200": @@ -95,14 +95,28 @@ components: - "data" properties: data: - $ref: "./../schemas/post.yaml#/components/schemas/FavoriteTweet" + $ref: "#/components/schemas/FavoriteTweet" + + FavoriteTweet: + required: + - "favorite_tweet" + properties: + favorite_tweet: + type: string UnfavoriteTweetResponseData: required: - "data" properties: data: - $ref: "./../schemas/post.yaml#/components/schemas/UnfavoriteTweet" + $ref: "#/components/schemas/UnfavoriteTweet" + + UnfavoriteTweet: + required: + - "unfavorite_tweet" + properties: + unfavorite_tweet: + type: string # ---Retweet--- @@ -125,7 +139,30 @@ components: - "retweet_results" properties: retweet_results: - $ref: "./../schemas/post.yaml#/components/schemas/CreateRetweet" + $ref: "#/components/schemas/CreateRetweet" + + CreateRetweet: + required: + - "result" + properties: + result: + type: object + items: + $ref: "#/components/schemas/Retweet" + + Retweet: + required: + - "rest_id" + - "legacy" + properties: + rest_id: + type: string + legacy: + type: object + items: + properties: + full_text: + type: string DeleteRetweetResponse: required: @@ -146,7 +183,16 @@ components: - "source_tweet_results" properties: retweet_results: - $ref: "./../schemas/post.yaml#/components/schemas/DeleteRetweet" + $ref: "#/components/schemas/DeleteRetweet" + + DeleteRetweet: + required: + - "result" + properties: + result: + type: object + items: + $ref: "#/components/schemas/Retweet" # ---Tweet--- @@ -169,7 +215,14 @@ components: - "tweet_results" properties: tweet_results: - $ref: "./../schemas/post.yaml#/components/schemas/CreateTweet" + $ref: "#/components/schemas/CreateTweet" + + CreateTweet: + required: + - "result" + properties: + result: + $ref: "./../schemas/tweet.yaml#/components/schemas/Tweet" DeleteTweetResponse: required: diff --git a/src/openapi/response/error.yaml b/src/openapi/response/error.yaml new file mode 100644 index 0000000..817edb6 --- /dev/null +++ b/src/openapi/response/error.yaml @@ -0,0 +1,97 @@ +openapi: 3.0.3 +info: + title: Twitter OpenAPI + version: 0.0.1 + +paths: {} + +components: + schemas: + ErrorResponse: + type: object + required: + - errors + - data + properties: + errors: + $ref: "#/components/schemas/Errors" + + Errors: + type: array + items: + $ref: "#/components/schemas/Error" + + Error: + type: object + required: + - message + - locations + - path + - extensions + - code + - kind + - name + - source + - tracing + properties: + message: + type: string + locations: + type: array + items: + $ref: "#/components/schemas/Location" + path: + type: array + items: + type: string + extensions: + $ref: "#/components/schemas/Extensions" + code: + type: integer + kind: + type: string + name: + type: string + source: + type: string + tracing: + $ref: "#/components/schemas/Tracing" + + Location: + type: object + required: + - line + - column + properties: + line: + type: integer + column: + type: integer + + Extensions: + type: object + required: + - name + - source + - code + - kind + - tracing + properties: + name: + type: string + source: + type: string + code: + type: integer + kind: + type: string + tracing: + $ref: "#/components/schemas/Tracing" + + Tracing: + type: object + required: + - trace_id + properties: + trace_id: + type: string diff --git a/src/openapi/schemas/post.yaml b/src/openapi/schemas/post.yaml deleted file mode 100644 index 69a1f94..0000000 --- a/src/openapi/schemas/post.yaml +++ /dev/null @@ -1,71 +0,0 @@ -openapi: 3.0.3 -info: - title: Twitter OpenAPI - version: 0.0.1 - -paths: {} -components: - schemas: - FavoriteTweet: - required: - - "favorite_tweet" - properties: - favorite_tweet: - type: string - - UnfavoriteTweet: - required: - - "unfavorite_tweet" - properties: - unfavorite_tweet: - type: string - - # ---Retweet--- - - CreateRetweet: - required: - - "result" - properties: - result: - type: object - items: - $ref: "#/components/schemas/Retweet" - - DeleteRetweet: - required: - - "result" - properties: - result: - type: object - items: - $ref: "#/components/schemas/Retweet" - - Retweet: - required: - - "rest_id" - - "legacy" - properties: - rest_id: - type: string - legacy: - type: object - items: - properties: - full_text: - type: string - - # ---Tweet--- - - CreateTweet: - required: - - "result" - properties: - result: - type: object - items: - $ref: "./tweet.yaml#/components/schemas/Tweet" - - DeleteTweet: - properties: - result: - type: object