@automate.ax/catalog 0.124.0 → 0.126.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/catalog.d.ts CHANGED
@@ -64,6 +64,24 @@ export declare const apolloService: {
64
64
  readonly name: "Apollo";
65
65
  readonly preferredConnectionMethodId: "oauth";
66
66
  };
67
+ export declare const apifyService: {
68
+ readonly connectionMethods: readonly [{
69
+ readonly credentialUrl: "https://console.apify.com/settings/integrations";
70
+ readonly fields: readonly [{
71
+ readonly input: "password";
72
+ readonly label: "API token";
73
+ readonly name: "apiKey";
74
+ readonly placeholder: "apify_api_...";
75
+ readonly required: true;
76
+ }];
77
+ readonly id: "api-token";
78
+ readonly name: "API token";
79
+ readonly type: "form";
80
+ }];
81
+ readonly description: "Connect an Apify account with an API token.";
82
+ readonly id: "apify";
83
+ readonly name: "Apify";
84
+ };
67
85
  export declare const asanaService: {
68
86
  readonly connectionMethods: readonly [{
69
87
  readonly id: "oauth";
@@ -732,6 +750,24 @@ export declare const resendService: {
732
750
  readonly name: "Resend";
733
751
  readonly preferredConnectionMethodId: "oauth";
734
752
  };
753
+ export declare const redditService: {
754
+ readonly connectionMethods: readonly [{
755
+ readonly id: "oauth";
756
+ readonly name: "OAuth";
757
+ readonly type: "redirect";
758
+ }];
759
+ readonly connectionNotice: {
760
+ readonly action: {
761
+ readonly href: "https://support.reddithelp.com/hc/en-us/articles/14945211791892-Reddit-Data-API-Wiki";
762
+ readonly label: "Review Reddit API access";
763
+ };
764
+ readonly description: "Reddit requires approval for commercial Data API access. Connect only an approved Reddit application.";
765
+ readonly title: "Reddit approval required";
766
+ };
767
+ readonly description: "Connect a Reddit account with OAuth.";
768
+ readonly id: "reddit";
769
+ readonly name: "Reddit";
770
+ };
735
771
  export declare const scrapflyService: {
736
772
  readonly id: "scrapfly";
737
773
  readonly name: string;
@@ -995,6 +1031,23 @@ export declare const integrationCatalog: readonly [{
995
1031
  readonly id: "apollo";
996
1032
  readonly name: "Apollo";
997
1033
  readonly preferredConnectionMethodId: "oauth";
1034
+ }, {
1035
+ readonly connectionMethods: readonly [{
1036
+ readonly credentialUrl: "https://console.apify.com/settings/integrations";
1037
+ readonly fields: readonly [{
1038
+ readonly input: "password";
1039
+ readonly label: "API token";
1040
+ readonly name: "apiKey";
1041
+ readonly placeholder: "apify_api_...";
1042
+ readonly required: true;
1043
+ }];
1044
+ readonly id: "api-token";
1045
+ readonly name: "API token";
1046
+ readonly type: "form";
1047
+ }];
1048
+ readonly description: "Connect an Apify account with an API token.";
1049
+ readonly id: "apify";
1050
+ readonly name: "Apify";
998
1051
  }, {
999
1052
  readonly connectionMethods: readonly [{
1000
1053
  readonly id: "oauth";
@@ -1609,6 +1662,23 @@ export declare const integrationCatalog: readonly [{
1609
1662
  readonly description: "Connect a PostgreSQL database with a least-privilege role.";
1610
1663
  readonly id: "postgres";
1611
1664
  readonly name: "PostgreSQL";
1665
+ }, {
1666
+ readonly connectionMethods: readonly [{
1667
+ readonly id: "oauth";
1668
+ readonly name: "OAuth";
1669
+ readonly type: "redirect";
1670
+ }];
1671
+ readonly connectionNotice: {
1672
+ readonly action: {
1673
+ readonly href: "https://support.reddithelp.com/hc/en-us/articles/14945211791892-Reddit-Data-API-Wiki";
1674
+ readonly label: "Review Reddit API access";
1675
+ };
1676
+ readonly description: "Reddit requires approval for commercial Data API access. Connect only an approved Reddit application.";
1677
+ readonly title: "Reddit approval required";
1678
+ };
1679
+ readonly description: "Connect a Reddit account with OAuth.";
1680
+ readonly id: "reddit";
1681
+ readonly name: "Reddit";
1612
1682
  }, {
1613
1683
  readonly connectionMethods: readonly [{
1614
1684
  readonly id: "oauth";
package/dist/catalog.js CHANGED
@@ -50,6 +50,28 @@ export const apolloService = defineIntegrationService({
50
50
  name: "Apollo",
51
51
  preferredConnectionMethodId: "oauth",
52
52
  });
53
+ export const apifyService = defineIntegrationService({
54
+ connectionMethods: [
55
+ {
56
+ credentialUrl: "https://console.apify.com/settings/integrations",
57
+ fields: [
58
+ {
59
+ input: "password",
60
+ label: "API token",
61
+ name: "apiKey",
62
+ placeholder: "apify_api_...",
63
+ required: true,
64
+ },
65
+ ],
66
+ id: "api-token",
67
+ name: "API token",
68
+ type: "form",
69
+ },
70
+ ],
71
+ description: "Connect an Apify account with an API token.",
72
+ id: "apify",
73
+ name: "Apify",
74
+ });
53
75
  export const asanaService = defineIntegrationService({
54
76
  connectionMethods: [{ id: "oauth", name: "OAuth", type: "redirect" }],
55
77
  description: "Connect an Asana account.",
@@ -488,6 +510,20 @@ export const resendService = defineIntegrationService({
488
510
  name: "Resend",
489
511
  preferredConnectionMethodId: "oauth",
490
512
  });
513
+ export const redditService = defineIntegrationService({
514
+ connectionMethods: [{ id: "oauth", name: "OAuth", type: "redirect" }],
515
+ connectionNotice: {
516
+ action: {
517
+ href: "https://support.reddithelp.com/hc/en-us/articles/14945211791892-Reddit-Data-API-Wiki",
518
+ label: "Review Reddit API access",
519
+ },
520
+ description: "Reddit requires approval for commercial Data API access. Connect only an approved Reddit application.",
521
+ title: "Reddit approval required",
522
+ },
523
+ description: "Connect a Reddit account with OAuth.",
524
+ id: "reddit",
525
+ name: "Reddit",
526
+ });
491
527
  export const scrapflyService = defineApiKeyService({
492
528
  credentialUrl: "https://scrapfly.io/dashboard/project",
493
529
  description: "Connect a Scrapfly API key.",
@@ -620,6 +656,7 @@ export const integrationCatalog = defineIntegrationCatalog([
620
656
  airtableService,
621
657
  anthropicService,
622
658
  apolloService,
659
+ apifyService,
623
660
  asanaService,
624
661
  automateService,
625
662
  brevoService,
@@ -652,6 +689,7 @@ export const integrationCatalog = defineIntegrationCatalog([
652
689
  openrouterService,
653
690
  perplexityService,
654
691
  postgresService,
692
+ redditService,
655
693
  resendService,
656
694
  scrapflyService,
657
695
  slackService,
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { airtableService, anthropicService, apolloService, asanaService, automateService, brevoService, browserbaseService, cerebrasService, chatgptService, cloudflareService, closeService, codexService, cohereService, convexService, deepinfraService, deepseekService, firecrawlService, fireworksService, getIntegrationService, githubService, googleGenaiService, googleService, groqService, huggingfaceService, hubspotService, integrationCatalog, jobNimbusService, linearService, microsoftService, millionverifierService, mistralService, notionService, openaiService, onePasswordService, openrouterService, perplexityService, postgresService, resendService, scrapflyService, slackService, stripeService, tidycalService, togetheraiService, trelloService, vercelAiGatewayService, vercelService, webflowService, whatsappService, xaiService, type IntegrationServiceId, } from "./catalog.js";
1
+ export { airtableService, anthropicService, apolloService, apifyService, asanaService, automateService, brevoService, browserbaseService, cerebrasService, chatgptService, cloudflareService, closeService, codexService, cohereService, convexService, deepinfraService, deepseekService, firecrawlService, fireworksService, getIntegrationService, githubService, googleGenaiService, googleService, groqService, huggingfaceService, hubspotService, integrationCatalog, jobNimbusService, linearService, microsoftService, millionverifierService, mistralService, notionService, openaiService, onePasswordService, openrouterService, perplexityService, postgresService, redditService, resendService, scrapflyService, slackService, stripeService, tidycalService, togetheraiService, trelloService, vercelAiGatewayService, vercelService, webflowService, whatsappService, xaiService, type IntegrationServiceId, } from "./catalog.js";
2
2
  export { defineIntegrationCatalog, defineIntegrationService, integrationScope, type IntegrationAccountConnectionOption, type IntegrationAccountRequirement, type IntegrationConnectionDefinition, type IntegrationConnectionNotice, type IntegrationFormField, type IntegrationScopeRequirement, type IntegrationServiceDefinition, type ScopeRequirementGroup, type TriggerAccountRequirement, type TriggerDefinition, type TriggerPresentation, type TriggerPresentationContext, type TriggerPresentationDetail, type TriggerScopePresentation, type TriggerPresentationValue, } from "./types.js";
3
3
  export { getDashboardRunEndpoint, getDashboardRunEndpointKey, getHttpTriggerEndpoint, getHttpTriggerEndpointKey, getMailhookAddress, getMailhookAddressKey, DASHBOARD_RUN_CONFIG_SCHEMA, getTriggerDefinition, getTriggerName, getTriggerPresentation, isTriggerVisible, PLATFORM_EMAIL_DOMAIN, triggerCatalog, triggerDefinitions, type DashboardRunConfig, type DashboardRunEndpointOptions, type DashboardRunField, type HttpTriggerEndpointOptions, type HttpTriggerScope, type MailhookAddressOptions, type MailhookScope, type TriggerType, } from "./triggers/index.js";
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { airtableService, anthropicService, apolloService, asanaService, automateService, brevoService, browserbaseService, cerebrasService, chatgptService, cloudflareService, closeService, codexService, cohereService, convexService, deepinfraService, deepseekService, firecrawlService, fireworksService, getIntegrationService, githubService, googleGenaiService, googleService, groqService, huggingfaceService, hubspotService, integrationCatalog, jobNimbusService, linearService, microsoftService, millionverifierService, mistralService, notionService, openaiService, onePasswordService, openrouterService, perplexityService, postgresService, resendService, scrapflyService, slackService, stripeService, tidycalService, togetheraiService, trelloService, vercelAiGatewayService, vercelService, webflowService, whatsappService, xaiService, } from "./catalog.js";
1
+ export { airtableService, anthropicService, apolloService, apifyService, asanaService, automateService, brevoService, browserbaseService, cerebrasService, chatgptService, cloudflareService, closeService, codexService, cohereService, convexService, deepinfraService, deepseekService, firecrawlService, fireworksService, getIntegrationService, githubService, googleGenaiService, googleService, groqService, huggingfaceService, hubspotService, integrationCatalog, jobNimbusService, linearService, microsoftService, millionverifierService, mistralService, notionService, openaiService, onePasswordService, openrouterService, perplexityService, postgresService, redditService, resendService, scrapflyService, slackService, stripeService, tidycalService, togetheraiService, trelloService, vercelAiGatewayService, vercelService, webflowService, whatsappService, xaiService, } from "./catalog.js";
2
2
  export { defineIntegrationCatalog, defineIntegrationService, integrationScope, } from "./types.js";
3
3
  export { getDashboardRunEndpoint, getDashboardRunEndpointKey, getHttpTriggerEndpoint, getHttpTriggerEndpointKey, getMailhookAddress, getMailhookAddressKey, DASHBOARD_RUN_CONFIG_SCHEMA, getTriggerDefinition, getTriggerName, getTriggerPresentation, isTriggerVisible, PLATFORM_EMAIL_DOMAIN, triggerCatalog, triggerDefinitions, } from "./triggers/index.js";
@@ -0,0 +1,132 @@
1
+ export declare const apifyTriggerDefinitions: {
2
+ readonly apifyActorBuildAborted: {
3
+ readonly account: {
4
+ readonly connectionOptions: readonly [{
5
+ readonly connectionMethodId: "api-token";
6
+ readonly requiredScopes: readonly [];
7
+ }];
8
+ readonly serviceId: "apify";
9
+ };
10
+ readonly type: "apify.actorBuild.aborted";
11
+ };
12
+ readonly apifyActorBuildCreated: {
13
+ readonly account: {
14
+ readonly connectionOptions: readonly [{
15
+ readonly connectionMethodId: "api-token";
16
+ readonly requiredScopes: readonly [];
17
+ }];
18
+ readonly serviceId: "apify";
19
+ };
20
+ readonly type: "apify.actorBuild.created";
21
+ };
22
+ readonly apifyActorBuildEvent: {
23
+ readonly account: {
24
+ readonly connectionOptions: readonly [{
25
+ readonly connectionMethodId: "api-token";
26
+ readonly requiredScopes: readonly [];
27
+ }];
28
+ readonly serviceId: "apify";
29
+ };
30
+ readonly type: "apify.actorBuild.event";
31
+ };
32
+ readonly apifyActorBuildFailed: {
33
+ readonly account: {
34
+ readonly connectionOptions: readonly [{
35
+ readonly connectionMethodId: "api-token";
36
+ readonly requiredScopes: readonly [];
37
+ }];
38
+ readonly serviceId: "apify";
39
+ };
40
+ readonly type: "apify.actorBuild.failed";
41
+ };
42
+ readonly apifyActorBuildSucceeded: {
43
+ readonly account: {
44
+ readonly connectionOptions: readonly [{
45
+ readonly connectionMethodId: "api-token";
46
+ readonly requiredScopes: readonly [];
47
+ }];
48
+ readonly serviceId: "apify";
49
+ };
50
+ readonly type: "apify.actorBuild.succeeded";
51
+ };
52
+ readonly apifyActorBuildTimedOut: {
53
+ readonly account: {
54
+ readonly connectionOptions: readonly [{
55
+ readonly connectionMethodId: "api-token";
56
+ readonly requiredScopes: readonly [];
57
+ }];
58
+ readonly serviceId: "apify";
59
+ };
60
+ readonly type: "apify.actorBuild.timedOut";
61
+ };
62
+ readonly apifyActorRunAborted: {
63
+ readonly account: {
64
+ readonly connectionOptions: readonly [{
65
+ readonly connectionMethodId: "api-token";
66
+ readonly requiredScopes: readonly [];
67
+ }];
68
+ readonly serviceId: "apify";
69
+ };
70
+ readonly type: "apify.actorRun.aborted";
71
+ };
72
+ readonly apifyActorRunCreated: {
73
+ readonly account: {
74
+ readonly connectionOptions: readonly [{
75
+ readonly connectionMethodId: "api-token";
76
+ readonly requiredScopes: readonly [];
77
+ }];
78
+ readonly serviceId: "apify";
79
+ };
80
+ readonly type: "apify.actorRun.created";
81
+ };
82
+ readonly apifyActorRunEvent: {
83
+ readonly account: {
84
+ readonly connectionOptions: readonly [{
85
+ readonly connectionMethodId: "api-token";
86
+ readonly requiredScopes: readonly [];
87
+ }];
88
+ readonly serviceId: "apify";
89
+ };
90
+ readonly type: "apify.actorRun.event";
91
+ };
92
+ readonly apifyActorRunFailed: {
93
+ readonly account: {
94
+ readonly connectionOptions: readonly [{
95
+ readonly connectionMethodId: "api-token";
96
+ readonly requiredScopes: readonly [];
97
+ }];
98
+ readonly serviceId: "apify";
99
+ };
100
+ readonly type: "apify.actorRun.failed";
101
+ };
102
+ readonly apifyActorRunResurrected: {
103
+ readonly account: {
104
+ readonly connectionOptions: readonly [{
105
+ readonly connectionMethodId: "api-token";
106
+ readonly requiredScopes: readonly [];
107
+ }];
108
+ readonly serviceId: "apify";
109
+ };
110
+ readonly type: "apify.actorRun.resurrected";
111
+ };
112
+ readonly apifyActorRunSucceeded: {
113
+ readonly account: {
114
+ readonly connectionOptions: readonly [{
115
+ readonly connectionMethodId: "api-token";
116
+ readonly requiredScopes: readonly [];
117
+ }];
118
+ readonly serviceId: "apify";
119
+ };
120
+ readonly type: "apify.actorRun.succeeded";
121
+ };
122
+ readonly apifyActorRunTimedOut: {
123
+ readonly account: {
124
+ readonly connectionOptions: readonly [{
125
+ readonly connectionMethodId: "api-token";
126
+ readonly requiredScopes: readonly [];
127
+ }];
128
+ readonly serviceId: "apify";
129
+ };
130
+ readonly type: "apify.actorRun.timedOut";
131
+ };
132
+ };
@@ -0,0 +1,27 @@
1
+ const APIFY_ACCOUNT = {
2
+ connectionOptions: [{ connectionMethodId: "api-token", requiredScopes: [] }],
3
+ serviceId: "apify",
4
+ };
5
+ export const apifyTriggerDefinitions = {
6
+ apifyActorBuildAborted: apifyTrigger("apify.actorBuild.aborted"),
7
+ apifyActorBuildCreated: apifyTrigger("apify.actorBuild.created"),
8
+ apifyActorBuildEvent: apifyTrigger("apify.actorBuild.event"),
9
+ apifyActorBuildFailed: apifyTrigger("apify.actorBuild.failed"),
10
+ apifyActorBuildSucceeded: apifyTrigger("apify.actorBuild.succeeded"),
11
+ apifyActorBuildTimedOut: apifyTrigger("apify.actorBuild.timedOut"),
12
+ apifyActorRunAborted: apifyTrigger("apify.actorRun.aborted"),
13
+ apifyActorRunCreated: apifyTrigger("apify.actorRun.created"),
14
+ apifyActorRunEvent: apifyTrigger("apify.actorRun.event"),
15
+ apifyActorRunFailed: apifyTrigger("apify.actorRun.failed"),
16
+ apifyActorRunResurrected: apifyTrigger("apify.actorRun.resurrected"),
17
+ apifyActorRunSucceeded: apifyTrigger("apify.actorRun.succeeded"),
18
+ apifyActorRunTimedOut: apifyTrigger("apify.actorRun.timedOut"),
19
+ };
20
+ /**
21
+ * Creates one Apify trigger definition with its shared account requirement.
22
+ *
23
+ * @param type - Registered Apify event type.
24
+ */
25
+ function apifyTrigger(type) {
26
+ return { account: APIFY_ACCOUNT, type };
27
+ }
@@ -1836,6 +1836,43 @@ export declare const triggerDefinitions: {
1836
1836
  };
1837
1837
  readonly type: "resend.suppression.removed";
1838
1838
  };
1839
+ readonly redditSubredditEvent: {
1840
+ account: import("..").IntegrationAccountRequirement<"reddit">;
1841
+ getPrimary: (context: TriggerPresentationContext) => {
1842
+ value: string;
1843
+ };
1844
+ name: string;
1845
+ type: "reddit.subreddit.event";
1846
+ };
1847
+ readonly redditNewPost: {
1848
+ account: import("..").IntegrationAccountRequirement<"reddit">;
1849
+ getPrimary: (context: TriggerPresentationContext) => {
1850
+ value: string;
1851
+ };
1852
+ name: string;
1853
+ type: "reddit.subreddit.post.created";
1854
+ };
1855
+ readonly redditNewComment: {
1856
+ account: import("..").IntegrationAccountRequirement<"reddit">;
1857
+ getPrimary: (context: TriggerPresentationContext) => {
1858
+ value: string;
1859
+ };
1860
+ name: string;
1861
+ type: "reddit.subreddit.comment.created";
1862
+ };
1863
+ readonly redditNewInboxItem: {
1864
+ readonly account: import("..").IntegrationAccountRequirement<"reddit">;
1865
+ readonly name: "New Reddit inbox item";
1866
+ readonly type: "reddit.inbox.item.received";
1867
+ };
1868
+ readonly redditNewModQueueItem: {
1869
+ readonly account: import("..").IntegrationAccountRequirement<"reddit">;
1870
+ readonly getPrimary: (context: TriggerPresentationContext) => {
1871
+ value: string;
1872
+ };
1873
+ readonly name: "New Reddit mod queue item";
1874
+ readonly type: "reddit.modQueue.item.received";
1875
+ };
1839
1876
  readonly notionCommentCreated: {
1840
1877
  account: import("..").IntegrationAccountRequirement<"notion">;
1841
1878
  type: "notion.comment.created";
@@ -7153,6 +7190,136 @@ export declare const triggerDefinitions: {
7153
7190
  readonly account: import("..").IntegrationAccountRequirement<"airtable">;
7154
7191
  readonly type: "airtable.table.updated";
7155
7192
  };
7193
+ readonly apifyActorBuildAborted: {
7194
+ readonly account: {
7195
+ readonly connectionOptions: readonly [{
7196
+ readonly connectionMethodId: "api-token";
7197
+ readonly requiredScopes: readonly [];
7198
+ }];
7199
+ readonly serviceId: "apify";
7200
+ };
7201
+ readonly type: "apify.actorBuild.aborted";
7202
+ };
7203
+ readonly apifyActorBuildCreated: {
7204
+ readonly account: {
7205
+ readonly connectionOptions: readonly [{
7206
+ readonly connectionMethodId: "api-token";
7207
+ readonly requiredScopes: readonly [];
7208
+ }];
7209
+ readonly serviceId: "apify";
7210
+ };
7211
+ readonly type: "apify.actorBuild.created";
7212
+ };
7213
+ readonly apifyActorBuildEvent: {
7214
+ readonly account: {
7215
+ readonly connectionOptions: readonly [{
7216
+ readonly connectionMethodId: "api-token";
7217
+ readonly requiredScopes: readonly [];
7218
+ }];
7219
+ readonly serviceId: "apify";
7220
+ };
7221
+ readonly type: "apify.actorBuild.event";
7222
+ };
7223
+ readonly apifyActorBuildFailed: {
7224
+ readonly account: {
7225
+ readonly connectionOptions: readonly [{
7226
+ readonly connectionMethodId: "api-token";
7227
+ readonly requiredScopes: readonly [];
7228
+ }];
7229
+ readonly serviceId: "apify";
7230
+ };
7231
+ readonly type: "apify.actorBuild.failed";
7232
+ };
7233
+ readonly apifyActorBuildSucceeded: {
7234
+ readonly account: {
7235
+ readonly connectionOptions: readonly [{
7236
+ readonly connectionMethodId: "api-token";
7237
+ readonly requiredScopes: readonly [];
7238
+ }];
7239
+ readonly serviceId: "apify";
7240
+ };
7241
+ readonly type: "apify.actorBuild.succeeded";
7242
+ };
7243
+ readonly apifyActorBuildTimedOut: {
7244
+ readonly account: {
7245
+ readonly connectionOptions: readonly [{
7246
+ readonly connectionMethodId: "api-token";
7247
+ readonly requiredScopes: readonly [];
7248
+ }];
7249
+ readonly serviceId: "apify";
7250
+ };
7251
+ readonly type: "apify.actorBuild.timedOut";
7252
+ };
7253
+ readonly apifyActorRunAborted: {
7254
+ readonly account: {
7255
+ readonly connectionOptions: readonly [{
7256
+ readonly connectionMethodId: "api-token";
7257
+ readonly requiredScopes: readonly [];
7258
+ }];
7259
+ readonly serviceId: "apify";
7260
+ };
7261
+ readonly type: "apify.actorRun.aborted";
7262
+ };
7263
+ readonly apifyActorRunCreated: {
7264
+ readonly account: {
7265
+ readonly connectionOptions: readonly [{
7266
+ readonly connectionMethodId: "api-token";
7267
+ readonly requiredScopes: readonly [];
7268
+ }];
7269
+ readonly serviceId: "apify";
7270
+ };
7271
+ readonly type: "apify.actorRun.created";
7272
+ };
7273
+ readonly apifyActorRunEvent: {
7274
+ readonly account: {
7275
+ readonly connectionOptions: readonly [{
7276
+ readonly connectionMethodId: "api-token";
7277
+ readonly requiredScopes: readonly [];
7278
+ }];
7279
+ readonly serviceId: "apify";
7280
+ };
7281
+ readonly type: "apify.actorRun.event";
7282
+ };
7283
+ readonly apifyActorRunFailed: {
7284
+ readonly account: {
7285
+ readonly connectionOptions: readonly [{
7286
+ readonly connectionMethodId: "api-token";
7287
+ readonly requiredScopes: readonly [];
7288
+ }];
7289
+ readonly serviceId: "apify";
7290
+ };
7291
+ readonly type: "apify.actorRun.failed";
7292
+ };
7293
+ readonly apifyActorRunResurrected: {
7294
+ readonly account: {
7295
+ readonly connectionOptions: readonly [{
7296
+ readonly connectionMethodId: "api-token";
7297
+ readonly requiredScopes: readonly [];
7298
+ }];
7299
+ readonly serviceId: "apify";
7300
+ };
7301
+ readonly type: "apify.actorRun.resurrected";
7302
+ };
7303
+ readonly apifyActorRunSucceeded: {
7304
+ readonly account: {
7305
+ readonly connectionOptions: readonly [{
7306
+ readonly connectionMethodId: "api-token";
7307
+ readonly requiredScopes: readonly [];
7308
+ }];
7309
+ readonly serviceId: "apify";
7310
+ };
7311
+ readonly type: "apify.actorRun.succeeded";
7312
+ };
7313
+ readonly apifyActorRunTimedOut: {
7314
+ readonly account: {
7315
+ readonly connectionOptions: readonly [{
7316
+ readonly connectionMethodId: "api-token";
7317
+ readonly requiredScopes: readonly [];
7318
+ }];
7319
+ readonly serviceId: "apify";
7320
+ };
7321
+ readonly type: "apify.actorRun.timedOut";
7322
+ };
7156
7323
  };
7157
7324
  /** Trigger definitions with inferred display names materialized. */
7158
7325
  export declare const triggerCatalog: ({
@@ -7203,6 +7370,136 @@ export declare const triggerCatalog: ({
7203
7370
  name: string;
7204
7371
  account: import("..").IntegrationAccountRequirement<"airtable">;
7205
7372
  type: "airtable.table.updated";
7373
+ } | {
7374
+ name: string;
7375
+ account: {
7376
+ readonly connectionOptions: readonly [{
7377
+ readonly connectionMethodId: "api-token";
7378
+ readonly requiredScopes: readonly [];
7379
+ }];
7380
+ readonly serviceId: "apify";
7381
+ };
7382
+ type: "apify.actorBuild.aborted";
7383
+ } | {
7384
+ name: string;
7385
+ account: {
7386
+ readonly connectionOptions: readonly [{
7387
+ readonly connectionMethodId: "api-token";
7388
+ readonly requiredScopes: readonly [];
7389
+ }];
7390
+ readonly serviceId: "apify";
7391
+ };
7392
+ type: "apify.actorBuild.created";
7393
+ } | {
7394
+ name: string;
7395
+ account: {
7396
+ readonly connectionOptions: readonly [{
7397
+ readonly connectionMethodId: "api-token";
7398
+ readonly requiredScopes: readonly [];
7399
+ }];
7400
+ readonly serviceId: "apify";
7401
+ };
7402
+ type: "apify.actorBuild.event";
7403
+ } | {
7404
+ name: string;
7405
+ account: {
7406
+ readonly connectionOptions: readonly [{
7407
+ readonly connectionMethodId: "api-token";
7408
+ readonly requiredScopes: readonly [];
7409
+ }];
7410
+ readonly serviceId: "apify";
7411
+ };
7412
+ type: "apify.actorBuild.failed";
7413
+ } | {
7414
+ name: string;
7415
+ account: {
7416
+ readonly connectionOptions: readonly [{
7417
+ readonly connectionMethodId: "api-token";
7418
+ readonly requiredScopes: readonly [];
7419
+ }];
7420
+ readonly serviceId: "apify";
7421
+ };
7422
+ type: "apify.actorBuild.succeeded";
7423
+ } | {
7424
+ name: string;
7425
+ account: {
7426
+ readonly connectionOptions: readonly [{
7427
+ readonly connectionMethodId: "api-token";
7428
+ readonly requiredScopes: readonly [];
7429
+ }];
7430
+ readonly serviceId: "apify";
7431
+ };
7432
+ type: "apify.actorBuild.timedOut";
7433
+ } | {
7434
+ name: string;
7435
+ account: {
7436
+ readonly connectionOptions: readonly [{
7437
+ readonly connectionMethodId: "api-token";
7438
+ readonly requiredScopes: readonly [];
7439
+ }];
7440
+ readonly serviceId: "apify";
7441
+ };
7442
+ type: "apify.actorRun.aborted";
7443
+ } | {
7444
+ name: string;
7445
+ account: {
7446
+ readonly connectionOptions: readonly [{
7447
+ readonly connectionMethodId: "api-token";
7448
+ readonly requiredScopes: readonly [];
7449
+ }];
7450
+ readonly serviceId: "apify";
7451
+ };
7452
+ type: "apify.actorRun.created";
7453
+ } | {
7454
+ name: string;
7455
+ account: {
7456
+ readonly connectionOptions: readonly [{
7457
+ readonly connectionMethodId: "api-token";
7458
+ readonly requiredScopes: readonly [];
7459
+ }];
7460
+ readonly serviceId: "apify";
7461
+ };
7462
+ type: "apify.actorRun.event";
7463
+ } | {
7464
+ name: string;
7465
+ account: {
7466
+ readonly connectionOptions: readonly [{
7467
+ readonly connectionMethodId: "api-token";
7468
+ readonly requiredScopes: readonly [];
7469
+ }];
7470
+ readonly serviceId: "apify";
7471
+ };
7472
+ type: "apify.actorRun.failed";
7473
+ } | {
7474
+ name: string;
7475
+ account: {
7476
+ readonly connectionOptions: readonly [{
7477
+ readonly connectionMethodId: "api-token";
7478
+ readonly requiredScopes: readonly [];
7479
+ }];
7480
+ readonly serviceId: "apify";
7481
+ };
7482
+ type: "apify.actorRun.resurrected";
7483
+ } | {
7484
+ name: string;
7485
+ account: {
7486
+ readonly connectionOptions: readonly [{
7487
+ readonly connectionMethodId: "api-token";
7488
+ readonly requiredScopes: readonly [];
7489
+ }];
7490
+ readonly serviceId: "apify";
7491
+ };
7492
+ type: "apify.actorRun.succeeded";
7493
+ } | {
7494
+ name: string;
7495
+ account: {
7496
+ readonly connectionOptions: readonly [{
7497
+ readonly connectionMethodId: "api-token";
7498
+ readonly requiredScopes: readonly [];
7499
+ }];
7500
+ readonly serviceId: "apify";
7501
+ };
7502
+ type: "apify.actorRun.timedOut";
7206
7503
  } | {
7207
7504
  name: string;
7208
7505
  account: {
@@ -12366,6 +12663,38 @@ export declare const triggerCatalog: ({
12366
12663
  name: string;
12367
12664
  account: import("..").IntegrationAccountRequirement<"notion">;
12368
12665
  type: "notion.view.updated";
12666
+ } | {
12667
+ name: string;
12668
+ account: import("..").IntegrationAccountRequirement<"reddit">;
12669
+ getPrimary: (context: TriggerPresentationContext) => {
12670
+ value: string;
12671
+ };
12672
+ type: "reddit.subreddit.event";
12673
+ } | {
12674
+ name: string;
12675
+ account: import("..").IntegrationAccountRequirement<"reddit">;
12676
+ getPrimary: (context: TriggerPresentationContext) => {
12677
+ value: string;
12678
+ };
12679
+ type: "reddit.subreddit.post.created";
12680
+ } | {
12681
+ name: string;
12682
+ account: import("..").IntegrationAccountRequirement<"reddit">;
12683
+ getPrimary: (context: TriggerPresentationContext) => {
12684
+ value: string;
12685
+ };
12686
+ type: "reddit.subreddit.comment.created";
12687
+ } | {
12688
+ name: string;
12689
+ account: import("..").IntegrationAccountRequirement<"reddit">;
12690
+ type: "reddit.inbox.item.received";
12691
+ } | {
12692
+ name: string;
12693
+ account: import("..").IntegrationAccountRequirement<"reddit">;
12694
+ getPrimary: (context: TriggerPresentationContext) => {
12695
+ value: string;
12696
+ };
12697
+ type: "reddit.modQueue.item.received";
12369
12698
  } | {
12370
12699
  name: string;
12371
12700
  account: {
@@ -1,4 +1,5 @@
1
1
  import { airtableTriggerDefinitions } from "./airtable.js";
2
+ import { apifyTriggerDefinitions } from "./apify.js";
2
3
  import { automateTriggerDefinitions } from "./automate.js";
3
4
  import { asanaTriggerDefinitions } from "./asana.js";
4
5
  import { brevoTriggerDefinitions } from "./brevo.js";
@@ -13,6 +14,7 @@ import { linearTriggerDefinitions } from "./linear.js";
13
14
  import { millionVerifierTriggerDefinitions } from "./millionverifier.js";
14
15
  import { microsoftTriggerDefinitions } from "./microsoft.js";
15
16
  import { notionTriggerDefinitions } from "./notion.js";
17
+ import { redditTriggerDefinitions } from "./reddit.js";
16
18
  import { resendTriggerDefinitions } from "./resend.js";
17
19
  import { slackTriggerDefinitions } from "./slack.js";
18
20
  import { stripeTriggerDefinitions } from "./stripe.js";
@@ -25,6 +27,7 @@ import { getIntegrationService } from "../catalog.js";
25
27
  export { getDashboardRunEndpoint, getDashboardRunEndpointKey, getHttpTriggerEndpoint, getHttpTriggerEndpointKey, getMailhookAddress, getMailhookAddressKey, PLATFORM_EMAIL_DOMAIN, DASHBOARD_RUN_CONFIG_SCHEMA, } from "./core.js";
26
28
  /** Plain shared definitions for every public trigger type. */
27
29
  export const triggerDefinitions = {
30
+ ...apifyTriggerDefinitions,
28
31
  ...airtableTriggerDefinitions,
29
32
  ...automateTriggerDefinitions,
30
33
  ...asanaTriggerDefinitions,
@@ -40,6 +43,7 @@ export const triggerDefinitions = {
40
43
  ...millionVerifierTriggerDefinitions,
41
44
  ...microsoftTriggerDefinitions,
42
45
  ...notionTriggerDefinitions,
46
+ ...redditTriggerDefinitions,
43
47
  ...resendTriggerDefinitions,
44
48
  ...slackTriggerDefinitions,
45
49
  ...stripeTriggerDefinitions,
@@ -0,0 +1,42 @@
1
+ import type { IntegrationAccountRequirement, TriggerPresentationContext } from "../types.js";
2
+ export declare const redditTriggerDefinitions: {
3
+ readonly redditSubredditEvent: {
4
+ account: IntegrationAccountRequirement<"reddit">;
5
+ getPrimary: typeof subredditPrimary;
6
+ name: string;
7
+ type: "reddit.subreddit.event";
8
+ };
9
+ readonly redditNewPost: {
10
+ account: IntegrationAccountRequirement<"reddit">;
11
+ getPrimary: typeof subredditPrimary;
12
+ name: string;
13
+ type: "reddit.subreddit.post.created";
14
+ };
15
+ readonly redditNewComment: {
16
+ account: IntegrationAccountRequirement<"reddit">;
17
+ getPrimary: typeof subredditPrimary;
18
+ name: string;
19
+ type: "reddit.subreddit.comment.created";
20
+ };
21
+ readonly redditNewInboxItem: {
22
+ readonly account: IntegrationAccountRequirement<"reddit">;
23
+ readonly name: "New Reddit inbox item";
24
+ readonly type: "reddit.inbox.item.received";
25
+ };
26
+ readonly redditNewModQueueItem: {
27
+ readonly account: IntegrationAccountRequirement<"reddit">;
28
+ readonly getPrimary: typeof subredditPrimary;
29
+ readonly name: "New Reddit mod queue item";
30
+ readonly type: "reddit.modQueue.item.received";
31
+ };
32
+ };
33
+ /**
34
+ * Reads a trigger's configured subreddit for presentation.
35
+ *
36
+ * @param context - Resolved trigger presentation context.
37
+ * @throws When canonical trigger configuration is missing its subreddit.
38
+ */
39
+ declare function subredditPrimary(context: TriggerPresentationContext): {
40
+ value: string;
41
+ };
42
+ export {};
@@ -0,0 +1,41 @@
1
+ const redditAccount = (scope) => ({
2
+ connectionOptions: [{ connectionMethodId: "oauth", requiredScopes: [scope] }],
3
+ serviceId: "reddit",
4
+ });
5
+ const SUBREDDIT_ACCOUNT = redditAccount("read");
6
+ const subredditTrigger = (type, name) => ({
7
+ account: SUBREDDIT_ACCOUNT,
8
+ getPrimary: subredditPrimary,
9
+ name,
10
+ type,
11
+ });
12
+ export const redditTriggerDefinitions = {
13
+ redditSubredditEvent: subredditTrigger("reddit.subreddit.event", "Reddit subreddit event"),
14
+ redditNewPost: subredditTrigger("reddit.subreddit.post.created", "New Reddit post"),
15
+ redditNewComment: subredditTrigger("reddit.subreddit.comment.created", "New Reddit comment"),
16
+ redditNewInboxItem: {
17
+ account: redditAccount("privatemessages"),
18
+ name: "New Reddit inbox item",
19
+ type: "reddit.inbox.item.received",
20
+ },
21
+ redditNewModQueueItem: {
22
+ account: redditAccount("read"),
23
+ getPrimary: subredditPrimary,
24
+ name: "New Reddit mod queue item",
25
+ type: "reddit.modQueue.item.received",
26
+ },
27
+ };
28
+ /**
29
+ * Reads a trigger's configured subreddit for presentation.
30
+ *
31
+ * @param context - Resolved trigger presentation context.
32
+ * @throws When canonical trigger configuration is missing its subreddit.
33
+ */
34
+ function subredditPrimary(context) {
35
+ if (typeof context.config !== "object" ||
36
+ context.config === null ||
37
+ !("subreddit" in context.config) ||
38
+ typeof context.config.subreddit !== "string")
39
+ throw new TypeError("Reddit trigger configuration requires a subreddit.");
40
+ return { value: `r/${context.config.subreddit}` };
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automate.ax/catalog",
3
- "version": "0.124.0",
3
+ "version": "0.126.0",
4
4
  "description": "Shared integration service and trigger definitions for Automate.ax.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,6 +20,7 @@
20
20
  "exports": {
21
21
  ".": "./src/index.ts",
22
22
  "./authoring": "./src/authoring.ts",
23
+ "./triggers/apify": "./src/triggers/apify.ts",
23
24
  "./triggers/airtable": "./src/triggers/airtable.ts",
24
25
  "./triggers/automate": "./src/triggers/automate.ts",
25
26
  "./triggers/asana": "./src/triggers/asana.ts",
@@ -39,6 +40,7 @@
39
40
  "./triggers/millionverifier": "./src/triggers/millionverifier.ts",
40
41
  "./triggers/microsoft": "./src/triggers/microsoft.ts",
41
42
  "./triggers/notion": "./src/triggers/notion.ts",
43
+ "./triggers/reddit": "./src/triggers/reddit.ts",
42
44
  "./triggers/name": "./src/triggers/name.ts",
43
45
  "./triggers/resend": "./src/triggers/resend.ts",
44
46
  "./triggers/slack": "./src/triggers/slack.ts",
@@ -95,6 +97,11 @@
95
97
  "types": "./dist/authoring.d.ts",
96
98
  "default": "./dist/authoring.js"
97
99
  },
100
+ "./triggers/apify": {
101
+ "bun": "./src/triggers/apify.ts",
102
+ "types": "./dist/triggers/apify.d.ts",
103
+ "default": "./dist/triggers/apify.js"
104
+ },
98
105
  "./triggers/airtable": {
99
106
  "bun": "./src/triggers/airtable.ts",
100
107
  "types": "./dist/triggers/airtable.d.ts",
@@ -190,6 +197,11 @@
190
197
  "types": "./dist/triggers/notion.d.ts",
191
198
  "default": "./dist/triggers/notion.js"
192
199
  },
200
+ "./triggers/reddit": {
201
+ "bun": "./src/triggers/reddit.ts",
202
+ "types": "./dist/triggers/reddit.d.ts",
203
+ "default": "./dist/triggers/reddit.js"
204
+ },
193
205
  "./triggers/name": {
194
206
  "bun": "./src/triggers/name.ts",
195
207
  "types": "./dist/triggers/name.d.ts",
package/src/catalog.ts CHANGED
@@ -56,6 +56,29 @@ export const apolloService = defineIntegrationService({
56
56
  preferredConnectionMethodId: "oauth",
57
57
  })
58
58
 
59
+ export const apifyService = defineIntegrationService({
60
+ connectionMethods: [
61
+ {
62
+ credentialUrl: "https://console.apify.com/settings/integrations",
63
+ fields: [
64
+ {
65
+ input: "password",
66
+ label: "API token",
67
+ name: "apiKey",
68
+ placeholder: "apify_api_...",
69
+ required: true,
70
+ },
71
+ ],
72
+ id: "api-token",
73
+ name: "API token",
74
+ type: "form",
75
+ },
76
+ ],
77
+ description: "Connect an Apify account with an API token.",
78
+ id: "apify",
79
+ name: "Apify",
80
+ })
81
+
59
82
  export const asanaService = defineIntegrationService({
60
83
  connectionMethods: [{ id: "oauth", name: "OAuth", type: "redirect" }],
61
84
  description: "Connect an Asana account.",
@@ -540,6 +563,22 @@ export const resendService = defineIntegrationService({
540
563
  preferredConnectionMethodId: "oauth",
541
564
  })
542
565
 
566
+ export const redditService = defineIntegrationService({
567
+ connectionMethods: [{ id: "oauth", name: "OAuth", type: "redirect" }],
568
+ connectionNotice: {
569
+ action: {
570
+ href: "https://support.reddithelp.com/hc/en-us/articles/14945211791892-Reddit-Data-API-Wiki",
571
+ label: "Review Reddit API access",
572
+ },
573
+ description:
574
+ "Reddit requires approval for commercial Data API access. Connect only an approved Reddit application.",
575
+ title: "Reddit approval required",
576
+ },
577
+ description: "Connect a Reddit account with OAuth.",
578
+ id: "reddit",
579
+ name: "Reddit",
580
+ })
581
+
543
582
  export const scrapflyService = defineApiKeyService({
544
583
  credentialUrl: "https://scrapfly.io/dashboard/project",
545
584
  description: "Connect a Scrapfly API key.",
@@ -686,6 +725,7 @@ export const integrationCatalog = defineIntegrationCatalog([
686
725
  airtableService,
687
726
  anthropicService,
688
727
  apolloService,
728
+ apifyService,
689
729
  asanaService,
690
730
  automateService,
691
731
  brevoService,
@@ -718,6 +758,7 @@ export const integrationCatalog = defineIntegrationCatalog([
718
758
  openrouterService,
719
759
  perplexityService,
720
760
  postgresService,
761
+ redditService,
721
762
  resendService,
722
763
  scrapflyService,
723
764
  slackService,
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ export {
2
2
  airtableService,
3
3
  anthropicService,
4
4
  apolloService,
5
+ apifyService,
5
6
  asanaService,
6
7
  automateService,
7
8
  brevoService,
@@ -36,6 +37,7 @@ export {
36
37
  openrouterService,
37
38
  perplexityService,
38
39
  postgresService,
40
+ redditService,
39
41
  resendService,
40
42
  scrapflyService,
41
43
  slackService,
@@ -0,0 +1,31 @@
1
+ import type { IntegrationAccountRequirement, TriggerDefinition } from "../types"
2
+
3
+ const APIFY_ACCOUNT = {
4
+ connectionOptions: [{ connectionMethodId: "api-token", requiredScopes: [] }],
5
+ serviceId: "apify",
6
+ } as const satisfies IntegrationAccountRequirement
7
+
8
+ export const apifyTriggerDefinitions = {
9
+ apifyActorBuildAborted: apifyTrigger("apify.actorBuild.aborted"),
10
+ apifyActorBuildCreated: apifyTrigger("apify.actorBuild.created"),
11
+ apifyActorBuildEvent: apifyTrigger("apify.actorBuild.event"),
12
+ apifyActorBuildFailed: apifyTrigger("apify.actorBuild.failed"),
13
+ apifyActorBuildSucceeded: apifyTrigger("apify.actorBuild.succeeded"),
14
+ apifyActorBuildTimedOut: apifyTrigger("apify.actorBuild.timedOut"),
15
+ apifyActorRunAborted: apifyTrigger("apify.actorRun.aborted"),
16
+ apifyActorRunCreated: apifyTrigger("apify.actorRun.created"),
17
+ apifyActorRunEvent: apifyTrigger("apify.actorRun.event"),
18
+ apifyActorRunFailed: apifyTrigger("apify.actorRun.failed"),
19
+ apifyActorRunResurrected: apifyTrigger("apify.actorRun.resurrected"),
20
+ apifyActorRunSucceeded: apifyTrigger("apify.actorRun.succeeded"),
21
+ apifyActorRunTimedOut: apifyTrigger("apify.actorRun.timedOut"),
22
+ } as const satisfies Record<string, TriggerDefinition>
23
+
24
+ /**
25
+ * Creates one Apify trigger definition with its shared account requirement.
26
+ *
27
+ * @param type - Registered Apify event type.
28
+ */
29
+ function apifyTrigger<const TType extends string>(type: TType) {
30
+ return { account: APIFY_ACCOUNT, type } as const
31
+ }
@@ -1,4 +1,5 @@
1
1
  import { airtableTriggerDefinitions } from "./airtable"
2
+ import { apifyTriggerDefinitions } from "./apify"
2
3
  import { automateTriggerDefinitions } from "./automate"
3
4
  import { asanaTriggerDefinitions } from "./asana"
4
5
  import { brevoTriggerDefinitions } from "./brevo"
@@ -13,6 +14,7 @@ import { linearTriggerDefinitions } from "./linear"
13
14
  import { millionVerifierTriggerDefinitions } from "./millionverifier"
14
15
  import { microsoftTriggerDefinitions } from "./microsoft"
15
16
  import { notionTriggerDefinitions } from "./notion"
17
+ import { redditTriggerDefinitions } from "./reddit"
16
18
  import { resendTriggerDefinitions } from "./resend"
17
19
  import { slackTriggerDefinitions } from "./slack"
18
20
  import { stripeTriggerDefinitions } from "./stripe"
@@ -49,6 +51,7 @@ export {
49
51
 
50
52
  /** Plain shared definitions for every public trigger type. */
51
53
  export const triggerDefinitions = {
54
+ ...apifyTriggerDefinitions,
52
55
  ...airtableTriggerDefinitions,
53
56
  ...automateTriggerDefinitions,
54
57
  ...asanaTriggerDefinitions,
@@ -64,6 +67,7 @@ export const triggerDefinitions = {
64
67
  ...millionVerifierTriggerDefinitions,
65
68
  ...microsoftTriggerDefinitions,
66
69
  ...notionTriggerDefinitions,
70
+ ...redditTriggerDefinitions,
67
71
  ...resendTriggerDefinitions,
68
72
  ...slackTriggerDefinitions,
69
73
  ...stripeTriggerDefinitions,
@@ -0,0 +1,67 @@
1
+ import type {
2
+ IntegrationAccountRequirement,
3
+ TriggerDefinition,
4
+ TriggerPresentationContext,
5
+ } from "../types"
6
+
7
+ const redditAccount = (
8
+ scope: "privatemessages" | "read",
9
+ ): IntegrationAccountRequirement<"reddit"> => ({
10
+ connectionOptions: [{ connectionMethodId: "oauth", requiredScopes: [scope] }],
11
+ serviceId: "reddit",
12
+ })
13
+
14
+ const SUBREDDIT_ACCOUNT = redditAccount("read")
15
+
16
+ const subredditTrigger = <const TType extends string>(
17
+ type: TType,
18
+ name: string,
19
+ ) => ({
20
+ account: SUBREDDIT_ACCOUNT,
21
+ getPrimary: subredditPrimary,
22
+ name,
23
+ type,
24
+ })
25
+
26
+ export const redditTriggerDefinitions = {
27
+ redditSubredditEvent: subredditTrigger(
28
+ "reddit.subreddit.event",
29
+ "Reddit subreddit event",
30
+ ),
31
+ redditNewPost: subredditTrigger(
32
+ "reddit.subreddit.post.created",
33
+ "New Reddit post",
34
+ ),
35
+ redditNewComment: subredditTrigger(
36
+ "reddit.subreddit.comment.created",
37
+ "New Reddit comment",
38
+ ),
39
+ redditNewInboxItem: {
40
+ account: redditAccount("privatemessages"),
41
+ name: "New Reddit inbox item",
42
+ type: "reddit.inbox.item.received",
43
+ },
44
+ redditNewModQueueItem: {
45
+ account: redditAccount("read"),
46
+ getPrimary: subredditPrimary,
47
+ name: "New Reddit mod queue item",
48
+ type: "reddit.modQueue.item.received",
49
+ },
50
+ } as const satisfies Record<string, TriggerDefinition>
51
+
52
+ /**
53
+ * Reads a trigger's configured subreddit for presentation.
54
+ *
55
+ * @param context - Resolved trigger presentation context.
56
+ * @throws When canonical trigger configuration is missing its subreddit.
57
+ */
58
+ function subredditPrimary(context: TriggerPresentationContext) {
59
+ if (
60
+ typeof context.config !== "object" ||
61
+ context.config === null ||
62
+ !("subreddit" in context.config) ||
63
+ typeof context.config.subreddit !== "string"
64
+ )
65
+ throw new TypeError("Reddit trigger configuration requires a subreddit.")
66
+ return { value: `r/${context.config.subreddit}` }
67
+ }