konecty-sdk-python 2.3.0__tar.gz → 2.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/feature_types/__init__.py +5 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/feature_types/cross_module_query.py +5 -0
- konecty_sdk_python-2.3.1/KonectySdkPython/lib/feature_types/derived.py +39 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/filters.py +6 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/PKG-INFO +1 -1
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/pyproject.toml +1 -1
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/.gitignore +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/__init__.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/cli/__init__.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/cli/apply.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/cli/backup.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/cli/pull.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/__init__.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/client.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/exceptions.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/feature_types/kpi.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/feature_types/query_json.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/file_manager.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/http.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/model.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/serialization.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/__init__.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/admin.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/aggregation.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/auth.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/base.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/change_user.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/comments.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/export.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/files.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/notifications.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/pat.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/query.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/stream.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/subscriptions.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/settings.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/types.py +0 -0
- {konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/README.md +0 -0
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/feature_types/__init__.py
RENAMED
|
@@ -8,6 +8,7 @@ from .cross_module_query import (
|
|
|
8
8
|
CrossModuleQuery,
|
|
9
9
|
CrossModuleRelation,
|
|
10
10
|
)
|
|
11
|
+
from .derived import Computed, DerivedExpression, DerivedOp, DerivedOperand
|
|
11
12
|
from .kpi import KpiConfig, KpiOperation
|
|
12
13
|
from .query_json import (
|
|
13
14
|
AggregatorName,
|
|
@@ -27,10 +28,14 @@ __all__ = [
|
|
|
27
28
|
"Aggregator",
|
|
28
29
|
"AggregatorName",
|
|
29
30
|
"AggregatorSpec",
|
|
31
|
+
"Computed",
|
|
30
32
|
"ConditionValue",
|
|
31
33
|
"CrossModuleQuery",
|
|
32
34
|
"CrossModuleRelation",
|
|
33
35
|
"DEFAULT_PRIMARY_LIMIT",
|
|
36
|
+
"DerivedExpression",
|
|
37
|
+
"DerivedOp",
|
|
38
|
+
"DerivedOperand",
|
|
34
39
|
"ExplicitJoinCondition",
|
|
35
40
|
"FilterMatch",
|
|
36
41
|
"KpiConfig",
|
|
@@ -4,6 +4,8 @@ from typing import Any, Dict, List, Optional, Union
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
6
6
|
|
|
7
|
+
from .derived import DerivedExpression
|
|
8
|
+
|
|
7
9
|
MAX_RELATIONS = 10
|
|
8
10
|
MAX_NESTING_DEPTH = 2
|
|
9
11
|
MAX_RELATION_LIMIT = 100_000
|
|
@@ -72,6 +74,9 @@ class CrossModuleQuery(BaseModel):
|
|
|
72
74
|
)
|
|
73
75
|
groupBy: List[str] = Field(default_factory=list, alias="groupBy")
|
|
74
76
|
aggregators: Dict[str, Aggregator] = Field(default_factory=dict)
|
|
77
|
+
#: Campos derivados do documento primário (ADR-0025); o alias vale em filter, sort,
|
|
78
|
+
#: groupBy e aggregators[*].field.
|
|
79
|
+
computed: Optional[Dict[str, DerivedExpression]] = None
|
|
75
80
|
includeTotal: bool = Field(default=True, alias="includeTotal")
|
|
76
81
|
includeMeta: bool = Field(default=False, alias="includeMeta")
|
|
77
82
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Campo derivado (ADR-0025 no repo Konecty).
|
|
2
|
+
|
|
3
|
+
Campo numérico que o chamador declara numa consulta, calculado no servidor por uma
|
|
4
|
+
expressão sobre campos ``number``/``money`` do documento primário. Volta em todo
|
|
5
|
+
registro e vale em ``filter`` (operadores numéricos), ``sort`` e, na consulta
|
|
6
|
+
cross-module, em ``groupBy`` e ``aggregators[*].field``.
|
|
7
|
+
|
|
8
|
+
O SDK só modela e transporta: alias, aridade, limites (10 campos, profundidade 3,
|
|
9
|
+
10 operandos) e permissão são decididos pelo servidor, que recusa com
|
|
10
|
+
``DERIVED_FIELD_INVALID`` (forma) ou ``DERIVED_FIELD_UNAVAILABLE`` (permissão).
|
|
11
|
+
Mesma forma no SDK TypeScript: ``src/sdk/types/derived.ts``.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from typing import Dict, List, Literal, Union
|
|
15
|
+
|
|
16
|
+
from pydantic import BaseModel
|
|
17
|
+
|
|
18
|
+
DerivedOp = Literal["add", "subtract", "multiply", "coalesce"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DerivedExpression(BaseModel):
|
|
22
|
+
"""Nó da expressão: ``{"op", "args"}``.
|
|
23
|
+
|
|
24
|
+
``args``: ``str`` = campo do documento primário (``money`` sem sufixo lê
|
|
25
|
+
``.value``), ``int``/``float`` = literal, ``DerivedExpression`` = nó aninhado.
|
|
26
|
+
``add``/``subtract``/``multiply`` ≥ 2 args (``subtract`` da esquerda para a
|
|
27
|
+
direita); ``coalesce`` exatamente 2, o segundo literal.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
op: DerivedOp
|
|
31
|
+
args: List[Union[str, int, float, "DerivedExpression"]]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
DerivedExpression.model_rebuild()
|
|
35
|
+
|
|
36
|
+
DerivedOperand = Union[str, int, float, DerivedExpression]
|
|
37
|
+
|
|
38
|
+
#: ``computed`` de ``KonectyFindParams`` e de ``CrossModuleQuery``: alias → expressão.
|
|
39
|
+
Computed = Dict[str, DerivedExpression]
|
|
@@ -4,6 +4,8 @@ from typing import Any, Dict, List, Mapping, Optional, TypedDict, Union
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
6
6
|
|
|
7
|
+
from .feature_types.derived import DerivedExpression
|
|
8
|
+
|
|
7
9
|
|
|
8
10
|
class FilterMatch(str, Enum):
|
|
9
11
|
"""Tipo de correspondência do filtro."""
|
|
@@ -289,3 +291,7 @@ class KonectyFindParams(BaseModel):
|
|
|
289
291
|
limit: Optional[int] = None
|
|
290
292
|
sort: Optional[List[SortOrder]] = None
|
|
291
293
|
fields: Optional[List[Union[str, int]]] = None
|
|
294
|
+
#: Campos derivados (ADR-0025): ``{alias: DerivedExpression}``, calculados no servidor
|
|
295
|
+
#: e devolvidos em todo registro; o alias vale em ``filter`` e ``sort``. Vai na query
|
|
296
|
+
#: string como JSON, igual a ``filter``/``sort``. Ver ``feature_types/derived.py``.
|
|
297
|
+
computed: Optional[Dict[str, DerivedExpression]] = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/feature_types/kpi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/__init__.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/admin.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/aggregation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/change_user.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/comments.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/export.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/files.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/notifications.py
RENAMED
|
File without changes
|
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/query.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/stream.py
RENAMED
|
File without changes
|
{konecty_sdk_python-2.3.0 → konecty_sdk_python-2.3.1}/KonectySdkPython/lib/services/subscriptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|