@jam-nodes/nodes 0.1.2 → 0.2.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/ai/analyze-posts.d.ts +175 -0
- package/dist/ai/analyze-posts.d.ts.map +1 -0
- package/dist/ai/analyze-posts.js +172 -0
- package/dist/ai/analyze-posts.js.map +1 -0
- package/dist/ai/draft-emails.d.ts +45 -0
- package/dist/ai/draft-emails.d.ts.map +1 -0
- package/dist/ai/draft-emails.js +134 -0
- package/dist/ai/draft-emails.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +4 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/keyword-generator.d.ts +37 -0
- package/dist/ai/keyword-generator.d.ts.map +1 -0
- package/dist/ai/keyword-generator.js +124 -0
- package/dist/ai/keyword-generator.js.map +1 -0
- package/dist/index.d.ts +323 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/apollo/index.d.ts +2 -0
- package/dist/integrations/apollo/index.d.ts.map +1 -0
- package/dist/integrations/apollo/index.js +2 -0
- package/dist/integrations/apollo/index.js.map +1 -0
- package/dist/integrations/apollo/search-contacts.d.ts +158 -0
- package/dist/integrations/apollo/search-contacts.d.ts.map +1 -0
- package/dist/integrations/apollo/search-contacts.js +161 -0
- package/dist/integrations/apollo/search-contacts.js.map +1 -0
- package/dist/integrations/dataforseo/index.d.ts +3 -0
- package/dist/integrations/dataforseo/index.d.ts.map +1 -0
- package/dist/integrations/dataforseo/index.js +3 -0
- package/dist/integrations/dataforseo/index.js.map +1 -0
- package/dist/integrations/dataforseo/keyword-research.d.ts +96 -0
- package/dist/integrations/dataforseo/keyword-research.d.ts.map +1 -0
- package/dist/integrations/dataforseo/keyword-research.js +115 -0
- package/dist/integrations/dataforseo/keyword-research.js.map +1 -0
- package/dist/integrations/dataforseo/seo-audit.d.ts +257 -0
- package/dist/integrations/dataforseo/seo-audit.d.ts.map +1 -0
- package/dist/integrations/dataforseo/seo-audit.js +266 -0
- package/dist/integrations/dataforseo/seo-audit.js.map +1 -0
- package/dist/integrations/index.d.ts +5 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +9 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/openai/index.d.ts +2 -0
- package/dist/integrations/openai/index.d.ts.map +1 -0
- package/dist/integrations/openai/index.js +2 -0
- package/dist/integrations/openai/index.js.map +1 -0
- package/dist/integrations/openai/sora-video.d.ts +89 -0
- package/dist/integrations/openai/sora-video.d.ts.map +1 -0
- package/dist/integrations/openai/sora-video.js +93 -0
- package/dist/integrations/openai/sora-video.js.map +1 -0
- package/dist/integrations/social/index.d.ts +4 -0
- package/dist/integrations/social/index.d.ts.map +1 -0
- package/dist/integrations/social/index.js +4 -0
- package/dist/integrations/social/index.js.map +1 -0
- package/dist/integrations/social/linkedin-monitor.d.ts +166 -0
- package/dist/integrations/social/linkedin-monitor.d.ts.map +1 -0
- package/dist/integrations/social/linkedin-monitor.js +167 -0
- package/dist/integrations/social/linkedin-monitor.js.map +1 -0
- package/dist/integrations/social/reddit-monitor.d.ts +177 -0
- package/dist/integrations/social/reddit-monitor.d.ts.map +1 -0
- package/dist/integrations/social/reddit-monitor.js +162 -0
- package/dist/integrations/social/reddit-monitor.js.map +1 -0
- package/dist/integrations/social/twitter-monitor.d.ts +186 -0
- package/dist/integrations/social/twitter-monitor.d.ts.map +1 -0
- package/dist/integrations/social/twitter-monitor.js +174 -0
- package/dist/integrations/social/twitter-monitor.js.map +1 -0
- package/dist/prompts/analyze-posts.d.ts +31 -0
- package/dist/prompts/analyze-posts.d.ts.map +1 -0
- package/dist/prompts/analyze-posts.js +87 -0
- package/dist/prompts/analyze-posts.js.map +1 -0
- package/dist/prompts/draft-emails.d.ts +19 -0
- package/dist/prompts/draft-emails.d.ts.map +1 -0
- package/dist/prompts/draft-emails.js +117 -0
- package/dist/prompts/draft-emails.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +7 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/keyword-generator.d.ts +17 -0
- package/dist/prompts/keyword-generator.d.ts.map +1 -0
- package/dist/prompts/keyword-generator.js +61 -0
- package/dist/prompts/keyword-generator.js.map +1 -0
- package/dist/schemas/ai.d.ts +1212 -0
- package/dist/schemas/ai.d.ts.map +1 -0
- package/dist/schemas/ai.js +119 -0
- package/dist/schemas/ai.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +9 -0
- package/dist/schemas/index.js.map +1 -0
- package/package.json +14 -6
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineNode } from '@jam-nodes/core';
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Schemas
|
|
5
|
+
// =============================================================================
|
|
6
|
+
export const SoraVideoInputSchema = z.object({
|
|
7
|
+
/** Detailed description of the video to generate */
|
|
8
|
+
prompt: z.string(),
|
|
9
|
+
/** Sora model to use */
|
|
10
|
+
model: z.enum(['sora-2', 'sora-2-pro']).optional().default('sora-2'),
|
|
11
|
+
/** Video duration in seconds */
|
|
12
|
+
seconds: z.union([z.literal(4), z.literal(8), z.literal(12)]).optional().default(4),
|
|
13
|
+
/** Video dimensions */
|
|
14
|
+
size: z.enum(['720x1280', '1280x720', '1024x1792', '1792x1024']).optional().default('1280x720'),
|
|
15
|
+
});
|
|
16
|
+
export const SoraVideoOutputSchema = z.object({
|
|
17
|
+
video: z.object({
|
|
18
|
+
url: z.string(),
|
|
19
|
+
durationSeconds: z.number(),
|
|
20
|
+
size: z.string(),
|
|
21
|
+
model: z.string(),
|
|
22
|
+
}),
|
|
23
|
+
processingTimeSeconds: z.number(),
|
|
24
|
+
});
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// Node Definition
|
|
27
|
+
// =============================================================================
|
|
28
|
+
/**
|
|
29
|
+
* Sora Video Generation Node
|
|
30
|
+
*
|
|
31
|
+
* Generates videos using OpenAI Sora 2 API.
|
|
32
|
+
* Requires `context.services.openai` to be provided by the host application.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const result = await soraVideoNode.executor({
|
|
37
|
+
* prompt: 'A serene ocean sunset with waves gently crashing',
|
|
38
|
+
* model: 'sora-2',
|
|
39
|
+
* seconds: 8,
|
|
40
|
+
* size: '1280x720'
|
|
41
|
+
* }, context);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export const soraVideoNode = defineNode({
|
|
45
|
+
type: 'sora_video',
|
|
46
|
+
name: 'Generate Sora Video',
|
|
47
|
+
description: 'Generate AI video using OpenAI Sora 2',
|
|
48
|
+
category: 'integration',
|
|
49
|
+
inputSchema: SoraVideoInputSchema,
|
|
50
|
+
outputSchema: SoraVideoOutputSchema,
|
|
51
|
+
estimatedDuration: 60,
|
|
52
|
+
capabilities: {
|
|
53
|
+
supportsRerun: true,
|
|
54
|
+
},
|
|
55
|
+
executor: async (input, context) => {
|
|
56
|
+
try {
|
|
57
|
+
// Require OpenAI service
|
|
58
|
+
if (!context.services?.openai) {
|
|
59
|
+
return {
|
|
60
|
+
success: false,
|
|
61
|
+
error: 'OpenAI service not configured. Please provide context.services.openai.',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const startTime = Date.now();
|
|
65
|
+
const result = await context.services.openai.generateVideo({
|
|
66
|
+
prompt: input.prompt,
|
|
67
|
+
model: input.model || 'sora-2',
|
|
68
|
+
seconds: input.seconds || 4,
|
|
69
|
+
size: input.size || '1280x720',
|
|
70
|
+
});
|
|
71
|
+
const processingTimeSeconds = Math.round((Date.now() - startTime) / 1000);
|
|
72
|
+
return {
|
|
73
|
+
success: true,
|
|
74
|
+
output: {
|
|
75
|
+
video: {
|
|
76
|
+
url: result.url,
|
|
77
|
+
durationSeconds: result.durationSeconds,
|
|
78
|
+
size: input.size || '1280x720',
|
|
79
|
+
model: input.model || 'sora-2',
|
|
80
|
+
},
|
|
81
|
+
processingTimeSeconds,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
success: false,
|
|
88
|
+
error: error instanceof Error ? error.message : 'Failed to generate video',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=sora-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sora-video.js","sourceRoot":"","sources":["../../../src/integrations/openai/sora-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,oDAAoD;IACpD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,wBAAwB;IACxB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC;IACpE,gCAAgC;IAChC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnF,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAA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AAE,KAAK,CAAC,KAAK,IAAI,QAAQ;gBAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC;gBAC3B,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,UAAU;aAC/B,CAAC,CAAC;YAEH,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;YAE1E,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACN,KAAK,EAAE;wBACL,GAAG,EAAE,MAAM,CAAC,GAAG;wBACf,eAAe,EAAE,MAAM,CAAC,eAAe;wBACvC,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,UAAU;wBAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,QAAQ;qBAC/B;oBACD,qBAAqB;iBACtB;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B;aAC3E,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { redditMonitorNode, RedditMonitorInputSchema, RedditMonitorOutputSchema, type RedditMonitorInput, type RedditMonitorOutput, type RedditPost, } from './reddit-monitor';
|
|
2
|
+
export { twitterMonitorNode, TwitterMonitorInputSchema, TwitterMonitorOutputSchema, type TwitterMonitorInput, type TwitterMonitorOutput, type TwitterPost, } from './twitter-monitor';
|
|
3
|
+
export { linkedinMonitorNode, LinkedInMonitorInputSchema, LinkedInMonitorOutputSchema, type LinkedInMonitorInput, type LinkedInMonitorOutput, type LinkedInPost, } from './linkedin-monitor';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/social/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { redditMonitorNode, RedditMonitorInputSchema, RedditMonitorOutputSchema, } from './reddit-monitor';
|
|
2
|
+
export { twitterMonitorNode, TwitterMonitorInputSchema, TwitterMonitorOutputSchema, } from './twitter-monitor';
|
|
3
|
+
export { linkedinMonitorNode, LinkedInMonitorInputSchema, LinkedInMonitorOutputSchema, } from './linkedin-monitor';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integrations/social/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,GAI1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,GAI3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,2BAA2B,GAI5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* LinkedIn post in unified social format
|
|
4
|
+
*/
|
|
5
|
+
export interface LinkedInPost {
|
|
6
|
+
id: string;
|
|
7
|
+
platform: 'linkedin';
|
|
8
|
+
url: string;
|
|
9
|
+
text: string;
|
|
10
|
+
authorName: string;
|
|
11
|
+
authorHandle: string;
|
|
12
|
+
authorUrl: string;
|
|
13
|
+
authorFollowers: number;
|
|
14
|
+
authorHeadline?: string;
|
|
15
|
+
engagement: {
|
|
16
|
+
likes: number;
|
|
17
|
+
comments: number;
|
|
18
|
+
shares: number;
|
|
19
|
+
};
|
|
20
|
+
hashtags: string[];
|
|
21
|
+
postedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const LinkedInMonitorInputSchema: z.ZodObject<{
|
|
24
|
+
/** Keywords to search for */
|
|
25
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
26
|
+
/** Time filter for results */
|
|
27
|
+
timeFilter: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/** Maximum number of results */
|
|
29
|
+
maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
keywords: string[];
|
|
32
|
+
maxResults: number;
|
|
33
|
+
timeFilter?: string | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
keywords: string[];
|
|
36
|
+
timeFilter?: string | undefined;
|
|
37
|
+
maxResults?: number | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export type LinkedInMonitorInput = z.infer<typeof LinkedInMonitorInputSchema>;
|
|
40
|
+
export declare const LinkedInMonitorOutputSchema: z.ZodObject<{
|
|
41
|
+
posts: z.ZodArray<z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
platform: z.ZodLiteral<"linkedin">;
|
|
44
|
+
url: z.ZodString;
|
|
45
|
+
text: z.ZodString;
|
|
46
|
+
authorName: z.ZodString;
|
|
47
|
+
authorHandle: z.ZodString;
|
|
48
|
+
authorUrl: z.ZodString;
|
|
49
|
+
authorFollowers: z.ZodNumber;
|
|
50
|
+
authorHeadline: z.ZodOptional<z.ZodString>;
|
|
51
|
+
engagement: z.ZodObject<{
|
|
52
|
+
likes: z.ZodNumber;
|
|
53
|
+
comments: z.ZodNumber;
|
|
54
|
+
shares: z.ZodNumber;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
comments: number;
|
|
57
|
+
likes: number;
|
|
58
|
+
shares: number;
|
|
59
|
+
}, {
|
|
60
|
+
comments: number;
|
|
61
|
+
likes: number;
|
|
62
|
+
shares: number;
|
|
63
|
+
}>;
|
|
64
|
+
hashtags: z.ZodArray<z.ZodString, "many">;
|
|
65
|
+
postedAt: z.ZodString;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
url: string;
|
|
68
|
+
id: string;
|
|
69
|
+
platform: "linkedin";
|
|
70
|
+
text: string;
|
|
71
|
+
authorName: string;
|
|
72
|
+
authorHandle: string;
|
|
73
|
+
authorUrl: string;
|
|
74
|
+
engagement: {
|
|
75
|
+
comments: number;
|
|
76
|
+
likes: number;
|
|
77
|
+
shares: number;
|
|
78
|
+
};
|
|
79
|
+
postedAt: string;
|
|
80
|
+
authorFollowers: number;
|
|
81
|
+
hashtags: string[];
|
|
82
|
+
authorHeadline?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
url: string;
|
|
85
|
+
id: string;
|
|
86
|
+
platform: "linkedin";
|
|
87
|
+
text: string;
|
|
88
|
+
authorName: string;
|
|
89
|
+
authorHandle: string;
|
|
90
|
+
authorUrl: string;
|
|
91
|
+
engagement: {
|
|
92
|
+
comments: number;
|
|
93
|
+
likes: number;
|
|
94
|
+
shares: number;
|
|
95
|
+
};
|
|
96
|
+
postedAt: string;
|
|
97
|
+
authorFollowers: number;
|
|
98
|
+
hashtags: string[];
|
|
99
|
+
authorHeadline?: string | undefined;
|
|
100
|
+
}>, "many">;
|
|
101
|
+
totalFound: z.ZodNumber;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
posts: {
|
|
104
|
+
url: string;
|
|
105
|
+
id: string;
|
|
106
|
+
platform: "linkedin";
|
|
107
|
+
text: string;
|
|
108
|
+
authorName: string;
|
|
109
|
+
authorHandle: string;
|
|
110
|
+
authorUrl: string;
|
|
111
|
+
engagement: {
|
|
112
|
+
comments: number;
|
|
113
|
+
likes: number;
|
|
114
|
+
shares: number;
|
|
115
|
+
};
|
|
116
|
+
postedAt: string;
|
|
117
|
+
authorFollowers: number;
|
|
118
|
+
hashtags: string[];
|
|
119
|
+
authorHeadline?: string | undefined;
|
|
120
|
+
}[];
|
|
121
|
+
totalFound: number;
|
|
122
|
+
}, {
|
|
123
|
+
posts: {
|
|
124
|
+
url: string;
|
|
125
|
+
id: string;
|
|
126
|
+
platform: "linkedin";
|
|
127
|
+
text: string;
|
|
128
|
+
authorName: string;
|
|
129
|
+
authorHandle: string;
|
|
130
|
+
authorUrl: string;
|
|
131
|
+
engagement: {
|
|
132
|
+
comments: number;
|
|
133
|
+
likes: number;
|
|
134
|
+
shares: number;
|
|
135
|
+
};
|
|
136
|
+
postedAt: string;
|
|
137
|
+
authorFollowers: number;
|
|
138
|
+
hashtags: string[];
|
|
139
|
+
authorHeadline?: string | undefined;
|
|
140
|
+
}[];
|
|
141
|
+
totalFound: number;
|
|
142
|
+
}>;
|
|
143
|
+
export type LinkedInMonitorOutput = z.infer<typeof LinkedInMonitorOutputSchema>;
|
|
144
|
+
/**
|
|
145
|
+
* LinkedIn Monitor Node
|
|
146
|
+
*
|
|
147
|
+
* Searches LinkedIn for posts matching keywords using ForumScout API.
|
|
148
|
+
* Requires `context.services.forumScout` to be provided by the host application.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const result = await linkedinMonitorNode.executor({
|
|
153
|
+
* keywords: ['hiring', 'remote'],
|
|
154
|
+
* maxResults: 25
|
|
155
|
+
* }, context);
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
export declare const linkedinMonitorNode: import("@jam-nodes/core").NodeDefinition<{
|
|
159
|
+
keywords: string[];
|
|
160
|
+
timeFilter?: string | undefined;
|
|
161
|
+
maxResults?: number | undefined;
|
|
162
|
+
}, {
|
|
163
|
+
posts: LinkedInPost[];
|
|
164
|
+
totalFound: number;
|
|
165
|
+
}>;
|
|
166
|
+
//# sourceMappingURL=linkedin-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkedin-monitor.d.ts","sourceRoot":"","sources":["../../../src/integrations/social/linkedin-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,eAAO,MAAM,0BAA0B;IACrC,6BAA6B;;IAE7B,8BAA8B;;IAE9B,gCAAgC;;;;;;;;;;EAEhC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AA8ChF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB;;;;;;;EAiF9B,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineNode } from '@jam-nodes/core';
|
|
3
|
+
// =============================================================================
|
|
4
|
+
// Schemas
|
|
5
|
+
// =============================================================================
|
|
6
|
+
export const LinkedInMonitorInputSchema = z.object({
|
|
7
|
+
/** Keywords to search for */
|
|
8
|
+
keywords: z.array(z.string()),
|
|
9
|
+
/** Time filter for results */
|
|
10
|
+
timeFilter: z.string().optional(),
|
|
11
|
+
/** Maximum number of results */
|
|
12
|
+
maxResults: z.number().optional().default(50),
|
|
13
|
+
});
|
|
14
|
+
export const LinkedInMonitorOutputSchema = z.object({
|
|
15
|
+
posts: z.array(z.object({
|
|
16
|
+
id: z.string(),
|
|
17
|
+
platform: z.literal('linkedin'),
|
|
18
|
+
url: z.string(),
|
|
19
|
+
text: z.string(),
|
|
20
|
+
authorName: z.string(),
|
|
21
|
+
authorHandle: z.string(),
|
|
22
|
+
authorUrl: z.string(),
|
|
23
|
+
authorFollowers: z.number(),
|
|
24
|
+
authorHeadline: z.string().optional(),
|
|
25
|
+
engagement: z.object({
|
|
26
|
+
likes: z.number(),
|
|
27
|
+
comments: z.number(),
|
|
28
|
+
shares: z.number(),
|
|
29
|
+
}),
|
|
30
|
+
hashtags: z.array(z.string()),
|
|
31
|
+
postedAt: z.string(),
|
|
32
|
+
})),
|
|
33
|
+
totalFound: z.number(),
|
|
34
|
+
});
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// Helpers
|
|
37
|
+
// =============================================================================
|
|
38
|
+
/**
|
|
39
|
+
* Extract hashtags from post text
|
|
40
|
+
*/
|
|
41
|
+
function extractHashtags(text) {
|
|
42
|
+
const matches = text.match(/#\w+/g);
|
|
43
|
+
return matches ? matches.map(tag => tag.slice(1)) : [];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Extract LinkedIn handle from profile URL
|
|
47
|
+
*/
|
|
48
|
+
function extractHandleFromUrl(url) {
|
|
49
|
+
if (!url)
|
|
50
|
+
return 'unknown';
|
|
51
|
+
try {
|
|
52
|
+
const parts = url.split('/');
|
|
53
|
+
const inIndex = parts.indexOf('in');
|
|
54
|
+
if (inIndex !== -1) {
|
|
55
|
+
const handle = parts[inIndex + 1];
|
|
56
|
+
if (handle) {
|
|
57
|
+
return handle.split('?')[0] ?? 'unknown';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const companyIndex = parts.indexOf('company');
|
|
61
|
+
if (companyIndex !== -1) {
|
|
62
|
+
const handle = parts[companyIndex + 1];
|
|
63
|
+
if (handle) {
|
|
64
|
+
return handle.split('?')[0] ?? 'unknown';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const lastPart = parts[parts.length - 1];
|
|
68
|
+
return lastPart?.split('?')[0] ?? 'unknown';
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return 'unknown';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// Node Definition
|
|
76
|
+
// =============================================================================
|
|
77
|
+
/**
|
|
78
|
+
* LinkedIn Monitor Node
|
|
79
|
+
*
|
|
80
|
+
* Searches LinkedIn for posts matching keywords using ForumScout API.
|
|
81
|
+
* Requires `context.services.forumScout` to be provided by the host application.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const result = await linkedinMonitorNode.executor({
|
|
86
|
+
* keywords: ['hiring', 'remote'],
|
|
87
|
+
* maxResults: 25
|
|
88
|
+
* }, context);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export const linkedinMonitorNode = defineNode({
|
|
92
|
+
type: 'linkedin_monitor',
|
|
93
|
+
name: 'LinkedIn Monitor',
|
|
94
|
+
description: 'Search LinkedIn for posts matching keywords using ForumScout',
|
|
95
|
+
category: 'integration',
|
|
96
|
+
inputSchema: LinkedInMonitorInputSchema,
|
|
97
|
+
outputSchema: LinkedInMonitorOutputSchema,
|
|
98
|
+
estimatedDuration: 60,
|
|
99
|
+
capabilities: {
|
|
100
|
+
supportsRerun: true,
|
|
101
|
+
},
|
|
102
|
+
executor: async (input, context) => {
|
|
103
|
+
try {
|
|
104
|
+
const keywords = input.keywords.map(k => k.trim()).filter(Boolean);
|
|
105
|
+
if (keywords.length === 0) {
|
|
106
|
+
return {
|
|
107
|
+
success: false,
|
|
108
|
+
error: 'No valid keywords provided',
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
// Require ForumScout service
|
|
112
|
+
if (!context.services?.forumScout) {
|
|
113
|
+
return {
|
|
114
|
+
success: false,
|
|
115
|
+
error: 'ForumScout service not configured. Please provide context.services.forumScout.',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
// Search LinkedIn via ForumScout
|
|
119
|
+
const results = await context.services.forumScout.searchLinkedIn(keywords, {
|
|
120
|
+
maxResults: input.maxResults || 50,
|
|
121
|
+
timeFilter: input.timeFilter,
|
|
122
|
+
});
|
|
123
|
+
// Transform to unified format
|
|
124
|
+
const posts = results.map(post => ({
|
|
125
|
+
id: post.id,
|
|
126
|
+
platform: 'linkedin',
|
|
127
|
+
url: post.url,
|
|
128
|
+
text: post.text,
|
|
129
|
+
authorName: post.authorName,
|
|
130
|
+
authorHandle: extractHandleFromUrl(post.authorUrl),
|
|
131
|
+
authorUrl: post.authorUrl || '',
|
|
132
|
+
authorFollowers: post.likes || 0,
|
|
133
|
+
authorHeadline: post.authorHeadline,
|
|
134
|
+
engagement: {
|
|
135
|
+
likes: post.likes || 0,
|
|
136
|
+
comments: post.comments || 0,
|
|
137
|
+
shares: post.shares || 0,
|
|
138
|
+
},
|
|
139
|
+
hashtags: post.hashtags || extractHashtags(post.text),
|
|
140
|
+
postedAt: post.createdAt,
|
|
141
|
+
}));
|
|
142
|
+
// Optional: send notification if service available
|
|
143
|
+
if (context.services?.notifications && posts.length > 0) {
|
|
144
|
+
await context.services.notifications.send({
|
|
145
|
+
userId: context.userId,
|
|
146
|
+
title: 'LinkedIn Monitor Complete',
|
|
147
|
+
message: `Found ${posts.length} LinkedIn posts`,
|
|
148
|
+
data: { posts: posts.slice(0, 5) },
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
success: true,
|
|
153
|
+
output: {
|
|
154
|
+
posts,
|
|
155
|
+
totalFound: posts.length,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
return {
|
|
161
|
+
success: false,
|
|
162
|
+
error: error instanceof Error ? error.message : 'Failed to monitor LinkedIn',
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=linkedin-monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkedin-monitor.js","sourceRoot":"","sources":["../../../src/integrations/social/linkedin-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA4B7C,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,6BAA6B;IAC7B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,8BAA8B;IAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,gCAAgC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE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4BAA4B;aAC7E,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Reddit post in unified social format
|
|
4
|
+
*/
|
|
5
|
+
export interface RedditPost {
|
|
6
|
+
id: string;
|
|
7
|
+
platform: 'reddit';
|
|
8
|
+
url: string;
|
|
9
|
+
text: string;
|
|
10
|
+
title: string;
|
|
11
|
+
authorName: string;
|
|
12
|
+
authorHandle: string;
|
|
13
|
+
authorUrl: string;
|
|
14
|
+
subreddit: string;
|
|
15
|
+
engagement: {
|
|
16
|
+
likes: number;
|
|
17
|
+
comments: number;
|
|
18
|
+
shares: number;
|
|
19
|
+
};
|
|
20
|
+
upvoteRatio: number;
|
|
21
|
+
postedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const RedditMonitorInputSchema: z.ZodObject<{
|
|
24
|
+
/** Keywords to search for */
|
|
25
|
+
keywords: z.ZodArray<z.ZodString, "many">;
|
|
26
|
+
/** Time filter for search results */
|
|
27
|
+
timeFilter: z.ZodDefault<z.ZodOptional<z.ZodEnum<["hour", "day", "week", "month", "year", "all"]>>>;
|
|
28
|
+
/** Sort order for results */
|
|
29
|
+
sortBy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["relevance", "hot", "top", "new", "comments"]>>>;
|
|
30
|
+
/** Maximum number of results to return */
|
|
31
|
+
maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
keywords: string[];
|
|
34
|
+
timeFilter: "hour" | "day" | "week" | "month" | "year" | "all";
|
|
35
|
+
sortBy: "relevance" | "hot" | "top" | "new" | "comments";
|
|
36
|
+
maxResults: number;
|
|
37
|
+
}, {
|
|
38
|
+
keywords: string[];
|
|
39
|
+
timeFilter?: "hour" | "day" | "week" | "month" | "year" | "all" | undefined;
|
|
40
|
+
sortBy?: "relevance" | "hot" | "top" | "new" | "comments" | undefined;
|
|
41
|
+
maxResults?: number | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export type RedditMonitorInput = z.infer<typeof RedditMonitorInputSchema>;
|
|
44
|
+
export declare const RedditMonitorOutputSchema: z.ZodObject<{
|
|
45
|
+
posts: z.ZodArray<z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
platform: z.ZodLiteral<"reddit">;
|
|
48
|
+
url: z.ZodString;
|
|
49
|
+
text: z.ZodString;
|
|
50
|
+
title: z.ZodString;
|
|
51
|
+
authorName: z.ZodString;
|
|
52
|
+
authorHandle: z.ZodString;
|
|
53
|
+
authorUrl: z.ZodString;
|
|
54
|
+
subreddit: z.ZodString;
|
|
55
|
+
engagement: z.ZodObject<{
|
|
56
|
+
likes: z.ZodNumber;
|
|
57
|
+
comments: z.ZodNumber;
|
|
58
|
+
shares: z.ZodNumber;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
comments: number;
|
|
61
|
+
likes: number;
|
|
62
|
+
shares: number;
|
|
63
|
+
}, {
|
|
64
|
+
comments: number;
|
|
65
|
+
likes: number;
|
|
66
|
+
shares: number;
|
|
67
|
+
}>;
|
|
68
|
+
upvoteRatio: z.ZodNumber;
|
|
69
|
+
postedAt: z.ZodString;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
url: string;
|
|
72
|
+
id: string;
|
|
73
|
+
platform: "reddit";
|
|
74
|
+
text: string;
|
|
75
|
+
title: string;
|
|
76
|
+
authorName: string;
|
|
77
|
+
authorHandle: string;
|
|
78
|
+
authorUrl: string;
|
|
79
|
+
subreddit: string;
|
|
80
|
+
engagement: {
|
|
81
|
+
comments: number;
|
|
82
|
+
likes: number;
|
|
83
|
+
shares: number;
|
|
84
|
+
};
|
|
85
|
+
upvoteRatio: number;
|
|
86
|
+
postedAt: string;
|
|
87
|
+
}, {
|
|
88
|
+
url: string;
|
|
89
|
+
id: string;
|
|
90
|
+
platform: "reddit";
|
|
91
|
+
text: string;
|
|
92
|
+
title: string;
|
|
93
|
+
authorName: string;
|
|
94
|
+
authorHandle: string;
|
|
95
|
+
authorUrl: string;
|
|
96
|
+
subreddit: string;
|
|
97
|
+
engagement: {
|
|
98
|
+
comments: number;
|
|
99
|
+
likes: number;
|
|
100
|
+
shares: number;
|
|
101
|
+
};
|
|
102
|
+
upvoteRatio: number;
|
|
103
|
+
postedAt: string;
|
|
104
|
+
}>, "many">;
|
|
105
|
+
totalFound: z.ZodNumber;
|
|
106
|
+
subredditsSearched: z.ZodArray<z.ZodString, "many">;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
posts: {
|
|
109
|
+
url: string;
|
|
110
|
+
id: string;
|
|
111
|
+
platform: "reddit";
|
|
112
|
+
text: string;
|
|
113
|
+
title: string;
|
|
114
|
+
authorName: string;
|
|
115
|
+
authorHandle: string;
|
|
116
|
+
authorUrl: string;
|
|
117
|
+
subreddit: string;
|
|
118
|
+
engagement: {
|
|
119
|
+
comments: number;
|
|
120
|
+
likes: number;
|
|
121
|
+
shares: number;
|
|
122
|
+
};
|
|
123
|
+
upvoteRatio: number;
|
|
124
|
+
postedAt: string;
|
|
125
|
+
}[];
|
|
126
|
+
totalFound: number;
|
|
127
|
+
subredditsSearched: string[];
|
|
128
|
+
}, {
|
|
129
|
+
posts: {
|
|
130
|
+
url: string;
|
|
131
|
+
id: string;
|
|
132
|
+
platform: "reddit";
|
|
133
|
+
text: string;
|
|
134
|
+
title: string;
|
|
135
|
+
authorName: string;
|
|
136
|
+
authorHandle: string;
|
|
137
|
+
authorUrl: string;
|
|
138
|
+
subreddit: string;
|
|
139
|
+
engagement: {
|
|
140
|
+
comments: number;
|
|
141
|
+
likes: number;
|
|
142
|
+
shares: number;
|
|
143
|
+
};
|
|
144
|
+
upvoteRatio: number;
|
|
145
|
+
postedAt: string;
|
|
146
|
+
}[];
|
|
147
|
+
totalFound: number;
|
|
148
|
+
subredditsSearched: string[];
|
|
149
|
+
}>;
|
|
150
|
+
export type RedditMonitorOutput = z.infer<typeof RedditMonitorOutputSchema>;
|
|
151
|
+
/**
|
|
152
|
+
* Reddit Monitor Node
|
|
153
|
+
*
|
|
154
|
+
* Searches Reddit for posts matching keywords using the public search.json API.
|
|
155
|
+
* No authentication required - uses public Reddit API.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const result = await redditMonitorNode.executor({
|
|
160
|
+
* keywords: ['typescript', 'nodejs'],
|
|
161
|
+
* timeFilter: 'week',
|
|
162
|
+
* maxResults: 25
|
|
163
|
+
* }, context);
|
|
164
|
+
* // Returns: { posts: [...], totalFound: 25, subredditsSearched: ['all'] }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
export declare const redditMonitorNode: import("@jam-nodes/core").NodeDefinition<{
|
|
168
|
+
keywords: string[];
|
|
169
|
+
timeFilter?: "hour" | "day" | "week" | "month" | "year" | "all" | undefined;
|
|
170
|
+
sortBy?: "relevance" | "hot" | "top" | "new" | "comments" | undefined;
|
|
171
|
+
maxResults?: number | undefined;
|
|
172
|
+
}, {
|
|
173
|
+
posts: RedditPost[];
|
|
174
|
+
totalFound: number;
|
|
175
|
+
subredditsSearched: string[];
|
|
176
|
+
}>;
|
|
177
|
+
//# sourceMappingURL=reddit-monitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reddit-monitor.d.ts","sourceRoot":"","sources":["../../../src/integrations/social/reddit-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,eAAO,MAAM,wBAAwB;IACnC,6BAA6B;;IAE7B,qCAAqC;;IAErC,6BAA6B;;IAE7B,0CAA0C;;;;;;;;;;;;EAE1C,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAgD5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;EAsF5B,CAAC"}
|