From 7414fb6dba0b946677d984ebfdbb549f181e3903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Fri, 1 Sep 2023 12:47:26 +0900 Subject: [PATCH] update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/schemas/tweet.yaml | 156 ++++++++++++++------------- dist/docs/schemas/tweet.yaml | 156 ++++++++++++++------------- src/openapi/schemas/tweet.yaml | 163 ++++++++++++++++------------- 3 files changed, 256 insertions(+), 219 deletions(-) diff --git a/dist/compatible/schemas/tweet.yaml b/dist/compatible/schemas/tweet.yaml index 99ac345..c18e3fc 100644 --- a/dist/compatible/schemas/tweet.yaml +++ b/dist/compatible/schemas/tweet.yaml @@ -219,6 +219,13 @@ components: required: - content_type - url + SelfThread: + properties: + id_str: + pattern: ^[0-9]+$ + type: string + required: + - id_str Symbol: additionalProperties: true type: object @@ -227,69 +234,13 @@ components: __typename: $ref: ./typename.yaml#/components/schemas/TypeName card: - properties: - legacy: - properties: - binding_values: - items: - properties: - key: - type: string - value: - properties: - boolean_value: - type: boolean - scribe_key: - type: string - string_value: - type: string - type: - type: string - required: - - type - type: object - required: - - key - - value - type: object - type: array - name: - type: string - url: - type: string - required: - - binding_values - - name - - url - type: object - rest_id: - type: string - type: object + $ref: '#/components/schemas/TweetCard' core: $ref: ./user.yaml#/components/schemas/UserResultCore edit_control: - properties: - edit_tweet_ids: - items: - pattern: ^[0-9]+$ - type: string - type: array - editable_until_msecs: - pattern: ^[0-9]+$ - type: string - edits_remaining: - pattern: ^[0-9]+$ - type: string - is_edit_eligible: - type: boolean - type: object + $ref: '#/components/schemas/TweetEditControl' edit_prespective: - properties: - favorited: - type: boolean - retweeted: - type: boolean - type: object + $ref: '#/components/schemas/TweetEditPrespective' is_translatable: default: false type: boolean @@ -304,13 +255,7 @@ components: additionalProperties: true type: object views: - properties: - count: - pattern: ^[0-9]+$ - type: string - state: - type: string - type: object + $ref: '#/components/schemas/TweetView' required: - rest_id - core @@ -318,6 +263,68 @@ components: - is_translatable - legacy - views + TweetCard: + properties: + legacy: + $ref: '#/components/schemas/TweetCardLegacy' + rest_id: + type: string + TweetCardLegacy: + properties: + binding_values: + items: + $ref: '#/components/schemas/TweetCardLegacyBindingValue' + type: array + name: + type: string + url: + type: string + required: + - binding_values + - name + - url + TweetCardLegacyBindingValue: + properties: + key: + type: string + value: + $ref: '#/components/schemas/TweetCardLegacyBindingValueData' + required: + - key + - value + TweetCardLegacyBindingValueData: + properties: + boolean_value: + type: boolean + scribe_key: + type: string + string_value: + type: string + type: + type: string + required: + - type + TweetEditControl: + properties: + edit_tweet_ids: + items: + pattern: ^[0-9]+$ + type: string + type: array + editable_until_msecs: + pattern: ^[0-9]+$ + type: string + edits_remaining: + pattern: ^[0-9]+$ + type: string + is_edit_eligible: + type: boolean + TweetEditPrespective: + properties: + favorited: + type: boolean + retweeted: + type: boolean TweetLegacy: properties: bookmark_count: @@ -367,13 +374,7 @@ components: retweeted_status_result: $ref: ./content.yaml#/components/schemas/ItemResult self_thread: - properties: - id_str: - pattern: ^[0-9]+$ - type: string - required: - - id_str - type: object + $ref: '#/components/schemas/SelfThread' user_id_str: pattern: ^[0-9]+$ type: string @@ -411,6 +412,15 @@ components: - $ref: '#/components/schemas/Tweet' - $ref: '#/components/schemas/TweetWithVisibilityResults' - $ref: '#/components/schemas/TweetTombstone' + TweetView: + properties: + count: + pattern: ^[0-9]+$ + type: string + state: + type: string + required: + - state TweetWithVisibilityResults: properties: __typename: diff --git a/dist/docs/schemas/tweet.yaml b/dist/docs/schemas/tweet.yaml index 99ac345..c18e3fc 100644 --- a/dist/docs/schemas/tweet.yaml +++ b/dist/docs/schemas/tweet.yaml @@ -219,6 +219,13 @@ components: required: - content_type - url + SelfThread: + properties: + id_str: + pattern: ^[0-9]+$ + type: string + required: + - id_str Symbol: additionalProperties: true type: object @@ -227,69 +234,13 @@ components: __typename: $ref: ./typename.yaml#/components/schemas/TypeName card: - properties: - legacy: - properties: - binding_values: - items: - properties: - key: - type: string - value: - properties: - boolean_value: - type: boolean - scribe_key: - type: string - string_value: - type: string - type: - type: string - required: - - type - type: object - required: - - key - - value - type: object - type: array - name: - type: string - url: - type: string - required: - - binding_values - - name - - url - type: object - rest_id: - type: string - type: object + $ref: '#/components/schemas/TweetCard' core: $ref: ./user.yaml#/components/schemas/UserResultCore edit_control: - properties: - edit_tweet_ids: - items: - pattern: ^[0-9]+$ - type: string - type: array - editable_until_msecs: - pattern: ^[0-9]+$ - type: string - edits_remaining: - pattern: ^[0-9]+$ - type: string - is_edit_eligible: - type: boolean - type: object + $ref: '#/components/schemas/TweetEditControl' edit_prespective: - properties: - favorited: - type: boolean - retweeted: - type: boolean - type: object + $ref: '#/components/schemas/TweetEditPrespective' is_translatable: default: false type: boolean @@ -304,13 +255,7 @@ components: additionalProperties: true type: object views: - properties: - count: - pattern: ^[0-9]+$ - type: string - state: - type: string - type: object + $ref: '#/components/schemas/TweetView' required: - rest_id - core @@ -318,6 +263,68 @@ components: - is_translatable - legacy - views + TweetCard: + properties: + legacy: + $ref: '#/components/schemas/TweetCardLegacy' + rest_id: + type: string + TweetCardLegacy: + properties: + binding_values: + items: + $ref: '#/components/schemas/TweetCardLegacyBindingValue' + type: array + name: + type: string + url: + type: string + required: + - binding_values + - name + - url + TweetCardLegacyBindingValue: + properties: + key: + type: string + value: + $ref: '#/components/schemas/TweetCardLegacyBindingValueData' + required: + - key + - value + TweetCardLegacyBindingValueData: + properties: + boolean_value: + type: boolean + scribe_key: + type: string + string_value: + type: string + type: + type: string + required: + - type + TweetEditControl: + properties: + edit_tweet_ids: + items: + pattern: ^[0-9]+$ + type: string + type: array + editable_until_msecs: + pattern: ^[0-9]+$ + type: string + edits_remaining: + pattern: ^[0-9]+$ + type: string + is_edit_eligible: + type: boolean + TweetEditPrespective: + properties: + favorited: + type: boolean + retweeted: + type: boolean TweetLegacy: properties: bookmark_count: @@ -367,13 +374,7 @@ components: retweeted_status_result: $ref: ./content.yaml#/components/schemas/ItemResult self_thread: - properties: - id_str: - pattern: ^[0-9]+$ - type: string - required: - - id_str - type: object + $ref: '#/components/schemas/SelfThread' user_id_str: pattern: ^[0-9]+$ type: string @@ -411,6 +412,15 @@ components: - $ref: '#/components/schemas/Tweet' - $ref: '#/components/schemas/TweetWithVisibilityResults' - $ref: '#/components/schemas/TweetTombstone' + TweetView: + properties: + count: + pattern: ^[0-9]+$ + type: string + state: + type: string + required: + - state TweetWithVisibilityResults: properties: __typename: diff --git a/src/openapi/schemas/tweet.yaml b/src/openapi/schemas/tweet.yaml index 73dd612..ba30666 100644 --- a/src/openapi/schemas/tweet.yaml +++ b/src/openapi/schemas/tweet.yaml @@ -54,86 +54,101 @@ components: core: $ref: "./user.yaml#/components/schemas/UserResultCore" card: - type: object - properties: - rest_id: - type: string - legacy: - type: object - required: - - "binding_values" - - "name" - - "url" - properties: - name: - type: string - url: - type: string - binding_values: - type: array - items: - type: object - required: - - "key" - - "value" - properties: - key: - type: string - value: - type: object - required: - - "type" - properties: - string_value: - type: string - boolean_value: - type: boolean - scribe_key: - type: string - type: - type: string + $ref: "#/components/schemas/TweetCard" unmention_data: type: object additionalProperties: true # todo edit_control: - type: object - properties: - edit_tweet_ids: - type: array - items: - type: string - pattern: "^[0-9]+$" - editable_until_msecs: - type: string - pattern: "^[0-9]+$" - is_edit_eligible: - type: boolean - edits_remaining: - type: string - pattern: "^[0-9]+$" + $ref: "#/components/schemas/TweetEditControl" edit_prespective: - type: object - properties: - favorited: - type: boolean - retweeted: - type: boolean + $ref: "#/components/schemas/TweetEditPrespective" is_translatable: type: boolean default: false legacy: $ref: "#/components/schemas/TweetLegacy" views: - type: object - properties: - count: - type: string - pattern: "^[0-9]+$" - state: - type: string # enum + $ref: "#/components/schemas/TweetView" quoted_status_result: $ref: "./content.yaml#/components/schemas/ItemResult" + TweetEditControl: + properties: + edit_tweet_ids: + type: array + items: + type: string + pattern: "^[0-9]+$" + editable_until_msecs: + type: string + pattern: "^[0-9]+$" + is_edit_eligible: + type: boolean + edits_remaining: + type: string + pattern: "^[0-9]+$" + + TweetEditPrespective: + properties: + favorited: + type: boolean + retweeted: + type: boolean + TweetView: + required: + - "state" + properties: + count: + type: string + pattern: "^[0-9]+$" + state: + type: string # enum + + TweetCard: + properties: + rest_id: + type: string + legacy: + $ref: "#/components/schemas/TweetCardLegacy" + + TweetCardLegacy: + required: + - "binding_values" + - "name" + - "url" + properties: + name: + type: string + url: + type: string + binding_values: + type: array + items: + $ref: "#/components/schemas/TweetCardLegacyBindingValue" + + TweetCardLegacyBindingValue: + required: + - "key" + - "value" + properties: + key: + type: string + value: + $ref: "#/components/schemas/TweetCardLegacyBindingValueData" + + TweetCardLegacyBindingValueData: + required: + - "type" + properties: + string_value: + type: string + boolean_value: + type: boolean + scribe_key: + type: string + type: + type: string + TweetLegacy: required: - "bookmark_count" @@ -202,16 +217,18 @@ components: type: string pattern: "^[0-9]+$" self_thread: - type: object - required: - - "id_str" - properties: - id_str: - type: string - pattern: "^[0-9]+$" + $ref: "#/components/schemas/SelfThread" extended_entities: $ref: "#/components/schemas/ExtendedEntities" + SelfThread: + required: + - "id_str" + properties: + id_str: + type: string + pattern: "^[0-9]+$" + Entities: required: - "hashtags"