mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-02 09:24:48 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
69 lines
2.1 KiB
Python
69 lines
2.1 KiB
Python
from enum import Enum
|
|
from typing import Union
|
|
|
|
from insights.rbac.user_access_control import ACCESS_CONTROL_RESOURCES
|
|
from insights.scopes import APIScopeObject
|
|
|
|
|
|
class NotificationType(str, Enum):
|
|
COMMENT_MENTION = "comment_mention"
|
|
ALERT_FIRING = "alert_firing"
|
|
ISSUE_ASSIGNED = "issue_assigned"
|
|
APPROVAL_REQUESTED = "approval_requested"
|
|
APPROVAL_RESOLVED = "approval_resolved"
|
|
EXPERIMENT_CONCLUDED = "experiment_concluded"
|
|
PIPELINE_FAILURE = "pipeline_failure"
|
|
PROJECT_CREATED = "project_created"
|
|
USAGE_SPIKE = "usage_spike"
|
|
REMINDER = "reminder"
|
|
WEB_ANALYTICS_DIGEST = "web_analytics_digest"
|
|
ACHIEVEMENT_UNLOCKED = "achievement_unlocked"
|
|
SUBSCRIPTION_NUDGE = "subscription_nudge"
|
|
EMAIL_REPUTATION = "email_reputation"
|
|
|
|
|
|
class Priority(str, Enum):
|
|
NORMAL = "normal"
|
|
CRITICAL = "critical"
|
|
|
|
|
|
# Discriminator for transient "resource edited elsewhere" realtime events. These ride the
|
|
# notifications SSE transport but are NOT inbox notifications (no NotificationEvent row, no unread
|
|
# count) — see products.notifications.backend.logic.publish_resource_edited.
|
|
RESOURCE_EDITED_EVENT_TYPE = "resource_edited"
|
|
|
|
|
|
class TargetType(str, Enum):
|
|
USER = "user"
|
|
TEAM = "team"
|
|
ORGANIZATION = "organization"
|
|
ROLE = "role"
|
|
|
|
|
|
class SourceType(str, Enum):
|
|
REPLAY = "replay"
|
|
NOTEBOOK = "notebook"
|
|
INSIGHT = "insight"
|
|
FEATURE_FLAG = "feature_flag"
|
|
DASHBOARD = "dashboard"
|
|
SURVEY = "survey"
|
|
EXPERIMENT = "experiment"
|
|
ERROR_TRACKING = "error_tracking"
|
|
CUSTOMER_ANALYTICS = "customer_analytics"
|
|
TICKET = "ticket"
|
|
|
|
|
|
class NotificationOnlyResourceType(str, Enum):
|
|
"""Resource types that only exist in the notification system (no AC counterpart)."""
|
|
|
|
PIPELINE = "pipeline"
|
|
APPROVAL = "approval"
|
|
COMMENT = "comment"
|
|
|
|
|
|
# Derived from APIScopeObject (used by ACCESS_CONTROL_RESOURCES) — keep in sync
|
|
# if ACCESS_CONTROL_RESOURCES changes its element type
|
|
type NotificationResourceType = Union[APIScopeObject, NotificationOnlyResourceType]
|
|
|
|
AC_RESOURCE_TYPES: set[str] = set(ACCESS_CONTROL_RESOURCES)
|