-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add admin action for eventsub subscribe (#733)
* feat: add admin action for eventsub subscribe * wires * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto * kruto --------- Co-authored-by: Vitalij Ryndin <crashmax.dev@gmail.com>
- Loading branch information
1 parent
051842e
commit 1a3590b
Showing
121 changed files
with
1,264 additions
and
1,198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
apps/api-gql/internal/gql/resolvers/admin-actions.resolver.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
apps/api-gql/internal/gql/resolvers/admin-actions.resolver.service.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package resolvers | ||
|
||
import ( | ||
"fmt" | ||
|
||
model "github.com/satont/twir/libs/gomodels" | ||
"github.com/twirapp/twir/apps/api-gql/internal/gql/gqlmodel" | ||
) | ||
|
||
func (r *mutationResolver) eventSubGqlToCondition( | ||
input gqlmodel.EventsubSubscribeConditionInput, | ||
) (model.EventsubConditionType, error) { | ||
switch input { | ||
case gqlmodel.EventsubSubscribeConditionInputChannel: | ||
return model.EventsubConditionTypeBroadcasterUserID, nil | ||
case gqlmodel.EventsubSubscribeConditionInputUser: | ||
return model.EventsubConditionTypeUserID, nil | ||
case gqlmodel.EventsubSubscribeConditionInputChannelWithModeratorID: | ||
return model.EventsubConditionTypeBroadcasterWithModeratorID, nil | ||
case gqlmodel.EventsubSubscribeConditionInputChannelWithBotID: | ||
return model.EventsubConditionTypeBroadcasterWithUserID, nil | ||
default: | ||
return "", fmt.Errorf("unknown input type") | ||
} | ||
} |
32 changes: 6 additions & 26 deletions
32
apps/api-gql/internal/gql/resolvers/notifications.resolver.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
extend type Mutation { | ||
dropAllAuthSessions: Boolean! @isAuthenticated @isAdmin | ||
eventsubSubscribe(opts: EventsubSubscribeInput!): Boolean! @isAuthenticated @isAdmin | ||
} | ||
|
||
input EventsubSubscribeInput { | ||
type: String! @validate(constraint: "max=50") | ||
version: String! @validate(constraint: "max=50") | ||
condition: EventsubSubscribeConditionInput! | ||
} | ||
|
||
enum EventsubSubscribeConditionInput { | ||
CHANNEL | ||
USER | ||
CHANNEL_WITH_MODERATOR_ID | ||
CHANNEL_WITH_BOT_ID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.