Commit 2e42d65
Add new APIs to support new developer portal (#14)
This is the big appstore-api update to support the new developer portal -- it is the backend that matches the frontend @ https://github.com/pebble-dev/rebble-dev-portal/tree/devPortal2 . No changes to database schema or sqlalchemy models have been made -- just new web APIs.
* Inital push of devportal2 apis. Currently added one developer-centric 'about me' api
* Start work on new app API
* For now, add copy functions for in-memory uploading to s3 rather than from on-disk
* Add appstore submission validation function
* Add developer portal API under /api/v2. With working submit of new app
* For now, add copy file with in-memory pbw functions. This is temporary
* Add aws session token to .gitignore. Just in case
* Update app -> watchapp to match api
* Update new app submission validator to match new api field names
* Add update appstore listing fields api
* app.notfound now returns 400. Fix updating descriptions
* Handle dodgy appinfo.json. Need to add an appinfo.json validator
* If users performs GET on update app endpoint, redirect to existing getappdetails API
* Return developer name instead of user name on /me/developer. Add POST request option to /me/developer to update developer name
* Validate appinfo.json. Handle no appinfo in pbw
* Add appinfo.json validator
* Remove unnecessary import
* Add app visibility toggle to api. Todo: handle agolia
* Add onboarding API to create new developer accounts. Handle request developer info for Rebble accounts with no developer account
* Return the user's rebble auth name if they do not have a developer account yet
* Move platform validation into standalone util
* Add screenshot API (Get only atm)
* Always return authName. We use this for account recovery
* Add delete screenshot api
* Don't allow the last screenshot for any given platform to be deleted
* Check users owns app before deleting screenshots
* Add screenshot upload api
* Remove platform agnostic screenshots. We're no longer doing that
* Return is_wizard with /me/developer
* Add discord integration. Add new release API. Clean up some old code. Handle junk pbws on submit api
* Forgot to add new discord file!
* Clean up imports in discord.py
* Announce new apps on creation, not edit
* Add 2 wizard apis. Fix bug with announce to discord. Update agolia after app edit
* Update agolia code on delete. Currently guessing here
* Merge pbw and pbw_in_memory into one nice file. Let DB do deletion. Change wording of 1 corrupt pbw error message so we can tell which is which
* Update pbw.py to handle file paths or file objects in one function. pbw_in_memory now redundant and deleted
* Handle app submission with no developer account. Shouldn't ever be possible but still
* Clearup debug logging
* Clear up more testing stuff
* Minor consistency fixes
* Remove option for generic screenshots
* Validate submission type is watchface or watchapp
* Merge in_memory and from file functions in s3.py. Remove blanks and duplicates from wizard get s3 assets function
* Use image url generator instead of hardcoded asset url
* Add API for wizard app developer transfer
* Update appstore/developer_portal_api.py
Fix indentation
Co-authored-by: Katharine Berry <[email protected]>
* Inital post-code-review changes
* Apply suggestions from code review (Part 2)
All the small bits from KB's review.
Co-authored-by: Katharine Berry <[email protected]>
* Replace edit listing API's if statements with setattr()
* More review fixes. Remove redirect. If not X in Y -> If X not in Y. Remove some Except statements
* Correct cases in Discord function. Remove catch statement
* Fix if statement typo
* Change camelCase variables to snake_case
* Replace generic except with specific error
* Remove field whitelist from /submit. Remove blanking of optional parameters
* Replace generic excepts with specific errors
* Merge the two invalid pbw try statements
* Deconstruct is_appinfo_valid response
* Remove unnecessary try wrapper
* Move discord webhook error handling to calling function
* Ask for forgiveness with new screenshot error. Add discord log message
* Camels are now snakes
* EAFP & Remove 302 redirect to correct api for GETting screenshots
* Snakes
* EAFP
* Cleaner screenshot removal
* Be more specific about exception
* snek
* sssss
* Be more specific about exception
* Tidy up Discord integration
* Make auth check and is_wizard checks into util functions
* /api/v2 -> /api/dp
* Check new version is greater than old version, not equal to
* Break long return message into multiple lines
* Replace generic Exception handler with BadRequest handler
* Fail if we can't detect the mime type from the filename. No longer default to png
* Raise KeyError if algolia setup isn't present. Add optional override to this behaviour for dev. Currently doesn't kill flask
* Replace generic exception with FileNotFoundError
* Only look for 'screenshot' on single new image api instead of taking the file file we find
* Validate image dimensions. Do this on new submission api and new screenshot api
* Remove spaces surrounding equals sign when it's a named parameter
* Update comment on pbw function inputs
* Update new app validation function to throw exceptions instead of returning a tuple
* Add demand_authed_request
* Add missing import
* Add screenshot range start. Thereby ignoring screenshot-platform-0
* Add wizard discord audit log
* No longer throw typeerror on invalid field on app field edit api
Co-authored-by: Katharine Berry <[email protected]>1 parent 12055ad commit 2e42d65
File tree
9 files changed
+1070
-38
lines changed- appstore
9 files changed
+1070
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
45 | 117 | | |
46 | 118 | | |
47 | 119 | | |
| |||
0 commit comments