@automate.ax/catalog 0.125.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 +35 -0
- package/dist/catalog.js +15 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/triggers/index.d.ts +69 -0
- package/dist/triggers/index.js +2 -0
- package/dist/triggers/reddit.d.ts +42 -0
- package/dist/triggers/reddit.js +41 -0
- package/package.json +7 -1
- package/src/catalog.ts +17 -0
- package/src/index.ts +1 -0
- package/src/triggers/index.ts +2 -0
- package/src/triggers/reddit.ts +67 -0
package/dist/catalog.d.ts
CHANGED
|
@@ -750,6 +750,24 @@ export declare const resendService: {
|
|
|
750
750
|
readonly name: "Resend";
|
|
751
751
|
readonly preferredConnectionMethodId: "oauth";
|
|
752
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
|
+
};
|
|
753
771
|
export declare const scrapflyService: {
|
|
754
772
|
readonly id: "scrapfly";
|
|
755
773
|
readonly name: string;
|
|
@@ -1644,6 +1662,23 @@ export declare const integrationCatalog: readonly [{
|
|
|
1644
1662
|
readonly description: "Connect a PostgreSQL database with a least-privilege role.";
|
|
1645
1663
|
readonly id: "postgres";
|
|
1646
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";
|
|
1647
1682
|
}, {
|
|
1648
1683
|
readonly connectionMethods: readonly [{
|
|
1649
1684
|
readonly id: "oauth";
|
package/dist/catalog.js
CHANGED
|
@@ -510,6 +510,20 @@ export const resendService = defineIntegrationService({
|
|
|
510
510
|
name: "Resend",
|
|
511
511
|
preferredConnectionMethodId: "oauth",
|
|
512
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
|
+
});
|
|
513
527
|
export const scrapflyService = defineApiKeyService({
|
|
514
528
|
credentialUrl: "https://scrapfly.io/dashboard/project",
|
|
515
529
|
description: "Connect a Scrapfly API key.",
|
|
@@ -675,6 +689,7 @@ export const integrationCatalog = defineIntegrationCatalog([
|
|
|
675
689
|
openrouterService,
|
|
676
690
|
perplexityService,
|
|
677
691
|
postgresService,
|
|
692
|
+
redditService,
|
|
678
693
|
resendService,
|
|
679
694
|
scrapflyService,
|
|
680
695
|
slackService,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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, 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, 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, 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";
|
package/dist/triggers/index.d.ts
CHANGED
|
@@ -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";
|
|
@@ -12626,6 +12663,38 @@ export declare const triggerCatalog: ({
|
|
|
12626
12663
|
name: string;
|
|
12627
12664
|
account: import("..").IntegrationAccountRequirement<"notion">;
|
|
12628
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";
|
|
12629
12698
|
} | {
|
|
12630
12699
|
name: string;
|
|
12631
12700
|
account: {
|
package/dist/triggers/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { linearTriggerDefinitions } from "./linear.js";
|
|
|
14
14
|
import { millionVerifierTriggerDefinitions } from "./millionverifier.js";
|
|
15
15
|
import { microsoftTriggerDefinitions } from "./microsoft.js";
|
|
16
16
|
import { notionTriggerDefinitions } from "./notion.js";
|
|
17
|
+
import { redditTriggerDefinitions } from "./reddit.js";
|
|
17
18
|
import { resendTriggerDefinitions } from "./resend.js";
|
|
18
19
|
import { slackTriggerDefinitions } from "./slack.js";
|
|
19
20
|
import { stripeTriggerDefinitions } from "./stripe.js";
|
|
@@ -42,6 +43,7 @@ export const triggerDefinitions = {
|
|
|
42
43
|
...millionVerifierTriggerDefinitions,
|
|
43
44
|
...microsoftTriggerDefinitions,
|
|
44
45
|
...notionTriggerDefinitions,
|
|
46
|
+
...redditTriggerDefinitions,
|
|
45
47
|
...resendTriggerDefinitions,
|
|
46
48
|
...slackTriggerDefinitions,
|
|
47
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.
|
|
3
|
+
"version": "0.126.0",
|
|
4
4
|
"description": "Shared integration service and trigger definitions for Automate.ax.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"./triggers/millionverifier": "./src/triggers/millionverifier.ts",
|
|
41
41
|
"./triggers/microsoft": "./src/triggers/microsoft.ts",
|
|
42
42
|
"./triggers/notion": "./src/triggers/notion.ts",
|
|
43
|
+
"./triggers/reddit": "./src/triggers/reddit.ts",
|
|
43
44
|
"./triggers/name": "./src/triggers/name.ts",
|
|
44
45
|
"./triggers/resend": "./src/triggers/resend.ts",
|
|
45
46
|
"./triggers/slack": "./src/triggers/slack.ts",
|
|
@@ -196,6 +197,11 @@
|
|
|
196
197
|
"types": "./dist/triggers/notion.d.ts",
|
|
197
198
|
"default": "./dist/triggers/notion.js"
|
|
198
199
|
},
|
|
200
|
+
"./triggers/reddit": {
|
|
201
|
+
"bun": "./src/triggers/reddit.ts",
|
|
202
|
+
"types": "./dist/triggers/reddit.d.ts",
|
|
203
|
+
"default": "./dist/triggers/reddit.js"
|
|
204
|
+
},
|
|
199
205
|
"./triggers/name": {
|
|
200
206
|
"bun": "./src/triggers/name.ts",
|
|
201
207
|
"types": "./dist/triggers/name.d.ts",
|
package/src/catalog.ts
CHANGED
|
@@ -563,6 +563,22 @@ export const resendService = defineIntegrationService({
|
|
|
563
563
|
preferredConnectionMethodId: "oauth",
|
|
564
564
|
})
|
|
565
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
|
+
|
|
566
582
|
export const scrapflyService = defineApiKeyService({
|
|
567
583
|
credentialUrl: "https://scrapfly.io/dashboard/project",
|
|
568
584
|
description: "Connect a Scrapfly API key.",
|
|
@@ -742,6 +758,7 @@ export const integrationCatalog = defineIntegrationCatalog([
|
|
|
742
758
|
openrouterService,
|
|
743
759
|
perplexityService,
|
|
744
760
|
postgresService,
|
|
761
|
+
redditService,
|
|
745
762
|
resendService,
|
|
746
763
|
scrapflyService,
|
|
747
764
|
slackService,
|
package/src/index.ts
CHANGED
package/src/triggers/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { linearTriggerDefinitions } from "./linear"
|
|
|
14
14
|
import { millionVerifierTriggerDefinitions } from "./millionverifier"
|
|
15
15
|
import { microsoftTriggerDefinitions } from "./microsoft"
|
|
16
16
|
import { notionTriggerDefinitions } from "./notion"
|
|
17
|
+
import { redditTriggerDefinitions } from "./reddit"
|
|
17
18
|
import { resendTriggerDefinitions } from "./resend"
|
|
18
19
|
import { slackTriggerDefinitions } from "./slack"
|
|
19
20
|
import { stripeTriggerDefinitions } from "./stripe"
|
|
@@ -66,6 +67,7 @@ export const triggerDefinitions = {
|
|
|
66
67
|
...millionVerifierTriggerDefinitions,
|
|
67
68
|
...microsoftTriggerDefinitions,
|
|
68
69
|
...notionTriggerDefinitions,
|
|
70
|
+
...redditTriggerDefinitions,
|
|
69
71
|
...resendTriggerDefinitions,
|
|
70
72
|
...slackTriggerDefinitions,
|
|
71
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
|
+
}
|