* Upload static cohort using CSV, closes #2868
* fix tests
* Fix tests
* Fix e2e test
* Avoid double inserts
* Speed up query
* Move to params
* fix tests
* initial cleanup
* initial scaffold for cohort static logic
* intiial frontend changes
* initial working
* fix error on iterable
* stickiness people func refactor
* Use JSON instead of protobuf
* stickiness working
* clickhouse route
* unused import
* move button
* make interface easier to user
* clickhouse support
* restore cache decorator
* endpoint adjustment
* adjust how clickhouse handles inserting for static cohorts
* split out processing into pg
* use worker for clickhouse querying too
* add pg test
* ee test
* add input for cohort naming
* add stickiness test
* condition for when to show save cohort
* fix types
* minor fix
* remove repeats
* remove hardcoded id
* add date handling to trends cohort func
* remove print
* add link on success creation
* cohort working
* fix backend test
* fix cohort typescript
* remove unnecessary kafka topic
* remove brackets
* shift default
* raise exceptions when debug or test is true
* remove test flag
* move trends insight related components to different folder
* change get_earliest_timestamp
* remove extraneous condition
* fix test call
* put behind ff
* fix test x2
* fix tests
* restore exceptions hog
* fix tests
* restore exceptions hog
* fix test x20
Co-authored-by: Tim Glaser <tim@glsr.nl>
* Update plugin server to 0.9.24
* Add more hook metrics in Python
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
* Fix REST hooks being only fired if project has webhook
* Fix firing more
* Actually still filter but also for Zapier
* Don't .only() Team in EE process_event to optimize REST hook firing
* Fix REST hook duplication in EE
* Update test_process_event.py
* Debug
* Revert "Debug"
This reverts commit 6d4c9f754d.
* Fix organization-less teams partly
* Fix more organization-less teams
* Fix moar organization-less teams
* Explicitly bootstrap org without user in tests
* Fix org bootstrap
* Fix typing
* Fix bootstrap usage
* Update test_process_event.py
* Fix num queries
* Add test_action_on_perform_hook_fired_once
* Fix Action.objects.create call
* Don't test hook firing as it's offloaded to worker
* Nest endpoints under /project/ with StructuredViewSetMixin
* Rewrite URLs
* isort
* Update utils.py
* Fix errors
* Fix almoast all the errors
Last left to do: shared dashboards and permission classes.
* isort
* Adjust for master
* Add compatbility with shared dashboards
* Debug ClickHouse
* Remove some # type: ignores
* Simplify CursorPagination
* Move test base from posthog.api.test to posthog.test
* Improve API structure
* Bring back legacy endpoints
* Fix legacy compatibility
* Fix bugs and typing
* isort
* Fix hooks test
* Try fixing errors
* Fix oversight
* isort
* Fix problems
* isort
* Be more tolerant
* Fix naming and remove redundant code
* Fix imports
* Update deleteWithUndo
* Roll back
* Roll back more
* Update .gitignore
* Rollll back
* Rollllllll
* back
* Betterify
* Address feedback
* Add missing migration
* Add generate_random_token() model util
* Move PublicTokenAuthentication to utils
* Make use of generate_random_token
* Add User.personal_access_token field
* Add PersonalAccessTokenAuthentication
* Fix PublicTokenAuthentication
* Fix migration and auth import
* Add personal_access_token to user API
* Update Setup.js
* Support trailing slash in API
* Improve PAT auth quality
* Add django-rest-hooks requirement
* Update settings.py for rest_hooks
* Fix django-rest-hooks requirement
* Bring back API routes with no double trailing slash
* Rename posthog.api.team to team_user
* Add API TODO
* Ad PAT auth with X-PAT HTTP header
* Replace User.personal_access_token with PersonalAPIKey model
* Fix PersonalAPIKey max_lengths
* Describe posthog.models.utils.generate_random_token better
* Add personal_api_key to API
* Add authenticate_header to PersonalAPIKeyAuthentication
* Add hook API endpoint
* Use django.utils.timezone in place of datetime.datetime
* Add Personal API Keys to Setup
* Sort personal_api_keys in ORM
* Add Action.on_perform()
* Remove requirements.txt comment
* Add a
* Add REST hook tasks
* Optimize PersonalAPIKeyAuthentication query
* Add a trailing slash version of /e endpoint
* Add team field to PersonalAPIKey model
* Add personal API key support to capture endpoint, get_cached_from_token
* Reject personal API keys from inactive users
* Add extra_properties_json field to /capture
* Improve PAK auth header regex
* Use custom hook model
* Deliver hooks
* Handle action.on_perform
* Consolidate userLogic in userLogic.tsx
* Update PersonalAPIKeys.js
* Make PersonalAPIKey foreign keys read-only
* Update requirements/dev.txt
* Make PersonalAPIKeys TSX
* Fix conflict
* Fix migration
* Fix minor mishaps
* Update and fix tests
* Use CharField of random 32 bits as hook.id
* Fix conflicting migrations
* Fix ValidationError in HookSerializer.validate_event
* Use query param in /api/event/actions ID filtering
* Rename endpoint `hook` to `hooks`
* Satisfy mypy
* Add tests
* Use DRF serialization in action_defined and annotation_created triggers
* Update migration leafs
* Make mypy ignore rest_hooks
* Update Django signal receiver names
* Update TS dependencies
* Revert "Update TS dependencies"
This reverts commit 7fc26fefcd.
* Add field user to Hook model
* Update migration leafs
* Fix circular import
* Fix some code
* Install git before running pip install in Dockerfiles
* Improve personal API keys UI
* Satisfy mypy
* Reword key label placeholder
* Add personal API key support to /api/user/*
Unfortunately these endpoints are still limited by CSRF protections at the moment, so not accessible outside PostHog itself.
* Improve PersonalAPIKeyAuthentication and add CsrfOrKeyViewMiddleware
* Run collectstatic before test
* Don't install dev dependencies in CI
* Update dependency installation order in CI
* Fix bug and describe PersonalAPIKeyAuthentication
* Fix CI issues
* Fix typing issues
* Fix more typing issues
* Use /api/personal_api_keys to list keys
* Move REST hooks (and therefore Zapier) to ee/
* Refactor personal API logic with kea-loaders
* Add "More about API authentication in PostHog docs."
* Update PersonalAPIKeys.tsx
* Use TestMixin
* Fix "Authentication" that should've been "Authorization"
* Add option to skip self.client.force_login in API tests
* Include team_id and user_id in personal API key serialization
* Update test_hooks.py
* Add personal API key tests
* Remove leftover
* Make ee.settings override posthog.settings
* Don't directly import from models
* Remove unused imports
* Fix mypy issues
* Fix HOOK_DELIVERER
* Use decorator for /api/user PAK auth
* Don't fire REST hook if user doesn't have "zapier" feature
* Import Optional
* Reword to "premium Zapier"
* Make mypy happy
* Fix test_delete_personal_api_key
* Fix misclick
* Fix and test /capture with personal API key
* Make mypy happy
* Remove extra_properties_json
* Resolve migrations
* Remove apt-utils
* Optimize and test PAK user.is_active filtering
* Replace DEBUG true with 1
* Remove unused instance_id
* Improve typing
* Fix deletion toast
* Refactor CopyToClipboard and use it in PAKs
* Use toast.success
* Update migrations
* Fix migration
* Fix migrations
* Complete merge
Co-authored-by: Tim Glaser <tim@glsr.nl>