-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* getUserInviteCodes lex * small change * implement user invite code creation/getting * transactionally ensure we dont allow duplicate creates * testing & fixes * clean up & allow admin creation for a particular user * fix dev-env * user -> accnt & add admin disable codes route * proposed admin inv schemas * more admin routes for inv codes * tests for invite admin views * pr feedback * refactor & return usedBy + more details on getAccountInviteCodes * adding invite info into moderation views * tests passing
- Loading branch information
Showing
40 changed files
with
1,654 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.admin.disableInviteCodes", | ||
"defs": { | ||
"main": { | ||
"type": "procedure", | ||
"description": "Disable some set of codes and/or all codes associated with a set of users", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"codes": { | ||
"type": "array", | ||
"items": {"type": "string"} | ||
}, | ||
"accounts": { | ||
"type": "array", | ||
"items": {"type": "string"} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,39 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.admin.getInviteCodes", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Admin view of invite codes", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"sort": { | ||
"type": "string", | ||
"knownValues": [ | ||
"recent", | ||
"usage" | ||
], | ||
"default": "recent" | ||
}, | ||
"limit": {"type": "integer", "minimum": 1, "maximum": 500, "default": 100}, | ||
"cursor": {"type": "string"} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["codes"], | ||
"properties": { | ||
"cursor": {"type": "string"}, | ||
"codes": { | ||
"type": "array", | ||
"items": {"type": "ref", "ref": "com.atproto.server.defs#inviteCode"} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 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,30 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.server.defs", | ||
"defs": { | ||
"inviteCode": { | ||
"type": "object", | ||
"required": ["code", "available", "disabled", "forAccount", "createdBy", "createdAt", "uses"], | ||
"properties": { | ||
"code": {"type": "string"}, | ||
"available": {"type": "integer"}, | ||
"disabled": {"type": "boolean"}, | ||
"forAccount": {"type": "string"}, | ||
"createdBy": {"type": "string"}, | ||
"createdAt": {"type": "string", "format": "datetime"}, | ||
"uses": { | ||
"type": "array", | ||
"items": {"type": "ref", "ref": "#inviteCodeUse"} | ||
} | ||
} | ||
}, | ||
"inviteCodeUse": { | ||
"type": "object", | ||
"required": ["usedBy", "usedAt"], | ||
"properties": { | ||
"usedBy": {"type": "string", "format": "did"}, | ||
"usedAt": {"type": "string", "format": "datetime"} | ||
} | ||
} | ||
} | ||
} |
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,36 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.server.getAccountInviteCodes", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get all invite codes for a given account", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"includeUsed": { "type": "boolean", "default": true }, | ||
"createAvailable": { "type": "boolean", "default": true } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["codes"], | ||
"properties": { | ||
"codes": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "com.atproto.server.defs#inviteCode" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [ | ||
{"name": "DuplicateCreate"} | ||
] | ||
} | ||
} | ||
} |
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
Oops, something went wrong.