generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
66 lines (65 loc) · 2.55 KB
/
test.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Define a runner
class MyRunner (JobRunner):
def __init__(self):
# Set the runner metadata, template and filter
super().__init__(\
RunnerConfig(
meta ={
"kind":5003,
"name":"My Action",
"description":"This is a new action",
"tos": "https://example.com/tos",
"privacy": "https://example.com/privacy",
"picture": "https://example.com/icon.png",
"tags": ["tag1","tag2"],
"website": "https://example.com",
"author": "John Doe",
},
filter={
"filterByKind":5003,
#AND
"filterByRunOn": "my-new-action",
},
template="""
{
"kind": {{meta.kind}},
"created_at": {{sys.timestamp_seconds}},
"tags": [
["param","run-on", "my-new-action" ],
["param", "k", "{{in.k}}"],
["output" , "{{out.content}}"],
{{#in.queries}},
["i", "{{value}}", "{{type}}", "", "query"],
{{/in.queries}},
["expiration", "{{sys.expiration_timestamp_seconds}}"],
],
"content":""
}""",
sockets={
"in": {
"k": {
"title": "K",
"description":"This is a number",
"type":"integer",
"default": 0,
},
"queries": {
"title": "Queries",
"type":"array",
"description":"This is an array of queries",
"items": {
"type":"string"
}
}
},
"out": {
"contentType": {
"title": "Content Type",
"type": "string",
"description": "The content of the event",
"default": "application/json"
}
}
}
)
)