@automate.ax/integration-contracts 0.104.0 → 0.107.0
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/close/events.d.ts +13 -13
- package/dist/close/schemas.d.ts +9 -9
- package/dist/cloudflare/api.d.ts +93 -0
- package/dist/cloudflare/api.js +250 -0
- package/dist/cloudflare/events.d.ts +1340 -0
- package/dist/cloudflare/events.js +178 -0
- package/dist/cloudflare/index.d.ts +3 -0
- package/dist/cloudflare/index.js +3 -0
- package/dist/cloudflare/schemas.d.ts +608 -0
- package/dist/cloudflare/schemas.js +340 -0
- package/dist/linear/api.d.ts +1 -1
- package/dist/linear/api.js +9 -6
- package/dist/linear/index.d.ts +3479 -782
- package/dist/linear/index.js +249 -13
- package/dist/linear/schemas.d.ts +2721 -28
- package/dist/linear/schemas.js +515 -2
- package/dist/notion/index.js +2 -2
- package/dist/notion/schemas.d.ts +2140 -58
- package/dist/notion/schemas.js +41 -2
- package/dist/outlook/schemas.d.ts +2 -2
- package/dist/resend/action-schemas.d.ts +9 -9
- package/dist/resend/index.d.ts +36 -36
- package/dist/resend/schemas.d.ts +40 -40
- package/dist/slack/event-schemas.d.ts +583 -583
- package/dist/slack/index.d.ts +303 -303
- package/dist/slack/schemas.d.ts +1 -1
- package/dist/teams/schemas.d.ts +5 -5
- package/dist/triggers.d.ts +2 -1
- package/dist/whatsapp/index.d.ts +2 -2
- package/dist/whatsapp/schemas.d.ts +5 -5
- package/package.json +8 -2
- package/src/cloudflare/api.ts +340 -0
- package/src/cloudflare/events.ts +212 -0
- package/src/cloudflare/index.ts +3 -0
- package/src/cloudflare/schemas.ts +359 -0
- package/src/linear/api.ts +10 -6
- package/src/linear/index.ts +249 -26
- package/src/linear/schemas.ts +688 -2
- package/src/notion/index.ts +2 -2
- package/src/notion/schemas.ts +58 -4
- package/src/triggers.ts +2 -0
package/dist/linear/schemas.js
CHANGED
|
@@ -77,9 +77,9 @@ const LINEAR_WEBHOOK_EVENT_SCHEMA = z
|
|
|
77
77
|
/** Stable Linear workspace ID. */
|
|
78
78
|
organizationId: z.string(),
|
|
79
79
|
/** Previous values for fields included in an update. */
|
|
80
|
-
updatedFrom: LINEAR_JSON_OBJECT_SCHEMA.optional(),
|
|
80
|
+
updatedFrom: LINEAR_JSON_OBJECT_SCHEMA.nullable().optional(),
|
|
81
81
|
/** Linear URL for the changed resource, when available. */
|
|
82
|
-
url: z.string().optional(),
|
|
82
|
+
url: z.string().nullable().optional(),
|
|
83
83
|
/** Stable ID of the OAuth app webhook delivering this event. */
|
|
84
84
|
webhookId: z.string(),
|
|
85
85
|
/** Unix timestamp in milliseconds when Linear sent the webhook. */
|
|
@@ -264,6 +264,230 @@ const LINEAR_PROJECT_WEBHOOK_DATA_SCHEMA = z
|
|
|
264
264
|
url: z.string(),
|
|
265
265
|
})
|
|
266
266
|
.catchall(z.json());
|
|
267
|
+
const LINEAR_ATTACHMENT_WEBHOOK_DATA_SCHEMA = z
|
|
268
|
+
.looseObject({
|
|
269
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
270
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
271
|
+
creatorId: z.string().nullable().optional(),
|
|
272
|
+
groupBySource: z.boolean(),
|
|
273
|
+
id: z.string(),
|
|
274
|
+
issueId: z.string(),
|
|
275
|
+
metadata: LINEAR_JSON_OBJECT_SCHEMA,
|
|
276
|
+
sourceType: z.string().nullable().optional(),
|
|
277
|
+
subtitle: z.string().nullable().optional(),
|
|
278
|
+
title: z.string(),
|
|
279
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
280
|
+
url: z.string(),
|
|
281
|
+
})
|
|
282
|
+
.catchall(z.json());
|
|
283
|
+
const LINEAR_CYCLE_WEBHOOK_DATA_SCHEMA = z
|
|
284
|
+
.looseObject({
|
|
285
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
286
|
+
completedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
287
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
288
|
+
description: z.string().nullable().optional(),
|
|
289
|
+
endsAt: z.iso.datetime({ offset: true }),
|
|
290
|
+
id: z.string(),
|
|
291
|
+
name: z.string().nullable().optional(),
|
|
292
|
+
number: z.number(),
|
|
293
|
+
startsAt: z.iso.datetime({ offset: true }),
|
|
294
|
+
teamId: z.string(),
|
|
295
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
296
|
+
})
|
|
297
|
+
.catchall(z.json());
|
|
298
|
+
const LINEAR_DOCUMENT_WEBHOOK_DATA_SCHEMA = z
|
|
299
|
+
.looseObject({
|
|
300
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
301
|
+
color: z.string().nullable().optional(),
|
|
302
|
+
content: z.string().nullable().optional(),
|
|
303
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
304
|
+
creatorId: z.string().nullable().optional(),
|
|
305
|
+
hiddenAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
306
|
+
icon: z.string().nullable().optional(),
|
|
307
|
+
id: z.string(),
|
|
308
|
+
initiativeId: z.string().nullable().optional(),
|
|
309
|
+
projectId: z.string().nullable().optional(),
|
|
310
|
+
slugId: z.string(),
|
|
311
|
+
sortOrder: z.number(),
|
|
312
|
+
title: z.string(),
|
|
313
|
+
trashed: z.boolean().nullable().optional(),
|
|
314
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
315
|
+
updatedById: z.string().nullable().optional(),
|
|
316
|
+
})
|
|
317
|
+
.catchall(z.json());
|
|
318
|
+
const LINEAR_INITIATIVE_WEBHOOK_DATA_SCHEMA = z
|
|
319
|
+
.looseObject({
|
|
320
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
321
|
+
canceledAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
322
|
+
completedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
323
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
324
|
+
description: z.string(),
|
|
325
|
+
health: z.string().nullable().optional(),
|
|
326
|
+
id: z.string(),
|
|
327
|
+
identifier: z.string().nullable().optional(),
|
|
328
|
+
labelIds: z.string().array(),
|
|
329
|
+
name: z.string(),
|
|
330
|
+
organizationId: z.string(),
|
|
331
|
+
ownerId: z.string().nullable().optional(),
|
|
332
|
+
targetDate: z.iso.date().nullable().optional(),
|
|
333
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
334
|
+
url: z.string(),
|
|
335
|
+
})
|
|
336
|
+
.catchall(z.json());
|
|
337
|
+
const LINEAR_INITIATIVE_UPDATE_WEBHOOK_DATA_SCHEMA = z
|
|
338
|
+
.looseObject({
|
|
339
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
340
|
+
body: z.string(),
|
|
341
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
342
|
+
diffMarkdown: z.string().nullable().optional(),
|
|
343
|
+
editedAt: z.iso.datetime({ offset: true }),
|
|
344
|
+
health: z.string(),
|
|
345
|
+
id: z.string(),
|
|
346
|
+
initiativeId: z.string(),
|
|
347
|
+
slugId: z.string(),
|
|
348
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
349
|
+
url: z.string().nullable().optional(),
|
|
350
|
+
userId: z.string(),
|
|
351
|
+
})
|
|
352
|
+
.catchall(z.json());
|
|
353
|
+
const LINEAR_LABEL_WEBHOOK_DATA_SCHEMA = z
|
|
354
|
+
.looseObject({
|
|
355
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
356
|
+
color: z.string(),
|
|
357
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
358
|
+
creatorId: z.string().nullable().optional(),
|
|
359
|
+
description: z.string().nullable().optional(),
|
|
360
|
+
id: z.string(),
|
|
361
|
+
isGroup: z.boolean(),
|
|
362
|
+
name: z.string(),
|
|
363
|
+
parentId: z.string().nullable().optional(),
|
|
364
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
365
|
+
})
|
|
366
|
+
.catchall(z.json());
|
|
367
|
+
const LINEAR_ISSUE_LABEL_WEBHOOK_DATA_SCHEMA = LINEAR_LABEL_WEBHOOK_DATA_SCHEMA.extend({
|
|
368
|
+
teamId: z.string().nullable().optional(),
|
|
369
|
+
});
|
|
370
|
+
const LINEAR_PROJECT_UPDATE_WEBHOOK_DATA_SCHEMA = z
|
|
371
|
+
.looseObject({
|
|
372
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
373
|
+
body: z.string(),
|
|
374
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
375
|
+
diffMarkdown: z.string().nullable().optional(),
|
|
376
|
+
editedAt: z.iso.datetime({ offset: true }),
|
|
377
|
+
health: z.string(),
|
|
378
|
+
id: z.string(),
|
|
379
|
+
projectId: z.string(),
|
|
380
|
+
slugId: z.string(),
|
|
381
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
382
|
+
url: z.string().nullable().optional(),
|
|
383
|
+
userId: z.string(),
|
|
384
|
+
})
|
|
385
|
+
.catchall(z.json());
|
|
386
|
+
const LINEAR_REACTION_WEBHOOK_DATA_SCHEMA = z
|
|
387
|
+
.looseObject({
|
|
388
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
389
|
+
commentId: z.string().nullable().optional(),
|
|
390
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
391
|
+
emoji: z.string(),
|
|
392
|
+
id: z.string(),
|
|
393
|
+
initiativeUpdateId: z.string().nullable().optional(),
|
|
394
|
+
issueId: z.string().nullable().optional(),
|
|
395
|
+
projectUpdateId: z.string().nullable().optional(),
|
|
396
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
397
|
+
userId: z.string().nullable().optional(),
|
|
398
|
+
})
|
|
399
|
+
.catchall(z.json());
|
|
400
|
+
const LINEAR_CUSTOMER_WEBHOOK_DATA_SCHEMA = z
|
|
401
|
+
.looseObject({
|
|
402
|
+
approximateNeedCount: z.number(),
|
|
403
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
404
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
405
|
+
domains: z.string().array(),
|
|
406
|
+
externalIds: z.string().array(),
|
|
407
|
+
id: z.string(),
|
|
408
|
+
logoUrl: z.string().nullable().optional(),
|
|
409
|
+
name: z.string(),
|
|
410
|
+
ownerId: z.string().nullable().optional(),
|
|
411
|
+
revenue: z.number().nullable().optional(),
|
|
412
|
+
size: z.number().nullable().optional(),
|
|
413
|
+
slugId: z.string(),
|
|
414
|
+
statusId: z.string().nullable().optional(),
|
|
415
|
+
tierId: z.string().nullable().optional(),
|
|
416
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
417
|
+
url: z.string(),
|
|
418
|
+
})
|
|
419
|
+
.catchall(z.json());
|
|
420
|
+
const LINEAR_CUSTOMER_NEED_WEBHOOK_DATA_SCHEMA = z
|
|
421
|
+
.looseObject({
|
|
422
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
423
|
+
attachmentId: z.string().nullable().optional(),
|
|
424
|
+
body: z.string().nullable().optional(),
|
|
425
|
+
commentId: z.string().nullable().optional(),
|
|
426
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
427
|
+
creatorId: z.string().nullable().optional(),
|
|
428
|
+
customerId: z.string().nullable().optional(),
|
|
429
|
+
id: z.string(),
|
|
430
|
+
issueId: z.string().nullable().optional(),
|
|
431
|
+
priority: z.number(),
|
|
432
|
+
projectId: z.string().nullable().optional(),
|
|
433
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
434
|
+
})
|
|
435
|
+
.catchall(z.json());
|
|
436
|
+
const LINEAR_USER_WEBHOOK_DATA_SCHEMA = z
|
|
437
|
+
.looseObject({
|
|
438
|
+
active: z.boolean(),
|
|
439
|
+
admin: z.boolean(),
|
|
440
|
+
app: z.boolean(),
|
|
441
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
442
|
+
avatarUrl: z.string().nullable().optional(),
|
|
443
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
444
|
+
displayName: z.string(),
|
|
445
|
+
email: z.string(),
|
|
446
|
+
guest: z.boolean(),
|
|
447
|
+
id: z.string(),
|
|
448
|
+
name: z.string(),
|
|
449
|
+
owner: z.boolean().nullable().optional(),
|
|
450
|
+
timezone: z.string().nullable().optional(),
|
|
451
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
452
|
+
url: z.string(),
|
|
453
|
+
})
|
|
454
|
+
.catchall(z.json());
|
|
455
|
+
const LINEAR_RELEASE_WEBHOOK_DATA_SCHEMA = z
|
|
456
|
+
.looseObject({
|
|
457
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
458
|
+
canceledAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
459
|
+
commitSha: z.string().nullable().optional(),
|
|
460
|
+
completedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
461
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
462
|
+
description: z.string().nullable().optional(),
|
|
463
|
+
id: z.string(),
|
|
464
|
+
name: z.string(),
|
|
465
|
+
pipelineId: z.string(),
|
|
466
|
+
slugId: z.string(),
|
|
467
|
+
stageId: z.string(),
|
|
468
|
+
startDate: z.iso.date().nullable().optional(),
|
|
469
|
+
startedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
470
|
+
targetDate: z.iso.date().nullable().optional(),
|
|
471
|
+
trashed: z.boolean().nullable().optional(),
|
|
472
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
473
|
+
url: z.string(),
|
|
474
|
+
version: z.string().nullable().optional(),
|
|
475
|
+
})
|
|
476
|
+
.catchall(z.json());
|
|
477
|
+
const LINEAR_RELEASE_NOTE_WEBHOOK_DATA_SCHEMA = z
|
|
478
|
+
.looseObject({
|
|
479
|
+
archivedAt: z.iso.datetime({ offset: true }).nullable().optional(),
|
|
480
|
+
content: z.string().nullable().optional(),
|
|
481
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
482
|
+
id: z.string(),
|
|
483
|
+
pipelineId: z.string(),
|
|
484
|
+
releaseIds: z.string().array(),
|
|
485
|
+
slugId: z.string(),
|
|
486
|
+
title: z.string().nullable().optional(),
|
|
487
|
+
updatedAt: z.iso.datetime({ offset: true }),
|
|
488
|
+
url: z.string(),
|
|
489
|
+
})
|
|
490
|
+
.catchall(z.json());
|
|
267
491
|
const LINEAR_ISSUE_WEBHOOK_EVENT_SCHEMA = LINEAR_WEBHOOK_EVENT_SCHEMA.extend({
|
|
268
492
|
data: LINEAR_ISSUE_WEBHOOK_DATA_SCHEMA,
|
|
269
493
|
type: z.literal("Issue"),
|
|
@@ -333,6 +557,130 @@ export const LINEAR_PROJECT_REMOVED_EVENT_SCHEMA = LINEAR_PROJECT_EVENT_SCHEMA.e
|
|
|
333
557
|
action: z.literal("remove"),
|
|
334
558
|
}),
|
|
335
559
|
});
|
|
560
|
+
const attachmentEvents = linearEntityEventSchemas("Attachment", LINEAR_ATTACHMENT_WEBHOOK_DATA_SCHEMA);
|
|
561
|
+
export const LINEAR_ATTACHMENT_EVENT_SCHEMA = attachmentEvents.event;
|
|
562
|
+
export const LINEAR_ATTACHMENT_CREATED_EVENT_SCHEMA = attachmentEvents.created;
|
|
563
|
+
export const LINEAR_ATTACHMENT_UPDATED_EVENT_SCHEMA = attachmentEvents.updated;
|
|
564
|
+
export const LINEAR_ATTACHMENT_REMOVED_EVENT_SCHEMA = attachmentEvents.removed;
|
|
565
|
+
const cycleEvents = linearEntityEventSchemas("Cycle", LINEAR_CYCLE_WEBHOOK_DATA_SCHEMA);
|
|
566
|
+
export const LINEAR_CYCLE_EVENT_SCHEMA = cycleEvents.event;
|
|
567
|
+
export const LINEAR_CYCLE_CREATED_EVENT_SCHEMA = cycleEvents.created;
|
|
568
|
+
export const LINEAR_CYCLE_UPDATED_EVENT_SCHEMA = cycleEvents.updated;
|
|
569
|
+
export const LINEAR_CYCLE_REMOVED_EVENT_SCHEMA = cycleEvents.removed;
|
|
570
|
+
const documentEvents = linearEntityEventSchemas("Document", LINEAR_DOCUMENT_WEBHOOK_DATA_SCHEMA);
|
|
571
|
+
export const LINEAR_DOCUMENT_EVENT_SCHEMA = documentEvents.event;
|
|
572
|
+
export const LINEAR_DOCUMENT_CREATED_EVENT_SCHEMA = documentEvents.created;
|
|
573
|
+
export const LINEAR_DOCUMENT_UPDATED_EVENT_SCHEMA = documentEvents.updated;
|
|
574
|
+
export const LINEAR_DOCUMENT_REMOVED_EVENT_SCHEMA = documentEvents.removed;
|
|
575
|
+
const initiativeEvents = linearEntityEventSchemas("Initiative", LINEAR_INITIATIVE_WEBHOOK_DATA_SCHEMA);
|
|
576
|
+
export const LINEAR_INITIATIVE_EVENT_SCHEMA = initiativeEvents.event;
|
|
577
|
+
export const LINEAR_INITIATIVE_CREATED_EVENT_SCHEMA = initiativeEvents.created;
|
|
578
|
+
export const LINEAR_INITIATIVE_UPDATED_EVENT_SCHEMA = initiativeEvents.updated;
|
|
579
|
+
export const LINEAR_INITIATIVE_REMOVED_EVENT_SCHEMA = initiativeEvents.removed;
|
|
580
|
+
const initiativeUpdateEvents = linearEntityEventSchemas("InitiativeUpdate", LINEAR_INITIATIVE_UPDATE_WEBHOOK_DATA_SCHEMA);
|
|
581
|
+
export const LINEAR_INITIATIVE_UPDATE_EVENT_SCHEMA = initiativeUpdateEvents.event;
|
|
582
|
+
export const LINEAR_INITIATIVE_UPDATE_CREATED_EVENT_SCHEMA = initiativeUpdateEvents.created;
|
|
583
|
+
export const LINEAR_INITIATIVE_UPDATE_UPDATED_EVENT_SCHEMA = initiativeUpdateEvents.updated;
|
|
584
|
+
export const LINEAR_INITIATIVE_UPDATE_REMOVED_EVENT_SCHEMA = initiativeUpdateEvents.removed;
|
|
585
|
+
const issueLabelEvents = linearEntityEventSchemas("IssueLabel", LINEAR_ISSUE_LABEL_WEBHOOK_DATA_SCHEMA);
|
|
586
|
+
export const LINEAR_ISSUE_LABEL_EVENT_SCHEMA = issueLabelEvents.event;
|
|
587
|
+
export const LINEAR_ISSUE_LABEL_CREATED_EVENT_SCHEMA = issueLabelEvents.created;
|
|
588
|
+
export const LINEAR_ISSUE_LABEL_UPDATED_EVENT_SCHEMA = issueLabelEvents.updated;
|
|
589
|
+
export const LINEAR_ISSUE_LABEL_REMOVED_EVENT_SCHEMA = issueLabelEvents.removed;
|
|
590
|
+
const projectLabelEvents = linearEntityEventSchemas("ProjectLabel", LINEAR_LABEL_WEBHOOK_DATA_SCHEMA);
|
|
591
|
+
export const LINEAR_PROJECT_LABEL_EVENT_SCHEMA = projectLabelEvents.event;
|
|
592
|
+
export const LINEAR_PROJECT_LABEL_CREATED_EVENT_SCHEMA = projectLabelEvents.created;
|
|
593
|
+
export const LINEAR_PROJECT_LABEL_UPDATED_EVENT_SCHEMA = projectLabelEvents.updated;
|
|
594
|
+
export const LINEAR_PROJECT_LABEL_REMOVED_EVENT_SCHEMA = projectLabelEvents.removed;
|
|
595
|
+
const projectUpdateEvents = linearEntityEventSchemas("ProjectUpdate", LINEAR_PROJECT_UPDATE_WEBHOOK_DATA_SCHEMA);
|
|
596
|
+
export const LINEAR_PROJECT_UPDATE_EVENT_SCHEMA = projectUpdateEvents.event;
|
|
597
|
+
export const LINEAR_PROJECT_UPDATE_CREATED_EVENT_SCHEMA = projectUpdateEvents.created;
|
|
598
|
+
export const LINEAR_PROJECT_UPDATE_UPDATED_EVENT_SCHEMA = projectUpdateEvents.updated;
|
|
599
|
+
export const LINEAR_PROJECT_UPDATE_REMOVED_EVENT_SCHEMA = projectUpdateEvents.removed;
|
|
600
|
+
const LINEAR_REACTION_EVENTS = linearEntityEventSchemas("Reaction", LINEAR_REACTION_WEBHOOK_DATA_SCHEMA);
|
|
601
|
+
export const LINEAR_REACTION_EVENT_SCHEMA = LINEAR_REACTION_EVENTS.event;
|
|
602
|
+
export const LINEAR_REACTION_CREATED_EVENT_SCHEMA = LINEAR_REACTION_EVENTS.created;
|
|
603
|
+
export const LINEAR_REACTION_REMOVED_EVENT_SCHEMA = LINEAR_REACTION_EVENTS.removed;
|
|
604
|
+
const customerEvents = linearEntityEventSchemas("Customer", LINEAR_CUSTOMER_WEBHOOK_DATA_SCHEMA);
|
|
605
|
+
export const LINEAR_CUSTOMER_EVENT_SCHEMA = customerEvents.event;
|
|
606
|
+
export const LINEAR_CUSTOMER_CREATED_EVENT_SCHEMA = customerEvents.created;
|
|
607
|
+
export const LINEAR_CUSTOMER_UPDATED_EVENT_SCHEMA = customerEvents.updated;
|
|
608
|
+
export const LINEAR_CUSTOMER_REMOVED_EVENT_SCHEMA = customerEvents.removed;
|
|
609
|
+
const customerNeedEvents = linearEntityEventSchemas("CustomerNeed", LINEAR_CUSTOMER_NEED_WEBHOOK_DATA_SCHEMA);
|
|
610
|
+
export const LINEAR_CUSTOMER_NEED_EVENT_SCHEMA = customerNeedEvents.event;
|
|
611
|
+
export const LINEAR_CUSTOMER_NEED_CREATED_EVENT_SCHEMA = customerNeedEvents.created;
|
|
612
|
+
export const LINEAR_CUSTOMER_NEED_UPDATED_EVENT_SCHEMA = customerNeedEvents.updated;
|
|
613
|
+
export const LINEAR_CUSTOMER_NEED_REMOVED_EVENT_SCHEMA = customerNeedEvents.removed;
|
|
614
|
+
const userEvents = linearEntityEventSchemas("User", LINEAR_USER_WEBHOOK_DATA_SCHEMA);
|
|
615
|
+
export const LINEAR_USER_EVENT_SCHEMA = userEvents.event;
|
|
616
|
+
export const LINEAR_USER_CREATED_EVENT_SCHEMA = userEvents.created;
|
|
617
|
+
export const LINEAR_USER_UPDATED_EVENT_SCHEMA = userEvents.updated;
|
|
618
|
+
export const LINEAR_USER_REMOVED_EVENT_SCHEMA = userEvents.removed;
|
|
619
|
+
const releaseEvents = linearEntityEventSchemas("Release", LINEAR_RELEASE_WEBHOOK_DATA_SCHEMA);
|
|
620
|
+
export const LINEAR_RELEASE_EVENT_SCHEMA = releaseEvents.event;
|
|
621
|
+
export const LINEAR_RELEASE_CREATED_EVENT_SCHEMA = releaseEvents.created;
|
|
622
|
+
export const LINEAR_RELEASE_UPDATED_EVENT_SCHEMA = releaseEvents.updated;
|
|
623
|
+
export const LINEAR_RELEASE_REMOVED_EVENT_SCHEMA = releaseEvents.removed;
|
|
624
|
+
const releaseNoteEvents = linearEntityEventSchemas("ReleaseNote", LINEAR_RELEASE_NOTE_WEBHOOK_DATA_SCHEMA);
|
|
625
|
+
export const LINEAR_RELEASE_NOTE_EVENT_SCHEMA = releaseNoteEvents.event;
|
|
626
|
+
export const LINEAR_RELEASE_NOTE_CREATED_EVENT_SCHEMA = releaseNoteEvents.created;
|
|
627
|
+
export const LINEAR_RELEASE_NOTE_UPDATED_EVENT_SCHEMA = releaseNoteEvents.updated;
|
|
628
|
+
export const LINEAR_RELEASE_NOTE_REMOVED_EVENT_SCHEMA = releaseNoteEvents.removed;
|
|
629
|
+
const LINEAR_ISSUE_SLA_WEBHOOK_EVENT_SCHEMA = z
|
|
630
|
+
.looseObject({
|
|
631
|
+
action: z.enum(["set", "highRisk", "breached"]),
|
|
632
|
+
createdAt: z.iso.datetime({ offset: true }),
|
|
633
|
+
issueData: LINEAR_ISSUE_WEBHOOK_DATA_SCHEMA,
|
|
634
|
+
organizationId: z.string(),
|
|
635
|
+
type: z.literal("IssueSLA"),
|
|
636
|
+
url: z.string().nullable().optional(),
|
|
637
|
+
webhookId: z.string(),
|
|
638
|
+
webhookTimestamp: z.number().int().nonnegative(),
|
|
639
|
+
})
|
|
640
|
+
.catchall(z.json());
|
|
641
|
+
export const LINEAR_ISSUE_SLA_EVENT_SCHEMA = LINEAR_ISSUE_WEBHOOK_DATA_SCHEMA.extend({
|
|
642
|
+
event: LINEAR_ISSUE_SLA_WEBHOOK_EVENT_SCHEMA,
|
|
643
|
+
});
|
|
644
|
+
export const LINEAR_ISSUE_SLA_SET_EVENT_SCHEMA = LINEAR_ISSUE_SLA_EVENT_SCHEMA.extend({
|
|
645
|
+
event: LINEAR_ISSUE_SLA_WEBHOOK_EVENT_SCHEMA.extend({
|
|
646
|
+
action: z.literal("set"),
|
|
647
|
+
}),
|
|
648
|
+
});
|
|
649
|
+
export const LINEAR_ISSUE_SLA_HIGH_RISK_EVENT_SCHEMA = LINEAR_ISSUE_SLA_EVENT_SCHEMA.extend({
|
|
650
|
+
event: LINEAR_ISSUE_SLA_WEBHOOK_EVENT_SCHEMA.extend({
|
|
651
|
+
action: z.literal("highRisk"),
|
|
652
|
+
}),
|
|
653
|
+
});
|
|
654
|
+
export const LINEAR_ISSUE_SLA_BREACHED_EVENT_SCHEMA = LINEAR_ISSUE_SLA_EVENT_SCHEMA.extend({
|
|
655
|
+
event: LINEAR_ISSUE_SLA_WEBHOOK_EVENT_SCHEMA.extend({
|
|
656
|
+
action: z.literal("breached"),
|
|
657
|
+
}),
|
|
658
|
+
});
|
|
659
|
+
/**
|
|
660
|
+
* Creates broad and lifecycle-specific schemas for one Linear entity webhook.
|
|
661
|
+
*
|
|
662
|
+
* @param type - Provider webhook resource type.
|
|
663
|
+
* @param dataSchema - Provider resource payload schema.
|
|
664
|
+
*/
|
|
665
|
+
function linearEntityEventSchemas(type, dataSchema) {
|
|
666
|
+
const webhook = LINEAR_WEBHOOK_EVENT_SCHEMA.extend({
|
|
667
|
+
data: dataSchema,
|
|
668
|
+
type: z.literal(type),
|
|
669
|
+
});
|
|
670
|
+
const event = dataSchema.extend({ event: webhook });
|
|
671
|
+
return {
|
|
672
|
+
created: event.extend({
|
|
673
|
+
event: webhook.extend({ action: z.literal("create") }),
|
|
674
|
+
}),
|
|
675
|
+
event,
|
|
676
|
+
removed: event.extend({
|
|
677
|
+
event: webhook.extend({ action: z.literal("remove") }),
|
|
678
|
+
}),
|
|
679
|
+
updated: event.extend({
|
|
680
|
+
event: webhook.extend({ action: z.literal("update") }),
|
|
681
|
+
}),
|
|
682
|
+
};
|
|
683
|
+
}
|
|
336
684
|
export const LINEAR_PAGE_INPUT_SCHEMA = z.object({
|
|
337
685
|
/** Cursor returned by the previous page. */
|
|
338
686
|
after: z.string().min(1).optional(),
|
|
@@ -762,6 +1110,171 @@ export const LINEAR_ATTACHMENT_SCHEMA = z.object({
|
|
|
762
1110
|
/** Unique external attachment URL. */
|
|
763
1111
|
url: z.string(),
|
|
764
1112
|
});
|
|
1113
|
+
export const LINEAR_CYCLE_SCHEMA = z.object({
|
|
1114
|
+
/** When the cycle was archived, or `null` while active. */
|
|
1115
|
+
archivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1116
|
+
/** When Linear automatically archived the cycle. */
|
|
1117
|
+
autoArchivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1118
|
+
/** When the cycle completed, or `null` while open. */
|
|
1119
|
+
completedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1120
|
+
/** When the cycle was created. */
|
|
1121
|
+
createdAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1122
|
+
/** Optional cycle description. */
|
|
1123
|
+
description: z.string().nullable(),
|
|
1124
|
+
/** Scheduled cycle end. */
|
|
1125
|
+
endsAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1126
|
+
/** Stable Linear cycle ID. */
|
|
1127
|
+
id: z.string(),
|
|
1128
|
+
/** Whether the cycle currently contains the present time. */
|
|
1129
|
+
isActive: z.boolean(),
|
|
1130
|
+
/** Whether the cycle starts in the future. */
|
|
1131
|
+
isFuture: z.boolean(),
|
|
1132
|
+
/** Whether this is the team's next cycle. */
|
|
1133
|
+
isNext: z.boolean(),
|
|
1134
|
+
/** Whether the cycle has ended. */
|
|
1135
|
+
isPast: z.boolean(),
|
|
1136
|
+
/** Whether this is the team's most recently completed cycle. */
|
|
1137
|
+
isPrevious: z.boolean(),
|
|
1138
|
+
/** Custom cycle name, when set. */
|
|
1139
|
+
name: z.string().nullable(),
|
|
1140
|
+
/** Team-local cycle number. */
|
|
1141
|
+
number: z.number(),
|
|
1142
|
+
/** Completion ratio from zero to one. */
|
|
1143
|
+
progress: z.number(),
|
|
1144
|
+
/** Scheduled cycle start. */
|
|
1145
|
+
startsAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1146
|
+
/** Team that owns the cycle. */
|
|
1147
|
+
team: LINEAR_TEAM_REFERENCE_SCHEMA,
|
|
1148
|
+
/** When the cycle was last updated. */
|
|
1149
|
+
updatedAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1150
|
+
});
|
|
1151
|
+
export const LINEAR_DOCUMENT_SCHEMA = z.object({
|
|
1152
|
+
/** When the document was archived, or `null` while active. */
|
|
1153
|
+
archivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1154
|
+
/** Document icon color, when set. */
|
|
1155
|
+
color: z.string().nullable(),
|
|
1156
|
+
/** Markdown document content, when set. */
|
|
1157
|
+
content: z.string().nullable(),
|
|
1158
|
+
/** When the document was created. */
|
|
1159
|
+
createdAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1160
|
+
/** Workspace user who created the document. */
|
|
1161
|
+
creator: LINEAR_USER_REFERENCE_SCHEMA.nullable(),
|
|
1162
|
+
/** When the document was hidden, or `null` while visible. */
|
|
1163
|
+
hiddenAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1164
|
+
/** Document icon or emoji, when set. */
|
|
1165
|
+
icon: z.string().nullable(),
|
|
1166
|
+
/** Stable Linear document ID. */
|
|
1167
|
+
id: z.string(),
|
|
1168
|
+
/** Issue containing the document, when applicable. */
|
|
1169
|
+
issue: LINEAR_ISSUE_REFERENCE_SCHEMA.nullable(),
|
|
1170
|
+
/** Workspace user who owns the document. */
|
|
1171
|
+
owner: LINEAR_USER_REFERENCE_SCHEMA.nullable(),
|
|
1172
|
+
/** Project containing the document, when applicable. */
|
|
1173
|
+
project: LINEAR_PROJECT_REFERENCE_SCHEMA.nullable(),
|
|
1174
|
+
/** URL-safe document slug. */
|
|
1175
|
+
slugId: z.string(),
|
|
1176
|
+
/** Relative order among sibling resources. */
|
|
1177
|
+
sortOrder: z.number(),
|
|
1178
|
+
/** Document title. */
|
|
1179
|
+
title: z.string(),
|
|
1180
|
+
/** Whether the document is in reversible trash. */
|
|
1181
|
+
trashed: z.boolean().nullable(),
|
|
1182
|
+
/** When the document was last updated. */
|
|
1183
|
+
updatedAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1184
|
+
/** Workspace user who last updated the document. */
|
|
1185
|
+
updatedBy: LINEAR_USER_REFERENCE_SCHEMA.nullable(),
|
|
1186
|
+
/** Canonical Linear document URL. */
|
|
1187
|
+
url: z.string(),
|
|
1188
|
+
});
|
|
1189
|
+
export const LINEAR_PROJECT_UPDATE_HEALTH_SCHEMA = z.enum([
|
|
1190
|
+
"onTrack",
|
|
1191
|
+
"atRisk",
|
|
1192
|
+
"offTrack",
|
|
1193
|
+
]);
|
|
1194
|
+
export const LINEAR_PROJECT_UPDATE_SCHEMA = z.object({
|
|
1195
|
+
/** When the update was archived, or `null` while active. */
|
|
1196
|
+
archivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1197
|
+
/** Markdown update body. */
|
|
1198
|
+
body: z.string(),
|
|
1199
|
+
/** Number of comments on the update. */
|
|
1200
|
+
commentCount: z.number().int().nonnegative(),
|
|
1201
|
+
/** When the update was created. */
|
|
1202
|
+
createdAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1203
|
+
/** Markdown diff from the previous update, when available. */
|
|
1204
|
+
diffMarkdown: z.string().nullable(),
|
|
1205
|
+
/** When the update was edited, or `null` if never edited. */
|
|
1206
|
+
editedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1207
|
+
/** Project health reported by this update. */
|
|
1208
|
+
health: LINEAR_PROJECT_UPDATE_HEALTH_SCHEMA,
|
|
1209
|
+
/** Stable Linear project-update ID. */
|
|
1210
|
+
id: z.string(),
|
|
1211
|
+
/** Whether the previous-update diff is hidden. */
|
|
1212
|
+
isDiffHidden: z.boolean(),
|
|
1213
|
+
/** Whether Linear considers the update stale. */
|
|
1214
|
+
isStale: z.boolean(),
|
|
1215
|
+
/** Project receiving the update. */
|
|
1216
|
+
project: LINEAR_PROJECT_REFERENCE_SCHEMA,
|
|
1217
|
+
/** URL-safe update slug. */
|
|
1218
|
+
slugId: z.string(),
|
|
1219
|
+
/** When the update was last changed. */
|
|
1220
|
+
updatedAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1221
|
+
/** Canonical Linear update URL. */
|
|
1222
|
+
url: z.string(),
|
|
1223
|
+
/** Workspace user who wrote the update. */
|
|
1224
|
+
user: LINEAR_USER_REFERENCE_SCHEMA,
|
|
1225
|
+
});
|
|
1226
|
+
export const LINEAR_PROJECT_MILESTONE_STATUS_SCHEMA = z.enum([
|
|
1227
|
+
"unstarted",
|
|
1228
|
+
"next",
|
|
1229
|
+
"overdue",
|
|
1230
|
+
"done",
|
|
1231
|
+
]);
|
|
1232
|
+
export const LINEAR_PROJECT_MILESTONE_SCHEMA = z.object({
|
|
1233
|
+
/** When the milestone was archived, or `null` while active. */
|
|
1234
|
+
archivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1235
|
+
/** When the milestone was created. */
|
|
1236
|
+
createdAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1237
|
+
/** Markdown milestone description. */
|
|
1238
|
+
description: z.string().nullable(),
|
|
1239
|
+
/** Stable Linear milestone ID. */
|
|
1240
|
+
id: z.string(),
|
|
1241
|
+
/** Milestone name. */
|
|
1242
|
+
name: z.string(),
|
|
1243
|
+
/** Completion ratio from zero to one. */
|
|
1244
|
+
progress: z.number(),
|
|
1245
|
+
/** Project containing the milestone. */
|
|
1246
|
+
project: LINEAR_PROJECT_REFERENCE_SCHEMA,
|
|
1247
|
+
/** Relative milestone order inside the project. */
|
|
1248
|
+
sortOrder: z.number(),
|
|
1249
|
+
/** Computed milestone lifecycle status. */
|
|
1250
|
+
status: LINEAR_PROJECT_MILESTONE_STATUS_SCHEMA,
|
|
1251
|
+
/** Planned completion date. */
|
|
1252
|
+
targetDate: z.iso.date().nullable(),
|
|
1253
|
+
/** When the milestone was last updated. */
|
|
1254
|
+
updatedAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1255
|
+
});
|
|
1256
|
+
export const LINEAR_REACTION_SCHEMA = z.object({
|
|
1257
|
+
/** When the reaction was archived, or `null` while active. */
|
|
1258
|
+
archivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
|
1259
|
+
/** Comment receiving the reaction, when applicable. */
|
|
1260
|
+
comment: z.object({ id: z.string() }).nullable(),
|
|
1261
|
+
/** When the reaction was created. */
|
|
1262
|
+
createdAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1263
|
+
/** Provider-normalized emoji name. */
|
|
1264
|
+
emoji: z.string(),
|
|
1265
|
+
/** Stable Linear reaction ID. */
|
|
1266
|
+
id: z.string(),
|
|
1267
|
+
/** Initiative update receiving the reaction, when applicable. */
|
|
1268
|
+
initiativeUpdate: z.object({ id: z.string() }).nullable(),
|
|
1269
|
+
/** Issue receiving the reaction, when applicable. */
|
|
1270
|
+
issue: LINEAR_ISSUE_REFERENCE_SCHEMA.nullable(),
|
|
1271
|
+
/** Project update receiving the reaction, when applicable. */
|
|
1272
|
+
projectUpdate: z.object({ id: z.string() }).nullable(),
|
|
1273
|
+
/** When the reaction was last updated. */
|
|
1274
|
+
updatedAt: LINEAR_DATE_TIME_SCHEMA,
|
|
1275
|
+
/** Workspace user who created the reaction. */
|
|
1276
|
+
user: LINEAR_USER_REFERENCE_SCHEMA.nullable(),
|
|
1277
|
+
});
|
|
765
1278
|
export const LINEAR_ISSUE_RELATION_SCHEMA = z.object({
|
|
766
1279
|
/** When the relation was archived, or `null` while active. */
|
|
767
1280
|
archivedAt: LINEAR_DATE_TIME_SCHEMA.nullable(),
|
package/dist/notion/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { NOTION_PUBLIC_EVENT_SCHEMA, notionSemanticEventSchema, } from "./schemas.js";
|
|
3
3
|
export * from "./schemas.js";
|
|
4
4
|
export const NOTION_TRIGGER_CONFIG_SCHEMA = z.object({});
|
|
5
5
|
export const NOTION_WEBHOOK_EVENT_TYPES = [
|
|
@@ -80,7 +80,7 @@ export const notionTriggerContracts = {
|
|
|
80
80
|
"notion.dataSource.undeleted": semanticContract("data_source.undeleted"),
|
|
81
81
|
"notion.event": {
|
|
82
82
|
configSchema: NOTION_TRIGGER_CONFIG_SCHEMA,
|
|
83
|
-
eventSchema:
|
|
83
|
+
eventSchema: NOTION_PUBLIC_EVENT_SCHEMA,
|
|
84
84
|
},
|
|
85
85
|
"notion.fileUpload.completed": semanticContract("file_upload.completed"),
|
|
86
86
|
"notion.fileUpload.created": semanticContract("file_upload.created"),
|