Skip to content

Commit 00363c9

Browse files
committed
chore: updates with PostOperationValidationRule fix
1 parent 581d459 commit 00363c9

File tree

3 files changed

+133
-16
lines changed

3 files changed

+133
-16
lines changed

packages/graphql/schema.graphql

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,24 @@ type AuthenticationTokens {
981981
idToken: IdToken!
982982
}
983983

984+
input BanAccountGroupRuleConfig {
985+
enable: AlwaysTrue
986+
}
987+
988+
input BanGroupAccountRequest {
989+
"""The group you want to ban member on."""
990+
group: EvmAddress!
991+
992+
"""The account you want to ban on the group."""
993+
account: EvmAddress!
994+
}
995+
996+
type BanGroupAccountResponse {
997+
hash: TxHash!
998+
}
999+
1000+
union BanGroupAccountResult = BanGroupAccountResponse | SponsoredTransactionRequest | SelfFundedTransactionRequest | TransactionWillFail
1001+
9841002
scalar BigDecimal
9851003

9861004
type BigDecimalKeyValue {
@@ -2702,9 +2720,50 @@ type Group {
27022720
metadata: GroupMetadata
27032721
owner: EvmAddress!
27042722
operations: LoggedInGroupOperations
2723+
2724+
"""Returns true if the group has banning rule enabled"""
2725+
banningEnabled: Boolean!
2726+
2727+
"""Returns true if the group has membership approval rule enabled"""
2728+
membershipApprovalEnabled: Boolean!
27052729
rules: GroupRules!
27062730
}
27072731

2732+
type GroupBannedAccount {
2733+
ruleId: RuleId!
2734+
account: Account!
2735+
bannedBy: Account!
2736+
lastActiveAt: DateTime!
2737+
bannedAt: DateTime!
2738+
}
2739+
2740+
input GroupBannedAccountsFilter {
2741+
"""The optional filter to narrow banned accounts by search query."""
2742+
searchBy: UsernameSearchInput
2743+
}
2744+
2745+
enum GroupBannedAccountsOrderBy {
2746+
LAST_BANNED
2747+
FIRST_BANNED
2748+
LAST_ACTIVE
2749+
ACCOUNT_SCORE
2750+
}
2751+
2752+
input GroupBannedAccountsRequest {
2753+
"""The group"""
2754+
group: EvmAddress!
2755+
filter: GroupBannedAccountsFilter
2756+
2757+
"""The order by."""
2758+
orderBy: GroupBannedAccountsOrderBy! = ACCOUNT_SCORE
2759+
2760+
"""The page size."""
2761+
pageSize: PageSize! = FIFTY
2762+
2763+
"""The cursor."""
2764+
cursor: Cursor
2765+
}
2766+
27082767
input GroupGatedFeedRuleConfig {
27092768
group: EvmAddress!
27102769
}
@@ -2843,6 +2902,7 @@ type GroupRule {
28432902

28442903
input GroupRuleConfig {
28452904
membershipApprovalRule: MembershipApprovalGroupRuleConfig
2905+
banAccountRule: BanAccountGroupRuleConfig
28462906
tokenGatedRule: TokenGatedGroupRuleConfig
28472907
simplePaymentRule: SimplePaymentGroupRuleConfig
28482908
unknownRule: UnknownGroupRuleConfig
@@ -2859,7 +2919,7 @@ enum GroupRuleType {
28592919
TOKEN_GATED
28602920
SIMPLE_PAYMENT
28612921
MEMBERSHIP_APPROVAL
2862-
BAN_MEMBER
2922+
BAN_ACCOUNT
28632923
UNKNOWN
28642924
}
28652925

@@ -2868,6 +2928,7 @@ enum GroupRuleUnsatisfiedReason {
28682928
TOKEN_GATED_ACCOUNT_REMOVAL_STILL_TOKEN_HOLDER
28692929
SIMPLE_PAYMENT_NOT_ENOUGH_BALANCE
28702930
MEMBERSHIP_APPROVAL_REQUIRED
2931+
ACCOUNT_BANNED
28712932
}
28722933

28732934
type GroupRules {
@@ -3187,6 +3248,7 @@ type LoggedInGroupOperations {
31873248
canAddMember: GroupOperationValidationOutcome!
31883249
canRemoveMember: GroupOperationValidationOutcome!
31893250
isMember: Boolean!
3251+
isBanned: Boolean!
31903252
}
31913253

31923254
type LoggedInPostOperations {
@@ -4304,6 +4366,22 @@ type Mutation {
43044366
You MUST be a group owner or admin to use this mutation
43054367
"""
43064368
rejectGroupMembershipRequest(request: RejectGroupMembershipRequest!): RejectGroupMembershipResult!
4369+
4370+
"""
4371+
Ban account to join a group
4372+
Banned account MUST not be a member of a group.
4373+
Use `removeGroupMember` mutation with `ban` flag to remove and ban existing members
4374+
4375+
You MUST be authenticated as Account Owner or Account Manager to use this mutation.
4376+
"""
4377+
banGroupAccount(request: BanGroupAccountRequest!): BanGroupAccountResult!
4378+
4379+
"""
4380+
Unban account
4381+
4382+
You MUST be authenticated as Account Owner or Account Manager to use this mutation.
4383+
"""
4384+
unbanGroupAccount(request: UnbanGroupAccountRequest!): UnbanGroupAccountResult!
43074385
createSnsSubscriptions(request: CreateSnsSubscriptionRequest!): [SnsSubscription!]!
43084386
deleteSnsSubscription(request: DeleteSnsSubscriptionRequest!): Void!
43094387

@@ -4564,8 +4642,6 @@ input OnboardingUserChallengeRequest {
45644642
wallet: EvmAddress!
45654643
}
45664644

4567-
union OperationValidationRule = PostRule | FeedRule
4568-
45694645
enum PageSize {
45704646
TEN
45714647
FIFTY
@@ -4654,6 +4730,11 @@ type PaginatedGraphsResult {
46544730
pageInfo: PaginatedResultInfo!
46554731
}
46564732

4733+
type PaginatedGroupBannedAccountsResult {
4734+
items: [GroupBannedAccount!]!
4735+
pageInfo: PaginatedResultInfo!
4736+
}
4737+
46574738
type PaginatedGroupMembersResult {
46584739
items: [GroupMember!]!
46594740
pageInfo: PaginatedResultInfo!
@@ -4924,8 +5005,10 @@ type PostOperationValidationPassed {
49245005
passed: AlwaysTrue!
49255006
}
49265007

5008+
union PostOperationValidationRule = PostRule | FeedRule
5009+
49275010
type PostOperationValidationUnknown {
4928-
extraChecksRequired: [OperationValidationRule!]!
5011+
extraChecksRequired: [PostOperationValidationRule!]!
49295012
}
49305013

49315014
type PostReaction {
@@ -5327,6 +5410,9 @@ type Query {
53275410
"""Get the group membership requests"""
53285411
groupMembershipRequests(request: GroupMembershipRequestsRequest!): PaginatedGroupMembershipRequestsResult!
53295412

5413+
"""Get the banned accounts of a group"""
5414+
groupBannedAccounts(request: GroupBannedAccountsRequest!): PaginatedGroupBannedAccountsResult!
5415+
53305416
"""Get admins for a graph/app/sponsor/feed/username/group address"""
53315417
adminsFor(request: AdminsForRequest!): PaginatedAdminsResult!
53325418

@@ -5494,6 +5580,9 @@ input RemoveGroupMemberRequest {
54945580
"""The account you want to remove from the group."""
54955581
account: EvmAddress!
54965582

5583+
"""Ban the account from the joining the group."""
5584+
ban: Boolean! = false
5585+
54975586
"""The processing params for the join rules."""
54985587
rulesProcessingParams: [GroupRulesProcessingParams!]
54995588
}
@@ -6458,6 +6547,8 @@ enum TransactionOperation {
64586547
GROUP_MEMBERSHIP_APPROVAL_REQUEST_CANCELLED
64596548
GROUP_MEMBERSHIP_APPROVAL_APPROVED
64606549
GROUP_MEMBERSHIP_APPROVAL_REJECTED
6550+
GROUP_ACCOUNT_BANNED
6551+
GROUP_ACCOUNT_UNBANNED
64616552
NAMESPACE_FACTORY_DEPLOYMENT
64626553
SPONSOR_FREE_PAYMASTER_CREATED
64636554
SPONSOR_ADDED_TO_APPROVED_SIGNERS
@@ -6552,6 +6643,20 @@ type UnassignUsernameResponse {
65526643

65536644
union UnassignUsernameToAccountResult = UnassignUsernameResponse | SponsoredTransactionRequest | SelfFundedTransactionRequest | TransactionWillFail
65546645

6646+
input UnbanGroupAccountRequest {
6647+
"""The group you want to unban member on."""
6648+
group: EvmAddress!
6649+
6650+
"""The account you want to unban on the group."""
6651+
account: EvmAddress!
6652+
}
6653+
6654+
type UnbanGroupAccountResponse {
6655+
hash: TxHash!
6656+
}
6657+
6658+
union UnbanGroupAccountResult = UnbanGroupAccountResponse | SponsoredTransactionRequest | SelfFundedTransactionRequest | TransactionWillFail
6659+
65556660
type UnblockError {
65566661
error: UnblockErrorType!
65576662
}

packages/graphql/src/fragments/post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export const PostRuleFragment = graphql(
176176
export type PostRule = FragmentOf<typeof PostRuleFragment>;
177177

178178
export const PostOperationValidationRuleFragment = graphql(
179-
`fragment PostOperationValidationRule on OperationValidationRule {
179+
`fragment PostOperationValidationRule on PostOperationValidationRule {
180180
... on PostRule {
181181
...PostRule
182182
}

0 commit comments

Comments
 (0)