terse-cli 0.1.46 → 0.1.47
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.
- package/dist/api.d.ts +0 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -2
- package/dist/api.js.map +1 -1
- package/dist/cliError.d.ts +2 -3
- package/dist/cliError.d.ts.map +1 -1
- package/dist/cliError.js +2 -2
- package/dist/cliError.js.map +1 -1
- package/dist/commands/auth.d.ts +0 -5
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +2 -2
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/deployTheme.d.ts +28 -0
- package/dist/commands/deployTheme.d.ts.map +1 -0
- package/dist/commands/deployTheme.js +68 -0
- package/dist/commands/deployTheme.js.map +1 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +47 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/serve.d.ts +1 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +2 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/terseCliTheme.d.ts +28 -0
- package/dist/commands/terseCliTheme.d.ts.map +1 -0
- package/dist/commands/terseCliTheme.js +68 -0
- package/dist/commands/terseCliTheme.js.map +1 -0
- package/dist/commands/test.d.ts +0 -35
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +1 -1
- package/dist/commands/test.js.map +1 -1
- package/dist/env.d.ts +0 -2
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/nonInteractive.d.ts +4 -2
- package/dist/nonInteractive.d.ts.map +1 -1
- package/dist/nonInteractive.js +5 -2
- package/dist/nonInteractive.js.map +1 -1
- package/dist/perf.d.ts +9 -0
- package/dist/perf.d.ts.map +1 -0
- package/dist/perf.js +59 -0
- package/dist/perf.js.map +1 -0
- package/dist/projectConfig.d.ts +0 -1
- package/dist/projectConfig.d.ts.map +1 -1
- package/dist/projectConfig.js +1 -1
- package/dist/projectConfig.js.map +1 -1
- package/dist/providers/LanguageProvider.d.ts +1 -1
- package/dist/providers/LanguageProvider.d.ts.map +1 -1
- package/dist/providers/codegen.test.d.ts +2 -0
- package/dist/providers/codegen.test.d.ts.map +1 -0
- package/dist/providers/codegen.test.js +45 -0
- package/dist/providers/codegen.test.js.map +1 -0
- package/dist/providers/codegenTypes.d.ts +10 -9
- package/dist/providers/codegenTypes.d.ts.map +1 -1
- package/dist/providers/fetchSdkVersion.d.ts +1 -3
- package/dist/providers/fetchSdkVersion.d.ts.map +1 -1
- package/dist/providers/fetchSdkVersion.js +2 -2
- package/dist/providers/fetchSdkVersion.js.map +1 -1
- package/dist/providers/python/PythonProvider.js +1 -0
- package/dist/providers/python/PythonProvider.js.map +1 -1
- package/dist/providers/python/PythonProvider.test.d.ts +2 -0
- package/dist/providers/python/PythonProvider.test.d.ts.map +1 -0
- package/dist/providers/python/PythonProvider.test.js +169 -0
- package/dist/providers/python/PythonProvider.test.js.map +1 -0
- package/dist/providers/resolveProvider.d.ts +0 -1
- package/dist/providers/resolveProvider.d.ts.map +1 -1
- package/dist/providers/resolveProvider.js +4 -20
- package/dist/providers/resolveProvider.js.map +1 -1
- package/dist/providers/shared/sessionStream.d.ts +0 -4
- package/dist/providers/shared/sessionStream.d.ts.map +1 -1
- package/dist/providers/shared/sessionStream.js +1 -1
- package/dist/providers/shared/sessionStream.js.map +1 -1
- package/dist/providers/shared/shellUtils.d.ts +0 -11
- package/dist/providers/shared/shellUtils.d.ts.map +1 -1
- package/dist/providers/shared/shellUtils.js +0 -44
- package/dist/providers/shared/shellUtils.js.map +1 -1
- package/dist/providers/templateUtils.d.ts +0 -2
- package/dist/providers/templateUtils.d.ts.map +1 -1
- package/dist/providers/templateUtils.js +2 -2
- package/dist/providers/templateUtils.js.map +1 -1
- package/dist/providers/typescript/TypeScriptProvider.d.ts +2 -1
- package/dist/providers/typescript/TypeScriptProvider.d.ts.map +1 -1
- package/dist/providers/typescript/TypeScriptProvider.js +1 -1
- package/dist/providers/typescript/TypeScriptProvider.js.map +1 -1
- package/dist/providers/typescript/prepareCodegenData.d.ts +20 -23
- package/dist/providers/typescript/prepareCodegenData.d.ts.map +1 -1
- package/dist/providers/typescript/prepareCodegenData.js +4 -4
- package/dist/providers/typescript/prepareCodegenData.js.map +1 -1
- package/dist/providers/typescript/prepareCodegenData.test.d.ts +2 -0
- package/dist/providers/typescript/prepareCodegenData.test.d.ts.map +1 -0
- package/dist/providers/typescript/prepareCodegenData.test.js +54 -0
- package/dist/providers/typescript/prepareCodegenData.test.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +36 -12
- package/dist/run.js.map +1 -1
- package/dist/sampleEventId.d.ts +0 -4
- package/dist/sampleEventId.d.ts.map +1 -1
- package/dist/sampleEventId.js +0 -4
- package/dist/sampleEventId.js.map +1 -1
- package/dist/shared/ToolDisplayUtils.js +1 -1
- package/dist/shared/ToolDisplayUtils.js.map +1 -1
- package/package.json +3 -3
- package/dist/jsonOutput.d.ts +0 -19
- package/dist/jsonOutput.d.ts.map +0 -1
- package/dist/jsonOutput.js +0 -25
- package/dist/jsonOutput.js.map +0 -1
- package/dist/replay.d.ts +0 -3
- package/dist/replay.d.ts.map +0 -1
- package/dist/replay.js +0 -20
- package/dist/replay.js.map +0 -1
- package/dist/urls.d.ts +0 -3
- package/dist/urls.d.ts.map +0 -1
- package/dist/urls.js +0 -27
- package/dist/urls.js.map +0 -1
- package/templates/python/codegen/generated.hbs +0 -12
- package/templates/python/codegen/partials/attio-list-objects-method.hbs +0 -8
- package/templates/python/codegen/partials/attio-object-types.hbs +0 -23
- package/templates/python/codegen/partials/attio-query-records-method.hbs +0 -45
- package/templates/python/codegen/partials/attio-section.hbs +0 -110
- package/templates/python/codegen/partials/attio-upsert-record-method.hbs +0 -51
- package/templates/python/codegen/partials/deterministic-tools-section.hbs +0 -308
- package/templates/python/codegen/partials/file-header.hbs +0 -32
- package/templates/python/codegen/partials/github-section.hbs +0 -149
- package/templates/python/codegen/partials/gmail-section.hbs +0 -30
- package/templates/python/codegen/partials/linear-section.hbs +0 -229
- package/templates/python/codegen/partials/schedule-section.hbs +0 -15
- package/templates/python/codegen/partials/slack-section.hbs +0 -266
- package/templates/python/codegen/partials/snowflake-section.hbs +0 -26
- package/templates/python/codegen/partials/tool-name-types.hbs +0 -18
- package/templates/python/codegen/partials/webhook-section.hbs +0 -15
- package/templates/python/codegen/partials/workos-section.hbs +0 -149
- package/templates/python/init/.python-version.hbs +0 -1
- package/templates/python/init/README.md.hbs +0 -68
- package/templates/python/init/env.example.hbs +0 -1
- package/templates/python/init/gitignore.hbs +0 -3
- package/templates/python/init/pyproject.toml.hbs +0 -16
- package/templates/python/init/src/main.py.hbs +0 -23
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
{{~#if linear}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# === Linear ===
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class LinearTeam(BaseModel):
|
|
8
|
-
model_config = ConfigDict(frozen=True)
|
|
9
|
-
team_id: str
|
|
10
|
-
name: str
|
|
11
|
-
key: str
|
|
12
|
-
{{#if linear.teams.length}}
|
|
13
|
-
{{#each linear.teams}}
|
|
14
|
-
{{staticName}}: ClassVar["LinearTeam"]
|
|
15
|
-
{{/each}}
|
|
16
|
-
{{#each linear.teams}}
|
|
17
|
-
|
|
18
|
-
LinearTeam.{{staticName}} = LinearTeam(team_id={{{teamIdRepr}}}, name={{{nameRepr}}}, key={{{keyRepr}}})
|
|
19
|
-
{{/each}}
|
|
20
|
-
{{/if}}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class LinearProject(BaseModel):
|
|
24
|
-
model_config = ConfigDict(frozen=True)
|
|
25
|
-
project_id: str
|
|
26
|
-
name: str
|
|
27
|
-
{{#if linear.projects.length}}
|
|
28
|
-
{{#each linear.projects}}
|
|
29
|
-
{{staticName}}: ClassVar["LinearProject"]
|
|
30
|
-
{{/each}}
|
|
31
|
-
{{#each linear.projects}}
|
|
32
|
-
|
|
33
|
-
LinearProject.{{staticName}} = LinearProject(project_id={{{projectIdRepr}}}, name={{{nameRepr}}})
|
|
34
|
-
{{/each}}
|
|
35
|
-
{{/if}}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class Linear:
|
|
39
|
-
@staticmethod
|
|
40
|
-
def on_issue_created(
|
|
41
|
-
*,
|
|
42
|
-
team: LinearTeam | None = None,
|
|
43
|
-
project: LinearProject | None = None,
|
|
44
|
-
) -> TriggerConfig[LinearIssueCreatedTrigger]:
|
|
45
|
-
return TriggerConfig(
|
|
46
|
-
integration_id={{{linear.instanceIdRepr}}},
|
|
47
|
-
integration_type='linear',
|
|
48
|
-
config_type='linear_input',
|
|
49
|
-
config=_compact_dict(
|
|
50
|
-
teamId=team.team_id if team is not None else None,
|
|
51
|
-
projectId=project.project_id if project is not None else None,
|
|
52
|
-
eventTypes=[LinearEventType.issue_created],
|
|
53
|
-
),
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
@staticmethod
|
|
57
|
-
def on_issue_updated(
|
|
58
|
-
*,
|
|
59
|
-
team: LinearTeam | None = None,
|
|
60
|
-
project: LinearProject | None = None,
|
|
61
|
-
) -> TriggerConfig[LinearIssueUpdatedTrigger]:
|
|
62
|
-
return TriggerConfig(
|
|
63
|
-
integration_id={{{linear.instanceIdRepr}}},
|
|
64
|
-
integration_type='linear',
|
|
65
|
-
config_type='linear_input',
|
|
66
|
-
config=_compact_dict(
|
|
67
|
-
teamId=team.team_id if team is not None else None,
|
|
68
|
-
projectId=project.project_id if project is not None else None,
|
|
69
|
-
eventTypes=[LinearEventType.issue_updated],
|
|
70
|
-
),
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
@staticmethod
|
|
74
|
-
def on_comment(
|
|
75
|
-
*,
|
|
76
|
-
team: LinearTeam | None = None,
|
|
77
|
-
project: LinearProject | None = None,
|
|
78
|
-
) -> TriggerConfig[LinearCommentCreatedTrigger]:
|
|
79
|
-
return TriggerConfig(
|
|
80
|
-
integration_id={{{linear.instanceIdRepr}}},
|
|
81
|
-
integration_type='linear',
|
|
82
|
-
config_type='linear_input',
|
|
83
|
-
config=_compact_dict(
|
|
84
|
-
teamId=team.team_id if team is not None else None,
|
|
85
|
-
projectId=project.project_id if project is not None else None,
|
|
86
|
-
eventTypes=[LinearEventType.comment_created],
|
|
87
|
-
),
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
@staticmethod
|
|
91
|
-
def trigger(
|
|
92
|
-
*,
|
|
93
|
-
team: LinearTeam | None = None,
|
|
94
|
-
project: LinearProject | None = None,
|
|
95
|
-
event_types: Sequence[LinearEventType] | None = None,
|
|
96
|
-
) -> TriggerConfig[LinearTrigger]:
|
|
97
|
-
return TriggerConfig(
|
|
98
|
-
integration_id={{{linear.instanceIdRepr}}},
|
|
99
|
-
integration_type='linear',
|
|
100
|
-
config_type='linear_input',
|
|
101
|
-
config=_compact_dict(
|
|
102
|
-
teamId=team.team_id if team is not None else None,
|
|
103
|
-
projectId=project.project_id if project is not None else None,
|
|
104
|
-
eventTypes=list(event_types) if event_types is not None else None,
|
|
105
|
-
),
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
@staticmethod
|
|
109
|
-
def skill(
|
|
110
|
-
*,
|
|
111
|
-
team: LinearTeam | None = None,
|
|
112
|
-
project: LinearProject | None = None,
|
|
113
|
-
) -> SkillConfig[str]:
|
|
114
|
-
return SkillConfig(
|
|
115
|
-
integration_id={{{linear.instanceIdRepr}}},
|
|
116
|
-
integration_type='linear',
|
|
117
|
-
config_type='linear_output',
|
|
118
|
-
config=_compact_dict(
|
|
119
|
-
teamId=team.team_id if team is not None else None,
|
|
120
|
-
teamName=team.name if team is not None else None,
|
|
121
|
-
projectId=project.project_id if project is not None else None,
|
|
122
|
-
),
|
|
123
|
-
)
|
|
124
|
-
{{~else}}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
# === Linear ===
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
class LinearTeam:
|
|
131
|
-
def __init__(self, team_id: str, name: str, key: str) -> None:
|
|
132
|
-
self.team_id = team_id
|
|
133
|
-
self.name = name
|
|
134
|
-
self.key = key
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
class LinearProject:
|
|
138
|
-
def __init__(self, project_id: str, name: str) -> None:
|
|
139
|
-
self.project_id = project_id
|
|
140
|
-
self.name = name
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
class Linear:
|
|
144
|
-
@staticmethod
|
|
145
|
-
def on_issue_created(
|
|
146
|
-
*,
|
|
147
|
-
team: LinearTeam | None = None,
|
|
148
|
-
project: LinearProject | None = None,
|
|
149
|
-
) -> TriggerConfig[LinearIssueCreatedTrigger]:
|
|
150
|
-
return TriggerConfig(
|
|
151
|
-
integration_id='linear_placeholder',
|
|
152
|
-
integration_type='linear',
|
|
153
|
-
config_type='linear_input',
|
|
154
|
-
config=_compact_dict(
|
|
155
|
-
teamId=team.team_id if team is not None else None,
|
|
156
|
-
projectId=project.project_id if project is not None else None,
|
|
157
|
-
eventTypes=[LinearEventType.issue_created],
|
|
158
|
-
),
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
@staticmethod
|
|
162
|
-
def on_issue_updated(
|
|
163
|
-
*,
|
|
164
|
-
team: LinearTeam | None = None,
|
|
165
|
-
project: LinearProject | None = None,
|
|
166
|
-
) -> TriggerConfig[LinearIssueUpdatedTrigger]:
|
|
167
|
-
return TriggerConfig(
|
|
168
|
-
integration_id='linear_placeholder',
|
|
169
|
-
integration_type='linear',
|
|
170
|
-
config_type='linear_input',
|
|
171
|
-
config=_compact_dict(
|
|
172
|
-
teamId=team.team_id if team is not None else None,
|
|
173
|
-
projectId=project.project_id if project is not None else None,
|
|
174
|
-
eventTypes=[LinearEventType.issue_updated],
|
|
175
|
-
),
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
@staticmethod
|
|
179
|
-
def on_comment(
|
|
180
|
-
*,
|
|
181
|
-
team: LinearTeam | None = None,
|
|
182
|
-
project: LinearProject | None = None,
|
|
183
|
-
) -> TriggerConfig[LinearCommentCreatedTrigger]:
|
|
184
|
-
return TriggerConfig(
|
|
185
|
-
integration_id='linear_placeholder',
|
|
186
|
-
integration_type='linear',
|
|
187
|
-
config_type='linear_input',
|
|
188
|
-
config=_compact_dict(
|
|
189
|
-
teamId=team.team_id if team is not None else None,
|
|
190
|
-
projectId=project.project_id if project is not None else None,
|
|
191
|
-
eventTypes=[LinearEventType.comment_created],
|
|
192
|
-
),
|
|
193
|
-
)
|
|
194
|
-
|
|
195
|
-
@staticmethod
|
|
196
|
-
def trigger(
|
|
197
|
-
*,
|
|
198
|
-
team: LinearTeam | None = None,
|
|
199
|
-
project: LinearProject | None = None,
|
|
200
|
-
event_types: list[LinearEventType] | None = None,
|
|
201
|
-
) -> TriggerConfig[LinearTrigger]:
|
|
202
|
-
return TriggerConfig(
|
|
203
|
-
integration_id='linear_placeholder',
|
|
204
|
-
integration_type='linear',
|
|
205
|
-
config_type='linear_input',
|
|
206
|
-
config=_compact_dict(
|
|
207
|
-
teamId=team.team_id if team is not None else None,
|
|
208
|
-
projectId=project.project_id if project is not None else None,
|
|
209
|
-
eventTypes=list(event_types) if event_types is not None else None,
|
|
210
|
-
),
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
@staticmethod
|
|
214
|
-
def skill(
|
|
215
|
-
*,
|
|
216
|
-
team: LinearTeam | None = None,
|
|
217
|
-
project: LinearProject | None = None,
|
|
218
|
-
) -> SkillConfig[str]:
|
|
219
|
-
return SkillConfig(
|
|
220
|
-
integration_id='linear_placeholder',
|
|
221
|
-
integration_type='linear',
|
|
222
|
-
config_type='linear_output',
|
|
223
|
-
config=_compact_dict(
|
|
224
|
-
teamId=team.team_id if team is not None else None,
|
|
225
|
-
teamName=team.name if team is not None else None,
|
|
226
|
-
projectId=project.project_id if project is not None else None,
|
|
227
|
-
),
|
|
228
|
-
)
|
|
229
|
-
{{~/if}}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# === Schedule ===
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Schedule:
|
|
8
|
-
@staticmethod
|
|
9
|
-
def cron(expression: str) -> TriggerConfig[CronTrigger]:
|
|
10
|
-
return TriggerConfig(
|
|
11
|
-
integration_id='system',
|
|
12
|
-
integration_type='cron_job',
|
|
13
|
-
config_type='time_trigger',
|
|
14
|
-
config=_compact_dict(cronExpression=expression),
|
|
15
|
-
)
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
{{~#if slack}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# === Slack ===
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class SlackChannel(BaseModel):
|
|
8
|
-
model_config = ConfigDict(frozen=True)
|
|
9
|
-
channel_id: str
|
|
10
|
-
name: str
|
|
11
|
-
{{#if slack.channels.length}}
|
|
12
|
-
{{#each slack.channels}}
|
|
13
|
-
{{staticName}}: ClassVar["SlackChannel"]
|
|
14
|
-
{{/each}}
|
|
15
|
-
{{#each slack.channels}}
|
|
16
|
-
|
|
17
|
-
SlackChannel.{{staticName}} = SlackChannel(channel_id={{{channelIdRepr}}}, name={{{nameRepr}}})
|
|
18
|
-
{{/each}}
|
|
19
|
-
{{/if}}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class Slack:
|
|
23
|
-
@staticmethod
|
|
24
|
-
def on_message(
|
|
25
|
-
channel: SlackChannel,
|
|
26
|
-
*,
|
|
27
|
-
user_ids: Sequence[str] | None = None,
|
|
28
|
-
) -> TriggerConfig[SlackMessageTrigger]:
|
|
29
|
-
return TriggerConfig(
|
|
30
|
-
integration_id={{{slack.instanceIdRepr}}},
|
|
31
|
-
integration_type='slack',
|
|
32
|
-
event_type='message',
|
|
33
|
-
config_type='slack',
|
|
34
|
-
config=_compact_dict(
|
|
35
|
-
channelId=channel.channel_id,
|
|
36
|
-
channelName=channel.name,
|
|
37
|
-
listenToUserDms=False,
|
|
38
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
39
|
-
eventTypes=['message'],
|
|
40
|
-
),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
@staticmethod
|
|
44
|
-
def on_dm(*, user_ids: Sequence[str] | None = None) -> TriggerConfig[SlackMessageTrigger]:
|
|
45
|
-
return TriggerConfig(
|
|
46
|
-
integration_id={{{slack.instanceIdRepr}}},
|
|
47
|
-
integration_type='slack',
|
|
48
|
-
event_type='message',
|
|
49
|
-
config_type='slack',
|
|
50
|
-
config=_compact_dict(
|
|
51
|
-
listenToUserDms=True,
|
|
52
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
53
|
-
eventTypes=['message'],
|
|
54
|
-
),
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
@staticmethod
|
|
58
|
-
def on_app_mention(
|
|
59
|
-
channel: SlackChannel,
|
|
60
|
-
*,
|
|
61
|
-
user_ids: Sequence[str] | None = None,
|
|
62
|
-
) -> TriggerConfig[SlackAppMentionTrigger]:
|
|
63
|
-
return TriggerConfig(
|
|
64
|
-
integration_id={{{slack.instanceIdRepr}}},
|
|
65
|
-
integration_type='slack',
|
|
66
|
-
event_type='app_mention',
|
|
67
|
-
config_type='slack',
|
|
68
|
-
config=_compact_dict(
|
|
69
|
-
channelId=channel.channel_id,
|
|
70
|
-
channelName=channel.name,
|
|
71
|
-
listenToUserDms=False,
|
|
72
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
73
|
-
eventTypes=[SlackEventType.app_mention],
|
|
74
|
-
),
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
@staticmethod
|
|
78
|
-
def on_reaction_added(
|
|
79
|
-
channel: SlackChannel,
|
|
80
|
-
*,
|
|
81
|
-
user_ids: Sequence[str] | None = None,
|
|
82
|
-
) -> TriggerConfig[SlackReactionAddedTrigger]:
|
|
83
|
-
return TriggerConfig(
|
|
84
|
-
integration_id={{{slack.instanceIdRepr}}},
|
|
85
|
-
integration_type='slack',
|
|
86
|
-
event_type='reaction_added',
|
|
87
|
-
config_type='slack',
|
|
88
|
-
config=_compact_dict(
|
|
89
|
-
channelId=channel.channel_id,
|
|
90
|
-
channelName=channel.name,
|
|
91
|
-
listenToUserDms=False,
|
|
92
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
93
|
-
eventTypes=[SlackEventType.reaction_added],
|
|
94
|
-
),
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
@staticmethod
|
|
98
|
-
def trigger(
|
|
99
|
-
*,
|
|
100
|
-
channel: SlackChannel | None = None,
|
|
101
|
-
listen_to_user_dms: bool | None = None,
|
|
102
|
-
user_ids: Sequence[str] | None = None,
|
|
103
|
-
event_types: Sequence[SlackEventType] | None = None,
|
|
104
|
-
) -> TriggerConfig[SlackTrigger]:
|
|
105
|
-
return TriggerConfig(
|
|
106
|
-
integration_id={{{slack.instanceIdRepr}}},
|
|
107
|
-
integration_type='slack',
|
|
108
|
-
config_type='slack',
|
|
109
|
-
config=_compact_dict(
|
|
110
|
-
channelId=channel.channel_id if channel is not None else None,
|
|
111
|
-
channelName=channel.name if channel is not None else None,
|
|
112
|
-
listenToUserDms=listen_to_user_dms,
|
|
113
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
114
|
-
eventTypes=list(event_types) if event_types is not None else None,
|
|
115
|
-
),
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
@staticmethod
|
|
119
|
-
def skill(
|
|
120
|
-
*,
|
|
121
|
-
channel: SlackChannel | None = None,
|
|
122
|
-
user_ids: Sequence[str] | None = [],
|
|
123
|
-
user_names: Sequence[str] | None = [],
|
|
124
|
-
listen_to_user_dms: bool | None = False,
|
|
125
|
-
) -> SkillConfig[{{slack.skillToolType}}]:
|
|
126
|
-
return SkillConfig(
|
|
127
|
-
integration_id={{{slack.instanceIdRepr}}},
|
|
128
|
-
integration_type='slack',
|
|
129
|
-
config_type='slack_output',
|
|
130
|
-
config=_compact_dict(
|
|
131
|
-
channelId=channel.channel_id if channel is not None else None,
|
|
132
|
-
channelName=channel.name if channel is not None else None,
|
|
133
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
134
|
-
userNames=list(user_names) if user_names is not None else None,
|
|
135
|
-
listenToUserDms=listen_to_user_dms,
|
|
136
|
-
),
|
|
137
|
-
)
|
|
138
|
-
{{~else}}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
# === Slack ===
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
class SlackChannel:
|
|
145
|
-
def __init__(self, channel_id: str, name: str) -> None:
|
|
146
|
-
self.channel_id = channel_id
|
|
147
|
-
self.name = name
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
class Slack:
|
|
151
|
-
@staticmethod
|
|
152
|
-
def on_message(
|
|
153
|
-
channel: SlackChannel,
|
|
154
|
-
*,
|
|
155
|
-
user_ids: list[str] | None = None,
|
|
156
|
-
) -> TriggerConfig[SlackMessageTrigger]:
|
|
157
|
-
return TriggerConfig(
|
|
158
|
-
integration_id='slack_placeholder',
|
|
159
|
-
integration_type='slack',
|
|
160
|
-
event_type='message',
|
|
161
|
-
config_type='slack',
|
|
162
|
-
config=_compact_dict(
|
|
163
|
-
channelId=channel.channel_id,
|
|
164
|
-
channelName=channel.name,
|
|
165
|
-
listenToUserDms=False,
|
|
166
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
167
|
-
eventTypes=['message'],
|
|
168
|
-
),
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
@staticmethod
|
|
172
|
-
def on_dm(*, user_ids: list[str] | None = None) -> TriggerConfig[SlackMessageTrigger]:
|
|
173
|
-
return TriggerConfig(
|
|
174
|
-
integration_id='slack_placeholder',
|
|
175
|
-
integration_type='slack',
|
|
176
|
-
event_type='message',
|
|
177
|
-
config_type='slack',
|
|
178
|
-
config=_compact_dict(
|
|
179
|
-
listenToUserDms=True,
|
|
180
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
181
|
-
eventTypes=['message'],
|
|
182
|
-
),
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
@staticmethod
|
|
186
|
-
def on_app_mention(
|
|
187
|
-
channel: SlackChannel,
|
|
188
|
-
*,
|
|
189
|
-
user_ids: list[str] | None = None,
|
|
190
|
-
) -> TriggerConfig[SlackAppMentionTrigger]:
|
|
191
|
-
return TriggerConfig(
|
|
192
|
-
integration_id='slack_placeholder',
|
|
193
|
-
integration_type='slack',
|
|
194
|
-
event_type='app_mention',
|
|
195
|
-
config_type='slack',
|
|
196
|
-
config=_compact_dict(
|
|
197
|
-
channelId=channel.channel_id,
|
|
198
|
-
channelName=channel.name,
|
|
199
|
-
listenToUserDms=False,
|
|
200
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
201
|
-
eventTypes=[SlackEventType.app_mention],
|
|
202
|
-
),
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
@staticmethod
|
|
206
|
-
def on_reaction_added(
|
|
207
|
-
channel: SlackChannel,
|
|
208
|
-
*,
|
|
209
|
-
user_ids: list[str] | None = None,
|
|
210
|
-
) -> TriggerConfig[SlackReactionAddedTrigger]:
|
|
211
|
-
return TriggerConfig(
|
|
212
|
-
integration_id='slack_placeholder',
|
|
213
|
-
integration_type='slack',
|
|
214
|
-
event_type='reaction_added',
|
|
215
|
-
config_type='slack',
|
|
216
|
-
config=_compact_dict(
|
|
217
|
-
channelId=channel.channel_id,
|
|
218
|
-
channelName=channel.name,
|
|
219
|
-
listenToUserDms=False,
|
|
220
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
221
|
-
eventTypes=[SlackEventType.reaction_added],
|
|
222
|
-
),
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
@staticmethod
|
|
226
|
-
def trigger(
|
|
227
|
-
*,
|
|
228
|
-
channel: SlackChannel | None = None,
|
|
229
|
-
listen_to_user_dms: bool | None = None,
|
|
230
|
-
user_ids: list[str] | None = None,
|
|
231
|
-
event_types: list[str] | None = None,
|
|
232
|
-
) -> TriggerConfig[SlackTrigger]:
|
|
233
|
-
return TriggerConfig(
|
|
234
|
-
integration_id='slack_placeholder',
|
|
235
|
-
integration_type='slack',
|
|
236
|
-
config_type='slack',
|
|
237
|
-
config=_compact_dict(
|
|
238
|
-
channelId=channel.channel_id if channel is not None else None,
|
|
239
|
-
channelName=channel.name if channel is not None else None,
|
|
240
|
-
listenToUserDms=listen_to_user_dms,
|
|
241
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
242
|
-
eventTypes=list(event_types) if event_types is not None else None,
|
|
243
|
-
),
|
|
244
|
-
)
|
|
245
|
-
|
|
246
|
-
@staticmethod
|
|
247
|
-
def skill(
|
|
248
|
-
*,
|
|
249
|
-
channel: SlackChannel | None = None,
|
|
250
|
-
user_ids: list[str] | None = None,
|
|
251
|
-
user_names: list[str] | None = None,
|
|
252
|
-
listen_to_user_dms: bool | None = None,
|
|
253
|
-
) -> SkillConfig[str]:
|
|
254
|
-
return SkillConfig(
|
|
255
|
-
integration_id='slack_placeholder',
|
|
256
|
-
integration_type='slack',
|
|
257
|
-
config_type='slack_output',
|
|
258
|
-
config=_compact_dict(
|
|
259
|
-
channelId=channel.channel_id if channel is not None else None,
|
|
260
|
-
channelName=channel.name if channel is not None else None,
|
|
261
|
-
userIds=list(user_ids) if user_ids is not None else [],
|
|
262
|
-
userNames=list(user_names) if user_names is not None else [],
|
|
263
|
-
listenToUserDms=listen_to_user_dms,
|
|
264
|
-
),
|
|
265
|
-
)
|
|
266
|
-
{{~/if}}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{{#if snowflake}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# === Snowflake ===
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Snowflake:
|
|
8
|
-
@staticmethod
|
|
9
|
-
def skill() -> SkillConfig[{{snowflake.skillToolType}}]:
|
|
10
|
-
return SkillConfig(integration_id={{{snowflake.instanceIdRepr}}}, integration_type='snowflake', config_type='snowflake_output', config=_compact_dict())
|
|
11
|
-
{{else}}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# === Snowflake ===
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class Snowflake:
|
|
18
|
-
@staticmethod
|
|
19
|
-
def skill() -> SkillConfig[str]:
|
|
20
|
-
return SkillConfig(
|
|
21
|
-
integration_id='snowflake_placeholder',
|
|
22
|
-
integration_type='snowflake',
|
|
23
|
-
config_type='snowflake_output',
|
|
24
|
-
config=_compact_dict(),
|
|
25
|
-
)
|
|
26
|
-
{{/if}}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{{#if hasAnyToolNameTypes}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# === Tool name types ===
|
|
5
|
-
|
|
6
|
-
{{#if attioToolNamesLiteral}}
|
|
7
|
-
AttioToolNames = Literal[{{{attioToolNamesLiteral}}}]
|
|
8
|
-
{{/if}}
|
|
9
|
-
{{#if slackToolNamesLiteral}}
|
|
10
|
-
SlackToolNames = Literal[{{{slackToolNamesLiteral}}}]
|
|
11
|
-
{{/if}}
|
|
12
|
-
{{#if snowflakeToolNamesLiteral}}
|
|
13
|
-
SnowflakeToolNames = Literal[{{{snowflakeToolNamesLiteral}}}]
|
|
14
|
-
{{/if}}
|
|
15
|
-
{{#if allToolNamesLiteral}}
|
|
16
|
-
AllToolNames = Literal[{{{allToolNamesLiteral}}}]
|
|
17
|
-
{{/if}}
|
|
18
|
-
{{/if}}
|