mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-10 15:20:26 +01:00
Merge branch 'dev' into remove-agpl
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
commit
4a3ce57109
10 changed files with 457 additions and 38 deletions
18
dist/compatible/schemas/content.yaml
vendored
18
dist/compatible/schemas/content.yaml
vendored
|
|
@ -1,5 +1,14 @@
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
|
ClientEventInfo:
|
||||||
|
properties:
|
||||||
|
component:
|
||||||
|
type: string
|
||||||
|
details:
|
||||||
|
additionalProperties: true
|
||||||
|
type: object
|
||||||
|
element:
|
||||||
|
type: string
|
||||||
ContentEntryType:
|
ContentEntryType:
|
||||||
enum:
|
enum:
|
||||||
- TimelineTimelineItem
|
- TimelineTimelineItem
|
||||||
|
|
@ -54,13 +63,11 @@ components:
|
||||||
$ref: ./typename.yaml#/components/schemas/TypeName
|
$ref: ./typename.yaml#/components/schemas/TypeName
|
||||||
result:
|
result:
|
||||||
$ref: ./tweet.yaml#/components/schemas/TweetUnion
|
$ref: ./tweet.yaml#/components/schemas/TweetUnion
|
||||||
required:
|
required: null
|
||||||
- result
|
|
||||||
ModuleEntry:
|
ModuleEntry:
|
||||||
properties:
|
properties:
|
||||||
clientEventInfo:
|
clientEventInfo:
|
||||||
additionalProperties: true
|
$ref: '#/components/schemas/ClientEventInfo'
|
||||||
type: object
|
|
||||||
itemContent:
|
itemContent:
|
||||||
$ref: '#/components/schemas/ItemContentUnion'
|
$ref: '#/components/schemas/ItemContentUnion'
|
||||||
required:
|
required:
|
||||||
|
|
@ -116,8 +123,7 @@ components:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: ./typename.yaml#/components/schemas/TypeName
|
$ref: ./typename.yaml#/components/schemas/TypeName
|
||||||
clientEventInfo:
|
clientEventInfo:
|
||||||
additionalProperties: true
|
$ref: '#/components/schemas/ClientEventInfo'
|
||||||
type: object
|
|
||||||
entryType:
|
entryType:
|
||||||
$ref: '#/components/schemas/ContentEntryType'
|
$ref: '#/components/schemas/ContentEntryType'
|
||||||
feedbackInfo:
|
feedbackInfo:
|
||||||
|
|
|
||||||
130
dist/compatible/schemas/instruction.yaml
vendored
130
dist/compatible/schemas/instruction.yaml
vendored
|
|
@ -1,5 +1,42 @@
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
|
Callback:
|
||||||
|
properties:
|
||||||
|
endpoint:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- endpoint
|
||||||
|
CoverCta:
|
||||||
|
properties:
|
||||||
|
Text:
|
||||||
|
type: string
|
||||||
|
buttonStyle:
|
||||||
|
enum:
|
||||||
|
- Primary
|
||||||
|
type: string
|
||||||
|
callbacks:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Callback'
|
||||||
|
type: array
|
||||||
|
clientEventInfo:
|
||||||
|
$ref: '#/components/schemas/CtaClientEventInfo'
|
||||||
|
ctaBehavior:
|
||||||
|
$ref: '#/components/schemas/TimelineCoverBehavior'
|
||||||
|
required:
|
||||||
|
- text
|
||||||
|
- ctaBehavior
|
||||||
|
- callbacks
|
||||||
|
- clientEventInfo
|
||||||
|
- buttonStyle
|
||||||
|
CtaClientEventInfo:
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
enum:
|
||||||
|
- primary_cta
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- action
|
||||||
InstructionType:
|
InstructionType:
|
||||||
enum:
|
enum:
|
||||||
- TimelineAddEntries
|
- TimelineAddEntries
|
||||||
|
|
@ -9,6 +46,7 @@ components:
|
||||||
- TimelineReplaceEntry
|
- TimelineReplaceEntry
|
||||||
- TimelineShowAlert
|
- TimelineShowAlert
|
||||||
- TimelineTerminateTimeline
|
- TimelineTerminateTimeline
|
||||||
|
- TimelineShowCover
|
||||||
type: string
|
type: string
|
||||||
InstructionUnion:
|
InstructionUnion:
|
||||||
discriminator:
|
discriminator:
|
||||||
|
|
@ -19,6 +57,7 @@ components:
|
||||||
TimelinePinEntry: '#/components/schemas/TimelinePinEntry'
|
TimelinePinEntry: '#/components/schemas/TimelinePinEntry'
|
||||||
TimelineReplaceEntry: '#/components/schemas/TimelineReplaceEntry'
|
TimelineReplaceEntry: '#/components/schemas/TimelineReplaceEntry'
|
||||||
TimelineShowAlert: '#/components/schemas/TimelineShowAlert'
|
TimelineShowAlert: '#/components/schemas/TimelineShowAlert'
|
||||||
|
TimelineShowCover: '#/components/schemas/TimelineShowCover'
|
||||||
TimelineTerminateTimeline: '#/components/schemas/TimelineTerminateTimeline'
|
TimelineTerminateTimeline: '#/components/schemas/TimelineTerminateTimeline'
|
||||||
propertyName: type
|
propertyName: type
|
||||||
oneOf:
|
oneOf:
|
||||||
|
|
@ -29,6 +68,47 @@ components:
|
||||||
- $ref: '#/components/schemas/TimelineReplaceEntry'
|
- $ref: '#/components/schemas/TimelineReplaceEntry'
|
||||||
- $ref: '#/components/schemas/TimelineShowAlert'
|
- $ref: '#/components/schemas/TimelineShowAlert'
|
||||||
- $ref: '#/components/schemas/TimelineTerminateTimeline'
|
- $ref: '#/components/schemas/TimelineTerminateTimeline'
|
||||||
|
- $ref: '#/components/schemas/TimelineShowCover'
|
||||||
|
Text:
|
||||||
|
properties:
|
||||||
|
entities:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TextEntity'
|
||||||
|
type: array
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- text
|
||||||
|
- entities
|
||||||
|
TextEntity:
|
||||||
|
properties:
|
||||||
|
fromIndex:
|
||||||
|
type: integer
|
||||||
|
ref:
|
||||||
|
$ref: '#/components/schemas/TextEntityRef'
|
||||||
|
toIndex:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- fromIndex
|
||||||
|
- toIndex
|
||||||
|
- ref
|
||||||
|
TextEntityRef:
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- TimelineUrl
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
urlType:
|
||||||
|
enum:
|
||||||
|
- ExternalUrl
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- url
|
||||||
|
- urlType
|
||||||
TimelineAddEntries:
|
TimelineAddEntries:
|
||||||
properties:
|
properties:
|
||||||
entries:
|
entries:
|
||||||
|
|
@ -76,6 +156,44 @@ components:
|
||||||
$ref: '#/components/schemas/InstructionType'
|
$ref: '#/components/schemas/InstructionType'
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
|
TimelineCoverBehavior:
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- TimelineCoverBehaviorDismiss
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
TimelineHalfCover:
|
||||||
|
properties:
|
||||||
|
dismissible:
|
||||||
|
type: boolean
|
||||||
|
halfCoverDisplayType:
|
||||||
|
enum:
|
||||||
|
- Cover
|
||||||
|
type: string
|
||||||
|
impressionCallbacks:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Callback'
|
||||||
|
type: array
|
||||||
|
primaryCoverCta:
|
||||||
|
$ref: '#/components/schemas/CoverCta'
|
||||||
|
primaryText:
|
||||||
|
$ref: '#/components/schemas/Text'
|
||||||
|
secondaryText:
|
||||||
|
$ref: '#/components/schemas/Text'
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- TimelineHalfCover
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- halfCoverDisplayType
|
||||||
|
- primaryText
|
||||||
|
- primaryCoverCta
|
||||||
|
- secondaryText
|
||||||
|
- impressionCallbacks
|
||||||
|
- dismissible
|
||||||
TimelinePinEntry:
|
TimelinePinEntry:
|
||||||
properties:
|
properties:
|
||||||
entry:
|
entry:
|
||||||
|
|
@ -137,6 +255,18 @@ components:
|
||||||
- type
|
- type
|
||||||
- usersResults
|
- usersResults
|
||||||
- richText
|
- richText
|
||||||
|
TimelineShowCover:
|
||||||
|
properties:
|
||||||
|
clientEventInfo:
|
||||||
|
$ref: ./content.yaml#/components/schemas/ClientEventInfo
|
||||||
|
cover:
|
||||||
|
$ref: '#/components/schemas/TimelineHalfCover'
|
||||||
|
type:
|
||||||
|
$ref: '#/components/schemas/InstructionType'
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- clientEventInfo
|
||||||
|
- cover
|
||||||
TimelineTerminateTimeline:
|
TimelineTerminateTimeline:
|
||||||
properties:
|
properties:
|
||||||
direction:
|
direction:
|
||||||
|
|
|
||||||
5
dist/compatible/schemas/tweet.yaml
vendored
5
dist/compatible/schemas/tweet.yaml
vendored
|
|
@ -269,11 +269,8 @@ components:
|
||||||
$ref: '#/components/schemas/TweetView'
|
$ref: '#/components/schemas/TweetView'
|
||||||
required:
|
required:
|
||||||
- rest_id
|
- rest_id
|
||||||
- core
|
|
||||||
- edit_control
|
- edit_control
|
||||||
- is_translatable
|
- is_translatable
|
||||||
- source
|
|
||||||
- legacy
|
|
||||||
- views
|
- views
|
||||||
TweetCard:
|
TweetCard:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -498,8 +495,6 @@ components:
|
||||||
enum:
|
enum:
|
||||||
- Available
|
- Available
|
||||||
type: string
|
type: string
|
||||||
required:
|
|
||||||
- status
|
|
||||||
mediaStats:
|
mediaStats:
|
||||||
properties:
|
properties:
|
||||||
viewCount:
|
viewCount:
|
||||||
|
|
|
||||||
18
dist/docs/schemas/content.yaml
vendored
18
dist/docs/schemas/content.yaml
vendored
|
|
@ -1,5 +1,14 @@
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
|
ClientEventInfo:
|
||||||
|
properties:
|
||||||
|
component:
|
||||||
|
type: string
|
||||||
|
details:
|
||||||
|
additionalProperties: true
|
||||||
|
type: object
|
||||||
|
element:
|
||||||
|
type: string
|
||||||
ContentEntryType:
|
ContentEntryType:
|
||||||
enum:
|
enum:
|
||||||
- TimelineTimelineItem
|
- TimelineTimelineItem
|
||||||
|
|
@ -54,13 +63,11 @@ components:
|
||||||
$ref: ./typename.yaml#/components/schemas/TypeName
|
$ref: ./typename.yaml#/components/schemas/TypeName
|
||||||
result:
|
result:
|
||||||
$ref: ./tweet.yaml#/components/schemas/TweetUnion
|
$ref: ./tweet.yaml#/components/schemas/TweetUnion
|
||||||
required:
|
required: null
|
||||||
- result
|
|
||||||
ModuleEntry:
|
ModuleEntry:
|
||||||
properties:
|
properties:
|
||||||
clientEventInfo:
|
clientEventInfo:
|
||||||
additionalProperties: true
|
$ref: '#/components/schemas/ClientEventInfo'
|
||||||
type: object
|
|
||||||
itemContent:
|
itemContent:
|
||||||
$ref: '#/components/schemas/ItemContentUnion'
|
$ref: '#/components/schemas/ItemContentUnion'
|
||||||
required:
|
required:
|
||||||
|
|
@ -116,8 +123,7 @@ components:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: ./typename.yaml#/components/schemas/TypeName
|
$ref: ./typename.yaml#/components/schemas/TypeName
|
||||||
clientEventInfo:
|
clientEventInfo:
|
||||||
additionalProperties: true
|
$ref: '#/components/schemas/ClientEventInfo'
|
||||||
type: object
|
|
||||||
entryType:
|
entryType:
|
||||||
$ref: '#/components/schemas/ContentEntryType'
|
$ref: '#/components/schemas/ContentEntryType'
|
||||||
feedbackInfo:
|
feedbackInfo:
|
||||||
|
|
|
||||||
130
dist/docs/schemas/instruction.yaml
vendored
130
dist/docs/schemas/instruction.yaml
vendored
|
|
@ -1,5 +1,42 @@
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
|
Callback:
|
||||||
|
properties:
|
||||||
|
endpoint:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- endpoint
|
||||||
|
CoverCta:
|
||||||
|
properties:
|
||||||
|
Text:
|
||||||
|
type: string
|
||||||
|
buttonStyle:
|
||||||
|
enum:
|
||||||
|
- Primary
|
||||||
|
type: string
|
||||||
|
callbacks:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Callback'
|
||||||
|
type: array
|
||||||
|
clientEventInfo:
|
||||||
|
$ref: '#/components/schemas/CtaClientEventInfo'
|
||||||
|
ctaBehavior:
|
||||||
|
$ref: '#/components/schemas/TimelineCoverBehavior'
|
||||||
|
required:
|
||||||
|
- text
|
||||||
|
- ctaBehavior
|
||||||
|
- callbacks
|
||||||
|
- clientEventInfo
|
||||||
|
- buttonStyle
|
||||||
|
CtaClientEventInfo:
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
enum:
|
||||||
|
- primary_cta
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- action
|
||||||
InstructionType:
|
InstructionType:
|
||||||
enum:
|
enum:
|
||||||
- TimelineAddEntries
|
- TimelineAddEntries
|
||||||
|
|
@ -9,6 +46,7 @@ components:
|
||||||
- TimelineReplaceEntry
|
- TimelineReplaceEntry
|
||||||
- TimelineShowAlert
|
- TimelineShowAlert
|
||||||
- TimelineTerminateTimeline
|
- TimelineTerminateTimeline
|
||||||
|
- TimelineShowCover
|
||||||
type: string
|
type: string
|
||||||
InstructionUnion:
|
InstructionUnion:
|
||||||
discriminator:
|
discriminator:
|
||||||
|
|
@ -19,6 +57,7 @@ components:
|
||||||
TimelinePinEntry: '#/components/schemas/TimelinePinEntry'
|
TimelinePinEntry: '#/components/schemas/TimelinePinEntry'
|
||||||
TimelineReplaceEntry: '#/components/schemas/TimelineReplaceEntry'
|
TimelineReplaceEntry: '#/components/schemas/TimelineReplaceEntry'
|
||||||
TimelineShowAlert: '#/components/schemas/TimelineShowAlert'
|
TimelineShowAlert: '#/components/schemas/TimelineShowAlert'
|
||||||
|
TimelineShowCover: '#/components/schemas/TimelineShowCover'
|
||||||
TimelineTerminateTimeline: '#/components/schemas/TimelineTerminateTimeline'
|
TimelineTerminateTimeline: '#/components/schemas/TimelineTerminateTimeline'
|
||||||
propertyName: type
|
propertyName: type
|
||||||
oneOf:
|
oneOf:
|
||||||
|
|
@ -29,6 +68,47 @@ components:
|
||||||
- $ref: '#/components/schemas/TimelineReplaceEntry'
|
- $ref: '#/components/schemas/TimelineReplaceEntry'
|
||||||
- $ref: '#/components/schemas/TimelineShowAlert'
|
- $ref: '#/components/schemas/TimelineShowAlert'
|
||||||
- $ref: '#/components/schemas/TimelineTerminateTimeline'
|
- $ref: '#/components/schemas/TimelineTerminateTimeline'
|
||||||
|
- $ref: '#/components/schemas/TimelineShowCover'
|
||||||
|
Text:
|
||||||
|
properties:
|
||||||
|
entities:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TextEntity'
|
||||||
|
type: array
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- text
|
||||||
|
- entities
|
||||||
|
TextEntity:
|
||||||
|
properties:
|
||||||
|
fromIndex:
|
||||||
|
type: integer
|
||||||
|
ref:
|
||||||
|
$ref: '#/components/schemas/TextEntityRef'
|
||||||
|
toIndex:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- fromIndex
|
||||||
|
- toIndex
|
||||||
|
- ref
|
||||||
|
TextEntityRef:
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- TimelineUrl
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
urlType:
|
||||||
|
enum:
|
||||||
|
- ExternalUrl
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- url
|
||||||
|
- urlType
|
||||||
TimelineAddEntries:
|
TimelineAddEntries:
|
||||||
properties:
|
properties:
|
||||||
entries:
|
entries:
|
||||||
|
|
@ -76,6 +156,44 @@ components:
|
||||||
$ref: '#/components/schemas/InstructionType'
|
$ref: '#/components/schemas/InstructionType'
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
|
TimelineCoverBehavior:
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- TimelineCoverBehaviorDismiss
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
TimelineHalfCover:
|
||||||
|
properties:
|
||||||
|
dismissible:
|
||||||
|
type: boolean
|
||||||
|
halfCoverDisplayType:
|
||||||
|
enum:
|
||||||
|
- Cover
|
||||||
|
type: string
|
||||||
|
impressionCallbacks:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Callback'
|
||||||
|
type: array
|
||||||
|
primaryCoverCta:
|
||||||
|
$ref: '#/components/schemas/CoverCta'
|
||||||
|
primaryText:
|
||||||
|
$ref: '#/components/schemas/Text'
|
||||||
|
secondaryText:
|
||||||
|
$ref: '#/components/schemas/Text'
|
||||||
|
type:
|
||||||
|
enum:
|
||||||
|
- TimelineHalfCover
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- halfCoverDisplayType
|
||||||
|
- primaryText
|
||||||
|
- primaryCoverCta
|
||||||
|
- secondaryText
|
||||||
|
- impressionCallbacks
|
||||||
|
- dismissible
|
||||||
TimelinePinEntry:
|
TimelinePinEntry:
|
||||||
properties:
|
properties:
|
||||||
entry:
|
entry:
|
||||||
|
|
@ -137,6 +255,18 @@ components:
|
||||||
- type
|
- type
|
||||||
- usersResults
|
- usersResults
|
||||||
- richText
|
- richText
|
||||||
|
TimelineShowCover:
|
||||||
|
properties:
|
||||||
|
clientEventInfo:
|
||||||
|
$ref: ./content.yaml#/components/schemas/ClientEventInfo
|
||||||
|
cover:
|
||||||
|
$ref: '#/components/schemas/TimelineHalfCover'
|
||||||
|
type:
|
||||||
|
$ref: '#/components/schemas/InstructionType'
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- clientEventInfo
|
||||||
|
- cover
|
||||||
TimelineTerminateTimeline:
|
TimelineTerminateTimeline:
|
||||||
properties:
|
properties:
|
||||||
direction:
|
direction:
|
||||||
|
|
|
||||||
5
dist/docs/schemas/tweet.yaml
vendored
5
dist/docs/schemas/tweet.yaml
vendored
|
|
@ -269,11 +269,8 @@ components:
|
||||||
$ref: '#/components/schemas/TweetView'
|
$ref: '#/components/schemas/TweetView'
|
||||||
required:
|
required:
|
||||||
- rest_id
|
- rest_id
|
||||||
- core
|
|
||||||
- edit_control
|
- edit_control
|
||||||
- is_translatable
|
- is_translatable
|
||||||
- source
|
|
||||||
- legacy
|
|
||||||
- views
|
- views
|
||||||
TweetCard:
|
TweetCard:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -498,8 +495,6 @@ components:
|
||||||
enum:
|
enum:
|
||||||
- Available
|
- Available
|
||||||
type: string
|
type: string
|
||||||
required:
|
|
||||||
- status
|
|
||||||
mediaStats:
|
mediaStats:
|
||||||
properties:
|
properties:
|
||||||
viewCount:
|
viewCount:
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,7 @@ components:
|
||||||
itemContent:
|
itemContent:
|
||||||
$ref: "#/components/schemas/ItemContentUnion"
|
$ref: "#/components/schemas/ItemContentUnion"
|
||||||
clientEventInfo:
|
clientEventInfo:
|
||||||
type: object
|
$ref: "#/components/schemas/ClientEventInfo"
|
||||||
additionalProperties: true # todo
|
|
||||||
feedbackInfo:
|
feedbackInfo:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: true # todo
|
additionalProperties: true # todo
|
||||||
|
|
@ -113,8 +112,7 @@ components:
|
||||||
- "itemContent"
|
- "itemContent"
|
||||||
properties:
|
properties:
|
||||||
clientEventInfo:
|
clientEventInfo:
|
||||||
type: object
|
$ref: "#/components/schemas/ClientEventInfo"
|
||||||
additionalProperties: true # todo
|
|
||||||
itemContent:
|
itemContent:
|
||||||
$ref: "#/components/schemas/ItemContentUnion"
|
$ref: "#/components/schemas/ItemContentUnion"
|
||||||
|
|
||||||
|
|
@ -191,7 +189,6 @@ components:
|
||||||
|
|
||||||
ItemResult:
|
ItemResult:
|
||||||
required:
|
required:
|
||||||
- "result"
|
|
||||||
properties:
|
properties:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet
|
$ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet
|
||||||
|
|
@ -219,3 +216,17 @@ components:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineMessagePrompt
|
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineMessagePrompt
|
||||||
additionalProperties: true # todo
|
additionalProperties: true # todo
|
||||||
|
|
||||||
|
ClientEventInfo:
|
||||||
|
properties:
|
||||||
|
component:
|
||||||
|
# enum half_cover
|
||||||
|
type: string
|
||||||
|
element:
|
||||||
|
type: string
|
||||||
|
# august-2023-privacy-prompt-candidate
|
||||||
|
# pattern: "(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+"
|
||||||
|
# pattern: "^(january|february|march|april|may|june|july|august|september|october|november|december)-[0-9]{4}-([a-z]-)+[a-z]+$"
|
||||||
|
details:
|
||||||
|
type: object
|
||||||
|
additionalProperties: true # todo
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ components:
|
||||||
- $ref: "#/components/schemas/TimelineReplaceEntry"
|
- $ref: "#/components/schemas/TimelineReplaceEntry"
|
||||||
- $ref: "#/components/schemas/TimelineShowAlert"
|
- $ref: "#/components/schemas/TimelineShowAlert"
|
||||||
- $ref: "#/components/schemas/TimelineTerminateTimeline"
|
- $ref: "#/components/schemas/TimelineTerminateTimeline"
|
||||||
|
- $ref: "#/components/schemas/TimelineShowCover"
|
||||||
|
|
||||||
discriminator:
|
discriminator:
|
||||||
propertyName: type
|
propertyName: type
|
||||||
mapping": # deprecated
|
mapping": # deprecated
|
||||||
|
|
@ -25,6 +27,7 @@ components:
|
||||||
TimelineReplaceEntry: "#/components/schemas/TimelineReplaceEntry"
|
TimelineReplaceEntry: "#/components/schemas/TimelineReplaceEntry"
|
||||||
TimelineShowAlert: "#/components/schemas/TimelineShowAlert"
|
TimelineShowAlert: "#/components/schemas/TimelineShowAlert"
|
||||||
TimelineTerminateTimeline: "#/components/schemas/TimelineTerminateTimeline"
|
TimelineTerminateTimeline: "#/components/schemas/TimelineTerminateTimeline"
|
||||||
|
TimelineShowCover: "#/components/schemas/TimelineShowCover"
|
||||||
|
|
||||||
InstructionType:
|
InstructionType:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -37,6 +40,7 @@ components:
|
||||||
TimelineReplaceEntry,
|
TimelineReplaceEntry,
|
||||||
TimelineShowAlert,
|
TimelineShowAlert,
|
||||||
TimelineTerminateTimeline,
|
TimelineTerminateTimeline,
|
||||||
|
TimelineShowCover,
|
||||||
]
|
]
|
||||||
|
|
||||||
TimelineAddEntries:
|
TimelineAddEntries:
|
||||||
|
|
@ -162,3 +166,133 @@ components:
|
||||||
sortIndex:
|
sortIndex:
|
||||||
type: string
|
type: string
|
||||||
pattern: "[0-9]+$"
|
pattern: "[0-9]+$"
|
||||||
|
|
||||||
|
TimelineShowCover:
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- clientEventInfo
|
||||||
|
- cover
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
$ref: "#/components/schemas/InstructionType" # TimelineShowCover
|
||||||
|
clientEventInfo:
|
||||||
|
$ref: "./content.yaml#/components/schemas/ClientEventInfo"
|
||||||
|
cover:
|
||||||
|
$ref: "#/components/schemas/TimelineHalfCover"
|
||||||
|
|
||||||
|
TimelineHalfCover:
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- halfCoverDisplayType
|
||||||
|
- primaryText
|
||||||
|
- primaryCoverCta
|
||||||
|
- secondaryText
|
||||||
|
- impressionCallbacks
|
||||||
|
- dismissible
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum: [TimelineHalfCover]
|
||||||
|
halfCoverDisplayType:
|
||||||
|
type: string
|
||||||
|
enum: [Cover]
|
||||||
|
primaryText:
|
||||||
|
$ref: "#/components/schemas/Text"
|
||||||
|
secondaryText:
|
||||||
|
$ref: "#/components/schemas/Text"
|
||||||
|
primaryCoverCta:
|
||||||
|
$ref: "#/components/schemas/CoverCta"
|
||||||
|
impressionCallbacks:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/Callback"
|
||||||
|
dismissible:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
Text:
|
||||||
|
required:
|
||||||
|
- text
|
||||||
|
- entities
|
||||||
|
properties:
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
entities:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/TextEntity"
|
||||||
|
|
||||||
|
TextEntity:
|
||||||
|
required:
|
||||||
|
- fromIndex
|
||||||
|
- toIndex
|
||||||
|
- ref
|
||||||
|
properties:
|
||||||
|
fromIndex:
|
||||||
|
type: integer
|
||||||
|
toIndex:
|
||||||
|
type: integer
|
||||||
|
ref:
|
||||||
|
$ref: "#/components/schemas/TextEntityRef"
|
||||||
|
|
||||||
|
TextEntityRef:
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- url
|
||||||
|
- urlType
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum: [TimelineUrl]
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
urlType:
|
||||||
|
type: string
|
||||||
|
enum: [ExternalUrl]
|
||||||
|
|
||||||
|
CoverCta:
|
||||||
|
required:
|
||||||
|
- text
|
||||||
|
- ctaBehavior
|
||||||
|
- callbacks
|
||||||
|
- clientEventInfo
|
||||||
|
- buttonStyle
|
||||||
|
properties:
|
||||||
|
Text:
|
||||||
|
type: string
|
||||||
|
ctaBehavior:
|
||||||
|
$ref: "#/components/schemas/TimelineCoverBehavior"
|
||||||
|
callbacks:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/Callback"
|
||||||
|
clientEventInfo:
|
||||||
|
$ref: "#/components/schemas/CtaClientEventInfo"
|
||||||
|
buttonStyle:
|
||||||
|
type: string
|
||||||
|
enum: ["Primary"]
|
||||||
|
|
||||||
|
TimelineCoverBehavior:
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum: [TimelineCoverBehaviorDismiss]
|
||||||
|
|
||||||
|
Callback:
|
||||||
|
required:
|
||||||
|
- endpoint
|
||||||
|
properties:
|
||||||
|
endpoint:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
# pattern: '^/1\.1/[a-z]+/[a-z]+\.json\?[a-z_]+=[a-z0-9-]+(&[a-z_]+=[a-z0-9-]+)+?$' #/1.1/onboarding/fatigue.json?{params}
|
||||||
|
|
||||||
|
CtaClientEventInfo:
|
||||||
|
required:
|
||||||
|
- action
|
||||||
|
properties:
|
||||||
|
action:
|
||||||
|
type: string
|
||||||
|
enum: [primary_cta]
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,12 @@ components:
|
||||||
Tweet:
|
Tweet:
|
||||||
required:
|
required:
|
||||||
- "rest_id"
|
- "rest_id"
|
||||||
- "core"
|
# If the tweet has been edited, this property does not exist.
|
||||||
|
# - "core"
|
||||||
- "edit_control"
|
- "edit_control"
|
||||||
- "is_translatable"
|
- "is_translatable"
|
||||||
- "source"
|
# - "source"
|
||||||
- "legacy"
|
# - "legacy"
|
||||||
- "views"
|
- "views"
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -496,8 +497,8 @@ components:
|
||||||
type: integer
|
type: integer
|
||||||
|
|
||||||
extMediaAvailability:
|
extMediaAvailability:
|
||||||
required:
|
# required:
|
||||||
- "status"
|
# - "status"
|
||||||
properties:
|
properties:
|
||||||
status:
|
status:
|
||||||
type: string
|
type: string
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import time
|
||||||
import glob
|
import glob
|
||||||
import aenum
|
import aenum
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")
|
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")
|
||||||
|
|
@ -106,21 +107,23 @@ def save_cache(data):
|
||||||
json.dump(data, f, indent=4)
|
json.dump(data, f, indent=4)
|
||||||
|
|
||||||
|
|
||||||
def task_callback(file):
|
def task_callback(file, thread=True):
|
||||||
try:
|
try:
|
||||||
with open(file, "r") as f:
|
with open(file, "r") as f:
|
||||||
cache = json.load(f)
|
cache = json.load(f)
|
||||||
data = pt.__dict__[cache["type"]].from_json(cache["raw"])
|
data = pt.__dict__[cache["type"]].from_json(cache["raw"])
|
||||||
rate = match_rate(data.to_dict(), json.loads(cache["raw"]))
|
rate = match_rate(data.to_dict(), json.loads(cache["raw"]))
|
||||||
return f"Match rate: {rate}"
|
return rate, file
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return f"Error: {e} {file}"
|
if thread:
|
||||||
|
return 0, file
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
def error_dump(e):
|
def error_dump(e):
|
||||||
if ERROR_UNCATCHED:
|
if ERROR_UNCATCHED:
|
||||||
raise
|
raise
|
||||||
import traceback
|
|
||||||
|
|
||||||
logger.error("==========[STACK TRACE]==========")
|
logger.error("==========[STACK TRACE]==========")
|
||||||
for trace in traceback.format_exc().split("\n"):
|
for trace in traceback.format_exc().split("\n"):
|
||||||
|
|
@ -146,12 +149,20 @@ if __name__ == "__main__":
|
||||||
with open("src/config/placeholder.json", "r") as f:
|
with open("src/config/placeholder.json", "r") as f:
|
||||||
placeholder = json.load(f)
|
placeholder = json.load(f)
|
||||||
|
|
||||||
|
fail = []
|
||||||
with concurrent.futures.ProcessPoolExecutor() as executor:
|
with concurrent.futures.ProcessPoolExecutor() as executor:
|
||||||
tasks = [executor.submit(task_callback, x) for x in glob.glob("cache/*.json")]
|
tasks = [executor.submit(task_callback, x) for x in glob.glob("cache/*.json")]
|
||||||
for task in concurrent.futures.as_completed(tasks):
|
for task in concurrent.futures.as_completed(tasks):
|
||||||
logger.info(task.result())
|
rate, file = task.result()
|
||||||
|
if rate < 1:
|
||||||
|
fail.append(file)
|
||||||
|
logger.info(f"Match rate: {rate}")
|
||||||
|
|
||||||
logger.info(f"Success: {len(glob.glob('cache/*.json'))}")
|
logger.info(f"Fail: {len(fail)} / {len(glob.glob('cache/*.json'))}")
|
||||||
|
|
||||||
|
for file in fail:
|
||||||
|
task_callback(file, thread=False)
|
||||||
|
logger.info(f"Match rate: {rate}")
|
||||||
|
|
||||||
api_conf = pt.Configuration(
|
api_conf = pt.Configuration(
|
||||||
api_key={
|
api_key={
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue