Commit Graph

62 Commits

Author SHA1 Message Date
spiral
92e45a07ff
refactor: add SqlKata for SQL generation, move connection handling into ModelRepository 2021-09-29 21:51:38 -04:00
spiral
ac2671452d
run dotnet format 2021-08-27 11:03:47 -04:00
spiral
4b944e2b20
feat: refactor external input handling code
- refactor import/export code
- make import/export use the same JSON parsing as API
- make Patch.AssertIsValid actually useful
2021-08-25 21:43:31 -04:00
spiral
11bd66e8d8
refactor: move JsonModelExt to PluralKit.Core (in individual model/patch files) 2021-08-08 16:10:53 -04:00
spiral
e144571904
Add banner (large) image 2021-08-02 13:46:12 -04:00
spiral
1cb4bc9287
Expose git version in 'pk;stats' and '/v1/meta' 2021-08-01 15:22:23 -04:00
spiral
dcc15dc847
Move mediaproxy URL rewriting to ProxyService
This shows full size avatars in API / cards.

Also, rewrite URLs currently stored with media.discordapp.net "back" to
cdn.discordapp.com before sending them to users.
2021-08-01 12:51:54 -04:00
spiral
b82dad2b9f
api: correctly parse 'null' privacy as public 2021-07-06 18:07:17 -04:00
spiral
deedb61d41
Add /v1/meta endpoint (shows shard state) 2021-06-21 09:19:47 -04:00
spiral
7f3f81a111
Update error string 2021-04-21 23:09:45 +01:00
spiral
b34ed5c4c0
API patch improvements
- add PatchObject.CheckIsValid
- use transaction when creating member, as to not create a member if the
patch is invalid
- return edited system in `PATCH /s` endpoint
2021-04-21 22:57:19 +01:00
Ske
1fda6ec919 Add per-system member/group limit override 2020-10-09 12:18:29 +02:00
Ske
c7612df37e Major database refactor (again) 2020-08-29 13:46:27 +02:00
Ske
45775f2e8e Remove unversioned API endpoints 2020-07-28 19:59:28 +02:00
Grey Himmel
0d2777c1d1
Return new member after member PATCH (#191) 2020-07-05 12:54:51 +02:00
Ske
467ce78522 Retire more IDataStore methods 2020-06-29 14:54:11 +02:00
Ske
9c1efc7886 Move system updates to the same patch system as members 2020-06-29 14:39:19 +02:00
Ske
c5697b33e2 Finally retire the PKMember setters! 2020-06-29 14:15:30 +02:00
Ske
281b669391 Refactor member updates to use a patch object 2020-06-29 13:57:48 +02:00
Ske
d3cf382e3b Migrate to date/time format extension methods 2020-06-21 16:05:04 +02:00
Ske
dcffbef805 Migrate to more privacy helper extensions 2020-06-21 15:51:08 +02:00
Ske
ae4e8f97d0 Add member avatar privacy 2020-06-20 16:00:50 +02:00
Ske
56eae82b0a Move most references to PKMember.Name to go through helper extepsions for privacy 2020-06-18 17:08:36 +02:00
Ske
e92700f339 Comment out color privacy stuff for now (revisit later?) 2020-06-17 21:51:40 +02:00
BeeFox-sys
721a4502bb
Feature/granular member privacy (#174)
* Some reasons this needs to exist for it to run on my machine? I don't think it would hurt to have it in other machines so

* Add options to member model

* Add Privacy to member embed

* Added member privacy display list

* Update database settings

* apparetnly this is nolonger needed?

* Fix sql call

* Fix more sql errors

* Added in settings control

* Add all subject to system privacy

* Basic API Privacy

* Name privacy in logs

* update todo

* remove CheckReadMemberPermission

* Added name privacy to log embed

* update todo

* Update todo

* Update api to handle privacy

* update todo

* Update systemlist full to respect privacy (as well as system list)

* include colour as option for member privacy subject

* move todo file (why was it there?)

* Update TODO.md

* Update TODO.md

* Update TODO.md

* Deleted to create pr

* Update command usage and add to the command tree

* Make api respect created privacy

* Add editing privacy through the api

* Fix pronoun privacy field in api

* Fix info leak of display name in api

* deprecate privacy field in api

* Deprecate privacy diffrently

* Update API

* Update documentation

* Update documentation

* Remove comment in yml

* Update userguide

* Update migration (fix typo in 5.sql too)

* Sanatize names

* some full stops

* Fix after merge

* update migration

* update schema version

* update edit command

* update privacy filter

* fix a dumb mistake

* clarify on what name privacy does

* make it easier on someone else

* Update docs

* Comment out unused code

* Add aliases for `member privacy all public` and `member privacy all private`
2020-06-17 21:31:39 +02:00
Ske
627f544ee8 Migrate API to ASP.NET Core Auth services + refactor 2020-06-16 01:15:59 +02:00
Ske
90ac186183 Extract Database to interface 2020-06-13 19:36:43 +02:00
Ske
e176ccbab5 Several more database-y refactors
- DbConnectionFactory renamed to "Database", will now be the primary entry point for DB stuff
- Created IPKConnection interface mostly containing async extensions to IDbConnection, use this going forward
- Reworked the Connection/Command wrappers (that have performance/logging extensions)
- Probably more stuff that I forgot???
2020-06-13 18:31:20 +02:00
Ske
c4c3eaf954 Integrate ApiVersioning library for ASP.NET 2020-05-07 04:40:08 +02:00
Ske
6d5004bf54 Large refactor and project restructuring 2020-02-12 15:16:19 +01:00
Ske
b347d2d557 Add front history pagination; upgrade more store methods 2020-01-18 00:58:35 +01:00
Ske
8a689ac0f2 Upgrade various store methods to IAsyncEnumerable 2020-01-18 00:02:17 +01:00
Ske
98613c4287 Add system and member privacy support 2020-01-11 16:51:13 +01:00
Ske
0f22285824 Upgrade API serialisation code to enable potential context-based serialisation 2019-12-28 15:52:59 +01:00
Ske
ebc688ae54 Add original message ID to API response 2019-12-22 12:54:37 +01:00
Ske
55f77df39e Fix bounds checks and normalise nulls in API 2019-12-02 16:49:39 +01:00
Ske
d6edbe8e8d Fix PATCHing members with one-sided proxy tags 2019-11-03 19:16:06 +01:00
Ske
49dc25ee02 Allow keeping proxy tags when proxying messages.
Required database migration:

Closes #75.
2019-10-30 09:26:50 +01:00
Ske
393ee16c1b Add support for multiple proxy tags
Tangentially closes #103.
2019-10-30 08:18:59 +01:00
Ske
6a73b3bdd6 Refactor data stores, merging the Store classes 2019-10-26 19:45:44 +02:00
Noko
397da2e1fa Added max member count to limits
A given system can now have up to 1000 members. Within 50 members of that limit, a warning will display whenever a new member is created via the bot. Once the limit is reached, a final warning will appear indicating that no additional members can be created unless members are first deleted. Attempting to create a new member at that point by any method will result in an error message indicating that the limit has been reached.

Respecting this in pk;import required some restructuring to tease apart which members already exist and which ones need to be created prior to creating any members as it seems preferable to fail early and give the user the ability to intervene rather than pushing the system to the member cap and requiring manual deletion of "lower priority" members before others can be created. One consequence of the restructure is that existing members are being read in bulk which is a performance improvement of 25-70% depending on how many switches need to be imported (the more members you have, the more noticeable this is).
2019-10-20 02:16:57 -05:00
Astrid
af4da8fd72
Merge branch 'master' into patch-2 2019-10-18 13:37:09 +02:00
Ske
49dede7ff8 Remove compiler warning from API 2019-10-18 13:19:17 +02:00
Grey Himmel
d38c38cb9e
Add display name editing
- Set display name during member POST
- Update display name during member PATCH
2019-08-09 11:37:52 -04:00
Grey Himmel
1cfeaf281b Await member delete 2019-08-09 12:55:40 +02:00
Grey Himmel
13fe0b7ef9 Add endpoint to delete members
- Add endpoint to delete members through a DELETE request
2019-08-09 12:55:40 +02:00
Grey Himmel
ef68a5250f Return member after create/edit
Changing the POST and PATCH routes to return the member that's been created/edited, similar to how it worked before. Makes it easier to compare changes and get a newly created member's ID
2019-07-28 23:23:48 +02:00
xBelladonna
924924b10e Add endpoint to create new member by POST request 2019-07-27 12:56:35 +02:00
Ske
d5c0856abf Fix bounds checking on member patch endpoint 2019-07-19 18:36:47 +02:00
Ske
483611702e Fix error when switching with no previous switches 2019-07-18 12:09:19 +02:00