forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Ozone instance-wide and user-specific settings (bluesky-social#2905)
* ✨ Settings endpoints are working * 🧹 Rename file * ✨ Replace ad-hoc manage roles to match team member roles * ♻️ Refactor role names * ✨ Polish up * ✨ Move to using id for pagination * 📝 Add changeset * ✅ Update snapshots * ⚡ Change column order in setting table index and add did in all queries
- Loading branch information
Showing
35 changed files
with
2,423 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@atproto/ozone": patch | ||
"@atproto/api": patch | ||
--- | ||
|
||
Add user specific and instance-wide settings api for ozone |
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,63 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "tools.ozone.setting.defs", | ||
"defs": { | ||
"option": { | ||
"type": "object", | ||
"required": [ | ||
"key", | ||
"value", | ||
"did", | ||
"scope", | ||
"createdBy", | ||
"lastUpdatedBy" | ||
], | ||
"properties": { | ||
"key": { | ||
"type": "string", | ||
"format": "nsid" | ||
}, | ||
"did": { | ||
"type": "string", | ||
"format": "did" | ||
}, | ||
"value": { | ||
"type": "unknown" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"maxGraphemes": 1024, | ||
"maxLength": 10240 | ||
}, | ||
"createdAt": { | ||
"type": "string", | ||
"format": "datetime" | ||
}, | ||
"updatedAt": { | ||
"type": "string", | ||
"format": "datetime" | ||
}, | ||
"managerRole": { | ||
"type": "string", | ||
"knownValues": [ | ||
"tools.ozone.team.defs#roleModerator", | ||
"tools.ozone.team.defs#roleTriage", | ||
"tools.ozone.team.defs#roleAdmin" | ||
] | ||
}, | ||
"scope": { | ||
"type": "string", | ||
"knownValues": ["instance", "personal"] | ||
}, | ||
"createdBy": { | ||
"type": "string", | ||
"format": "did" | ||
}, | ||
"lastUpdatedBy": { | ||
"type": "string", | ||
"format": "did" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,61 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "tools.ozone.setting.listOptions", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "List settings with optional filtering", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 50 | ||
}, | ||
"cursor": { | ||
"type": "string" | ||
}, | ||
"scope": { | ||
"type": "string", | ||
"knownValues": ["instance", "personal"], | ||
"default": "instance" | ||
}, | ||
"prefix": { | ||
"type": "string", | ||
"description": "Filter keys by prefix" | ||
}, | ||
"keys": { | ||
"type": "array", | ||
"maxLength": 100, | ||
"items": { | ||
"type": "string", | ||
"format": "nsid" | ||
}, | ||
"description": "Filter for only the specified keys. Ignored if prefix is provided" | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["options"], | ||
"properties": { | ||
"cursor": { | ||
"type": "string" | ||
}, | ||
"options": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "tools.ozone.setting.defs#option" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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": "tools.ozone.setting.removeOptions", | ||
"defs": { | ||
"main": { | ||
"type": "procedure", | ||
"description": "Delete settings by key", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["keys", "scope"], | ||
"properties": { | ||
"keys": { | ||
"type": "array", | ||
"minLength": 1, | ||
"maxLength": 200, | ||
"items": { | ||
"type": "string", | ||
"format": "nsid" | ||
} | ||
}, | ||
"scope": { | ||
"type": "string", | ||
"knownValues": ["instance", "personal"] | ||
} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"properties": {} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,55 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "tools.ozone.setting.upsertOption", | ||
"defs": { | ||
"main": { | ||
"type": "procedure", | ||
"description": "Create or update setting option", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["key", "scope", "value"], | ||
"properties": { | ||
"key": { | ||
"type": "string", | ||
"format": "nsid" | ||
}, | ||
"scope": { | ||
"type": "string", | ||
"knownValues": ["instance", "personal"] | ||
}, | ||
"value": { | ||
"type": "unknown" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"maxLength": 2000 | ||
}, | ||
"managerRole": { | ||
"type": "string", | ||
"knownValues": [ | ||
"tools.ozone.team.defs#roleModerator", | ||
"tools.ozone.team.defs#roleTriage", | ||
"tools.ozone.team.defs#roleAdmin" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["option"], | ||
"properties": { | ||
"option": { | ||
"type": "ref", | ||
"ref": "tools.ozone.setting.defs#option" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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.