Unify constants variables documentation
This commit is contained in:
1 parent
5e2a40fc57
commit
20949e7738
2 files changed
+29
-23
No files matched your search
+26
-21
@@ -82,71 +82,76 @@ class GQLOperation(JsonType):
|
|||||||
|
|
||||||
|
|
||||||
GQL_OPERATIONS: Dict[str, GQLOperation] = {
|
GQL_OPERATIONS: Dict[str, GQLOperation] = {
|
||||||
"IsStreamLive": GQLOperation(
|
|
||||||
"WithIsStreamLiveQuery",
|
|
||||||
"04e46329a6786ff3a81c01c50bfa5d725902507a0deb83b0edbf7abe7a3716ea",
|
|
||||||
),
|
|
||||||
# returns stream information for a particular channel
|
# returns stream information for a particular channel
|
||||||
"GetStreamInfo": GQLOperation(
|
"GetStreamInfo": GQLOperation(
|
||||||
"VideoPlayerStreamInfoOverlayChannel",
|
"VideoPlayerStreamInfoOverlayChannel",
|
||||||
"a5f2e34d626a9f4f5c0204f910bab2194948a9502089be558bb6e779a9e1b3d2",
|
"a5f2e34d626a9f4f5c0204f910bab2194948a9502089be558bb6e779a9e1b3d2",
|
||||||
|
variables={
|
||||||
|
"channel": ..., # channel login
|
||||||
|
},
|
||||||
),
|
),
|
||||||
# can be used to claim channel points
|
# can be used to claim channel points
|
||||||
"ClaimCommunityPoints": GQLOperation(
|
"ClaimCommunityPoints": GQLOperation(
|
||||||
"ClaimCommunityPoints",
|
"ClaimCommunityPoints",
|
||||||
"46aaeebe02c99afdf4fc97c7c0cba964124bf6b0af229395f1f6d1feed05b3d0",
|
"46aaeebe02c99afdf4fc97c7c0cba964124bf6b0af229395f1f6d1feed05b3d0",
|
||||||
|
variables={
|
||||||
|
"input": {
|
||||||
|
"claimID": ..., # points claim_id
|
||||||
|
"channelID": ..., # channel ID as a str
|
||||||
|
},
|
||||||
|
},
|
||||||
),
|
),
|
||||||
# can be used to claim a drop
|
# can be used to claim a drop
|
||||||
"ClaimDrop": GQLOperation(
|
"ClaimDrop": GQLOperation(
|
||||||
"DropsPage_ClaimDropRewards",
|
"DropsPage_ClaimDropRewards",
|
||||||
"2f884fa187b8fadb2a49db0adc033e636f7b6aaee6e76de1e2bba9a7baf0daf6",
|
"2f884fa187b8fadb2a49db0adc033e636f7b6aaee6e76de1e2bba9a7baf0daf6",
|
||||||
|
variables={
|
||||||
|
"input": {
|
||||||
|
"dropInstanceID": ..., # drop claim_id
|
||||||
|
},
|
||||||
|
},
|
||||||
),
|
),
|
||||||
# returns current state of points (balance, claim available) for a particular channel
|
# returns current state of points (balance, claim available) for a particular channel
|
||||||
"ChannelPointsContext": GQLOperation(
|
"ChannelPointsContext": GQLOperation(
|
||||||
"ChannelPointsContext",
|
"ChannelPointsContext",
|
||||||
"9988086babc615a918a1e9a722ff41d98847acac822645209ac7379eecb27152",
|
"9988086babc615a918a1e9a722ff41d98847acac822645209ac7379eecb27152",
|
||||||
|
variables={
|
||||||
|
"channelLogin": ..., # channel login
|
||||||
|
},
|
||||||
),
|
),
|
||||||
# returns all in-progress campaigns
|
# returns all in-progress campaigns
|
||||||
"Inventory": GQLOperation(
|
"Inventory": GQLOperation(
|
||||||
"Inventory",
|
"Inventory",
|
||||||
"27f074f54ff74e0b05c8244ef2667180c2f911255e589ccd693a1a52ccca7367",
|
"27f074f54ff74e0b05c8244ef2667180c2f911255e589ccd693a1a52ccca7367",
|
||||||
|
# no variables needed
|
||||||
),
|
),
|
||||||
# returns current state of drops (current drop progress)
|
# returns current state of drops (current drop progress)
|
||||||
"CurrentDrop": GQLOperation(
|
"CurrentDrop": GQLOperation(
|
||||||
"DropCurrentSessionContext",
|
"DropCurrentSessionContext",
|
||||||
"2e4b3630b91552eb05b76a94b6850eb25fe42263b7cf6d06bee6d156dd247c1c",
|
"2e4b3630b91552eb05b76a94b6850eb25fe42263b7cf6d06bee6d156dd247c1c",
|
||||||
|
# no variables needed
|
||||||
),
|
),
|
||||||
# returns all available campaigns
|
# returns all available campaigns
|
||||||
"Campaigns": GQLOperation(
|
"Campaigns": GQLOperation(
|
||||||
"ViewerDropsDashboard",
|
"ViewerDropsDashboard",
|
||||||
"e8b98b52bbd7ccd37d0b671ad0d47be5238caa5bea637d2a65776175b4a23a64",
|
"e8b98b52bbd7ccd37d0b671ad0d47be5238caa5bea637d2a65776175b4a23a64",
|
||||||
|
# no variables needed
|
||||||
),
|
),
|
||||||
# returns extended information about a particular campaign
|
# returns extended information about a particular campaign
|
||||||
"CampaignDetails": GQLOperation(
|
"CampaignDetails": GQLOperation(
|
||||||
"DropCampaignDetails",
|
"DropCampaignDetails",
|
||||||
"f6396f5ffdde867a8f6f6da18286e4baf02e5b98d14689a69b5af320a4c7b7b8",
|
"f6396f5ffdde867a8f6f6da18286e4baf02e5b98d14689a69b5af320a4c7b7b8",
|
||||||
variables={
|
variables={
|
||||||
"channelLogin": ..., # user ID
|
"channelLogin": ..., # user login
|
||||||
"dropID": ..., # campaign ID
|
"dropID": ..., # campaign ID
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
# returns drops available for a particular channel
|
# returns drops available for a particular channel (unused)
|
||||||
"ChannelDrops": GQLOperation(
|
"ChannelDrops": GQLOperation(
|
||||||
"DropsHighlightService_AvailableDrops",
|
"DropsHighlightService_AvailableDrops",
|
||||||
"b19ee96a0e79e3f8281c4108bc4c7b3f232266db6f96fd04a339ab393673a075",
|
"b19ee96a0e79e3f8281c4108bc4c7b3f232266db6f96fd04a339ab393673a075",
|
||||||
variables={"channelID": ...},
|
|
||||||
),
|
|
||||||
"PersonalSections": GQLOperation(
|
|
||||||
"PersonalSections",
|
|
||||||
"9fbdfb00156f754c26bde81eb47436dee146655c92682328457037da1a48ed39",
|
|
||||||
variables={
|
variables={
|
||||||
"input": {
|
"channelID": ..., # channel ID as a str
|
||||||
"sectionInputs": ["FOLLOWED_SECTION"],
|
|
||||||
"recommendationContext": {"platform": "web"},
|
|
||||||
},
|
|
||||||
"channelLogin": None,
|
|
||||||
"withChannelUser": False,
|
|
||||||
"creatorAnniversariesExperimentEnabled": False,
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
# returns live channels for a particular game
|
# returns live channels for a particular game
|
||||||
@@ -154,13 +159,13 @@ GQL_OPERATIONS: Dict[str, GQLOperation] = {
|
|||||||
"DirectoryPage_Game",
|
"DirectoryPage_Game",
|
||||||
"d5c5df7ab9ae65c3ea0f225738c08a36a4a76e4c6c31db7f8c4b8dc064227f9e",
|
"d5c5df7ab9ae65c3ea0f225738c08a36a4a76e4c6c31db7f8c4b8dc064227f9e",
|
||||||
variables={
|
variables={
|
||||||
"limit": 40,
|
"limit": ..., # limit of channels returned
|
||||||
"name": "<game_name>",
|
"name": ..., # game name
|
||||||
"options": {
|
"options": {
|
||||||
"includeRestricted": ["SUB_ONLY_LIVE"],
|
"includeRestricted": ["SUB_ONLY_LIVE"],
|
||||||
"recommendationsContext": {"platform": "web"},
|
"recommendationsContext": {"platform": "web"},
|
||||||
"sort": "RELEVANCE",
|
"sort": "RELEVANCE",
|
||||||
"tags": [],
|
"tags": [], # list of tag IDs
|
||||||
"requestID": "JIRA-VXP-2397",
|
"requestID": "JIRA-VXP-2397",
|
||||||
},
|
},
|
||||||
"sortTypeIsRecency": False,
|
"sortTypeIsRecency": False,
|
||||||
|
|||||||
@@ -838,7 +838,8 @@ class Twitch:
|
|||||||
]
|
]
|
||||||
|
|
||||||
async def claim_points(self, channel_id: Union[str, int], claim_id: str) -> None:
|
async def claim_points(self, channel_id: Union[str, int], claim_id: str) -> None:
|
||||||
variables = {"input": {"channelID": str(channel_id), "claimID": claim_id}}
|
|
||||||
await self.gql_request(
|
await self.gql_request(
|
||||||
GQL_OPERATIONS["ClaimCommunityPoints"].with_variables(variables)
|
GQL_OPERATIONS["ClaimCommunityPoints"].with_variables(
|
||||||
|
{"input": {"channelID": str(channel_id), "claimID": claim_id}}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
Reference in new issue
Block a user