-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypedefs.py
More file actions
37 lines (29 loc) · 1.06 KB
/
typedefs.py
File metadata and controls
37 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from typing import Any, List, Literal, Dict, TypedDict
from typing_extensions import NotRequired
class PropertySpecification(TypedDict):
name: str
description: str
required: bool
nullable: NotRequired[bool]
type: "PropertyType"
class PropertyType(TypedDict):
kind: Literal['void', 'primitive', 'array', 'object', 'function', 'plain']
name: NotRequired[str]
type: NotRequired[str]
items: NotRequired['PropertyType']
schema: NotRequired[Dict]
properties: NotRequired[List[PropertySpecification]]
typeName: NotRequired[str]
value: NotRequired[str]
class FunctionSpecification(TypedDict):
arguments: List[PropertySpecification]
returnType: Dict[str, Any]
synchronous: NotRequired[bool]
class SpecificationDto(TypedDict):
id: str
context: str
name: str
description: str
function: FunctionSpecification | None
# variables have variable: {"secret": boolean} and NO function
type: Literal['apiFunction', 'customFunction', 'serverFunction', 'authFunction', 'webhookHandle', 'serverVariable']