@bubblelab/bubble-core 0.1.254 → 0.1.261
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/bubble-bundle.d.ts +148 -31
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +9 -0
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.js +9 -2
- package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
- package/dist/bubbles/service-bubble/asana/asana.d.ts +1232 -0
- package/dist/bubbles/service-bubble/asana/asana.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/asana/asana.js +809 -0
- package/dist/bubbles/service-bubble/asana/asana.js.map +1 -0
- package/dist/bubbles/service-bubble/asana/asana.schema.d.ts +1169 -0
- package/dist/bubbles/service-bubble/asana/asana.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/asana/asana.schema.js +740 -0
- package/dist/bubbles/service-bubble/asana/asana.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/asana/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/asana/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/asana/index.js +3 -0
- package/dist/bubbles/service-bubble/asana/index.js.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.d.ts +2 -2
- package/dist/bubbles/service-bubble/confluence/confluence.schema.d.ts +2 -2
- package/dist/bubbles/service-bubble/discord/discord.d.ts +778 -0
- package/dist/bubbles/service-bubble/discord/discord.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/discord/discord.js +370 -0
- package/dist/bubbles/service-bubble/discord/discord.js.map +1 -0
- package/dist/bubbles/service-bubble/discord/discord.schema.d.ts +739 -0
- package/dist/bubbles/service-bubble/discord/discord.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/discord/discord.schema.js +352 -0
- package/dist/bubbles/service-bubble/discord/discord.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/discord/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/discord/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/discord/index.js +3 -0
- package/dist/bubbles/service-bubble/discord/index.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/salesforce/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/index.js +3 -0
- package/dist/bubbles/service-bubble/salesforce/index.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.d.ts +209 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.js +221 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.d.ts +179 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.js +127 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/snowflake/snowflake.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/snowflake/snowflake.js +1 -1
- package/dist/bubbles/service-bubble/snowflake/snowflake.js.map +1 -1
- package/dist/bubbles.json +3945 -4
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
3
|
+
// ─── Shared Fields ────────────────────────────────────────────────────
|
|
4
|
+
const credentialsField = z
|
|
5
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
6
|
+
.optional()
|
|
7
|
+
.describe('Object mapping credential types to values (injected at runtime)');
|
|
8
|
+
const taskGidField = z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1, 'Task GID is required')
|
|
11
|
+
.describe('Asana task GID (globally unique identifier)');
|
|
12
|
+
const projectGidField = z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1, 'Project GID is required')
|
|
15
|
+
.describe('Asana project GID');
|
|
16
|
+
const optFieldsField = z
|
|
17
|
+
.array(z.string())
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Optional fields to include in the response (e.g. ["name","assignee","due_on","notes","completed","custom_fields","tags","memberships"])');
|
|
20
|
+
const limitField = z
|
|
21
|
+
.number()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(100)
|
|
24
|
+
.optional()
|
|
25
|
+
.default(50)
|
|
26
|
+
.describe('Maximum number of results to return (1-100, default 50)');
|
|
27
|
+
// ─── Parameter Schema ─────────────────────────────────────────────────
|
|
28
|
+
export const AsanaParamsSchema = z.discriminatedUnion('operation', [
|
|
29
|
+
// ── Tasks ───────────────────────────────────────────────────────────
|
|
30
|
+
z.object({
|
|
31
|
+
operation: z
|
|
32
|
+
.literal('list_tasks')
|
|
33
|
+
.describe('List tasks in a project, section, or assigned to a user. Provide at least one of project, section, or assignee.'),
|
|
34
|
+
project: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('[ONEOF:scope] Project GID to list tasks from'),
|
|
38
|
+
section: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('[ONEOF:scope] Section GID to list tasks from'),
|
|
42
|
+
assignee: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('[ONEOF:scope] User GID or "me" to list tasks assigned to this user (requires workspace)'),
|
|
46
|
+
workspace: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Workspace GID (required when filtering by assignee, auto-filled from credential if not provided)'),
|
|
50
|
+
completed_since: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Only return tasks completed since this date (ISO 8601 format, e.g. "2024-01-01T00:00:00Z"). Use "now" to only show incomplete tasks.'),
|
|
54
|
+
modified_since: z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Only return tasks modified since this date (ISO 8601 format)'),
|
|
58
|
+
opt_fields: optFieldsField,
|
|
59
|
+
limit: limitField,
|
|
60
|
+
credentials: credentialsField,
|
|
61
|
+
}),
|
|
62
|
+
z.object({
|
|
63
|
+
operation: z
|
|
64
|
+
.literal('get_task')
|
|
65
|
+
.describe('Get detailed information about a specific task'),
|
|
66
|
+
task_gid: taskGidField,
|
|
67
|
+
opt_fields: optFieldsField,
|
|
68
|
+
credentials: credentialsField,
|
|
69
|
+
}),
|
|
70
|
+
z.object({
|
|
71
|
+
operation: z
|
|
72
|
+
.literal('create_task')
|
|
73
|
+
.describe('Create a new task in a project or workspace'),
|
|
74
|
+
name: z.string().min(1).describe('Name/title of the task'),
|
|
75
|
+
notes: z.string().optional().describe('Description/notes for the task'),
|
|
76
|
+
html_notes: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('HTML-formatted description (overrides notes if provided)'),
|
|
80
|
+
assignee: z
|
|
81
|
+
.string()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('User GID to assign the task to, or "me"'),
|
|
84
|
+
due_on: z
|
|
85
|
+
.string()
|
|
86
|
+
.optional()
|
|
87
|
+
.describe('Due date in YYYY-MM-DD format (e.g. "2024-12-31")'),
|
|
88
|
+
due_at: z
|
|
89
|
+
.string()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe('Due date and time in ISO 8601 format (e.g. "2024-12-31T17:00:00Z")'),
|
|
92
|
+
start_on: z.string().optional().describe('Start date in YYYY-MM-DD format'),
|
|
93
|
+
projects: z
|
|
94
|
+
.array(z.string())
|
|
95
|
+
.optional()
|
|
96
|
+
.describe('Array of project GIDs to add this task to'),
|
|
97
|
+
memberships: z
|
|
98
|
+
.array(z.object({
|
|
99
|
+
project: z.string().describe('Project GID'),
|
|
100
|
+
section: z.string().describe('Section GID within the project'),
|
|
101
|
+
}))
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('Array of project/section memberships for the task'),
|
|
104
|
+
tags: z
|
|
105
|
+
.array(z.string())
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Array of tag GIDs to add to this task'),
|
|
108
|
+
parent: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('Parent task GID to create this as a subtask'),
|
|
112
|
+
workspace: z
|
|
113
|
+
.string()
|
|
114
|
+
.optional()
|
|
115
|
+
.describe('Workspace GID (required if no project specified, auto-filled from credential)'),
|
|
116
|
+
custom_fields: z
|
|
117
|
+
.record(z.string(), z.union([z.string(), z.number()]))
|
|
118
|
+
.optional()
|
|
119
|
+
.describe('Custom field values as { custom_field_gid: value }. For enum fields, use the enum option GID as the value.'),
|
|
120
|
+
credentials: credentialsField,
|
|
121
|
+
}),
|
|
122
|
+
z.object({
|
|
123
|
+
operation: z
|
|
124
|
+
.literal('update_task')
|
|
125
|
+
.describe('Update an existing task (name, assignee, due date, status, etc.)'),
|
|
126
|
+
task_gid: taskGidField,
|
|
127
|
+
name: z.string().optional().describe('New name/title for the task'),
|
|
128
|
+
notes: z.string().optional().describe('New description/notes for the task'),
|
|
129
|
+
html_notes: z
|
|
130
|
+
.string()
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('New HTML-formatted description'),
|
|
133
|
+
assignee: z
|
|
134
|
+
.string()
|
|
135
|
+
.nullable()
|
|
136
|
+
.optional()
|
|
137
|
+
.describe('User GID to assign the task to, "me", or null to unassign'),
|
|
138
|
+
due_on: z
|
|
139
|
+
.string()
|
|
140
|
+
.nullable()
|
|
141
|
+
.optional()
|
|
142
|
+
.describe('Due date in YYYY-MM-DD format, or null to clear'),
|
|
143
|
+
due_at: z
|
|
144
|
+
.string()
|
|
145
|
+
.nullable()
|
|
146
|
+
.optional()
|
|
147
|
+
.describe('Due date and time in ISO 8601 format, or null to clear'),
|
|
148
|
+
start_on: z
|
|
149
|
+
.string()
|
|
150
|
+
.nullable()
|
|
151
|
+
.optional()
|
|
152
|
+
.describe('Start date in YYYY-MM-DD format, or null to clear'),
|
|
153
|
+
completed: z
|
|
154
|
+
.boolean()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('Set to true to mark complete, false to mark incomplete'),
|
|
157
|
+
custom_fields: z
|
|
158
|
+
.record(z.string(), z.union([z.string(), z.number(), z.null()]))
|
|
159
|
+
.optional()
|
|
160
|
+
.describe('Custom field values to update as { custom_field_gid: value }'),
|
|
161
|
+
credentials: credentialsField,
|
|
162
|
+
}),
|
|
163
|
+
z.object({
|
|
164
|
+
operation: z.literal('delete_task').describe('Delete a task permanently'),
|
|
165
|
+
task_gid: taskGidField,
|
|
166
|
+
credentials: credentialsField,
|
|
167
|
+
}),
|
|
168
|
+
z.object({
|
|
169
|
+
operation: z
|
|
170
|
+
.literal('search_tasks')
|
|
171
|
+
.describe('Search for tasks in a workspace using text and/or filters'),
|
|
172
|
+
workspace: z
|
|
173
|
+
.string()
|
|
174
|
+
.optional()
|
|
175
|
+
.describe('Workspace GID to search in (auto-filled from credential)'),
|
|
176
|
+
text: z
|
|
177
|
+
.string()
|
|
178
|
+
.optional()
|
|
179
|
+
.describe('Text to search for in task names and descriptions'),
|
|
180
|
+
assignee: z
|
|
181
|
+
.string()
|
|
182
|
+
.optional()
|
|
183
|
+
.describe('Filter by assignee user GID or "me"'),
|
|
184
|
+
projects: z
|
|
185
|
+
.array(z.string())
|
|
186
|
+
.optional()
|
|
187
|
+
.describe('Filter by project GID(s)'),
|
|
188
|
+
completed: z
|
|
189
|
+
.boolean()
|
|
190
|
+
.optional()
|
|
191
|
+
.describe('Filter by completion status (true=completed, false=incomplete)'),
|
|
192
|
+
is_subtask: z.boolean().optional().describe('Filter by subtask status'),
|
|
193
|
+
sort_by: z
|
|
194
|
+
.enum(['due_date', 'created_at', 'completed_at', 'likes', 'modified_at'])
|
|
195
|
+
.optional()
|
|
196
|
+
.default('modified_at')
|
|
197
|
+
.describe('Sort results by this field'),
|
|
198
|
+
sort_ascending: z
|
|
199
|
+
.boolean()
|
|
200
|
+
.optional()
|
|
201
|
+
.default(false)
|
|
202
|
+
.describe('Sort in ascending order (default false = descending)'),
|
|
203
|
+
opt_fields: optFieldsField,
|
|
204
|
+
limit: limitField,
|
|
205
|
+
credentials: credentialsField,
|
|
206
|
+
}),
|
|
207
|
+
z.object({
|
|
208
|
+
operation: z
|
|
209
|
+
.literal('add_task_to_section')
|
|
210
|
+
.describe('Add a task to a specific section within a project'),
|
|
211
|
+
task_gid: taskGidField,
|
|
212
|
+
section_gid: z.string().min(1).describe('Section GID to add the task to'),
|
|
213
|
+
insert_before: z
|
|
214
|
+
.string()
|
|
215
|
+
.optional()
|
|
216
|
+
.describe('Task GID to insert before in the section'),
|
|
217
|
+
insert_after: z
|
|
218
|
+
.string()
|
|
219
|
+
.optional()
|
|
220
|
+
.describe('Task GID to insert after in the section'),
|
|
221
|
+
credentials: credentialsField,
|
|
222
|
+
}),
|
|
223
|
+
z.object({
|
|
224
|
+
operation: z
|
|
225
|
+
.literal('set_dependencies')
|
|
226
|
+
.describe('Set dependencies for a task (tasks that must be completed before this one)'),
|
|
227
|
+
task_gid: taskGidField,
|
|
228
|
+
dependencies: z
|
|
229
|
+
.array(z.string())
|
|
230
|
+
.describe('Array of task GIDs that this task depends on'),
|
|
231
|
+
credentials: credentialsField,
|
|
232
|
+
}),
|
|
233
|
+
// ── Projects ────────────────────────────────────────────────────────
|
|
234
|
+
z.object({
|
|
235
|
+
operation: z
|
|
236
|
+
.literal('list_projects')
|
|
237
|
+
.describe('List projects in a workspace or team'),
|
|
238
|
+
workspace: z
|
|
239
|
+
.string()
|
|
240
|
+
.optional()
|
|
241
|
+
.describe('[ONEOF:scope] Workspace GID (auto-filled from credential if not provided)'),
|
|
242
|
+
team: z
|
|
243
|
+
.string()
|
|
244
|
+
.optional()
|
|
245
|
+
.describe('[ONEOF:scope] Team GID to list projects for'),
|
|
246
|
+
archived: z
|
|
247
|
+
.boolean()
|
|
248
|
+
.optional()
|
|
249
|
+
.default(false)
|
|
250
|
+
.describe('Include archived projects (default false)'),
|
|
251
|
+
opt_fields: optFieldsField,
|
|
252
|
+
limit: limitField,
|
|
253
|
+
credentials: credentialsField,
|
|
254
|
+
}),
|
|
255
|
+
z.object({
|
|
256
|
+
operation: z
|
|
257
|
+
.literal('get_project')
|
|
258
|
+
.describe('Get detailed information about a specific project'),
|
|
259
|
+
project_gid: projectGidField,
|
|
260
|
+
opt_fields: optFieldsField,
|
|
261
|
+
credentials: credentialsField,
|
|
262
|
+
}),
|
|
263
|
+
z.object({
|
|
264
|
+
operation: z
|
|
265
|
+
.literal('create_project')
|
|
266
|
+
.describe('Create a new project in a workspace or team'),
|
|
267
|
+
name: z.string().min(1).describe('Name of the project'),
|
|
268
|
+
notes: z.string().optional().describe('Description/notes for the project'),
|
|
269
|
+
workspace: z
|
|
270
|
+
.string()
|
|
271
|
+
.optional()
|
|
272
|
+
.describe('Workspace GID (auto-filled from credential)'),
|
|
273
|
+
team: z
|
|
274
|
+
.string()
|
|
275
|
+
.optional()
|
|
276
|
+
.describe('Team GID (required for organization workspaces, optional for personal workspaces)'),
|
|
277
|
+
color: z
|
|
278
|
+
.string()
|
|
279
|
+
.optional()
|
|
280
|
+
.describe('Project color (e.g. "dark-pink", "dark-green", "dark-blue", "dark-red", "dark-orange", "dark-purple", "dark-warm-gray", "light-pink", "light-green", "light-blue", "light-red", "light-orange", "light-purple", "light-warm-gray")'),
|
|
281
|
+
layout: z
|
|
282
|
+
.enum(['board', 'list', 'timeline', 'calendar'])
|
|
283
|
+
.optional()
|
|
284
|
+
.default('list')
|
|
285
|
+
.describe('Project layout/view type (default "list")'),
|
|
286
|
+
is_template: z
|
|
287
|
+
.boolean()
|
|
288
|
+
.optional()
|
|
289
|
+
.describe('Whether to create as a project template'),
|
|
290
|
+
public: z
|
|
291
|
+
.boolean()
|
|
292
|
+
.optional()
|
|
293
|
+
.describe('Whether the project is public to the organization (default true)'),
|
|
294
|
+
credentials: credentialsField,
|
|
295
|
+
}),
|
|
296
|
+
z.object({
|
|
297
|
+
operation: z
|
|
298
|
+
.literal('update_project')
|
|
299
|
+
.describe('Update an existing project'),
|
|
300
|
+
project_gid: projectGidField,
|
|
301
|
+
name: z.string().optional().describe('New name for the project'),
|
|
302
|
+
notes: z.string().optional().describe('New description/notes'),
|
|
303
|
+
color: z.string().optional().describe('New project color'),
|
|
304
|
+
archived: z
|
|
305
|
+
.boolean()
|
|
306
|
+
.optional()
|
|
307
|
+
.describe('Set to true to archive, false to unarchive'),
|
|
308
|
+
public: z.boolean().optional().describe('Set project visibility'),
|
|
309
|
+
due_on: z
|
|
310
|
+
.string()
|
|
311
|
+
.nullable()
|
|
312
|
+
.optional()
|
|
313
|
+
.describe('Project due date in YYYY-MM-DD format, or null to clear'),
|
|
314
|
+
start_on: z
|
|
315
|
+
.string()
|
|
316
|
+
.nullable()
|
|
317
|
+
.optional()
|
|
318
|
+
.describe('Project start date in YYYY-MM-DD format, or null to clear'),
|
|
319
|
+
credentials: credentialsField,
|
|
320
|
+
}),
|
|
321
|
+
z.object({
|
|
322
|
+
operation: z
|
|
323
|
+
.literal('list_sections')
|
|
324
|
+
.describe('List sections in a project'),
|
|
325
|
+
project_gid: projectGidField,
|
|
326
|
+
opt_fields: optFieldsField,
|
|
327
|
+
limit: limitField,
|
|
328
|
+
credentials: credentialsField,
|
|
329
|
+
}),
|
|
330
|
+
z.object({
|
|
331
|
+
operation: z
|
|
332
|
+
.literal('create_section')
|
|
333
|
+
.describe('Create a new section in a project'),
|
|
334
|
+
project_gid: projectGidField,
|
|
335
|
+
name: z.string().min(1).describe('Name of the section'),
|
|
336
|
+
insert_before: z
|
|
337
|
+
.string()
|
|
338
|
+
.optional()
|
|
339
|
+
.describe('Section GID to insert before'),
|
|
340
|
+
insert_after: z.string().optional().describe('Section GID to insert after'),
|
|
341
|
+
credentials: credentialsField,
|
|
342
|
+
}),
|
|
343
|
+
// ── Comments / Stories ──────────────────────────────────────────────
|
|
344
|
+
z.object({
|
|
345
|
+
operation: z.literal('add_comment').describe('Add a comment to a task'),
|
|
346
|
+
task_gid: taskGidField,
|
|
347
|
+
text: z
|
|
348
|
+
.string()
|
|
349
|
+
.optional()
|
|
350
|
+
.describe('[ONEOF:body] Plain text comment body'),
|
|
351
|
+
html_text: z
|
|
352
|
+
.string()
|
|
353
|
+
.optional()
|
|
354
|
+
.describe('[ONEOF:body] HTML-formatted comment body (e.g. "<body>Great work!</body>")'),
|
|
355
|
+
credentials: credentialsField,
|
|
356
|
+
}),
|
|
357
|
+
z.object({
|
|
358
|
+
operation: z
|
|
359
|
+
.literal('get_task_stories')
|
|
360
|
+
.describe('Get comments and activity stories for a task'),
|
|
361
|
+
task_gid: taskGidField,
|
|
362
|
+
opt_fields: optFieldsField,
|
|
363
|
+
limit: limitField,
|
|
364
|
+
credentials: credentialsField,
|
|
365
|
+
}),
|
|
366
|
+
// ── Users & Teams ───────────────────────────────────────────────────
|
|
367
|
+
z.object({
|
|
368
|
+
operation: z.literal('list_users').describe('List users in a workspace'),
|
|
369
|
+
workspace: z
|
|
370
|
+
.string()
|
|
371
|
+
.optional()
|
|
372
|
+
.describe('Workspace GID (auto-filled from credential)'),
|
|
373
|
+
opt_fields: optFieldsField,
|
|
374
|
+
limit: limitField,
|
|
375
|
+
credentials: credentialsField,
|
|
376
|
+
}),
|
|
377
|
+
z.object({
|
|
378
|
+
operation: z
|
|
379
|
+
.literal('get_user')
|
|
380
|
+
.describe('Get details about a specific user'),
|
|
381
|
+
user_gid: z
|
|
382
|
+
.string()
|
|
383
|
+
.min(1)
|
|
384
|
+
.describe('User GID or "me" for the authenticated user'),
|
|
385
|
+
opt_fields: optFieldsField,
|
|
386
|
+
credentials: credentialsField,
|
|
387
|
+
}),
|
|
388
|
+
z.object({
|
|
389
|
+
operation: z
|
|
390
|
+
.literal('list_teams')
|
|
391
|
+
.describe('List teams in a workspace/organization'),
|
|
392
|
+
workspace: z
|
|
393
|
+
.string()
|
|
394
|
+
.optional()
|
|
395
|
+
.describe('Workspace GID (auto-filled from credential)'),
|
|
396
|
+
opt_fields: optFieldsField,
|
|
397
|
+
limit: limitField,
|
|
398
|
+
credentials: credentialsField,
|
|
399
|
+
}),
|
|
400
|
+
z.object({
|
|
401
|
+
operation: z
|
|
402
|
+
.literal('list_team_members')
|
|
403
|
+
.describe('List members of a team'),
|
|
404
|
+
team_gid: z.string().min(1).describe('Team GID'),
|
|
405
|
+
opt_fields: optFieldsField,
|
|
406
|
+
limit: limitField,
|
|
407
|
+
credentials: credentialsField,
|
|
408
|
+
}),
|
|
409
|
+
// ── Tags ────────────────────────────────────────────────────────────
|
|
410
|
+
z.object({
|
|
411
|
+
operation: z.literal('list_tags').describe('List tags in a workspace'),
|
|
412
|
+
workspace: z
|
|
413
|
+
.string()
|
|
414
|
+
.optional()
|
|
415
|
+
.describe('Workspace GID (auto-filled from credential)'),
|
|
416
|
+
opt_fields: optFieldsField,
|
|
417
|
+
limit: limitField,
|
|
418
|
+
credentials: credentialsField,
|
|
419
|
+
}),
|
|
420
|
+
z.object({
|
|
421
|
+
operation: z.literal('create_tag').describe('Create a new tag'),
|
|
422
|
+
name: z.string().min(1).describe('Name of the tag'),
|
|
423
|
+
workspace: z
|
|
424
|
+
.string()
|
|
425
|
+
.optional()
|
|
426
|
+
.describe('Workspace GID (auto-filled from credential)'),
|
|
427
|
+
color: z
|
|
428
|
+
.string()
|
|
429
|
+
.optional()
|
|
430
|
+
.describe('Tag color (e.g. "dark-pink", "dark-green", "light-blue")'),
|
|
431
|
+
credentials: credentialsField,
|
|
432
|
+
}),
|
|
433
|
+
z.object({
|
|
434
|
+
operation: z.literal('add_tag_to_task').describe('Add a tag to a task'),
|
|
435
|
+
task_gid: taskGidField,
|
|
436
|
+
tag_gid: z.string().min(1).describe('Tag GID to add'),
|
|
437
|
+
credentials: credentialsField,
|
|
438
|
+
}),
|
|
439
|
+
z.object({
|
|
440
|
+
operation: z
|
|
441
|
+
.literal('remove_tag_from_task')
|
|
442
|
+
.describe('Remove a tag from a task'),
|
|
443
|
+
task_gid: taskGidField,
|
|
444
|
+
tag_gid: z.string().min(1).describe('Tag GID to remove'),
|
|
445
|
+
credentials: credentialsField,
|
|
446
|
+
}),
|
|
447
|
+
// ── Workspaces ──────────────────────────────────────────────────────
|
|
448
|
+
z.object({
|
|
449
|
+
operation: z
|
|
450
|
+
.literal('list_workspaces')
|
|
451
|
+
.describe('List all workspaces the authenticated user has access to'),
|
|
452
|
+
opt_fields: optFieldsField,
|
|
453
|
+
limit: limitField,
|
|
454
|
+
credentials: credentialsField,
|
|
455
|
+
}),
|
|
456
|
+
// ── Custom Fields ───────────────────────────────────────────────────
|
|
457
|
+
z.object({
|
|
458
|
+
operation: z
|
|
459
|
+
.literal('list_custom_fields')
|
|
460
|
+
.describe('List custom field settings for a project'),
|
|
461
|
+
project_gid: projectGidField,
|
|
462
|
+
opt_fields: optFieldsField,
|
|
463
|
+
limit: limitField,
|
|
464
|
+
credentials: credentialsField,
|
|
465
|
+
}),
|
|
466
|
+
// ── Attachments ─────────────────────────────────────────────────────
|
|
467
|
+
z.object({
|
|
468
|
+
operation: z
|
|
469
|
+
.literal('list_attachments')
|
|
470
|
+
.describe('List attachments on a task'),
|
|
471
|
+
task_gid: taskGidField,
|
|
472
|
+
opt_fields: optFieldsField,
|
|
473
|
+
limit: limitField,
|
|
474
|
+
credentials: credentialsField,
|
|
475
|
+
}),
|
|
476
|
+
// ── Subtasks ────────────────────────────────────────────────────────
|
|
477
|
+
z.object({
|
|
478
|
+
operation: z
|
|
479
|
+
.literal('list_subtasks')
|
|
480
|
+
.describe('List subtasks (children) of a task'),
|
|
481
|
+
task_gid: taskGidField,
|
|
482
|
+
opt_fields: optFieldsField,
|
|
483
|
+
limit: limitField,
|
|
484
|
+
credentials: credentialsField,
|
|
485
|
+
}),
|
|
486
|
+
// ── Task-Project Membership ─────────────────────────────────────────
|
|
487
|
+
z.object({
|
|
488
|
+
operation: z
|
|
489
|
+
.literal('add_task_to_project')
|
|
490
|
+
.describe('Add a task to a project (task can belong to multiple projects)'),
|
|
491
|
+
task_gid: taskGidField,
|
|
492
|
+
project_gid: projectGidField,
|
|
493
|
+
section_gid: z
|
|
494
|
+
.string()
|
|
495
|
+
.optional()
|
|
496
|
+
.describe('Optional section GID to place the task in within the project'),
|
|
497
|
+
credentials: credentialsField,
|
|
498
|
+
}),
|
|
499
|
+
z.object({
|
|
500
|
+
operation: z
|
|
501
|
+
.literal('remove_task_from_project')
|
|
502
|
+
.describe('Remove a task from a project (task still exists, just no longer in this project)'),
|
|
503
|
+
task_gid: taskGidField,
|
|
504
|
+
project_gid: projectGidField,
|
|
505
|
+
credentials: credentialsField,
|
|
506
|
+
}),
|
|
507
|
+
// ── Section Management ──────────────────────────────────────────────
|
|
508
|
+
z.object({
|
|
509
|
+
operation: z
|
|
510
|
+
.literal('update_section')
|
|
511
|
+
.describe('Rename or reorder a section'),
|
|
512
|
+
section_gid: z.string().min(1).describe('Section GID to update'),
|
|
513
|
+
name: z.string().optional().describe('New name for the section'),
|
|
514
|
+
credentials: credentialsField,
|
|
515
|
+
}),
|
|
516
|
+
z.object({
|
|
517
|
+
operation: z
|
|
518
|
+
.literal('delete_section')
|
|
519
|
+
.describe('Delete a section from a project (tasks in it are NOT deleted, they become unsectioned)'),
|
|
520
|
+
section_gid: z.string().min(1).describe('Section GID to delete'),
|
|
521
|
+
credentials: credentialsField,
|
|
522
|
+
}),
|
|
523
|
+
// ── Project Deletion ────────────────────────────────────────────────
|
|
524
|
+
z.object({
|
|
525
|
+
operation: z
|
|
526
|
+
.literal('delete_project')
|
|
527
|
+
.describe('Permanently delete a project and all its tasks'),
|
|
528
|
+
project_gid: projectGidField,
|
|
529
|
+
credentials: credentialsField,
|
|
530
|
+
}),
|
|
531
|
+
]);
|
|
532
|
+
// ─── Asana Record Schema ──────────────────────────────────────────────
|
|
533
|
+
const AsanaResourceSchema = z
|
|
534
|
+
.record(z.string(), z.unknown())
|
|
535
|
+
.describe('An Asana resource object with its fields');
|
|
536
|
+
// ─── Result Schema ────────────────────────────────────────────────────
|
|
537
|
+
export const AsanaResultSchema = z.discriminatedUnion('operation', [
|
|
538
|
+
// Tasks
|
|
539
|
+
z.object({
|
|
540
|
+
operation: z.literal('list_tasks'),
|
|
541
|
+
success: z.boolean(),
|
|
542
|
+
tasks: z.array(AsanaResourceSchema).optional(),
|
|
543
|
+
error: z.string(),
|
|
544
|
+
}),
|
|
545
|
+
z.object({
|
|
546
|
+
operation: z.literal('get_task'),
|
|
547
|
+
success: z.boolean(),
|
|
548
|
+
task: AsanaResourceSchema.optional(),
|
|
549
|
+
error: z.string(),
|
|
550
|
+
}),
|
|
551
|
+
z.object({
|
|
552
|
+
operation: z.literal('create_task'),
|
|
553
|
+
success: z.boolean(),
|
|
554
|
+
task: AsanaResourceSchema.optional(),
|
|
555
|
+
error: z.string(),
|
|
556
|
+
}),
|
|
557
|
+
z.object({
|
|
558
|
+
operation: z.literal('update_task'),
|
|
559
|
+
success: z.boolean(),
|
|
560
|
+
task: AsanaResourceSchema.optional(),
|
|
561
|
+
error: z.string(),
|
|
562
|
+
}),
|
|
563
|
+
z.object({
|
|
564
|
+
operation: z.literal('delete_task'),
|
|
565
|
+
success: z.boolean(),
|
|
566
|
+
error: z.string(),
|
|
567
|
+
}),
|
|
568
|
+
z.object({
|
|
569
|
+
operation: z.literal('search_tasks'),
|
|
570
|
+
success: z.boolean(),
|
|
571
|
+
tasks: z.array(AsanaResourceSchema).optional(),
|
|
572
|
+
error: z.string(),
|
|
573
|
+
}),
|
|
574
|
+
z.object({
|
|
575
|
+
operation: z.literal('add_task_to_section'),
|
|
576
|
+
success: z.boolean(),
|
|
577
|
+
error: z.string(),
|
|
578
|
+
}),
|
|
579
|
+
z.object({
|
|
580
|
+
operation: z.literal('set_dependencies'),
|
|
581
|
+
success: z.boolean(),
|
|
582
|
+
error: z.string(),
|
|
583
|
+
}),
|
|
584
|
+
// Projects
|
|
585
|
+
z.object({
|
|
586
|
+
operation: z.literal('list_projects'),
|
|
587
|
+
success: z.boolean(),
|
|
588
|
+
projects: z.array(AsanaResourceSchema).optional(),
|
|
589
|
+
error: z.string(),
|
|
590
|
+
}),
|
|
591
|
+
z.object({
|
|
592
|
+
operation: z.literal('get_project'),
|
|
593
|
+
success: z.boolean(),
|
|
594
|
+
project: AsanaResourceSchema.optional(),
|
|
595
|
+
error: z.string(),
|
|
596
|
+
}),
|
|
597
|
+
z.object({
|
|
598
|
+
operation: z.literal('create_project'),
|
|
599
|
+
success: z.boolean(),
|
|
600
|
+
project: AsanaResourceSchema.optional(),
|
|
601
|
+
error: z.string(),
|
|
602
|
+
}),
|
|
603
|
+
z.object({
|
|
604
|
+
operation: z.literal('update_project'),
|
|
605
|
+
success: z.boolean(),
|
|
606
|
+
project: AsanaResourceSchema.optional(),
|
|
607
|
+
error: z.string(),
|
|
608
|
+
}),
|
|
609
|
+
z.object({
|
|
610
|
+
operation: z.literal('list_sections'),
|
|
611
|
+
success: z.boolean(),
|
|
612
|
+
sections: z.array(AsanaResourceSchema).optional(),
|
|
613
|
+
error: z.string(),
|
|
614
|
+
}),
|
|
615
|
+
z.object({
|
|
616
|
+
operation: z.literal('create_section'),
|
|
617
|
+
success: z.boolean(),
|
|
618
|
+
section: AsanaResourceSchema.optional(),
|
|
619
|
+
error: z.string(),
|
|
620
|
+
}),
|
|
621
|
+
// Comments / Stories
|
|
622
|
+
z.object({
|
|
623
|
+
operation: z.literal('add_comment'),
|
|
624
|
+
success: z.boolean(),
|
|
625
|
+
story: AsanaResourceSchema.optional(),
|
|
626
|
+
error: z.string(),
|
|
627
|
+
}),
|
|
628
|
+
z.object({
|
|
629
|
+
operation: z.literal('get_task_stories'),
|
|
630
|
+
success: z.boolean(),
|
|
631
|
+
stories: z.array(AsanaResourceSchema).optional(),
|
|
632
|
+
error: z.string(),
|
|
633
|
+
}),
|
|
634
|
+
// Users & Teams
|
|
635
|
+
z.object({
|
|
636
|
+
operation: z.literal('list_users'),
|
|
637
|
+
success: z.boolean(),
|
|
638
|
+
users: z.array(AsanaResourceSchema).optional(),
|
|
639
|
+
error: z.string(),
|
|
640
|
+
}),
|
|
641
|
+
z.object({
|
|
642
|
+
operation: z.literal('get_user'),
|
|
643
|
+
success: z.boolean(),
|
|
644
|
+
user: AsanaResourceSchema.optional(),
|
|
645
|
+
error: z.string(),
|
|
646
|
+
}),
|
|
647
|
+
z.object({
|
|
648
|
+
operation: z.literal('list_teams'),
|
|
649
|
+
success: z.boolean(),
|
|
650
|
+
teams: z.array(AsanaResourceSchema).optional(),
|
|
651
|
+
error: z.string(),
|
|
652
|
+
}),
|
|
653
|
+
z.object({
|
|
654
|
+
operation: z.literal('list_team_members'),
|
|
655
|
+
success: z.boolean(),
|
|
656
|
+
users: z.array(AsanaResourceSchema).optional(),
|
|
657
|
+
error: z.string(),
|
|
658
|
+
}),
|
|
659
|
+
// Tags
|
|
660
|
+
z.object({
|
|
661
|
+
operation: z.literal('list_tags'),
|
|
662
|
+
success: z.boolean(),
|
|
663
|
+
tags: z.array(AsanaResourceSchema).optional(),
|
|
664
|
+
error: z.string(),
|
|
665
|
+
}),
|
|
666
|
+
z.object({
|
|
667
|
+
operation: z.literal('create_tag'),
|
|
668
|
+
success: z.boolean(),
|
|
669
|
+
tag: AsanaResourceSchema.optional(),
|
|
670
|
+
error: z.string(),
|
|
671
|
+
}),
|
|
672
|
+
z.object({
|
|
673
|
+
operation: z.literal('add_tag_to_task'),
|
|
674
|
+
success: z.boolean(),
|
|
675
|
+
error: z.string(),
|
|
676
|
+
}),
|
|
677
|
+
z.object({
|
|
678
|
+
operation: z.literal('remove_tag_from_task'),
|
|
679
|
+
success: z.boolean(),
|
|
680
|
+
error: z.string(),
|
|
681
|
+
}),
|
|
682
|
+
// Workspaces
|
|
683
|
+
z.object({
|
|
684
|
+
operation: z.literal('list_workspaces'),
|
|
685
|
+
success: z.boolean(),
|
|
686
|
+
workspaces: z.array(AsanaResourceSchema).optional(),
|
|
687
|
+
error: z.string(),
|
|
688
|
+
}),
|
|
689
|
+
// Custom Fields
|
|
690
|
+
z.object({
|
|
691
|
+
operation: z.literal('list_custom_fields'),
|
|
692
|
+
success: z.boolean(),
|
|
693
|
+
custom_fields: z.array(AsanaResourceSchema).optional(),
|
|
694
|
+
error: z.string(),
|
|
695
|
+
}),
|
|
696
|
+
// Attachments
|
|
697
|
+
z.object({
|
|
698
|
+
operation: z.literal('list_attachments'),
|
|
699
|
+
success: z.boolean(),
|
|
700
|
+
attachments: z.array(AsanaResourceSchema).optional(),
|
|
701
|
+
error: z.string(),
|
|
702
|
+
}),
|
|
703
|
+
// Subtasks
|
|
704
|
+
z.object({
|
|
705
|
+
operation: z.literal('list_subtasks'),
|
|
706
|
+
success: z.boolean(),
|
|
707
|
+
tasks: z.array(AsanaResourceSchema).optional(),
|
|
708
|
+
error: z.string(),
|
|
709
|
+
}),
|
|
710
|
+
// Task-Project Membership
|
|
711
|
+
z.object({
|
|
712
|
+
operation: z.literal('add_task_to_project'),
|
|
713
|
+
success: z.boolean(),
|
|
714
|
+
error: z.string(),
|
|
715
|
+
}),
|
|
716
|
+
z.object({
|
|
717
|
+
operation: z.literal('remove_task_from_project'),
|
|
718
|
+
success: z.boolean(),
|
|
719
|
+
error: z.string(),
|
|
720
|
+
}),
|
|
721
|
+
// Section Management
|
|
722
|
+
z.object({
|
|
723
|
+
operation: z.literal('update_section'),
|
|
724
|
+
success: z.boolean(),
|
|
725
|
+
section: AsanaResourceSchema.optional(),
|
|
726
|
+
error: z.string(),
|
|
727
|
+
}),
|
|
728
|
+
z.object({
|
|
729
|
+
operation: z.literal('delete_section'),
|
|
730
|
+
success: z.boolean(),
|
|
731
|
+
error: z.string(),
|
|
732
|
+
}),
|
|
733
|
+
// Project Deletion
|
|
734
|
+
z.object({
|
|
735
|
+
operation: z.literal('delete_project'),
|
|
736
|
+
success: z.boolean(),
|
|
737
|
+
error: z.string(),
|
|
738
|
+
}),
|
|
739
|
+
]);
|
|
740
|
+
//# sourceMappingURL=asana.schema.js.map
|