@superdurable/connector-clickup 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,426 @@
1
+ // src/generated/models.ts
2
+ import { z } from "zod";
3
+ var ConfigSchema = z.object({
4
+ "maxResponseBytes": z.number().int().optional(),
5
+ "webhookMaxBodyBytes": z.number().int().optional()
6
+ });
7
+ var SearchTasksInputSchema = z.strictObject({
8
+ "workspaceId": z.string(),
9
+ "listIds": z.array(z.string()).optional(),
10
+ "folderIds": z.array(z.string()).optional(),
11
+ "spaceIds": z.array(z.string()).optional(),
12
+ "statuses": z.array(z.string()).optional(),
13
+ "assigneeIds": z.array(z.number().int()).optional(),
14
+ "tags": z.array(z.string()).optional(),
15
+ "updatedAfter": z.iso.datetime({ offset: true }).nullable().optional(),
16
+ "isClosedIncluded": z.boolean().optional(),
17
+ "areSubtasksIncluded": z.boolean().optional(),
18
+ "orderBy": z.string().optional(),
19
+ "isReverse": z.boolean().optional(),
20
+ "page": z.number().int().optional()
21
+ });
22
+ var TaskStatusSchema = z.strictObject({
23
+ "name": z.string(),
24
+ "type": z.string().optional()
25
+ });
26
+ var UserSchema = z.strictObject({
27
+ "id": z.number().int(),
28
+ "username": z.string().optional()
29
+ });
30
+ var CustomFieldValueSchema = z.strictObject({
31
+ "id": z.string(),
32
+ "name": z.string(),
33
+ "type": z.string(),
34
+ "value": z.unknown().optional()
35
+ });
36
+ var TaskSchema = z.strictObject({
37
+ "id": z.string(),
38
+ "customId": z.string().optional(),
39
+ "name": z.string(),
40
+ "url": z.string().optional(),
41
+ "status": TaskStatusSchema,
42
+ "priority": z.number().int().optional(),
43
+ "priorityName": z.string().optional(),
44
+ "dueAt": z.iso.datetime({ offset: true }).nullable().optional(),
45
+ "startAt": z.iso.datetime({ offset: true }).nullable().optional(),
46
+ "createdAt": z.iso.datetime({ offset: true }).optional(),
47
+ "updatedAt": z.iso.datetime({ offset: true }).optional(),
48
+ "closedAt": z.iso.datetime({ offset: true }).nullable().optional(),
49
+ "isArchived": z.boolean().optional(),
50
+ "creator": UserSchema.optional(),
51
+ "assignees": z.array(UserSchema).nullable(),
52
+ "tags": z.array(z.string()).nullable(),
53
+ "parentTaskId": z.string().optional(),
54
+ "workspaceId": z.string().optional(),
55
+ "listId": z.string().optional(),
56
+ "listName": z.string().optional(),
57
+ "folderId": z.string().optional(),
58
+ "spaceId": z.string().optional(),
59
+ "markdownDescription": z.string().optional(),
60
+ "isDescriptionTruncated": z.boolean().optional(),
61
+ "customFields": z.array(CustomFieldValueSchema).optional()
62
+ });
63
+ var SearchTasksOutputSchema = z.strictObject({
64
+ "tasks": z.array(TaskSchema).nullable(),
65
+ "page": z.number().int(),
66
+ "nextPage": z.number().int().optional()
67
+ });
68
+ var GetTaskInputSchema = z.strictObject({
69
+ "taskId": z.string(),
70
+ "isCustomTaskId": z.boolean().optional(),
71
+ "workspaceId": z.string().optional()
72
+ });
73
+ var CustomFieldInputSchema = z.strictObject({
74
+ "id": z.string(),
75
+ "value": z.unknown().nullable()
76
+ });
77
+ var CreateTaskInputSchema = z.strictObject({
78
+ "listId": z.string(),
79
+ "name": z.string(),
80
+ "markdownDescription": z.string().optional(),
81
+ "status": z.string().optional(),
82
+ "priority": z.number().int().optional(),
83
+ "dueAt": z.iso.datetime({ offset: true }).nullable().optional(),
84
+ "assigneeIds": z.array(z.number().int()).optional(),
85
+ "tags": z.array(z.string()).optional(),
86
+ "parentTaskId": z.string().optional(),
87
+ "customFields": z.array(CustomFieldInputSchema).optional(),
88
+ "isCreatorNotified": z.boolean().optional()
89
+ });
90
+ var CreateTaskOutputSchema = z.strictObject({
91
+ "listId": z.string(),
92
+ "name": z.string(),
93
+ "task": TaskSchema,
94
+ "wasAlreadyApplied": z.boolean().optional()
95
+ });
96
+ var UpdateTaskInputSchema = z.strictObject({
97
+ "taskId": z.string(),
98
+ "name": z.string().optional(),
99
+ "markdownDescription": z.string().optional(),
100
+ "status": z.string().optional(),
101
+ "priority": z.number().int().optional(),
102
+ "dueAt": z.iso.datetime({ offset: true }).nullable().optional(),
103
+ "addAssigneeIds": z.array(z.number().int()).optional(),
104
+ "removeAssigneeIds": z.array(z.number().int()).optional()
105
+ });
106
+ var UpdateTaskOutputSchema = z.strictObject({
107
+ "task": TaskSchema
108
+ });
109
+ var UpdateTaskTagsInputSchema = z.strictObject({
110
+ "taskId": z.string(),
111
+ "addTags": z.array(z.string()).optional(),
112
+ "removeTags": z.array(z.string()).optional()
113
+ });
114
+ var UpdateTaskTagsOutputSchema = z.strictObject({
115
+ "taskId": z.string(),
116
+ "tags": z.array(z.string()).nullable(),
117
+ "appliedChanges": z.number().int()
118
+ });
119
+ var AddCommentInputSchema = z.strictObject({
120
+ "taskId": z.string(),
121
+ "text": z.string(),
122
+ "isCreatorNotified": z.boolean().optional()
123
+ });
124
+ var AddCommentOutputSchema = z.strictObject({
125
+ "taskId": z.string(),
126
+ "commentId": z.string().optional(),
127
+ "createdAt": z.iso.datetime({ offset: true }).nullable().optional(),
128
+ "wasAlreadyApplied": z.boolean().optional()
129
+ });
130
+ var FindMemberByEmailInputSchema = z.strictObject({
131
+ "workspaceId": z.string(),
132
+ "email": z.string()
133
+ });
134
+ var MemberSchema = z.strictObject({
135
+ "id": z.number().int(),
136
+ "username": z.string().optional(),
137
+ "email": z.string(),
138
+ "role": z.number().int().optional(),
139
+ "workspaceId": z.string()
140
+ });
141
+
142
+ // src/generated/definitions.ts
143
+ var ConnectorID = "clickup";
144
+ var ProviderID = "clickup";
145
+ var SearchTasksBranch = {
146
+ Searched: "searched",
147
+ NotFound: "notFound",
148
+ ProviderRejected: "providerRejected",
149
+ InvalidResponse: "invalidResponse",
150
+ Defect: "defect"
151
+ };
152
+ var SearchTasksBranchSearched = SearchTasksBranch.Searched;
153
+ var SearchTasksBranchNotFound = SearchTasksBranch.NotFound;
154
+ var SearchTasksBranchProviderRejected = SearchTasksBranch.ProviderRejected;
155
+ var SearchTasksBranchInvalidResponse = SearchTasksBranch.InvalidResponse;
156
+ var SearchTasksBranchDefect = SearchTasksBranch.Defect;
157
+ var SearchTasksDefinition = {
158
+ operation: { connectorId: ConnectorID, operationId: "searchTasks" },
159
+ branches: [
160
+ { id: "searched", description: "One page of matching tasks was read; it can be empty." },
161
+ { id: "notFound", description: "The Workspace does not exist or the token's user is not a member of it.", optional: true },
162
+ { id: "providerRejected", description: "ClickUp conclusively rejected the search, such as an invalid filter or an invalid token.", optional: true },
163
+ { id: "invalidResponse", description: "ClickUp returned an invalid or oversized page of tasks.", optional: true },
164
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
165
+ ],
166
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
167
+ };
168
+ var SearchTasksMetadata = { kind: "query", idempotency: "none", authorization: "required" };
169
+ var GetTaskBranch = {
170
+ Found: "found",
171
+ NotFound: "notFound",
172
+ ProviderRejected: "providerRejected",
173
+ InvalidResponse: "invalidResponse",
174
+ Defect: "defect"
175
+ };
176
+ var GetTaskBranchFound = GetTaskBranch.Found;
177
+ var GetTaskBranchNotFound = GetTaskBranch.NotFound;
178
+ var GetTaskBranchProviderRejected = GetTaskBranch.ProviderRejected;
179
+ var GetTaskBranchInvalidResponse = GetTaskBranch.InvalidResponse;
180
+ var GetTaskBranchDefect = GetTaskBranch.Defect;
181
+ var GetTaskDefinition = {
182
+ operation: { connectorId: ConnectorID, operationId: "getTask" },
183
+ branches: [
184
+ { id: "found", description: "The task was read." },
185
+ { id: "notFound", description: "The task does not exist or the connection cannot see it.", optional: true },
186
+ { id: "providerRejected", description: "ClickUp conclusively rejected the task read.", optional: true },
187
+ { id: "invalidResponse", description: "ClickUp returned an invalid or oversized task.", optional: true },
188
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
189
+ ],
190
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
191
+ };
192
+ var GetTaskMetadata = { kind: "query", idempotency: "none", authorization: "required" };
193
+ var CreateTaskBranch = {
194
+ Created: "created",
195
+ NotFound: "notFound",
196
+ ProviderRejected: "providerRejected",
197
+ Uncertain: "uncertain",
198
+ Defect: "defect"
199
+ };
200
+ var CreateTaskBranchCreated = CreateTaskBranch.Created;
201
+ var CreateTaskBranchNotFound = CreateTaskBranch.NotFound;
202
+ var CreateTaskBranchProviderRejected = CreateTaskBranch.ProviderRejected;
203
+ var CreateTaskBranchUncertain = CreateTaskBranch.Uncertain;
204
+ var CreateTaskBranchDefect = CreateTaskBranch.Defect;
205
+ var CreateTaskDefinition = {
206
+ operation: { connectorId: ConnectorID, operationId: "createTask" },
207
+ branches: [
208
+ { id: "created", description: "ClickUp created the task; a retried attempt that found its own earlier task in the List reports it instead of creating another." },
209
+ { id: "notFound", description: "The List does not exist or the connection cannot see it; nothing was created.", optional: true },
210
+ { id: "providerRejected", description: "ClickUp conclusively rejected the task, such as an unknown status, assignee, or custom field value, or missing permission; nothing was created.", optional: true },
211
+ { id: "uncertain", description: "An earlier attempt sent the create but its outcome cannot be confirmed and the List shows no single matching task, so the task may exist; the connector never sends it again.", optional: true },
212
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
213
+ ],
214
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 5, totalDurationMs: 3e5 } }
215
+ };
216
+ var CreateTaskMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
217
+ var UpdateTaskBranch = {
218
+ Updated: "updated",
219
+ NotFound: "notFound",
220
+ ProviderRejected: "providerRejected",
221
+ InvalidResponse: "invalidResponse",
222
+ Defect: "defect"
223
+ };
224
+ var UpdateTaskBranchUpdated = UpdateTaskBranch.Updated;
225
+ var UpdateTaskBranchNotFound = UpdateTaskBranch.NotFound;
226
+ var UpdateTaskBranchProviderRejected = UpdateTaskBranch.ProviderRejected;
227
+ var UpdateTaskBranchInvalidResponse = UpdateTaskBranch.InvalidResponse;
228
+ var UpdateTaskBranchDefect = UpdateTaskBranch.Defect;
229
+ var UpdateTaskDefinition = {
230
+ operation: { connectorId: ConnectorID, operationId: "updateTask" },
231
+ branches: [
232
+ { id: "updated", description: "ClickUp applied every requested change, including when the task already had those values, and the Value holds the task it returned." },
233
+ { id: "notFound", description: "The task does not exist or the connection cannot see it.", optional: true },
234
+ { id: "providerRejected", description: "ClickUp conclusively rejected the change, such as a status that is not in the task's List or missing permission.", optional: true },
235
+ { id: "invalidResponse", description: "ClickUp returned an invalid or oversized task after the update, so the change may have been applied.", optional: true },
236
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
237
+ ],
238
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
239
+ };
240
+ var UpdateTaskMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
241
+ var UpdateTaskTagsBranch = {
242
+ Updated: "updated",
243
+ NotFound: "notFound",
244
+ ProviderRejected: "providerRejected",
245
+ InvalidResponse: "invalidResponse",
246
+ Defect: "defect"
247
+ };
248
+ var UpdateTaskTagsBranchUpdated = UpdateTaskTagsBranch.Updated;
249
+ var UpdateTaskTagsBranchNotFound = UpdateTaskTagsBranch.NotFound;
250
+ var UpdateTaskTagsBranchProviderRejected = UpdateTaskTagsBranch.ProviderRejected;
251
+ var UpdateTaskTagsBranchInvalidResponse = UpdateTaskTagsBranch.InvalidResponse;
252
+ var UpdateTaskTagsBranchDefect = UpdateTaskTagsBranch.Defect;
253
+ var UpdateTaskTagsDefinition = {
254
+ operation: { connectorId: ConnectorID, operationId: "updateTaskTags" },
255
+ branches: [
256
+ { id: "updated", description: "ClickUp applied every tag change, and the Value holds the task's tags read back." },
257
+ { id: "notFound", description: "The task does not exist or the connection cannot see it.", optional: true },
258
+ { id: "providerRejected", description: "ClickUp conclusively rejected a tag change, such as missing permission; earlier changes in the same Step may have been applied.", optional: true },
259
+ { id: "invalidResponse", description: "ClickUp returned an invalid or oversized task when its tags were read back; the tag changes were applied.", optional: true },
260
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
261
+ ],
262
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
263
+ };
264
+ var UpdateTaskTagsMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
265
+ var AddCommentBranch = {
266
+ Added: "added",
267
+ NotFound: "notFound",
268
+ ProviderRejected: "providerRejected",
269
+ Uncertain: "uncertain",
270
+ Defect: "defect"
271
+ };
272
+ var AddCommentBranchAdded = AddCommentBranch.Added;
273
+ var AddCommentBranchNotFound = AddCommentBranch.NotFound;
274
+ var AddCommentBranchProviderRejected = AddCommentBranch.ProviderRejected;
275
+ var AddCommentBranchUncertain = AddCommentBranch.Uncertain;
276
+ var AddCommentBranchDefect = AddCommentBranch.Defect;
277
+ var AddCommentDefinition = {
278
+ operation: { connectorId: ConnectorID, operationId: "addComment" },
279
+ branches: [
280
+ { id: "added", description: "The comment is on the task; a retried attempt that found its own earlier comment reports it instead of adding another." },
281
+ { id: "notFound", description: "The task does not exist or the connection cannot see it; nothing was added.", optional: true },
282
+ { id: "providerRejected", description: "ClickUp conclusively rejected the comment, such as missing permission; nothing was added.", optional: true },
283
+ { id: "uncertain", description: "An earlier attempt sent the comment but its outcome cannot be confirmed and the task shows no matching comment, so the comment may exist; the connector never sends it again.", optional: true },
284
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
285
+ ],
286
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 6e4, maximumAttempts: 5, totalDurationMs: 3e5 } }
287
+ };
288
+ var AddCommentMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
289
+ var FindMemberByEmailBranch = {
290
+ Found: "found",
291
+ NotFound: "notFound",
292
+ ProviderRejected: "providerRejected",
293
+ InvalidResponse: "invalidResponse",
294
+ Defect: "defect"
295
+ };
296
+ var FindMemberByEmailBranchFound = FindMemberByEmailBranch.Found;
297
+ var FindMemberByEmailBranchNotFound = FindMemberByEmailBranch.NotFound;
298
+ var FindMemberByEmailBranchProviderRejected = FindMemberByEmailBranch.ProviderRejected;
299
+ var FindMemberByEmailBranchInvalidResponse = FindMemberByEmailBranch.InvalidResponse;
300
+ var FindMemberByEmailBranchDefect = FindMemberByEmailBranch.Defect;
301
+ var FindMemberByEmailDefinition = {
302
+ operation: { connectorId: ConnectorID, operationId: "findMemberByEmail" },
303
+ branches: [
304
+ { id: "found", description: "A member of the Workspace has the email address." },
305
+ { id: "notFound", description: "No member of the Workspace has the email address, or the token's user is not a member of the Workspace.", optional: true },
306
+ { id: "providerRejected", description: "ClickUp conclusively rejected the Workspace read.", optional: true },
307
+ { id: "invalidResponse", description: "ClickUp returned an invalid or oversized list of Workspaces.", optional: true },
308
+ { id: "defect", description: "Local input, connection configuration, or connector definition is invalid.", optional: true }
309
+ ],
310
+ stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
311
+ };
312
+ var FindMemberByEmailMetadata = { kind: "query", idempotency: "none", authorization: "required" };
313
+
314
+ // src/generated/connection.ts
315
+ import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
316
+ var Connection = class {
317
+ /** Stable provider and connection name. */
318
+ reference;
319
+ /** Bound provider operations. */
320
+ operations;
321
+ /** Validate a reference and bind operations. */
322
+ constructor(reference, operations) {
323
+ this.reference = ConnectionRefSchema.parse(reference);
324
+ if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
325
+ if (!operations) throw new TypeError("connector operations are required");
326
+ this.operations = operations;
327
+ }
328
+ };
329
+ function newConnection(client, reference) {
330
+ if (!client) throw new TypeError("connector client is required");
331
+ return new Connection(reference, client);
332
+ }
333
+ function newConnectionWithOperations(operations, reference) {
334
+ return new Connection(reference, operations);
335
+ }
336
+ function newProjectConnection(project, connectionName, createClient) {
337
+ if (!project) throw new TypeError("loaded project is required");
338
+ const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
339
+ const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
340
+ if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
341
+ return newConnection(createClient(project, connectionName), reference);
342
+ }
343
+
344
+ export {
345
+ ConfigSchema,
346
+ SearchTasksInputSchema,
347
+ TaskStatusSchema,
348
+ UserSchema,
349
+ CustomFieldValueSchema,
350
+ TaskSchema,
351
+ SearchTasksOutputSchema,
352
+ GetTaskInputSchema,
353
+ CustomFieldInputSchema,
354
+ CreateTaskInputSchema,
355
+ CreateTaskOutputSchema,
356
+ UpdateTaskInputSchema,
357
+ UpdateTaskOutputSchema,
358
+ UpdateTaskTagsInputSchema,
359
+ UpdateTaskTagsOutputSchema,
360
+ AddCommentInputSchema,
361
+ AddCommentOutputSchema,
362
+ FindMemberByEmailInputSchema,
363
+ MemberSchema,
364
+ ConnectorID,
365
+ ProviderID,
366
+ SearchTasksBranch,
367
+ SearchTasksBranchSearched,
368
+ SearchTasksBranchNotFound,
369
+ SearchTasksBranchProviderRejected,
370
+ SearchTasksBranchInvalidResponse,
371
+ SearchTasksBranchDefect,
372
+ SearchTasksDefinition,
373
+ SearchTasksMetadata,
374
+ GetTaskBranch,
375
+ GetTaskBranchFound,
376
+ GetTaskBranchNotFound,
377
+ GetTaskBranchProviderRejected,
378
+ GetTaskBranchInvalidResponse,
379
+ GetTaskBranchDefect,
380
+ GetTaskDefinition,
381
+ GetTaskMetadata,
382
+ CreateTaskBranch,
383
+ CreateTaskBranchCreated,
384
+ CreateTaskBranchNotFound,
385
+ CreateTaskBranchProviderRejected,
386
+ CreateTaskBranchUncertain,
387
+ CreateTaskBranchDefect,
388
+ CreateTaskDefinition,
389
+ CreateTaskMetadata,
390
+ UpdateTaskBranch,
391
+ UpdateTaskBranchUpdated,
392
+ UpdateTaskBranchNotFound,
393
+ UpdateTaskBranchProviderRejected,
394
+ UpdateTaskBranchInvalidResponse,
395
+ UpdateTaskBranchDefect,
396
+ UpdateTaskDefinition,
397
+ UpdateTaskMetadata,
398
+ UpdateTaskTagsBranch,
399
+ UpdateTaskTagsBranchUpdated,
400
+ UpdateTaskTagsBranchNotFound,
401
+ UpdateTaskTagsBranchProviderRejected,
402
+ UpdateTaskTagsBranchInvalidResponse,
403
+ UpdateTaskTagsBranchDefect,
404
+ UpdateTaskTagsDefinition,
405
+ UpdateTaskTagsMetadata,
406
+ AddCommentBranch,
407
+ AddCommentBranchAdded,
408
+ AddCommentBranchNotFound,
409
+ AddCommentBranchProviderRejected,
410
+ AddCommentBranchUncertain,
411
+ AddCommentBranchDefect,
412
+ AddCommentDefinition,
413
+ AddCommentMetadata,
414
+ FindMemberByEmailBranch,
415
+ FindMemberByEmailBranchFound,
416
+ FindMemberByEmailBranchNotFound,
417
+ FindMemberByEmailBranchProviderRejected,
418
+ FindMemberByEmailBranchInvalidResponse,
419
+ FindMemberByEmailBranchDefect,
420
+ FindMemberByEmailDefinition,
421
+ FindMemberByEmailMetadata,
422
+ Connection,
423
+ newConnection,
424
+ newConnectionWithOperations,
425
+ newProjectConnection
426
+ };