@jam-nodes/nodes 0.2.8 → 0.2.10
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/README.md +147 -0
- package/dist/ai/draft-emails.d.ts +1 -1
- package/dist/index.d.ts +199 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/integrations/apollo/search-contacts.d.ts +4 -4
- package/dist/integrations/dataforseo/keyword-research.d.ts +6 -6
- package/dist/integrations/dataforseo/keyword-research.d.ts.map +1 -1
- package/dist/integrations/dataforseo/keyword-research.js +2 -8
- package/dist/integrations/dataforseo/keyword-research.js.map +1 -1
- package/dist/integrations/devto/create-article.d.ts +20 -0
- package/dist/integrations/devto/create-article.d.ts.map +1 -0
- package/dist/integrations/devto/create-article.js +67 -0
- package/dist/integrations/devto/create-article.js.map +1 -0
- package/dist/integrations/devto/credentials.d.ts +2 -0
- package/dist/integrations/devto/credentials.d.ts.map +1 -0
- package/dist/integrations/devto/credentials.js +17 -0
- package/dist/integrations/devto/credentials.js.map +1 -0
- package/dist/integrations/devto/get-articles.d.ts +21 -0
- package/dist/integrations/devto/get-articles.d.ts.map +1 -0
- package/dist/integrations/devto/get-articles.js +78 -0
- package/dist/integrations/devto/get-articles.js.map +1 -0
- package/dist/integrations/devto/index.d.ts +6 -0
- package/dist/integrations/devto/index.d.ts.map +1 -0
- package/dist/integrations/devto/index.js +6 -0
- package/dist/integrations/devto/index.js.map +1 -0
- package/dist/integrations/devto/schemas.d.ts +243 -0
- package/dist/integrations/devto/schemas.d.ts.map +1 -0
- package/dist/integrations/devto/schemas.js +69 -0
- package/dist/integrations/devto/schemas.js.map +1 -0
- package/dist/integrations/devto/update-article.d.ts +19 -0
- package/dist/integrations/devto/update-article.d.ts.map +1 -0
- package/dist/integrations/devto/update-article.js +65 -0
- package/dist/integrations/devto/update-article.js.map +1 -0
- package/dist/integrations/discord/schemas.d.ts +2 -2
- package/dist/integrations/discord/send-message.d.ts +1 -1
- package/dist/integrations/firecrawl/crawl.d.ts +3 -3
- package/dist/integrations/firecrawl/extract.d.ts +3 -3
- package/dist/integrations/firecrawl/scrape.d.ts +10 -10
- package/dist/integrations/index.d.ts +3 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +5 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/social/credentials.d.ts +2 -0
- package/dist/integrations/social/credentials.d.ts.map +1 -0
- package/dist/integrations/social/credentials.js +36 -0
- package/dist/integrations/social/credentials.js.map +1 -0
- package/dist/integrations/social/index.d.ts +8 -0
- package/dist/integrations/social/index.d.ts.map +1 -1
- package/dist/integrations/social/index.js +8 -0
- package/dist/integrations/social/index.js.map +1 -1
- package/dist/integrations/social/twitter-client.d.ts +6 -0
- package/dist/integrations/social/twitter-client.d.ts.map +1 -0
- package/dist/integrations/social/twitter-client.js +140 -0
- package/dist/integrations/social/twitter-client.js.map +1 -0
- package/dist/integrations/social/twitter-create-tweet.d.ts +61 -0
- package/dist/integrations/social/twitter-create-tweet.d.ts.map +1 -0
- package/dist/integrations/social/twitter-create-tweet.js +83 -0
- package/dist/integrations/social/twitter-create-tweet.js.map +1 -0
- package/dist/integrations/social/twitter-delete-tweet.d.ts +23 -0
- package/dist/integrations/social/twitter-delete-tweet.d.ts.map +1 -0
- package/dist/integrations/social/twitter-delete-tweet.js +41 -0
- package/dist/integrations/social/twitter-delete-tweet.js.map +1 -0
- package/dist/integrations/social/twitter-get-user-by-username.d.ts +39 -0
- package/dist/integrations/social/twitter-get-user-by-username.d.ts.map +1 -0
- package/dist/integrations/social/twitter-get-user-by-username.js +56 -0
- package/dist/integrations/social/twitter-get-user-by-username.js.map +1 -0
- package/dist/integrations/social/twitter-like-tweet.d.ts +23 -0
- package/dist/integrations/social/twitter-like-tweet.d.ts.map +1 -0
- package/dist/integrations/social/twitter-like-tweet.js +48 -0
- package/dist/integrations/social/twitter-like-tweet.js.map +1 -0
- package/dist/integrations/social/twitter-retweet.d.ts +23 -0
- package/dist/integrations/social/twitter-retweet.d.ts.map +1 -0
- package/dist/integrations/social/twitter-retweet.js +48 -0
- package/dist/integrations/social/twitter-retweet.js.map +1 -0
- package/dist/integrations/social/twitter-search-tweets.d.ts +77 -0
- package/dist/integrations/social/twitter-search-tweets.d.ts.map +1 -0
- package/dist/integrations/social/twitter-search-tweets.js +76 -0
- package/dist/integrations/social/twitter-search-tweets.js.map +1 -0
- package/dist/integrations/social/twitter-send-dm.d.ts +39 -0
- package/dist/integrations/social/twitter-send-dm.d.ts.map +1 -0
- package/dist/integrations/social/twitter-send-dm.js +67 -0
- package/dist/integrations/social/twitter-send-dm.js.map +1 -0
- package/dist/integrations/wordpress/createPost.d.ts +25 -0
- package/dist/integrations/wordpress/createPost.d.ts.map +1 -0
- package/dist/integrations/wordpress/createPost.js +67 -0
- package/dist/integrations/wordpress/createPost.js.map +1 -0
- package/dist/integrations/wordpress/credentials.d.ts +2 -0
- package/dist/integrations/wordpress/credentials.d.ts.map +1 -0
- package/dist/integrations/wordpress/credentials.js +25 -0
- package/dist/integrations/wordpress/credentials.js.map +1 -0
- package/dist/integrations/wordpress/getPosts.d.ts +28 -0
- package/dist/integrations/wordpress/getPosts.d.ts.map +1 -0
- package/dist/integrations/wordpress/getPosts.js +70 -0
- package/dist/integrations/wordpress/getPosts.js.map +1 -0
- package/dist/integrations/wordpress/index.d.ts +8 -0
- package/dist/integrations/wordpress/index.d.ts.map +1 -0
- package/dist/integrations/wordpress/index.js +7 -0
- package/dist/integrations/wordpress/index.js.map +1 -0
- package/dist/integrations/wordpress/schemas.d.ts +411 -0
- package/dist/integrations/wordpress/schemas.d.ts.map +1 -0
- package/dist/integrations/wordpress/schemas.js +110 -0
- package/dist/integrations/wordpress/schemas.js.map +1 -0
- package/dist/integrations/wordpress/updatePost.d.ts +21 -0
- package/dist/integrations/wordpress/updatePost.d.ts.map +1 -0
- package/dist/integrations/wordpress/updatePost.js +59 -0
- package/dist/integrations/wordpress/updatePost.js.map +1 -0
- package/dist/integrations/wordpress/uploadMedia.d.ts +15 -0
- package/dist/integrations/wordpress/uploadMedia.d.ts.map +1 -0
- package/dist/integrations/wordpress/uploadMedia.js +56 -0
- package/dist/integrations/wordpress/uploadMedia.js.map +1 -0
- package/dist/integrations/wordpress/utils.d.ts +15 -0
- package/dist/integrations/wordpress/utils.d.ts.map +1 -0
- package/dist/integrations/wordpress/utils.js +15 -0
- package/dist/integrations/wordpress/utils.js.map +1 -0
- package/dist/schemas/ai.d.ts +6 -6
- package/package.json +2 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineNode } from '@jam-nodes/core';
|
|
2
|
+
import { fetchWithRetry } from '../../utils/http.js';
|
|
3
|
+
import { resolveWordPressAuth } from './utils.js';
|
|
4
|
+
import { WordPressUploadMediaInputSchema, WordPressUploadMediaOutputSchema, normalizeWordPressMedia, } from './schemas.js';
|
|
5
|
+
export const wordpressUploadMediaNode = defineNode({
|
|
6
|
+
type: 'wordpress_upload_media',
|
|
7
|
+
name: 'WordPress Upload Media',
|
|
8
|
+
description: 'Upload a media file to the WordPress media library',
|
|
9
|
+
category: 'integration',
|
|
10
|
+
inputSchema: WordPressUploadMediaInputSchema,
|
|
11
|
+
outputSchema: WordPressUploadMediaOutputSchema,
|
|
12
|
+
estimatedDuration: 10,
|
|
13
|
+
capabilities: {
|
|
14
|
+
supportsRerun: false,
|
|
15
|
+
},
|
|
16
|
+
executor: async (input, context) => {
|
|
17
|
+
try {
|
|
18
|
+
const authResult = resolveWordPressAuth(context.credentials?.wordpress);
|
|
19
|
+
if ('error' in authResult) {
|
|
20
|
+
return { success: false, error: authResult.error };
|
|
21
|
+
}
|
|
22
|
+
const { baseUrl, authHeader } = authResult;
|
|
23
|
+
const fileBuffer = Buffer.from(input.contentBase64, 'base64');
|
|
24
|
+
const formData = new FormData();
|
|
25
|
+
const blob = new Blob([fileBuffer], { type: input.mimeType });
|
|
26
|
+
formData.append('file', blob, input.filename);
|
|
27
|
+
const response = await fetchWithRetry(`${baseUrl}/wp-json/wp/v2/media`, {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: {
|
|
30
|
+
Authorization: authHeader,
|
|
31
|
+
'Content-Disposition': `attachment; filename="${input.filename}"`,
|
|
32
|
+
},
|
|
33
|
+
body: formData,
|
|
34
|
+
}, { maxRetries: 3, backoffMs: 1000, timeoutMs: 60000 });
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
const errorText = await response.text();
|
|
37
|
+
return {
|
|
38
|
+
success: false,
|
|
39
|
+
error: `WordPress API error ${response.status}: ${errorText}`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const data = (await response.json());
|
|
43
|
+
return {
|
|
44
|
+
success: true,
|
|
45
|
+
output: normalizeWordPressMedia(data),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=uploadMedia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadMedia.js","sourceRoot":"","sources":["../../../src/integrations/wordpress/uploadMedia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAGhC,uBAAuB,GACxB,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;IACjD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE,aAAa;IACvB,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AAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;gBACvC,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,uBAAuB,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;iBAC9D,CAAA;YACH,CAAC;YAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAsB,CAAA;YAEzD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,uBAAuB,CAAC,IAAI,CAAC;aACtC,CAAA;QACH,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,eAAe;aAChE,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve WordPress credentials and return computed baseUrl and authHeader.
|
|
3
|
+
* Returns error if credentials are missing.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveWordPressAuth(creds: {
|
|
6
|
+
siteUrl?: string;
|
|
7
|
+
username?: string;
|
|
8
|
+
applicationPassword?: string;
|
|
9
|
+
} | undefined): {
|
|
10
|
+
baseUrl: string;
|
|
11
|
+
authHeader: string;
|
|
12
|
+
} | {
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/integrations/wordpress/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAY1E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve WordPress credentials and return computed baseUrl and authHeader.
|
|
3
|
+
* Returns error if credentials are missing.
|
|
4
|
+
*/
|
|
5
|
+
export function resolveWordPressAuth(creds) {
|
|
6
|
+
if (!creds?.siteUrl || !creds?.username || !creds?.applicationPassword) {
|
|
7
|
+
return {
|
|
8
|
+
error: 'WordPress credentials not configured. Please provide context.credentials.wordpress with siteUrl, username, and applicationPassword.',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
const baseUrl = creds.siteUrl.replace(/\/+$/, '');
|
|
12
|
+
const authHeader = `Basic ${Buffer.from(`${creds.username}:${creds.applicationPassword}`).toString('base64')}`;
|
|
13
|
+
return { baseUrl, authHeader };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/integrations/wordpress/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAIxB;IACX,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,CAAC;QACvE,OAAO;YACL,KAAK,EACH,qIAAqI;SACxI,CAAA;IACH,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,UAAU,GAAG,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IAE9G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;AAChC,CAAC"}
|
package/dist/schemas/ai.d.ts
CHANGED
|
@@ -81,14 +81,14 @@ export declare const ContactSchema: z.ZodObject<{
|
|
|
81
81
|
}, "strip", z.ZodTypeAny, {
|
|
82
82
|
id: string;
|
|
83
83
|
title: string | null;
|
|
84
|
-
company: string | null;
|
|
85
84
|
name: string;
|
|
85
|
+
company: string | null;
|
|
86
86
|
email: string | null;
|
|
87
87
|
}, {
|
|
88
88
|
id: string;
|
|
89
89
|
title: string | null;
|
|
90
|
-
company: string | null;
|
|
91
90
|
name: string;
|
|
91
|
+
company: string | null;
|
|
92
92
|
email: string | null;
|
|
93
93
|
}>;
|
|
94
94
|
export type Contact = z.infer<typeof ContactSchema>;
|
|
@@ -103,14 +103,14 @@ export declare const DraftEmailsInputSchema: z.ZodObject<{
|
|
|
103
103
|
}, "strip", z.ZodTypeAny, {
|
|
104
104
|
id: string;
|
|
105
105
|
title: string | null;
|
|
106
|
-
company: string | null;
|
|
107
106
|
name: string;
|
|
107
|
+
company: string | null;
|
|
108
108
|
email: string | null;
|
|
109
109
|
}, {
|
|
110
110
|
id: string;
|
|
111
111
|
title: string | null;
|
|
112
|
-
company: string | null;
|
|
113
112
|
name: string;
|
|
113
|
+
company: string | null;
|
|
114
114
|
email: string | null;
|
|
115
115
|
}>, "many">;
|
|
116
116
|
/** Description of the product/service being offered */
|
|
@@ -134,8 +134,8 @@ export declare const DraftEmailsInputSchema: z.ZodObject<{
|
|
|
134
134
|
contacts: {
|
|
135
135
|
id: string;
|
|
136
136
|
title: string | null;
|
|
137
|
-
company: string | null;
|
|
138
137
|
name: string;
|
|
138
|
+
company: string | null;
|
|
139
139
|
email: string | null;
|
|
140
140
|
}[];
|
|
141
141
|
productDescription: string;
|
|
@@ -149,8 +149,8 @@ export declare const DraftEmailsInputSchema: z.ZodObject<{
|
|
|
149
149
|
contacts: {
|
|
150
150
|
id: string;
|
|
151
151
|
title: string | null;
|
|
152
|
-
company: string | null;
|
|
153
152
|
name: string;
|
|
153
|
+
company: string | null;
|
|
154
154
|
email: string | null;
|
|
155
155
|
}[];
|
|
156
156
|
productDescription: string;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jam-nodes/nodes",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Built-in workflow nodes for jam-nodes framework",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
8
9
|
"exports": {
|