From 5007b97d017f32721faf4caaba6143f3b0923fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 20 May 2023 17:23:07 +0900 Subject: [PATCH] add window.__INITIAL_STATE__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/dart/openapi-3.0.yaml | 4 ++ dist/dart/paths/other.yaml | 98 +++++++++++++++++++++++++++++ dist/docs/openapi-3.0.yaml | 4 ++ dist/docs/paths/other.yaml | 98 +++++++++++++++++++++++++++++ dist/test/openapi-3.0.yaml | 4 ++ dist/test/paths/other.yaml | 98 +++++++++++++++++++++++++++++ dist/typescript/openapi-3.0.yaml | 4 ++ dist/typescript/paths/other.yaml | 98 +++++++++++++++++++++++++++++ src/openapi/openapi-3.0.yaml | 2 + src/openapi/paths/other.yaml | 103 +++++++++++++++++++++++++++++++ tools/build_config.py | 12 ++-- 11 files changed, 521 insertions(+), 4 deletions(-) create mode 100644 dist/dart/paths/other.yaml create mode 100644 dist/docs/paths/other.yaml create mode 100644 dist/test/paths/other.yaml create mode 100644 dist/typescript/paths/other.yaml create mode 100644 src/openapi/paths/other.yaml diff --git a/dist/dart/openapi-3.0.yaml b/dist/dart/openapi-3.0.yaml index 621757a..226b5a8 100644 --- a/dist/dart/openapi-3.0.yaml +++ b/dist/dart/openapi-3.0.yaml @@ -81,6 +81,8 @@ paths: $ref: ./paths/tweet.yaml#/paths/~1graphql~1wNNG8DBB8EaXw1lq4vFWGA~1TweetDetail /graphql/zhX91JE87mWvfprhYE97xA/HomeLatestTimeline: $ref: ./paths/timeline.yaml#/paths/~1graphql~1zhX91JE87mWvfprhYE97xA~1HomeLatestTimeline + /other: + $ref: ./paths/other.yaml#/paths/~1other security: - bearerAuth: [] - CsrfToken: [] @@ -108,3 +110,5 @@ tags: name: v2.0-get - description: legacy APIs post name: v2.0-post +- description: other + name: other diff --git a/dist/dart/paths/other.yaml b/dist/dart/paths/other.yaml new file mode 100644 index 0000000..766da46 --- /dev/null +++ b/dist/dart/paths/other.yaml @@ -0,0 +1,98 @@ +components: + schemas: + CommunitiesActions: + properties: + create: + type: boolean + required: + - create + type: object + OneFactorLoginEligibility: + properties: + fetchStatus: + type: string + required: + - fetchStatus + type: object + OtherResponse: + properties: + session: + $ref: '#/components/schemas/Session' + required: + - session + type: object + Session: + properties: + SsoInitTokens: + type: object + communitiesActions: + $ref: '#/components/schemas/CommunitiesActions' + country: + pattern: ^[A-Z]{2}$ + type: string + guestId: + pattern: ^[0-9]+$ + type: string + hasCommunityMemberships: + type: boolean + isActiveCreator: + type: boolean + isRestrictedSession: + type: boolean + isSuperFollowSubscriber: + type: boolean + language: + pattern: ^[a-z]{2}$ + type: string + oneFactorLoginEligibility: + $ref: '#/components/schemas/OneFactorLoginEligibility' + superFollowersCount: + type: integer + superFollowsApplicationStatus: + type: string + userFeatures: + $ref: '#/components/schemas/UserFeatures' + user_id: + pattern: ^[0-9]+$ + type: string + required: + - country + - communitiesActions + - isActiveCreator + - isRestrictedSession + - guestId + - hasCommunityMemberships + - language + - oneFactorLoginEligibility + - ssoInitTokens + - superFollowersCount + - superFollowsApplicationStatus + - user_id + - userFeatures + - isSuperFollowSubscriber + type: object + UserFeatures: + properties: + mediatool_studio_library: + type: boolean + required: + - mediatool_studio_library + type: object +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: + /other: + get: + description: This is not an actual endpoint + operationId: other + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OtherResponse' + description: Successful operation + tags: + - other diff --git a/dist/docs/openapi-3.0.yaml b/dist/docs/openapi-3.0.yaml index cabc5dd..a210777 100644 --- a/dist/docs/openapi-3.0.yaml +++ b/dist/docs/openapi-3.0.yaml @@ -101,6 +101,8 @@ paths: $ref: ./paths/tweet.yaml#/paths/~1graphql~1wNNG8DBB8EaXw1lq4vFWGA~1TweetDetail /graphql/zhX91JE87mWvfprhYE97xA/HomeLatestTimeline: $ref: ./paths/timeline.yaml#/paths/~1graphql~1zhX91JE87mWvfprhYE97xA~1HomeLatestTimeline + /other: + $ref: ./paths/other.yaml#/paths/~1other security: - bearerAuth: [] - CsrfToken: [] @@ -128,3 +130,5 @@ tags: name: v2.0-get - description: legacy APIs post name: v2.0-post +- description: other + name: other diff --git a/dist/docs/paths/other.yaml b/dist/docs/paths/other.yaml new file mode 100644 index 0000000..766da46 --- /dev/null +++ b/dist/docs/paths/other.yaml @@ -0,0 +1,98 @@ +components: + schemas: + CommunitiesActions: + properties: + create: + type: boolean + required: + - create + type: object + OneFactorLoginEligibility: + properties: + fetchStatus: + type: string + required: + - fetchStatus + type: object + OtherResponse: + properties: + session: + $ref: '#/components/schemas/Session' + required: + - session + type: object + Session: + properties: + SsoInitTokens: + type: object + communitiesActions: + $ref: '#/components/schemas/CommunitiesActions' + country: + pattern: ^[A-Z]{2}$ + type: string + guestId: + pattern: ^[0-9]+$ + type: string + hasCommunityMemberships: + type: boolean + isActiveCreator: + type: boolean + isRestrictedSession: + type: boolean + isSuperFollowSubscriber: + type: boolean + language: + pattern: ^[a-z]{2}$ + type: string + oneFactorLoginEligibility: + $ref: '#/components/schemas/OneFactorLoginEligibility' + superFollowersCount: + type: integer + superFollowsApplicationStatus: + type: string + userFeatures: + $ref: '#/components/schemas/UserFeatures' + user_id: + pattern: ^[0-9]+$ + type: string + required: + - country + - communitiesActions + - isActiveCreator + - isRestrictedSession + - guestId + - hasCommunityMemberships + - language + - oneFactorLoginEligibility + - ssoInitTokens + - superFollowersCount + - superFollowsApplicationStatus + - user_id + - userFeatures + - isSuperFollowSubscriber + type: object + UserFeatures: + properties: + mediatool_studio_library: + type: boolean + required: + - mediatool_studio_library + type: object +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: + /other: + get: + description: This is not an actual endpoint + operationId: other + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OtherResponse' + description: Successful operation + tags: + - other diff --git a/dist/test/openapi-3.0.yaml b/dist/test/openapi-3.0.yaml index cabc5dd..a210777 100644 --- a/dist/test/openapi-3.0.yaml +++ b/dist/test/openapi-3.0.yaml @@ -101,6 +101,8 @@ paths: $ref: ./paths/tweet.yaml#/paths/~1graphql~1wNNG8DBB8EaXw1lq4vFWGA~1TweetDetail /graphql/zhX91JE87mWvfprhYE97xA/HomeLatestTimeline: $ref: ./paths/timeline.yaml#/paths/~1graphql~1zhX91JE87mWvfprhYE97xA~1HomeLatestTimeline + /other: + $ref: ./paths/other.yaml#/paths/~1other security: - bearerAuth: [] - CsrfToken: [] @@ -128,3 +130,5 @@ tags: name: v2.0-get - description: legacy APIs post name: v2.0-post +- description: other + name: other diff --git a/dist/test/paths/other.yaml b/dist/test/paths/other.yaml new file mode 100644 index 0000000..766da46 --- /dev/null +++ b/dist/test/paths/other.yaml @@ -0,0 +1,98 @@ +components: + schemas: + CommunitiesActions: + properties: + create: + type: boolean + required: + - create + type: object + OneFactorLoginEligibility: + properties: + fetchStatus: + type: string + required: + - fetchStatus + type: object + OtherResponse: + properties: + session: + $ref: '#/components/schemas/Session' + required: + - session + type: object + Session: + properties: + SsoInitTokens: + type: object + communitiesActions: + $ref: '#/components/schemas/CommunitiesActions' + country: + pattern: ^[A-Z]{2}$ + type: string + guestId: + pattern: ^[0-9]+$ + type: string + hasCommunityMemberships: + type: boolean + isActiveCreator: + type: boolean + isRestrictedSession: + type: boolean + isSuperFollowSubscriber: + type: boolean + language: + pattern: ^[a-z]{2}$ + type: string + oneFactorLoginEligibility: + $ref: '#/components/schemas/OneFactorLoginEligibility' + superFollowersCount: + type: integer + superFollowsApplicationStatus: + type: string + userFeatures: + $ref: '#/components/schemas/UserFeatures' + user_id: + pattern: ^[0-9]+$ + type: string + required: + - country + - communitiesActions + - isActiveCreator + - isRestrictedSession + - guestId + - hasCommunityMemberships + - language + - oneFactorLoginEligibility + - ssoInitTokens + - superFollowersCount + - superFollowsApplicationStatus + - user_id + - userFeatures + - isSuperFollowSubscriber + type: object + UserFeatures: + properties: + mediatool_studio_library: + type: boolean + required: + - mediatool_studio_library + type: object +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: + /other: + get: + description: This is not an actual endpoint + operationId: other + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OtherResponse' + description: Successful operation + tags: + - other diff --git a/dist/typescript/openapi-3.0.yaml b/dist/typescript/openapi-3.0.yaml index cabc5dd..a210777 100644 --- a/dist/typescript/openapi-3.0.yaml +++ b/dist/typescript/openapi-3.0.yaml @@ -101,6 +101,8 @@ paths: $ref: ./paths/tweet.yaml#/paths/~1graphql~1wNNG8DBB8EaXw1lq4vFWGA~1TweetDetail /graphql/zhX91JE87mWvfprhYE97xA/HomeLatestTimeline: $ref: ./paths/timeline.yaml#/paths/~1graphql~1zhX91JE87mWvfprhYE97xA~1HomeLatestTimeline + /other: + $ref: ./paths/other.yaml#/paths/~1other security: - bearerAuth: [] - CsrfToken: [] @@ -128,3 +130,5 @@ tags: name: v2.0-get - description: legacy APIs post name: v2.0-post +- description: other + name: other diff --git a/dist/typescript/paths/other.yaml b/dist/typescript/paths/other.yaml new file mode 100644 index 0000000..766da46 --- /dev/null +++ b/dist/typescript/paths/other.yaml @@ -0,0 +1,98 @@ +components: + schemas: + CommunitiesActions: + properties: + create: + type: boolean + required: + - create + type: object + OneFactorLoginEligibility: + properties: + fetchStatus: + type: string + required: + - fetchStatus + type: object + OtherResponse: + properties: + session: + $ref: '#/components/schemas/Session' + required: + - session + type: object + Session: + properties: + SsoInitTokens: + type: object + communitiesActions: + $ref: '#/components/schemas/CommunitiesActions' + country: + pattern: ^[A-Z]{2}$ + type: string + guestId: + pattern: ^[0-9]+$ + type: string + hasCommunityMemberships: + type: boolean + isActiveCreator: + type: boolean + isRestrictedSession: + type: boolean + isSuperFollowSubscriber: + type: boolean + language: + pattern: ^[a-z]{2}$ + type: string + oneFactorLoginEligibility: + $ref: '#/components/schemas/OneFactorLoginEligibility' + superFollowersCount: + type: integer + superFollowsApplicationStatus: + type: string + userFeatures: + $ref: '#/components/schemas/UserFeatures' + user_id: + pattern: ^[0-9]+$ + type: string + required: + - country + - communitiesActions + - isActiveCreator + - isRestrictedSession + - guestId + - hasCommunityMemberships + - language + - oneFactorLoginEligibility + - ssoInitTokens + - superFollowersCount + - superFollowsApplicationStatus + - user_id + - userFeatures + - isSuperFollowSubscriber + type: object + UserFeatures: + properties: + mediatool_studio_library: + type: boolean + required: + - mediatool_studio_library + type: object +info: + title: Twitter OpenAPI + version: 0.0.1 +openapi: 3.0.3 +paths: + /other: + get: + description: This is not an actual endpoint + operationId: other + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OtherResponse' + description: Successful operation + tags: + - other diff --git a/src/openapi/openapi-3.0.yaml b/src/openapi/openapi-3.0.yaml index a961264..6ef6000 100644 --- a/src/openapi/openapi-3.0.yaml +++ b/src/openapi/openapi-3.0.yaml @@ -67,3 +67,5 @@ tags: description: legacy APIs get - name: v2.0-post description: legacy APIs post + - name: other + description: other diff --git a/src/openapi/paths/other.yaml b/src/openapi/paths/other.yaml new file mode 100644 index 0000000..2a057c1 --- /dev/null +++ b/src/openapi/paths/other.yaml @@ -0,0 +1,103 @@ +openapi: 3.0.3 +info: + title: Twitter OpenAPI + version: 0.0.1 + +paths: + /other: + get: + operationId: other + description: This is not an actual endpoint + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/OtherResponse" + tags: + - "other" + +components: + schemas: + OtherResponse: + type: object + required: + - "session" + properties: + session: + $ref: "#/components/schemas/Session" # window.__INITIAL_STATE__ + Session: + type: object + required: + - "country" + - "communitiesActions" + - "isActiveCreator" + - "isRestrictedSession" + - "guestId" + - "hasCommunityMemberships" + - "language" + - "oneFactorLoginEligibility" + - "ssoInitTokens" + - "superFollowersCount" + - "superFollowsApplicationStatus" + - "user_id" + - "userFeatures" + - "isSuperFollowSubscriber" + properties: + country: + type: string + pattern: "^[A-Z]{2}$" + communitiesActions: + $ref: "#/components/schemas/CommunitiesActions" + isActiveCreator: + type: boolean + isRestrictedSession: + type: boolean + guestId: + type: string + pattern: "^[0-9]+$" + hasCommunityMemberships: + type: boolean + language: + type: string + pattern: "^[a-z]{2}$" + oneFactorLoginEligibility: + $ref: "#/components/schemas/OneFactorLoginEligibility" + SsoInitTokens: + type: object + superFollowersCount: + type: integer + superFollowsApplicationStatus: + type: string # enum: NotStarted + user_id: + type: string + pattern: "^[0-9]+$" + userFeatures: + $ref: "#/components/schemas/UserFeatures" + isSuperFollowSubscriber: + type: boolean + + CommunitiesActions: + type: object + required: + - "create" + properties: + create: + type: boolean + + OneFactorLoginEligibility: + type: object + required: + - "fetchStatus" + properties: + fetchStatus: + type: string # enum: none + + UserFeatures: + type: object + required: + - "mediatool_studio_library" + properties: + mediatool_studio_library: + type: boolean diff --git a/tools/build_config.py b/tools/build_config.py index 7da5529..ea98d26 100644 --- a/tools/build_config.py +++ b/tools/build_config.py @@ -50,7 +50,8 @@ class Config: ), ] for key in ["v1.1-post", "v2.0-post"] - }, + } + | {"other": []}, }, "dart": { "openapi": [], @@ -101,7 +102,8 @@ class Config: ), ] for key in ["v1.1-post", "v2.0-post"] - }, + } + | {"other": []}, }, "typescript": { "openapi": [AddSecuritySchemesOnSecuritySchemes()], @@ -136,7 +138,8 @@ class Config: ), ] for key in ["v1.1-get", "v1.1-post", "v2.0-get", "v2.0-post"] - }, + } + | {"other": []}, }, "test": { "openapi": [AddSecuritySchemesOnSecuritySchemes()], @@ -171,6 +174,7 @@ class Config: ), ] for key in ["v1.1-get", "v1.1-post", "v2.0-get", "v2.0-post"] - }, + } + | {"other": []}, }, }