1378 Commits (8f5b5ef1b2cc6412dcfb0ffc77d2dea332d49a09)

Author SHA1 Message Date
psychobunny 9e1f72a435 feat: optional urlMethod param for loginStrategies 4 years ago
gasoved 077330b764
feat: scheduled topics (#9399)
* feat: scheduled topics

* refactor: linting fixes

* fix: tests

* fix(test): race condition

* fix: make a single request
4 years ago
Barış Soner Uşaklı d00268c9b8 refactor: style, no need to convert length to string 4 years ago
Julian Lam cc489708ee fix: #9378, crash on verifyToken if API Token settings not saved (null case error) 4 years ago
Julian Lam 4b5450853d feat: allow missing (or non-array) middlewares argument in route helper methods 4 years ago
Julian Lam e3b2c00db1 fix: request authentication called twice in account routes 4 years ago
Julian Lam 7da061f0d7
refactor: automatically authenticate all requests setup through route helpers (#9357)
* refactor: automatically authenticate all requests setup through route helpers

* fix: removed connect-ensure-login dependency

* fix: bug with some middlewares not defined outside route helper methods
4 years ago
Julian Lam c1b3079d93 feat: category privilege API routes
closes #9342
4 years ago
Julian Lam 984c9dd915 fix: in setupPageRoute helper, buildHeader after plugin hooks have fired
To allow for a plugin to call doLogin and have it properly reflect in the header
4 years ago
Julian Lam f561799f74 refactor: abstract out some client side dashboard code into modules, analytics subpages for users, topics, and logins 4 years ago
Julian Lam 7223074f1d feat: ability to re-order topic thumbnails 4 years ago
Julian Lam 9d17f397c0 fix(remountable-routes): more fixes to remountable routes
fix: ensure proper admin privilege checking on remounted `/admin` mount

fix: guard against plugins sending back missing mounts

fix: no need to make addRemountableRoutes awaitable
4 years ago
Julian Lam 16c1d6e937 style(remountable-routes): abstract removable routes code to a separate local fn 4 years ago
Julian Lam 1f28713f1a refactor(remountable-routes): rename `src/routes/accounts.js` to `src/routes/user.js` to better match the route prefix 4 years ago
Julian Lam bc68e990af fix(remountable-routes): bug with user routes remounting to itself 4 years ago
Julian Lam 9021f071d4 feat(remountable-routes): allow category and account routes to be remounted 4 years ago
Julian Lam f01af62b53 feat(remountable-routes): allow /admin and /post to be remountable 4 years ago
Julian Lam 92758ec50d refactor(remountable-routes): allow certain route prefixes to be mounted elsewhere 4 years ago
Peter Jaszkowiak cc9d6fd08b chore: eslint max-len 4 years ago
Peter Jaszkowiak 115d19e289 chore: eslint prefer-rest-params, prefer-spread 4 years ago
Peter Jaszkowiak 23f212a4c0 chore: eslint prefer-destructuring 4 years ago
Peter Jaszkowiak dab3b23575 chore: eslint no-var, vars-on-top 4 years ago
Peter Jaszkowiak b56d9e12b5 chore: eslint prefer-arrow-callback 4 years ago
Peter Jaszkowiak 707b55b6a5 chore: eslint prefer-template 4 years ago
Peter Jaszkowiak 4ee0f1459d chore: eslint import/newline-after-import 4 years ago
Barış Soner Uşaklı fca17cb713 fix: move service worker back to relative_path/service-worker.js 4 years ago
gasoved eb642f40b9 feat: #9109, ability to delete a post's diffs 4 years ago
Opliko 2bc74cffe6
fix: #9127, scope service worker to relative_path for the forum (#9239)
Adds a `Service-Worker-Allowed` header on `assets/src/service-worker.js` URL and uses `scope` option during registration to ensure the service worker is correctly scoped to the entire forum and only the forum.
4 years ago
Barış Soner Uşaklı 647d3ba810 fix: removed methods 4 years ago
Julian Lam 2ad0d0d0d8 chore: remove deprecated getObject routes [breaking]
`/api/post/pid/:pid`, `/api/topic/tid/:tid`, `/api/category/cid/:cid` have now been removed in favour of routes in the Write API (`/api/v3/(posts|topics|categories)/:id`)
4 years ago
Julian Lam dc84559d0b feat(topic-events): topic events GET route in write API 4 years ago
Julian Lam 966c4117ec refactor(api): post move to write API 4 years ago
Julian Lam e118e59ce0 refactor(api): post diffs to use write API 4 years ago
Julian Lam ab11435ed5 feat: grant plugins the ability to specify options to the SSO handler
... to be handled in the plugin itself (overriding the passport prototype's authorizationParams method)

+ new hook filter:auth.options
4 years ago
Julian Lam 9b289eca9d fix: ssoState passed to strategies even if not called for 4 years ago
Julian Lam 77ab46686d fix: access checks for tags and thumbs get route 4 years ago
Julian Lam 56f929ed4f feat: add write API route for checking login credentials 4 years ago
Julian Lam edb8da1ef9 feat(api): closes #9123 category and topic routes migrated to Write API 4 years ago
Julian Lam cdff8d286a chore(api): add deprecation notices re: #9123 4 years ago
Julian Lam e267f29584 feat(api): #9123, migrate /api/post/pid/:pid to Write API 4 years ago
Julian Lam 32e36f7b2e feat(api): group ownership API route, switch client-side to use API route 4 years ago
Julian Lam 1cd2689cf6 refactor(api): deprecated groups update socket in favour of API lib 4 years ago
Julian Lam 878ee06715 refactor: schema backreference test to use map instead of reduce, properly check write-api routes 4 years ago
Julian Lam 3e54b70c06 fix: #9092, Topic thumbnails do not work with third-party uploaders 4 years ago
Julian Lam 340387c18a fix: #9055, non-standard API response from addThumbs route
Also removed old thumb upload router handler, and updated uploadPost handling in composer to match new response schema
4 years ago
Julian Lam ef7d6db912 feat: server-side work for #9047
- rename Thumbs.commit to Thumbs.migrate
- new PUT method that calls Thumbs.migrate
- `checkThumbPrivileges` now takes a single object parameter (ins. of req/res)
4 years ago
Julian Lam b5d910f53b feat: core work for #9042, thumb deletion now accepts uuids
+ common data validation for thumb addition and deletion
4 years ago
Julian Lam 90497e3ef5 feat: more work on topic thumbs refactor
- addThumb and deleteThumb are now protected routes (duh)
- new getThumbs route GET /api/v3/topics/<tid>/thumbs
- Updated `assert.path` middleware to better handle if relative paths are received with upload_url
- Slight refactor of thumbs lib to use validator to differentiate between tid and UUID
4 years ago
Julian Lam 708b1c338f fix: #9040 4 years ago
Julian Lam 7e9e08f718 feat: server-side routes for handling multiple topic thumbnails
closes #8994, requires 'topic-thumb-refactor' branch of composer-default
4 years ago
Barış Soner Uşaklı 3cd0c9a476 fix: #8998, allow guests to use write api to post/reply 4 years ago
Julian Lam ac734b8335 fix: #8912 4 years ago
Julian Lam 6e2da9966e refactor: move plugin hook methods to plugin.hooks.* 4 years ago
Julian Lam 3b1c03ed50 feat: allow ACP API access to bearer tokens
closes nodebb/nodebb-plugin-write-api#132
4 years ago
Julian Lam 046d0b1637
feat: allow pins to expire (if set) (#8908)
* fix: add back topic assert middleware for pin route

* feat: server-side handling of pin expiries

* refactor: togglePin to not require uid parameter [breaking]

* feat: automatic unpinning if pin has expiration set

* feat: client-side modal for setting pin expiration

* refactor: categories.getPinnedTids to accept multiple cids

... in preparation for pin expiry logic, direct access to *:pinned zsets is discouraged

* fix: remove references to since-removed jobs file for topics

* feat: expire pins when getPinnedTids is called

* refactor: make the togglePin change non-breaking

The 'action:topic.pin' hook now sends uid again, as before. However, if it is a system action (that is, a pin that expired), 'system' will be sent in instead of a valid uid
4 years ago
Barış Soner Uşaklı fa4177c3bc fix: #6407, fix feeds
display latest posts instead of oldest in topic rss feed
fix missing await that was causing rss_tokens to not function
fix feed test
more tests for getTopicWithPosts
4 years ago
Julian Lam a0b7a82350
feat(api): account deletion routes for the Write API (#8881)
* feat(api): account deletion routes for the Write API

* refactor: rewrite client-side calls to account deletion to use api

* style: apply DRY
4 years ago
gasoved 3ccebf112e
feat: invites regardless of registration type, invite privilege, groups to join on acceptance (#8786)
* feat: allow invites in normal registration mode + invite privilege

* feat: select groups to join from an invite

* test: check if groups from invitations have been joined

* fix: remove unused variable

* feat: write API versions of socket calls

* docs: openapi specs for the new routes

* test: iron out mongo redis difference

* refactor: move inviteGroups endpoint into write API

* refactor: use GET /api/v3/users/:uid/invites/groups

Instead of GET /api/v3/users/:uid/inviteGroups

* fix: no need for /api/v3 prefix when using api module

* fix: tests

* refactor: change POST /api/v3/users/invite

To POST /api/v3/users/:uid/invites

* refactor: make helpers.invite awaitable

* fix: restrict invite API to self-use only

* fix: move invite groups controller to write api, +tests

* fix: tests

Co-authored-by: Julian Lam <julian@nodebb.org>
4 years ago
Julian Lam bcccb331db docs: openapi schema for user/group exist check, session deletion 4 years ago
Julian Lam f300c933a5 refactor: move session revocation route to write api 4 years ago
Barış Soner Uşaklı f1f9b225b0
feat: #8824, cache refactor (#8851)
* feat: #8824, cache refactor

ability to disable caches
ability to download contents of cache
refactor cache modules to remove duplicated code

* fix: remove duplicate hit/miss tracking

check cacheEnabled in getUncachedKeys
4 years ago
Julian Lam d263192271 feat: group exists API call in write api 4 years ago
Julian Lam f2bb42c076 fix: user exist route needs no authentication 4 years ago
Julian Lam 60e1e99b4f feat: new shorthand route /api/v3/users/bySlug/:userslug
closes #8844
4 years ago
Julian Lam 57ed6be78b fix: #8805 define our own name for write API v3 4 years ago
Julian Lam 266d7587b2 refactor: remove usage of middlewares
Specifically, middleware.isAdmin|exposePrivilegeSet|exposePrivileges
4 years ago
Julian Lam aa8faf58a0 refactor: remove /users/{uid}/settings/{setting} route
@baris Also, I am now allowing the following properties to be saved in User.saveSettings:
- categoryTopicSort
- topicPostSort
- setCategorySort
- setTopicSort
4 years ago
Julian Lam b156b8b573 feat: wip, write api tests framework
re-using read api tests if possible
4 years ago
Barış Soner Uşaklı a05905f196
performance improvements (#8795)
* perf: nconf/winston/render

cache nconf.get calls
modify middleware.pageView to call next earlier
don't call winston.verbose on every hook see https://github.com/winstonjs/winston/issues/1669
translate header/footer separately and cache results for guests

* fix: copy paste fail

* refactor: style and fire hook only log in dev mode

* fix: cache key, header changes based on template

* perf: change replace

* fix: add missing await

* perf: category

* perf: lodash clone

* perf: remove escapeRegexChars
4 years ago
Julian Lam c26f2b6599 feat(writeapi): user settings API 4 years ago
Barış Soner Uşaklı 9d81660e24 Revert "Revert "fix: appropriate 404 handling for write API calls""
This reverts commit 135c2d6c7d.
4 years ago
Barış Soner Uşaklı 135c2d6c7d Revert "fix: appropriate 404 handling for write API calls"
This reverts commit b6cce75d97.
4 years ago
Julian Lam 68d6818bca refactor: topic tools' actions to use api lib 4 years ago
Julian Lam b6cce75d97 fix: appropriate 404 handling for write API calls 4 years ago
Barış Soner Uşaklı bf480ee58b refactor: setupApiRoute signature 4 years ago
Barış Soner Uşaklı 688d7a2cc2 refactor: remove unused middleware 4 years ago
Barış Soner Uşaklı 5e2caf19f5 refactor: use single function for api code 4 years ago
Julian Lam 9dd3cc0483 feat: allow plugins to define api routes
via new plugin hook static:api.routes
4 years ago
Julian Lam a4ba23899e feat: require https if nodebb is configured with https url 4 years ago
Barış Soner Uşaklı 872bacf1c4
Admin/users (#8762)
* feat: wip admin/users

* feat: more work

* feat: more fixes

* feat: #8662, verified/unverified user groups

* feat: add filter

* feat: change user search to use filters array

* refactor: remove unused search call

* fix: tests

* fix: cant join system groups

* fix: upgrade script
4 years ago
psychobunny 9a5b8a798a fix: category RSS feed was displaying deleted topics 4 years ago
Julian Lam 8ecef7b891 refactor: middleware.assert.* 4 years ago
Julian Lam cfee431c53 feat(writeapi): commented-out stub code for file upload 4 years ago
Julian Lam f870721fca feat(writeapi): file deletion route 4 years ago
Julian Lam a55b381791 feat(writeapi): admin settings update route 4 years ago
Julian Lam 2ec838fc59 feat(writeapi): token generation/delete routes, ACP updates 4 years ago
Julian Lam 3ea1aa4780 refactor(writeapi): update route prefix to api/v3, default error option 4 years ago
Julian Lam f67824719c chore(writeapi): cleanup 4 years ago
Julian Lam 0973feea16 feat(writeapi): post bookmarking 4 years ago
Julian Lam 9942c248eb feat(writeapi): post voting 4 years ago
Julian Lam 414169fdfa feat(writeapi): post delete/restore/purge 4 years ago
Julian Lam f66c2fb60f feat(writeapi): post editing 4 years ago
Julian Lam 1605e5e443 feat(writeapi): topic tags 4 years ago
Julian Lam 9be5629458 feat(writeapi): topic follow/ignore 4 years ago
Julian Lam da25ce4d09 feat: topic delete/restore/purge/(un)pin/(un)lock 4 years ago
Julian Lam 675a62dadd fix: remove debug log 4 years ago
Julian Lam 49652e6f1b feat: management of API tokens via ACP 4 years ago
Julian Lam 8e7baac6ef fix(writeapi): calls to profile editing routes 200 even if user DNE 4 years ago
Julian Lam 6096f74ab2 feat(writeapi): adding missing files 4 years ago
Julian Lam 4c833d0bf0 feat(writeapi): topic posting and replying 4 years ago