terse-types 0.0.1 → 0.0.3
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/ApiRouteBuilder.d.ts +2 -0
- package/dist/ApiRoutes.json +4 -2
- package/dist/Configs.d.ts +214 -57
- package/dist/Configs.js +289 -36
- package/dist/Integrations.d.ts +10 -1
- package/dist/Integrations.js +11 -2
- package/dist/ModelEvents.d.ts +302 -155
- package/dist/ModelEvents.js +184 -0
- package/dist/Notifications.d.ts +23 -10
- package/dist/Notifications.js +12 -0
- package/dist/RunHistoryTypes.d.ts +7 -3
- package/dist/RunHistoryTypes.js +5 -6
- package/dist/Tools.d.ts +299 -168
- package/dist/Tools.js +171 -164
- package/dist/ToolsTypes.d.ts +4 -0
- package/dist/ToolsTypes.js +5 -1
- package/dist/types.d.ts +4934 -685
- package/dist/types.js +732 -103
- package/package.json +46 -42
package/dist/Configs.js
CHANGED
|
@@ -23,6 +23,7 @@ export var ConfigType;
|
|
|
23
23
|
ConfigType["WORKOS_OUTPUT"] = "workos_output";
|
|
24
24
|
ConfigType["ATTIO_OUTPUT"] = "attio_output";
|
|
25
25
|
ConfigType["SNOWFLAKE_OUTPUT"] = "snowflake_output";
|
|
26
|
+
ConfigType["WEBHOOK_INPUT"] = "webhook_input";
|
|
26
27
|
})(ConfigType || (ConfigType = {}));
|
|
27
28
|
export const configTypeEnum = z.enum(ConfigType);
|
|
28
29
|
// Metadata objects - using const objects instead of classes
|
|
@@ -194,6 +195,14 @@ export const SnowflakeOutputConfigMetadata = {
|
|
|
194
195
|
isInput: false,
|
|
195
196
|
isOutput: true
|
|
196
197
|
};
|
|
198
|
+
export const WebhookInputConfigMetadata = {
|
|
199
|
+
configType: ConfigType.WEBHOOK_INPUT,
|
|
200
|
+
name: "Webhook",
|
|
201
|
+
description: "Trigger via an external HTTP request to a generated URL",
|
|
202
|
+
integrationType: IntegrationType.WEBHOOK,
|
|
203
|
+
isInput: true,
|
|
204
|
+
isOutput: false
|
|
205
|
+
};
|
|
197
206
|
export const CONFIG_DETAILS = {
|
|
198
207
|
[ConfigType.GMAIL]: GmailConfigMetadata,
|
|
199
208
|
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfigMetadata,
|
|
@@ -215,7 +224,8 @@ export const CONFIG_DETAILS = {
|
|
|
215
224
|
[ConfigType.WORKOS_INPUT]: WorkOSInputConfigMetadata,
|
|
216
225
|
[ConfigType.WORKOS_OUTPUT]: WorkOSOutputConfigMetadata,
|
|
217
226
|
[ConfigType.ATTIO_OUTPUT]: AttioOutputConfigMetadata,
|
|
218
|
-
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfigMetadata
|
|
227
|
+
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfigMetadata,
|
|
228
|
+
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfigMetadata
|
|
219
229
|
};
|
|
220
230
|
// MARK: Event Types — specific events within each integration trigger
|
|
221
231
|
export var SlackEventType;
|
|
@@ -283,11 +293,11 @@ class BaseConfigInstance {
|
|
|
283
293
|
export const GmailConfigSchema = ConfigInstanceSchema.extend({
|
|
284
294
|
integrationType: z.literal(IntegrationType.GMAIL),
|
|
285
295
|
configType: z.literal(ConfigType.GMAIL),
|
|
286
|
-
eventTypes: z.array(z.enum(GmailEventType)).
|
|
296
|
+
eventTypes: z.array(z.enum(GmailEventType)).nullable()
|
|
287
297
|
});
|
|
288
298
|
export class GmailConfig extends BaseConfigInstance {
|
|
289
299
|
eventTypes;
|
|
290
|
-
constructor(integrationId, eventTypes) {
|
|
300
|
+
constructor(integrationId, eventTypes = null) {
|
|
291
301
|
super(integrationId, IntegrationType.GMAIL, ConfigType.GMAIL);
|
|
292
302
|
this.eventTypes = eventTypes;
|
|
293
303
|
}
|
|
@@ -304,14 +314,14 @@ export const FigmaConfigSchema = ConfigInstanceSchema.extend({
|
|
|
304
314
|
fileKey: z.string(),
|
|
305
315
|
fileName: z.string(),
|
|
306
316
|
teamId: z.string(),
|
|
307
|
-
eventTypes: z.array(z.enum(FigmaEventType)).
|
|
317
|
+
eventTypes: z.array(z.enum(FigmaEventType)).nullable()
|
|
308
318
|
});
|
|
309
319
|
export class FigmaConfig extends BaseConfigInstance {
|
|
310
320
|
fileKey;
|
|
311
321
|
fileName;
|
|
312
322
|
teamId;
|
|
313
323
|
eventTypes;
|
|
314
|
-
constructor(integrationId, fileKey, fileName, teamId, eventTypes) {
|
|
324
|
+
constructor(integrationId, fileKey, fileName, teamId, eventTypes = null) {
|
|
315
325
|
super(integrationId, IntegrationType.FIGMA, ConfigType.FIGMA);
|
|
316
326
|
this.fileKey = fileKey;
|
|
317
327
|
this.fileName = fileName;
|
|
@@ -335,11 +345,11 @@ export class FigmaConfig extends BaseConfigInstance {
|
|
|
335
345
|
export const SlackConfigSchema = ConfigInstanceSchema.extend({
|
|
336
346
|
integrationType: z.literal(IntegrationType.SLACK),
|
|
337
347
|
configType: z.literal(ConfigType.SLACK),
|
|
338
|
-
channelId: z.string().
|
|
339
|
-
channelName: z.string().
|
|
348
|
+
channelId: z.string().nullable(),
|
|
349
|
+
channelName: z.string().nullable(),
|
|
340
350
|
listenToUserDms: z.boolean().default(false),
|
|
341
|
-
userIds: z.array(z.string()).
|
|
342
|
-
eventTypes: z.array(z.enum(SlackEventType)).
|
|
351
|
+
userIds: z.array(z.string()).nullable(),
|
|
352
|
+
eventTypes: z.array(z.enum(SlackEventType)).nullable()
|
|
343
353
|
});
|
|
344
354
|
export class SlackConfig extends BaseConfigInstance {
|
|
345
355
|
channelId;
|
|
@@ -347,7 +357,7 @@ export class SlackConfig extends BaseConfigInstance {
|
|
|
347
357
|
listenToUserDms;
|
|
348
358
|
userIds;
|
|
349
359
|
eventTypes;
|
|
350
|
-
constructor(integrationId, channelId, channelName, listenToUserDms = false, userIds, eventTypes) {
|
|
360
|
+
constructor(integrationId, channelId = null, channelName = null, listenToUserDms = false, userIds = null, eventTypes = null) {
|
|
351
361
|
super(integrationId, IntegrationType.SLACK, ConfigType.SLACK);
|
|
352
362
|
this.channelId = channelId;
|
|
353
363
|
this.channelName = channelName;
|
|
@@ -379,10 +389,10 @@ export class SlackConfig extends BaseConfigInstance {
|
|
|
379
389
|
export const SlackOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
380
390
|
integrationType: z.literal(IntegrationType.SLACK),
|
|
381
391
|
configType: z.literal(ConfigType.SLACK_OUTPUT),
|
|
382
|
-
channelId: z.string().
|
|
383
|
-
channelName: z.string().
|
|
384
|
-
userIds: z.array(z.string()).
|
|
385
|
-
userNames: z.array(z.string()).
|
|
392
|
+
channelId: z.string().nullable(),
|
|
393
|
+
channelName: z.string().nullable(),
|
|
394
|
+
userIds: z.array(z.string()).nullable(),
|
|
395
|
+
userNames: z.array(z.string()).nullable(),
|
|
386
396
|
listenToUserDms: z.boolean().default(false)
|
|
387
397
|
});
|
|
388
398
|
export class SlackOutputConfig extends BaseConfigInstance {
|
|
@@ -391,7 +401,7 @@ export class SlackOutputConfig extends BaseConfigInstance {
|
|
|
391
401
|
userIds;
|
|
392
402
|
userNames;
|
|
393
403
|
listenToUserDms;
|
|
394
|
-
constructor(integrationId, channelId, channelName, userIds, userNames, listenToUserDms = false) {
|
|
404
|
+
constructor(integrationId, channelId = null, channelName = null, userIds = null, userNames = null, listenToUserDms = false) {
|
|
395
405
|
super(integrationId, IntegrationType.SLACK, ConfigType.SLACK_OUTPUT);
|
|
396
406
|
this.channelId = channelId;
|
|
397
407
|
this.channelName = channelName;
|
|
@@ -489,15 +499,15 @@ export class NotionConfig extends BaseConfigInstance {
|
|
|
489
499
|
export const LinearInputConfigSchema = ConfigInstanceSchema.extend({
|
|
490
500
|
integrationType: z.literal(IntegrationType.LINEAR),
|
|
491
501
|
configType: z.literal(ConfigType.LINEAR_INPUT),
|
|
492
|
-
projectId: z.string().
|
|
493
|
-
projectName: z.string().
|
|
494
|
-
eventTypes: z.array(z.enum(LinearEventType)).
|
|
502
|
+
projectId: z.string().nullable(),
|
|
503
|
+
projectName: z.string().nullable(),
|
|
504
|
+
eventTypes: z.array(z.enum(LinearEventType)).nullable()
|
|
495
505
|
});
|
|
496
506
|
export class LinearInputConfig extends BaseConfigInstance {
|
|
497
507
|
projectId;
|
|
498
508
|
projectName;
|
|
499
509
|
eventTypes;
|
|
500
|
-
constructor(integrationId, projectId, projectName, eventTypes) {
|
|
510
|
+
constructor(integrationId, projectId = null, projectName = null, eventTypes = null) {
|
|
501
511
|
super(integrationId, IntegrationType.LINEAR, ConfigType.LINEAR_INPUT);
|
|
502
512
|
this.projectId = projectId;
|
|
503
513
|
this.projectName = projectName;
|
|
@@ -520,17 +530,17 @@ export class LinearInputConfig extends BaseConfigInstance {
|
|
|
520
530
|
export const LinearOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
521
531
|
integrationType: z.literal(IntegrationType.LINEAR),
|
|
522
532
|
configType: z.literal(ConfigType.LINEAR_OUTPUT),
|
|
523
|
-
teamId: z.string().
|
|
524
|
-
teamName: z.string().
|
|
525
|
-
projectId: z.string().
|
|
526
|
-
projectName: z.string().
|
|
533
|
+
teamId: z.string().nullable(),
|
|
534
|
+
teamName: z.string().nullable(),
|
|
535
|
+
projectId: z.string().nullable(),
|
|
536
|
+
projectName: z.string().nullable()
|
|
527
537
|
});
|
|
528
538
|
export class LinearOutputConfig extends BaseConfigInstance {
|
|
529
539
|
teamId;
|
|
530
540
|
teamName;
|
|
531
541
|
projectId;
|
|
532
542
|
projectName;
|
|
533
|
-
constructor(integrationId, teamId, teamName, projectId, projectName) {
|
|
543
|
+
constructor(integrationId, teamId = null, teamName = null, projectId = null, projectName = null) {
|
|
534
544
|
super(integrationId, IntegrationType.LINEAR, ConfigType.LINEAR_OUTPUT);
|
|
535
545
|
this.teamId = teamId;
|
|
536
546
|
this.teamName = teamName;
|
|
@@ -560,13 +570,13 @@ export class LinearOutputConfig extends BaseConfigInstance {
|
|
|
560
570
|
export const GitHubConfigSchema = ConfigInstanceSchema.extend({
|
|
561
571
|
integrationType: z.literal(IntegrationType.GITHUB),
|
|
562
572
|
configType: z.literal(ConfigType.GITHUB),
|
|
563
|
-
repositoryIds: z.array(z.number()),
|
|
564
|
-
eventTypes: z.array(z.enum(GitHubEventType)).
|
|
573
|
+
repositoryIds: z.array(z.number().int()),
|
|
574
|
+
eventTypes: z.array(z.enum(GitHubEventType)).nullable()
|
|
565
575
|
});
|
|
566
576
|
export class GitHubConfig extends BaseConfigInstance {
|
|
567
577
|
repositoryIds;
|
|
568
578
|
eventTypes;
|
|
569
|
-
constructor(integrationId, repositoryIds, eventTypes) {
|
|
579
|
+
constructor(integrationId, repositoryIds, eventTypes = null) {
|
|
570
580
|
super(integrationId, IntegrationType.GITHUB, ConfigType.GITHUB);
|
|
571
581
|
this.repositoryIds = repositoryIds;
|
|
572
582
|
this.eventTypes = eventTypes;
|
|
@@ -585,15 +595,15 @@ export class GitHubConfig extends BaseConfigInstance {
|
|
|
585
595
|
export const JiraConfigSchema = ConfigInstanceSchema.extend({
|
|
586
596
|
integrationType: z.literal(IntegrationType.ATLASSIAN),
|
|
587
597
|
configType: z.literal(ConfigType.JIRA),
|
|
588
|
-
projectKey: z.string().
|
|
589
|
-
projectId: z.string().
|
|
590
|
-
eventTypes: z.array(z.enum(JiraEventType)).
|
|
598
|
+
projectKey: z.string().nullable(),
|
|
599
|
+
projectId: z.string().nullable(),
|
|
600
|
+
eventTypes: z.array(z.enum(JiraEventType)).nullable()
|
|
591
601
|
});
|
|
592
602
|
export class JiraConfig extends BaseConfigInstance {
|
|
593
603
|
projectKey;
|
|
594
604
|
projectId;
|
|
595
605
|
eventTypes;
|
|
596
|
-
constructor(integrationId, projectKey, projectId, eventTypes) {
|
|
606
|
+
constructor(integrationId, projectKey = null, projectId = null, eventTypes = null) {
|
|
597
607
|
super(integrationId, IntegrationType.ATLASSIAN, ConfigType.JIRA);
|
|
598
608
|
this.projectKey = projectKey;
|
|
599
609
|
this.projectId = projectId;
|
|
@@ -658,12 +668,12 @@ export const PosthogConfigSchema = ConfigInstanceSchema.extend({
|
|
|
658
668
|
integrationType: z.literal(IntegrationType.POSTHOG),
|
|
659
669
|
configType: z.literal(ConfigType.POSTHOG),
|
|
660
670
|
projectId: z.string(),
|
|
661
|
-
projectName: z.string().
|
|
671
|
+
projectName: z.string().nullable()
|
|
662
672
|
});
|
|
663
673
|
export class PosthogConfig extends BaseConfigInstance {
|
|
664
674
|
projectId;
|
|
665
675
|
projectName;
|
|
666
|
-
constructor(integrationId, projectId, projectName) {
|
|
676
|
+
constructor(integrationId, projectId, projectName = null) {
|
|
667
677
|
super(integrationId, IntegrationType.POSTHOG, ConfigType.POSTHOG);
|
|
668
678
|
this.projectId = projectId;
|
|
669
679
|
this.projectName = projectName;
|
|
@@ -808,11 +818,11 @@ export class WorkOSOutputConfig extends BaseConfigInstance {
|
|
|
808
818
|
export const AttioOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
809
819
|
integrationType: z.literal(IntegrationType.ATTIO),
|
|
810
820
|
configType: z.literal(ConfigType.ATTIO_OUTPUT),
|
|
811
|
-
objectSlug: z.string().
|
|
821
|
+
objectSlug: z.string().nullable()
|
|
812
822
|
});
|
|
813
823
|
export class AttioOutputConfig extends BaseConfigInstance {
|
|
814
824
|
objectSlug;
|
|
815
|
-
constructor(integrationId, objectSlug) {
|
|
825
|
+
constructor(integrationId, objectSlug = null) {
|
|
816
826
|
super(integrationId, IntegrationType.ATTIO, ConfigType.ATTIO_OUTPUT);
|
|
817
827
|
this.objectSlug = objectSlug;
|
|
818
828
|
}
|
|
@@ -843,6 +853,248 @@ export class SnowflakeOutputConfig extends BaseConfigInstance {
|
|
|
843
853
|
return parts.join("\n");
|
|
844
854
|
}
|
|
845
855
|
}
|
|
856
|
+
export const WebhookInputConfigSchema = ConfigInstanceSchema.extend({
|
|
857
|
+
integrationId: z.literal("system"),
|
|
858
|
+
integrationType: z.literal(IntegrationType.WEBHOOK),
|
|
859
|
+
configType: z.literal(ConfigType.WEBHOOK_INPUT)
|
|
860
|
+
});
|
|
861
|
+
export class WebhookInputConfig extends BaseConfigInstance {
|
|
862
|
+
constructor() {
|
|
863
|
+
super("system", IntegrationType.WEBHOOK, ConfigType.WEBHOOK_INPUT);
|
|
864
|
+
}
|
|
865
|
+
isComplete() {
|
|
866
|
+
return true;
|
|
867
|
+
}
|
|
868
|
+
formatForAgent() {
|
|
869
|
+
return "Type: Webhook Trigger";
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
export const configDataSchema = z.union([
|
|
873
|
+
GmailConfigSchema,
|
|
874
|
+
FigmaConfigSchema,
|
|
875
|
+
SlackConfigSchema,
|
|
876
|
+
SlackOutputConfigSchema,
|
|
877
|
+
GmailOutputConfigSchema,
|
|
878
|
+
GmailDraftOutputConfigSchema,
|
|
879
|
+
NotionConfigSchema,
|
|
880
|
+
LinearInputConfigSchema,
|
|
881
|
+
LinearOutputConfigSchema,
|
|
882
|
+
GitHubConfigSchema,
|
|
883
|
+
JiraConfigSchema,
|
|
884
|
+
ConfluenceConfigSchema,
|
|
885
|
+
PosthogConfigSchema,
|
|
886
|
+
DatadogConfigSchema,
|
|
887
|
+
TimeTriggerConfigSchema,
|
|
888
|
+
LaunchDarklyConfigSchema,
|
|
889
|
+
TerseConfigSchema,
|
|
890
|
+
WorkOSInputConfigSchema,
|
|
891
|
+
WorkOSOutputConfigSchema,
|
|
892
|
+
AttioOutputConfigSchema,
|
|
893
|
+
SnowflakeOutputConfigSchema,
|
|
894
|
+
WebhookInputConfigSchema
|
|
895
|
+
]);
|
|
896
|
+
export function isConfigComplete(config) {
|
|
897
|
+
if (!config) {
|
|
898
|
+
return false;
|
|
899
|
+
}
|
|
900
|
+
switch (config.configType) {
|
|
901
|
+
case ConfigType.GMAIL:
|
|
902
|
+
case ConfigType.GMAIL_OUTPUT:
|
|
903
|
+
case ConfigType.GMAIL_DRAFT_OUTPUT:
|
|
904
|
+
case ConfigType.LINEAR_INPUT:
|
|
905
|
+
case ConfigType.JIRA:
|
|
906
|
+
case ConfigType.CONFLUENCE:
|
|
907
|
+
case ConfigType.TERSE:
|
|
908
|
+
case ConfigType.WEBHOOK_INPUT:
|
|
909
|
+
return true;
|
|
910
|
+
case ConfigType.FIGMA:
|
|
911
|
+
return !!(config.fileKey && config.teamId);
|
|
912
|
+
case ConfigType.SLACK:
|
|
913
|
+
return !!(config.channelId || config.listenToUserDms);
|
|
914
|
+
case ConfigType.SLACK_OUTPUT:
|
|
915
|
+
return !!(config.channelId || (config.userIds?.length ?? 0) > 0 || config.listenToUserDms);
|
|
916
|
+
case ConfigType.NOTION:
|
|
917
|
+
return (config.databaseIds?.length ?? 0) > 0 || (config.pageIds?.length ?? 0) > 0;
|
|
918
|
+
case ConfigType.LINEAR_OUTPUT:
|
|
919
|
+
case ConfigType.DATADOG:
|
|
920
|
+
case ConfigType.WORKOS_OUTPUT:
|
|
921
|
+
case ConfigType.SNOWFLAKE_OUTPUT:
|
|
922
|
+
return !!config.integrationId;
|
|
923
|
+
case ConfigType.GITHUB:
|
|
924
|
+
return (config.repositoryIds?.length ?? 0) > 0;
|
|
925
|
+
case ConfigType.POSTHOG:
|
|
926
|
+
return !!config.projectId;
|
|
927
|
+
case ConfigType.TIME_TRIGGER:
|
|
928
|
+
return !!config.cronExpression;
|
|
929
|
+
case ConfigType.LAUNCHDARKLY:
|
|
930
|
+
return !!(config.projectKey && config.environmentKeys.length > 0);
|
|
931
|
+
case ConfigType.WORKOS_INPUT:
|
|
932
|
+
return config.eventTypes.length > 0;
|
|
933
|
+
case ConfigType.ATTIO_OUTPUT:
|
|
934
|
+
return !!config.objectSlug;
|
|
935
|
+
default:
|
|
936
|
+
const _exhaustive = config;
|
|
937
|
+
return _exhaustive;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
export function formatConfigForAgent(config) {
|
|
941
|
+
switch (config.configType) {
|
|
942
|
+
case ConfigType.GMAIL:
|
|
943
|
+
return `Type: Gmail\nIntegration ID: ${config.integrationId}`;
|
|
944
|
+
case ConfigType.FIGMA: {
|
|
945
|
+
const parts = [`Type: Figma`, `Integration ID: ${config.integrationId}`];
|
|
946
|
+
if (config.fileName)
|
|
947
|
+
parts.push(`File: ${config.fileName}`);
|
|
948
|
+
if (config.fileKey)
|
|
949
|
+
parts.push(`File Key: ${config.fileKey}`);
|
|
950
|
+
return parts.join("\n");
|
|
951
|
+
}
|
|
952
|
+
case ConfigType.SLACK: {
|
|
953
|
+
const parts = [`Type: Slack`, `Integration ID: ${config.integrationId}`];
|
|
954
|
+
if (config.channelName) {
|
|
955
|
+
parts.push(`Channel: ${config.channelName}`);
|
|
956
|
+
}
|
|
957
|
+
else if (config.channelId) {
|
|
958
|
+
parts.push(`Channel ID: ${config.channelId}`);
|
|
959
|
+
}
|
|
960
|
+
if (config.listenToUserDms)
|
|
961
|
+
parts.push(`Listening to user DMs: Yes`);
|
|
962
|
+
if (config.userIds)
|
|
963
|
+
parts.push(`Users: ${config.userIds.join(", ")}`);
|
|
964
|
+
return parts.join("\n");
|
|
965
|
+
}
|
|
966
|
+
case ConfigType.SLACK_OUTPUT: {
|
|
967
|
+
const parts = [`Type: Slack Output`, `Integration ID: ${config.integrationId}`];
|
|
968
|
+
if (config.channelId)
|
|
969
|
+
parts.push(`Channel ID: ${config.channelId}`);
|
|
970
|
+
if (config.listenToUserDms)
|
|
971
|
+
parts.push(`Listen to user DMs: Yes`);
|
|
972
|
+
if (config.userIds?.length)
|
|
973
|
+
parts.push(`DM user IDs: ${config.userIds.join(", ")}`);
|
|
974
|
+
return parts.join("\n");
|
|
975
|
+
}
|
|
976
|
+
case ConfigType.GMAIL_OUTPUT:
|
|
977
|
+
return `Type: Gmail Output\nIntegration ID: ${config.integrationId}`;
|
|
978
|
+
case ConfigType.GMAIL_DRAFT_OUTPUT:
|
|
979
|
+
return `Type: Gmail Draft Output\nIntegration ID: ${config.integrationId}`;
|
|
980
|
+
case ConfigType.NOTION: {
|
|
981
|
+
const parts = [`Type: Notion`, `Integration ID: ${config.integrationId}`];
|
|
982
|
+
const dbIds = config.databaseIds ?? [];
|
|
983
|
+
const dbNames = config.databaseNames ?? [];
|
|
984
|
+
if (dbIds.length > 0) {
|
|
985
|
+
parts.push(`Databases: ${dbIds.map((id, i) => dbNames[i] || id).join(", ")}`);
|
|
986
|
+
}
|
|
987
|
+
const pageIds = config.pageIds ?? [];
|
|
988
|
+
const pageNames = config.pageNames ?? [];
|
|
989
|
+
if (pageIds.length > 0) {
|
|
990
|
+
parts.push(`Pages: ${pageIds.map((id, i) => pageNames[i] || id).join(", ")}`);
|
|
991
|
+
}
|
|
992
|
+
return parts.join("\n");
|
|
993
|
+
}
|
|
994
|
+
case ConfigType.LINEAR_INPUT: {
|
|
995
|
+
const parts = [`Type: Linear`, `Integration ID: ${config.integrationId}`];
|
|
996
|
+
if (config.projectName) {
|
|
997
|
+
parts.push(`Project: ${config.projectName}`);
|
|
998
|
+
}
|
|
999
|
+
else if (config.projectId) {
|
|
1000
|
+
parts.push(`Project ID: ${config.projectId}`);
|
|
1001
|
+
}
|
|
1002
|
+
return parts.join("\n");
|
|
1003
|
+
}
|
|
1004
|
+
case ConfigType.LINEAR_OUTPUT: {
|
|
1005
|
+
const parts = [`Type: Linear`, `Integration ID: ${config.integrationId}`];
|
|
1006
|
+
if (config.teamName) {
|
|
1007
|
+
parts.push(`Team: ${config.teamName}`);
|
|
1008
|
+
}
|
|
1009
|
+
else if (config.teamId) {
|
|
1010
|
+
parts.push(`Team ID: ${config.teamId}`);
|
|
1011
|
+
}
|
|
1012
|
+
if (config.projectName) {
|
|
1013
|
+
parts.push(`Project: ${config.projectName}`);
|
|
1014
|
+
}
|
|
1015
|
+
else if (config.projectId) {
|
|
1016
|
+
parts.push(`Project ID: ${config.projectId}`);
|
|
1017
|
+
}
|
|
1018
|
+
return parts.join("\n");
|
|
1019
|
+
}
|
|
1020
|
+
case ConfigType.GITHUB: {
|
|
1021
|
+
const parts = [`Type: GitHub`, `Integration ID: ${config.integrationId}`];
|
|
1022
|
+
if (config.repositoryIds.length > 0)
|
|
1023
|
+
parts.push(`Repositories: ${config.repositoryIds.join(", ")}`);
|
|
1024
|
+
return parts.join("\n");
|
|
1025
|
+
}
|
|
1026
|
+
case ConfigType.JIRA: {
|
|
1027
|
+
const parts = [`Type: Jira`, `Integration ID: ${config.integrationId}`];
|
|
1028
|
+
if (config.projectKey) {
|
|
1029
|
+
parts.push(`Project Key: ${config.projectKey}`);
|
|
1030
|
+
}
|
|
1031
|
+
else if (config.projectId) {
|
|
1032
|
+
parts.push(`Project ID: ${config.projectId}`);
|
|
1033
|
+
}
|
|
1034
|
+
return parts.join("\n");
|
|
1035
|
+
}
|
|
1036
|
+
case ConfigType.CONFLUENCE: {
|
|
1037
|
+
const parts = [`Type: Confluence`, `Integration ID: ${config.integrationId}`];
|
|
1038
|
+
if (config.spaceName)
|
|
1039
|
+
parts.push(`Space: ${config.spaceName}`);
|
|
1040
|
+
if (config.pageName) {
|
|
1041
|
+
parts.push(`Page: ${config.pageName}`);
|
|
1042
|
+
}
|
|
1043
|
+
else if (config.pageId) {
|
|
1044
|
+
parts.push(`Page ID: ${config.pageId}`);
|
|
1045
|
+
}
|
|
1046
|
+
return parts.join("\n");
|
|
1047
|
+
}
|
|
1048
|
+
case ConfigType.POSTHOG: {
|
|
1049
|
+
const parts = [`Type: Posthog`, `Integration ID: ${config.integrationId}`];
|
|
1050
|
+
if (config.projectId)
|
|
1051
|
+
parts.push(`Project ID: ${config.projectId}`);
|
|
1052
|
+
if (config.projectName)
|
|
1053
|
+
parts.push(`Project: ${config.projectName}`);
|
|
1054
|
+
return parts.join("\n");
|
|
1055
|
+
}
|
|
1056
|
+
case ConfigType.DATADOG: {
|
|
1057
|
+
const parts = [`Type: Datadog`, `Integration ID: ${config.integrationId}`];
|
|
1058
|
+
if (config.defaultIndexes?.length)
|
|
1059
|
+
parts.push(`Default indexes: ${config.defaultIndexes.join(", ")}`);
|
|
1060
|
+
return parts.join("\n");
|
|
1061
|
+
}
|
|
1062
|
+
case ConfigType.TIME_TRIGGER: {
|
|
1063
|
+
const parts = [`Type: Time Trigger`];
|
|
1064
|
+
if (config.cronExpression)
|
|
1065
|
+
parts.push(`Schedule (UTC): ${config.cronExpression}`);
|
|
1066
|
+
return parts.join("\n");
|
|
1067
|
+
}
|
|
1068
|
+
case ConfigType.LAUNCHDARKLY: {
|
|
1069
|
+
const parts = [`Type: LaunchDarkly`, `Integration ID: ${config.integrationId}`];
|
|
1070
|
+
if (config.projectKey)
|
|
1071
|
+
parts.push(`Project Key: ${config.projectKey}`);
|
|
1072
|
+
if (config.environmentKeys.length > 0)
|
|
1073
|
+
parts.push(`Environments: ${config.environmentKeys.join(", ")}`);
|
|
1074
|
+
return parts.join("\n");
|
|
1075
|
+
}
|
|
1076
|
+
case ConfigType.TERSE:
|
|
1077
|
+
return "Type: Terse Skills";
|
|
1078
|
+
case ConfigType.WORKOS_INPUT:
|
|
1079
|
+
return `Type: WorkOS Events\nListening for: ${config.eventTypes.join(", ")}`;
|
|
1080
|
+
case ConfigType.WORKOS_OUTPUT:
|
|
1081
|
+
return `Type: WorkOS Skill\nIntegration ID: ${config.integrationId}`;
|
|
1082
|
+
case ConfigType.ATTIO_OUTPUT: {
|
|
1083
|
+
const parts = [`Type: Attio Output`, `Integration ID: ${config.integrationId}`];
|
|
1084
|
+
if (config.objectSlug)
|
|
1085
|
+
parts.push(`Object: ${config.objectSlug}`);
|
|
1086
|
+
return parts.join("\n");
|
|
1087
|
+
}
|
|
1088
|
+
case ConfigType.SNOWFLAKE_OUTPUT:
|
|
1089
|
+
return `Type: Snowflake Output\nIntegration ID: ${config.integrationId}`;
|
|
1090
|
+
case ConfigType.WEBHOOK_INPUT:
|
|
1091
|
+
return "Type: Webhook Trigger";
|
|
1092
|
+
default: {
|
|
1093
|
+
const _exhaustive = config;
|
|
1094
|
+
return _exhaustive;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
846
1098
|
export const CONFIG_METADATA = {
|
|
847
1099
|
[ConfigType.GMAIL]: GmailConfig,
|
|
848
1100
|
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfig,
|
|
@@ -864,5 +1116,6 @@ export const CONFIG_METADATA = {
|
|
|
864
1116
|
[ConfigType.WORKOS_INPUT]: WorkOSInputConfig,
|
|
865
1117
|
[ConfigType.WORKOS_OUTPUT]: WorkOSOutputConfig,
|
|
866
1118
|
[ConfigType.ATTIO_OUTPUT]: AttioOutputConfig,
|
|
867
|
-
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfig
|
|
1119
|
+
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfig,
|
|
1120
|
+
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfig
|
|
868
1121
|
};
|
package/dist/Integrations.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export declare enum IntegrationType {
|
|
|
14
14
|
LAUNCHDARKLY = "launchdarkly",
|
|
15
15
|
WORKOS = "workos",
|
|
16
16
|
ATTIO = "attio",
|
|
17
|
-
SNOWFLAKE = "snowflake"
|
|
17
|
+
SNOWFLAKE = "snowflake",
|
|
18
|
+
WEBHOOK = "webhook"
|
|
18
19
|
}
|
|
19
20
|
export declare const integrationTypeEnum: z.ZodEnum<typeof IntegrationType>;
|
|
20
21
|
export interface IntegrationDetails {
|
|
@@ -129,6 +130,13 @@ export declare const SnowflakeIntegrationMetadata: {
|
|
|
129
130
|
readonly isInput: false;
|
|
130
131
|
readonly isOutput: true;
|
|
131
132
|
};
|
|
133
|
+
export declare const WebhookIntegrationMetadata: {
|
|
134
|
+
readonly type: IntegrationType.WEBHOOK;
|
|
135
|
+
readonly name: "Webhook";
|
|
136
|
+
readonly description: "Trigger via an external HTTP request to a generated URL";
|
|
137
|
+
readonly isInput: true;
|
|
138
|
+
readonly isOutput: false;
|
|
139
|
+
};
|
|
132
140
|
export type IntegrationMetadataMap = Record<IntegrationType, IntegrationDetails>;
|
|
133
141
|
export declare const INTEGRATION_METADATA: IntegrationMetadataMap;
|
|
134
142
|
export declare const IntegrationInstanceSchema: z.ZodObject<{
|
|
@@ -157,6 +165,7 @@ export type IntegrationInstallationOptions = EnsureExhaustiveInstallationOptions
|
|
|
157
165
|
[IntegrationType.WORKOS]: NoInstallationOptions;
|
|
158
166
|
[IntegrationType.ATTIO]: NoInstallationOptions;
|
|
159
167
|
[IntegrationType.SNOWFLAKE]: NoInstallationOptions;
|
|
168
|
+
[IntegrationType.WEBHOOK]: NoInstallationOptions;
|
|
160
169
|
}>;
|
|
161
170
|
export type InstallationOptionsFor<T extends IntegrationType> = IntegrationInstallationOptions[T];
|
|
162
171
|
export declare const SlackIntegrationSchema: z.ZodObject<{
|
package/dist/Integrations.js
CHANGED
|
@@ -17,6 +17,7 @@ export var IntegrationType;
|
|
|
17
17
|
IntegrationType["WORKOS"] = "workos";
|
|
18
18
|
IntegrationType["ATTIO"] = "attio";
|
|
19
19
|
IntegrationType["SNOWFLAKE"] = "snowflake";
|
|
20
|
+
IntegrationType["WEBHOOK"] = "webhook";
|
|
20
21
|
})(IntegrationType || (IntegrationType = {}));
|
|
21
22
|
export const integrationTypeEnum = z.enum(IntegrationType);
|
|
22
23
|
// Metadata objects - using const objects instead of classes
|
|
@@ -125,6 +126,13 @@ export const SnowflakeIntegrationMetadata = {
|
|
|
125
126
|
isInput: false,
|
|
126
127
|
isOutput: true
|
|
127
128
|
};
|
|
129
|
+
export const WebhookIntegrationMetadata = {
|
|
130
|
+
type: IntegrationType.WEBHOOK,
|
|
131
|
+
name: "Webhook",
|
|
132
|
+
description: "Trigger via an external HTTP request to a generated URL",
|
|
133
|
+
isInput: true,
|
|
134
|
+
isOutput: false
|
|
135
|
+
};
|
|
128
136
|
export const INTEGRATION_METADATA = {
|
|
129
137
|
[IntegrationType.GMAIL]: GmailIntegrationMetadata,
|
|
130
138
|
[IntegrationType.NOTION]: NotionIntegrationMetadata,
|
|
@@ -140,7 +148,8 @@ export const INTEGRATION_METADATA = {
|
|
|
140
148
|
[IntegrationType.LAUNCHDARKLY]: LaunchDarklyIntegrationMetadata,
|
|
141
149
|
[IntegrationType.WORKOS]: WorkOSIntegrationMetadata,
|
|
142
150
|
[IntegrationType.ATTIO]: AttioIntegrationMetadata,
|
|
143
|
-
[IntegrationType.SNOWFLAKE]: SnowflakeIntegrationMetadata
|
|
151
|
+
[IntegrationType.SNOWFLAKE]: SnowflakeIntegrationMetadata,
|
|
152
|
+
[IntegrationType.WEBHOOK]: WebhookIntegrationMetadata
|
|
144
153
|
};
|
|
145
154
|
// MARK: Integration Details
|
|
146
155
|
export const IntegrationInstanceSchema = z.object({
|
|
@@ -173,7 +182,7 @@ export const AtlassianIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
|
173
182
|
projectName: z.string().optional()
|
|
174
183
|
});
|
|
175
184
|
export const GithubIntegrationSchema = IntegrationInstanceSchema.extend({
|
|
176
|
-
installation_id: z.number(),
|
|
185
|
+
installation_id: z.number().int(),
|
|
177
186
|
account_name: z.string().optional()
|
|
178
187
|
});
|
|
179
188
|
export const LinearIntegrationSchema = IntegrationInstanceSchema.extend({
|