* feat(chalice): upgraded dependencies * feat(chalice): changed path analysis schema * feat(DB): click coordinate support * feat(chalice): changed path analysis issues schema feat(chalice): upgraded dependencies * fix(chalice): fixed pydantic issue * refactor(chalice): refresh token validator * feat(chalice): role restrictions * feat(chalice): EE path analysis changes * refactor(DB): changed creation queries refactor(DB): changed delte queries feat(DB): support new path analysis payload * feat(chalice): save path analysis card * feat(chalice): restrict access * feat(chalice): restrict access * feat(chalice): EE save new path analysis card * refactor(chalice): path analysis * feat(chalice): path analysis new query * fix(chalice): configurable CH config * fix(chalice): assist autocomplete * refactor(chalice): refactored permissions * refactor(chalice): changed log level * refactor(chalice): upgraded dependencies * refactor(chalice): changed path analysis query * refactor(chalice): changed path analysis query * refactor(chalice): upgraded dependencies refactor(alerts): upgraded dependencies refactor(crons): upgraded dependencies * feat(chalice): path analysis ignore start point * feat(chalice): path analysis in progress * refactor(chalice): path analysis changed link sort * refactor(chalice): path analysis changed link sort * refactor(chalice): path analysis changed link sort * refactor(chalice): path analysis new query refactor(chalice): authorizers * refactor(chalice): refactored authorizer * fix(chalice): fixed create card of PathAnalysis * refactor(chalice): compute link-percentage for Path Analysis * refactor(chalice): remove null starting point from Path Analysis * feat(chalice): path analysis CH query * refactor(chalice): changed Path Analysis links-value fix(chalice): fixed search notes for EE * feat(chalice): path analysis enhanced query results * feat(chalice): include timezone in search sessions response * refactor(chalice): refactored logs * refactor(chalice): refactored logs feat(chalice): get path analysis issues * fix(chalice): fixed path analysis issues pagination * fix(chalice): sessions-search handle null values * feat(chalice): PathAnalysis start event support middle-event matching * feat(chalice): PathAnalysis start event support middle-event matching * feat(chalice): PathAnalysis support mixed events with start-point * fix(chalice): PathAnalysis fixed eventType value when metricValue is missing * fix(chalice): PathAnalysis fixed wrong super-class model for update card * fix(chalice): PathAnalysis fixed search issues refactor(chalice): upgraded dependencies * fix(chalice): enforce isEvent if missing * fix(chalice): enforce isEvent if missing * refactor(chalice): refactored custom-metrics * refactor(chalice): small changes * feat(chalice): path analysis EE new query * fix(chalice): fixed hide-excess state for Path Analysis * fix(chalice): fixed update start point and excludes for Path Analysis * fix(chalice): fix payload validation fix(chalice): fix update widget endpoint * fix(chalice): fix payload validation fix(chalice): fix update widget endpoint * fix(chalice): fix add member * refactor(chalice): upgraded dependencies refactor!(chalice): upgraded SAML dependencies * feat(chalice): ios-project support 1/5 * refactor(chalice): changed logs handling * fix(chalice): fix path analysis issues list * Api v1.15.0 (#1542) * refactor(chalice): changed default dev env vars * refactor(chalice): changes * refactor(chalice): changed payload fixer * refactor(chalice): changed payload fixer refactor(chalice): support duplicate filters * Api v1.15.0 no merge (#1546) * refactor(chalice): changed default dev env vars * refactor(chalice): changes * refactor(chalice): changed payload fixer * refactor(chalice): changed payload fixer refactor(chalice): support duplicate filters * refactor(chalice): changes * feature(chalice): mobile sessions search
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from typing import TypeVar, Annotated, Union
|
|
from enum import Enum as _Enum
|
|
from pydantic import BaseModel as _BaseModel
|
|
from pydantic import ConfigDict, TypeAdapter, Field
|
|
from pydantic.types import AnyType
|
|
|
|
|
|
def attribute_to_camel_case(snake_str: str) -> str:
|
|
components = snake_str.split("_")
|
|
return components[0] + ''.join(x.title() for x in components[1:])
|
|
|
|
|
|
def schema_extra(schema: dict, _):
|
|
props = {}
|
|
for k, v in schema.get('properties', {}).items():
|
|
if not v.get("doc_hidden", False):
|
|
props[k] = v
|
|
schema["properties"] = props
|
|
|
|
|
|
class BaseModel(_BaseModel):
|
|
model_config = ConfigDict(alias_generator=attribute_to_camel_case,
|
|
use_enum_values=True,
|
|
json_schema_extra=schema_extra)
|
|
|
|
|
|
class Enum(_Enum):
|
|
@classmethod
|
|
def has_value(cls, value) -> bool:
|
|
return value in cls._value2member_map_
|
|
|
|
|
|
T = TypeVar('T')
|
|
|
|
|
|
class ORUnion:
|
|
def __new__(self, union_types: Union[AnyType], discriminator: str) -> T:
|
|
return lambda **args: TypeAdapter(Annotated[union_types, Field(discriminator=discriminator)]) \
|
|
.validate_python(args)
|