@jam-nodes/nodes 0.2.7 → 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/analyze-posts.d.ts +3 -3
- package/dist/ai/draft-emails.d.ts +1 -1
- package/dist/index.d.ts +363 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -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 +121 -0
- package/dist/integrations/firecrawl/crawl.d.ts.map +1 -0
- package/dist/integrations/firecrawl/crawl.js +168 -0
- package/dist/integrations/firecrawl/crawl.js.map +1 -0
- package/dist/integrations/firecrawl/extract.d.ts +82 -0
- package/dist/integrations/firecrawl/extract.d.ts.map +1 -0
- package/dist/integrations/firecrawl/extract.js +168 -0
- package/dist/integrations/firecrawl/extract.js.map +1 -0
- package/dist/integrations/firecrawl/index.d.ts +4 -0
- package/dist/integrations/firecrawl/index.d.ts.map +1 -0
- package/dist/integrations/firecrawl/index.js +4 -0
- package/dist/integrations/firecrawl/index.js.map +1 -0
- package/dist/integrations/firecrawl/scrape.d.ts +1208 -0
- package/dist/integrations/firecrawl/scrape.d.ts.map +1 -0
- package/dist/integrations/firecrawl/scrape.js +254 -0
- package/dist/integrations/firecrawl/scrape.js.map +1 -0
- package/dist/integrations/index.d.ts +4 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +7 -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 +20 -20
- package/package.json +2 -1
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WordPressPostSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodNumber;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
slug: z.ZodString;
|
|
6
|
+
status: z.ZodString;
|
|
7
|
+
link: z.ZodString;
|
|
8
|
+
date: z.ZodString;
|
|
9
|
+
modified: z.ZodString;
|
|
10
|
+
author: z.ZodNumber;
|
|
11
|
+
featuredMedia: z.ZodNumber;
|
|
12
|
+
categories: z.ZodArray<z.ZodNumber, "many">;
|
|
13
|
+
tags: z.ZodArray<z.ZodNumber, "many">;
|
|
14
|
+
content: z.ZodOptional<z.ZodString>;
|
|
15
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
status: string;
|
|
18
|
+
date: string;
|
|
19
|
+
id: number;
|
|
20
|
+
title: string;
|
|
21
|
+
link: string;
|
|
22
|
+
author: number;
|
|
23
|
+
slug: string;
|
|
24
|
+
tags: number[];
|
|
25
|
+
modified: string;
|
|
26
|
+
featuredMedia: number;
|
|
27
|
+
categories: number[];
|
|
28
|
+
content?: string | undefined;
|
|
29
|
+
excerpt?: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
status: string;
|
|
32
|
+
date: string;
|
|
33
|
+
id: number;
|
|
34
|
+
title: string;
|
|
35
|
+
link: string;
|
|
36
|
+
author: number;
|
|
37
|
+
slug: string;
|
|
38
|
+
tags: number[];
|
|
39
|
+
modified: string;
|
|
40
|
+
featuredMedia: number;
|
|
41
|
+
categories: number[];
|
|
42
|
+
content?: string | undefined;
|
|
43
|
+
excerpt?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const WordPressCreatePostInputSchema: z.ZodObject<{
|
|
46
|
+
title: z.ZodString;
|
|
47
|
+
content: z.ZodString;
|
|
48
|
+
status: z.ZodOptional<z.ZodEnum<["publish", "draft", "private", "pending"]>>;
|
|
49
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
50
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
51
|
+
featuredMediaId: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
53
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
title: string;
|
|
56
|
+
content: string;
|
|
57
|
+
status?: "pending" | "publish" | "draft" | "private" | undefined;
|
|
58
|
+
slug?: string | undefined;
|
|
59
|
+
tags?: number[] | undefined;
|
|
60
|
+
categories?: number[] | undefined;
|
|
61
|
+
excerpt?: string | undefined;
|
|
62
|
+
featuredMediaId?: number | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
title: string;
|
|
65
|
+
content: string;
|
|
66
|
+
status?: "pending" | "publish" | "draft" | "private" | undefined;
|
|
67
|
+
slug?: string | undefined;
|
|
68
|
+
tags?: number[] | undefined;
|
|
69
|
+
categories?: number[] | undefined;
|
|
70
|
+
excerpt?: string | undefined;
|
|
71
|
+
featuredMediaId?: number | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const WordPressUpdatePostInputSchema: z.ZodObject<{
|
|
74
|
+
postId: z.ZodNumber;
|
|
75
|
+
title: z.ZodOptional<z.ZodString>;
|
|
76
|
+
content: z.ZodOptional<z.ZodString>;
|
|
77
|
+
status: z.ZodOptional<z.ZodEnum<["publish", "draft", "private", "pending"]>>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
postId: number;
|
|
80
|
+
status?: "pending" | "publish" | "draft" | "private" | undefined;
|
|
81
|
+
title?: string | undefined;
|
|
82
|
+
content?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
postId: number;
|
|
85
|
+
status?: "pending" | "publish" | "draft" | "private" | undefined;
|
|
86
|
+
title?: string | undefined;
|
|
87
|
+
content?: string | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export declare const WordPressGetPostsInputSchema: z.ZodObject<{
|
|
90
|
+
status: z.ZodOptional<z.ZodEnum<["publish", "draft", "private", "pending", "future", "trash", "any"]>>;
|
|
91
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
search: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
status?: "pending" | "publish" | "draft" | "private" | "future" | "trash" | "any" | undefined;
|
|
96
|
+
page?: number | undefined;
|
|
97
|
+
perPage?: number | undefined;
|
|
98
|
+
search?: string | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
status?: "pending" | "publish" | "draft" | "private" | "future" | "trash" | "any" | undefined;
|
|
101
|
+
page?: number | undefined;
|
|
102
|
+
perPage?: number | undefined;
|
|
103
|
+
search?: string | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
export declare const WordPressCreatePostOutputSchema: z.ZodObject<{
|
|
106
|
+
id: z.ZodNumber;
|
|
107
|
+
title: z.ZodString;
|
|
108
|
+
slug: z.ZodString;
|
|
109
|
+
status: z.ZodString;
|
|
110
|
+
link: z.ZodString;
|
|
111
|
+
date: z.ZodString;
|
|
112
|
+
modified: z.ZodString;
|
|
113
|
+
author: z.ZodNumber;
|
|
114
|
+
featuredMedia: z.ZodNumber;
|
|
115
|
+
categories: z.ZodArray<z.ZodNumber, "many">;
|
|
116
|
+
tags: z.ZodArray<z.ZodNumber, "many">;
|
|
117
|
+
content: z.ZodOptional<z.ZodString>;
|
|
118
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
status: string;
|
|
121
|
+
date: string;
|
|
122
|
+
id: number;
|
|
123
|
+
title: string;
|
|
124
|
+
link: string;
|
|
125
|
+
author: number;
|
|
126
|
+
slug: string;
|
|
127
|
+
tags: number[];
|
|
128
|
+
modified: string;
|
|
129
|
+
featuredMedia: number;
|
|
130
|
+
categories: number[];
|
|
131
|
+
content?: string | undefined;
|
|
132
|
+
excerpt?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
status: string;
|
|
135
|
+
date: string;
|
|
136
|
+
id: number;
|
|
137
|
+
title: string;
|
|
138
|
+
link: string;
|
|
139
|
+
author: number;
|
|
140
|
+
slug: string;
|
|
141
|
+
tags: number[];
|
|
142
|
+
modified: string;
|
|
143
|
+
featuredMedia: number;
|
|
144
|
+
categories: number[];
|
|
145
|
+
content?: string | undefined;
|
|
146
|
+
excerpt?: string | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
export declare const WordPressUpdatePostOutputSchema: z.ZodObject<{
|
|
149
|
+
id: z.ZodNumber;
|
|
150
|
+
title: z.ZodString;
|
|
151
|
+
slug: z.ZodString;
|
|
152
|
+
status: z.ZodString;
|
|
153
|
+
link: z.ZodString;
|
|
154
|
+
date: z.ZodString;
|
|
155
|
+
modified: z.ZodString;
|
|
156
|
+
author: z.ZodNumber;
|
|
157
|
+
featuredMedia: z.ZodNumber;
|
|
158
|
+
categories: z.ZodArray<z.ZodNumber, "many">;
|
|
159
|
+
tags: z.ZodArray<z.ZodNumber, "many">;
|
|
160
|
+
content: z.ZodOptional<z.ZodString>;
|
|
161
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
status: string;
|
|
164
|
+
date: string;
|
|
165
|
+
id: number;
|
|
166
|
+
title: string;
|
|
167
|
+
link: string;
|
|
168
|
+
author: number;
|
|
169
|
+
slug: string;
|
|
170
|
+
tags: number[];
|
|
171
|
+
modified: string;
|
|
172
|
+
featuredMedia: number;
|
|
173
|
+
categories: number[];
|
|
174
|
+
content?: string | undefined;
|
|
175
|
+
excerpt?: string | undefined;
|
|
176
|
+
}, {
|
|
177
|
+
status: string;
|
|
178
|
+
date: string;
|
|
179
|
+
id: number;
|
|
180
|
+
title: string;
|
|
181
|
+
link: string;
|
|
182
|
+
author: number;
|
|
183
|
+
slug: string;
|
|
184
|
+
tags: number[];
|
|
185
|
+
modified: string;
|
|
186
|
+
featuredMedia: number;
|
|
187
|
+
categories: number[];
|
|
188
|
+
content?: string | undefined;
|
|
189
|
+
excerpt?: string | undefined;
|
|
190
|
+
}>;
|
|
191
|
+
export declare const WordPressGetPostsOutputSchema: z.ZodObject<{
|
|
192
|
+
posts: z.ZodArray<z.ZodObject<{
|
|
193
|
+
id: z.ZodNumber;
|
|
194
|
+
title: z.ZodString;
|
|
195
|
+
slug: z.ZodString;
|
|
196
|
+
status: z.ZodString;
|
|
197
|
+
link: z.ZodString;
|
|
198
|
+
date: z.ZodString;
|
|
199
|
+
modified: z.ZodString;
|
|
200
|
+
author: z.ZodNumber;
|
|
201
|
+
featuredMedia: z.ZodNumber;
|
|
202
|
+
categories: z.ZodArray<z.ZodNumber, "many">;
|
|
203
|
+
tags: z.ZodArray<z.ZodNumber, "many">;
|
|
204
|
+
content: z.ZodOptional<z.ZodString>;
|
|
205
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
status: string;
|
|
208
|
+
date: string;
|
|
209
|
+
id: number;
|
|
210
|
+
title: string;
|
|
211
|
+
link: string;
|
|
212
|
+
author: number;
|
|
213
|
+
slug: string;
|
|
214
|
+
tags: number[];
|
|
215
|
+
modified: string;
|
|
216
|
+
featuredMedia: number;
|
|
217
|
+
categories: number[];
|
|
218
|
+
content?: string | undefined;
|
|
219
|
+
excerpt?: string | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
status: string;
|
|
222
|
+
date: string;
|
|
223
|
+
id: number;
|
|
224
|
+
title: string;
|
|
225
|
+
link: string;
|
|
226
|
+
author: number;
|
|
227
|
+
slug: string;
|
|
228
|
+
tags: number[];
|
|
229
|
+
modified: string;
|
|
230
|
+
featuredMedia: number;
|
|
231
|
+
categories: number[];
|
|
232
|
+
content?: string | undefined;
|
|
233
|
+
excerpt?: string | undefined;
|
|
234
|
+
}>, "many">;
|
|
235
|
+
meta: z.ZodObject<{
|
|
236
|
+
totalFound: z.ZodNumber;
|
|
237
|
+
limit: z.ZodNumber;
|
|
238
|
+
offset: z.ZodNumber;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
totalFound: number;
|
|
241
|
+
limit: number;
|
|
242
|
+
offset: number;
|
|
243
|
+
}, {
|
|
244
|
+
totalFound: number;
|
|
245
|
+
limit: number;
|
|
246
|
+
offset: number;
|
|
247
|
+
}>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
posts: {
|
|
250
|
+
status: string;
|
|
251
|
+
date: string;
|
|
252
|
+
id: number;
|
|
253
|
+
title: string;
|
|
254
|
+
link: string;
|
|
255
|
+
author: number;
|
|
256
|
+
slug: string;
|
|
257
|
+
tags: number[];
|
|
258
|
+
modified: string;
|
|
259
|
+
featuredMedia: number;
|
|
260
|
+
categories: number[];
|
|
261
|
+
content?: string | undefined;
|
|
262
|
+
excerpt?: string | undefined;
|
|
263
|
+
}[];
|
|
264
|
+
meta: {
|
|
265
|
+
totalFound: number;
|
|
266
|
+
limit: number;
|
|
267
|
+
offset: number;
|
|
268
|
+
};
|
|
269
|
+
}, {
|
|
270
|
+
posts: {
|
|
271
|
+
status: string;
|
|
272
|
+
date: string;
|
|
273
|
+
id: number;
|
|
274
|
+
title: string;
|
|
275
|
+
link: string;
|
|
276
|
+
author: number;
|
|
277
|
+
slug: string;
|
|
278
|
+
tags: number[];
|
|
279
|
+
modified: string;
|
|
280
|
+
featuredMedia: number;
|
|
281
|
+
categories: number[];
|
|
282
|
+
content?: string | undefined;
|
|
283
|
+
excerpt?: string | undefined;
|
|
284
|
+
}[];
|
|
285
|
+
meta: {
|
|
286
|
+
totalFound: number;
|
|
287
|
+
limit: number;
|
|
288
|
+
offset: number;
|
|
289
|
+
};
|
|
290
|
+
}>;
|
|
291
|
+
export declare const WordPressMediaSchema: z.ZodObject<{
|
|
292
|
+
id: z.ZodNumber;
|
|
293
|
+
title: z.ZodString;
|
|
294
|
+
slug: z.ZodString;
|
|
295
|
+
status: z.ZodString;
|
|
296
|
+
link: z.ZodString;
|
|
297
|
+
sourceUrl: z.ZodString;
|
|
298
|
+
mediaType: z.ZodString;
|
|
299
|
+
mimeType: z.ZodString;
|
|
300
|
+
}, "strip", z.ZodTypeAny, {
|
|
301
|
+
status: string;
|
|
302
|
+
id: number;
|
|
303
|
+
title: string;
|
|
304
|
+
link: string;
|
|
305
|
+
slug: string;
|
|
306
|
+
sourceUrl: string;
|
|
307
|
+
mediaType: string;
|
|
308
|
+
mimeType: string;
|
|
309
|
+
}, {
|
|
310
|
+
status: string;
|
|
311
|
+
id: number;
|
|
312
|
+
title: string;
|
|
313
|
+
link: string;
|
|
314
|
+
slug: string;
|
|
315
|
+
sourceUrl: string;
|
|
316
|
+
mediaType: string;
|
|
317
|
+
mimeType: string;
|
|
318
|
+
}>;
|
|
319
|
+
export declare const WordPressUploadMediaInputSchema: z.ZodObject<{
|
|
320
|
+
filename: z.ZodString;
|
|
321
|
+
mimeType: z.ZodString;
|
|
322
|
+
contentBase64: z.ZodString;
|
|
323
|
+
}, "strip", z.ZodTypeAny, {
|
|
324
|
+
mimeType: string;
|
|
325
|
+
filename: string;
|
|
326
|
+
contentBase64: string;
|
|
327
|
+
}, {
|
|
328
|
+
mimeType: string;
|
|
329
|
+
filename: string;
|
|
330
|
+
contentBase64: string;
|
|
331
|
+
}>;
|
|
332
|
+
export declare const WordPressUploadMediaOutputSchema: z.ZodObject<{
|
|
333
|
+
id: z.ZodNumber;
|
|
334
|
+
title: z.ZodString;
|
|
335
|
+
slug: z.ZodString;
|
|
336
|
+
status: z.ZodString;
|
|
337
|
+
link: z.ZodString;
|
|
338
|
+
sourceUrl: z.ZodString;
|
|
339
|
+
mediaType: z.ZodString;
|
|
340
|
+
mimeType: z.ZodString;
|
|
341
|
+
}, "strip", z.ZodTypeAny, {
|
|
342
|
+
status: string;
|
|
343
|
+
id: number;
|
|
344
|
+
title: string;
|
|
345
|
+
link: string;
|
|
346
|
+
slug: string;
|
|
347
|
+
sourceUrl: string;
|
|
348
|
+
mediaType: string;
|
|
349
|
+
mimeType: string;
|
|
350
|
+
}, {
|
|
351
|
+
status: string;
|
|
352
|
+
id: number;
|
|
353
|
+
title: string;
|
|
354
|
+
link: string;
|
|
355
|
+
slug: string;
|
|
356
|
+
sourceUrl: string;
|
|
357
|
+
mediaType: string;
|
|
358
|
+
mimeType: string;
|
|
359
|
+
}>;
|
|
360
|
+
export interface WordPressApiPost {
|
|
361
|
+
id: number;
|
|
362
|
+
title: {
|
|
363
|
+
rendered: string;
|
|
364
|
+
};
|
|
365
|
+
slug: string;
|
|
366
|
+
status: string;
|
|
367
|
+
link: string;
|
|
368
|
+
date: string;
|
|
369
|
+
modified: string;
|
|
370
|
+
author: number;
|
|
371
|
+
featured_media: number;
|
|
372
|
+
categories: number[];
|
|
373
|
+
tags: number[];
|
|
374
|
+
content?: {
|
|
375
|
+
rendered: string;
|
|
376
|
+
};
|
|
377
|
+
excerpt?: {
|
|
378
|
+
rendered: string;
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
export interface WordPressApiMedia {
|
|
382
|
+
id: number;
|
|
383
|
+
title: {
|
|
384
|
+
rendered: string;
|
|
385
|
+
};
|
|
386
|
+
slug: string;
|
|
387
|
+
status: string;
|
|
388
|
+
link: string;
|
|
389
|
+
source_url: string;
|
|
390
|
+
media_type: string;
|
|
391
|
+
mime_type: string;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Normalize a raw WordPress REST API post response into the minimal output shape.
|
|
395
|
+
*/
|
|
396
|
+
export declare function normalizeWordPressPost(raw: WordPressApiPost): WordPressPost;
|
|
397
|
+
/**
|
|
398
|
+
* Normalize a raw WordPress REST API media response into the minimal output shape.
|
|
399
|
+
*/
|
|
400
|
+
export declare function normalizeWordPressMedia(raw: WordPressApiMedia): WordPressMedia;
|
|
401
|
+
export type WordPressPost = z.infer<typeof WordPressPostSchema>;
|
|
402
|
+
export type WordPressCreatePostInput = z.infer<typeof WordPressCreatePostInputSchema>;
|
|
403
|
+
export type WordPressCreatePostOutput = z.infer<typeof WordPressCreatePostOutputSchema>;
|
|
404
|
+
export type WordPressUpdatePostInput = z.infer<typeof WordPressUpdatePostInputSchema>;
|
|
405
|
+
export type WordPressUpdatePostOutput = z.infer<typeof WordPressUpdatePostOutputSchema>;
|
|
406
|
+
export type WordPressGetPostsInput = z.infer<typeof WordPressGetPostsInputSchema>;
|
|
407
|
+
export type WordPressGetPostsOutput = z.infer<typeof WordPressGetPostsOutputSchema>;
|
|
408
|
+
export type WordPressMedia = z.infer<typeof WordPressMediaSchema>;
|
|
409
|
+
export type WordPressUploadMediaInput = z.infer<typeof WordPressUploadMediaInputSchema>;
|
|
410
|
+
export type WordPressUploadMediaOutput = z.infer<typeof WordPressUploadMediaOutputSchema>;
|
|
411
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/integrations/wordpress/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc9B,CAAA;AAIF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;EASzC,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;EAKzC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAKvC,CAAA;AAIF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsB,CAAA;AAElE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsB,CAAA;AAElE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxC,CAAA;AAIF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS/B,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;EAI1C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuB,CAAA;AAIpE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,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CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,gCAAgC,CACxC,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// ─── Normalized post shape shared across create/update/get ───────────────────
|
|
3
|
+
export const WordPressPostSchema = z.object({
|
|
4
|
+
id: z.number(),
|
|
5
|
+
title: z.string(),
|
|
6
|
+
slug: z.string(),
|
|
7
|
+
status: z.string(),
|
|
8
|
+
link: z.string(),
|
|
9
|
+
date: z.string(),
|
|
10
|
+
modified: z.string(),
|
|
11
|
+
author: z.number(),
|
|
12
|
+
featuredMedia: z.number(),
|
|
13
|
+
categories: z.array(z.number()),
|
|
14
|
+
tags: z.array(z.number()),
|
|
15
|
+
content: z.string().optional(),
|
|
16
|
+
excerpt: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
// ─── Input schemas ────────────────────────────────────────────────────────────
|
|
19
|
+
export const WordPressCreatePostInputSchema = z.object({
|
|
20
|
+
title: z.string().min(1),
|
|
21
|
+
content: z.string().min(1),
|
|
22
|
+
status: z.enum(['publish', 'draft', 'private', 'pending']).optional(),
|
|
23
|
+
categories: z.array(z.number().int().positive()).optional(),
|
|
24
|
+
tags: z.array(z.number().int().positive()).optional(),
|
|
25
|
+
featuredMediaId: z.number().int().positive().optional(),
|
|
26
|
+
excerpt: z.string().optional(),
|
|
27
|
+
slug: z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
export const WordPressUpdatePostInputSchema = z.object({
|
|
30
|
+
postId: z.number().int().positive(),
|
|
31
|
+
title: z.string().min(1).optional(),
|
|
32
|
+
content: z.string().min(1).optional(),
|
|
33
|
+
status: z.enum(['publish', 'draft', 'private', 'pending']).optional(),
|
|
34
|
+
});
|
|
35
|
+
export const WordPressGetPostsInputSchema = z.object({
|
|
36
|
+
status: z.enum(['publish', 'draft', 'private', 'pending', 'future', 'trash', 'any']).optional(),
|
|
37
|
+
perPage: z.number().int().min(1).max(100).optional(),
|
|
38
|
+
page: z.number().int().positive().optional(),
|
|
39
|
+
search: z.string().optional(),
|
|
40
|
+
});
|
|
41
|
+
// ─── Output schemas ───────────────────────────────────────────────────────────
|
|
42
|
+
export const WordPressCreatePostOutputSchema = WordPressPostSchema;
|
|
43
|
+
export const WordPressUpdatePostOutputSchema = WordPressPostSchema;
|
|
44
|
+
export const WordPressGetPostsOutputSchema = z.object({
|
|
45
|
+
posts: z.array(WordPressPostSchema),
|
|
46
|
+
meta: z.object({
|
|
47
|
+
totalFound: z.number(),
|
|
48
|
+
limit: z.number(),
|
|
49
|
+
offset: z.number(),
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
// ─── Upload media schemas ─────────────────────────────────────────────────────
|
|
53
|
+
export const WordPressMediaSchema = z.object({
|
|
54
|
+
id: z.number(),
|
|
55
|
+
title: z.string(),
|
|
56
|
+
slug: z.string(),
|
|
57
|
+
status: z.string(),
|
|
58
|
+
link: z.string(),
|
|
59
|
+
sourceUrl: z.string(),
|
|
60
|
+
mediaType: z.string(),
|
|
61
|
+
mimeType: z.string(),
|
|
62
|
+
});
|
|
63
|
+
export const WordPressUploadMediaInputSchema = z.object({
|
|
64
|
+
filename: z.string().min(1),
|
|
65
|
+
mimeType: z.string().min(1),
|
|
66
|
+
contentBase64: z.string().min(1),
|
|
67
|
+
});
|
|
68
|
+
export const WordPressUploadMediaOutputSchema = WordPressMediaSchema;
|
|
69
|
+
// ─── Normalizer ───────────────────────────────────────────────────────────────
|
|
70
|
+
/**
|
|
71
|
+
* Normalize a raw WordPress REST API post response into the minimal output shape.
|
|
72
|
+
*/
|
|
73
|
+
export function normalizeWordPressPost(raw) {
|
|
74
|
+
const normalized = {
|
|
75
|
+
id: raw.id,
|
|
76
|
+
title: raw.title.rendered,
|
|
77
|
+
slug: raw.slug,
|
|
78
|
+
status: raw.status,
|
|
79
|
+
link: raw.link,
|
|
80
|
+
date: raw.date,
|
|
81
|
+
modified: raw.modified,
|
|
82
|
+
author: raw.author,
|
|
83
|
+
featuredMedia: raw.featured_media,
|
|
84
|
+
categories: raw.categories ?? [],
|
|
85
|
+
tags: raw.tags ?? [],
|
|
86
|
+
};
|
|
87
|
+
if (raw.content !== undefined) {
|
|
88
|
+
normalized.content = raw.content.rendered;
|
|
89
|
+
}
|
|
90
|
+
if (raw.excerpt !== undefined) {
|
|
91
|
+
normalized.excerpt = raw.excerpt.rendered;
|
|
92
|
+
}
|
|
93
|
+
return normalized;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Normalize a raw WordPress REST API media response into the minimal output shape.
|
|
97
|
+
*/
|
|
98
|
+
export function normalizeWordPressMedia(raw) {
|
|
99
|
+
return {
|
|
100
|
+
id: raw.id,
|
|
101
|
+
title: raw.title.rendered,
|
|
102
|
+
slug: raw.slug,
|
|
103
|
+
status: raw.status,
|
|
104
|
+
link: raw.link,
|
|
105
|
+
sourceUrl: raw.source_url,
|
|
106
|
+
mediaType: raw.media_type,
|
|
107
|
+
mimeType: raw.mime_type,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","s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GAAG,CAAC,IAAI;QACd,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,QAAQ,EAAE,GAAG,CAAC,SAAS;KACxB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const wordpressUpdatePostNode: import("@jam-nodes/core").NodeDefinition<{
|
|
2
|
+
postId: number;
|
|
3
|
+
status?: "pending" | "publish" | "draft" | "private" | undefined;
|
|
4
|
+
title?: string | undefined;
|
|
5
|
+
content?: string | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
status: string;
|
|
8
|
+
date: string;
|
|
9
|
+
id: number;
|
|
10
|
+
title: string;
|
|
11
|
+
link: string;
|
|
12
|
+
author: number;
|
|
13
|
+
slug: string;
|
|
14
|
+
tags: number[];
|
|
15
|
+
modified: string;
|
|
16
|
+
featuredMedia: number;
|
|
17
|
+
categories: number[];
|
|
18
|
+
content?: string | undefined;
|
|
19
|
+
excerpt?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=updatePost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updatePost.d.ts","sourceRoot":"","sources":["../../../src/integrations/wordpress/updatePost.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;EA0DlC,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineNode } from '@jam-nodes/core';
|
|
2
|
+
import { fetchWithRetry } from '../../utils/http.js';
|
|
3
|
+
import { resolveWordPressAuth } from './utils.js';
|
|
4
|
+
import { WordPressUpdatePostInputSchema, WordPressUpdatePostOutputSchema, normalizeWordPressPost, } from './schemas.js';
|
|
5
|
+
export const wordpressUpdatePostNode = defineNode({
|
|
6
|
+
type: 'wordpress_update_post',
|
|
7
|
+
name: 'WordPress Update Post',
|
|
8
|
+
description: 'Update an existing post on WordPress by its ID',
|
|
9
|
+
category: 'integration',
|
|
10
|
+
inputSchema: WordPressUpdatePostInputSchema,
|
|
11
|
+
outputSchema: WordPressUpdatePostOutputSchema,
|
|
12
|
+
estimatedDuration: 5,
|
|
13
|
+
capabilities: {
|
|
14
|
+
supportsRerun: true,
|
|
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 postBody = {};
|
|
24
|
+
if (input.title !== undefined)
|
|
25
|
+
postBody['title'] = input.title;
|
|
26
|
+
if (input.content !== undefined)
|
|
27
|
+
postBody['content'] = input.content;
|
|
28
|
+
if (input.status !== undefined)
|
|
29
|
+
postBody['status'] = input.status;
|
|
30
|
+
const response = await fetchWithRetry(`${baseUrl}/wp-json/wp/v2/posts/${input.postId}`, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
headers: {
|
|
33
|
+
Authorization: authHeader,
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
},
|
|
36
|
+
body: JSON.stringify(postBody),
|
|
37
|
+
}, { maxRetries: 3, backoffMs: 1000, timeoutMs: 30000 });
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
const errorText = await response.text();
|
|
40
|
+
return {
|
|
41
|
+
success: false,
|
|
42
|
+
error: `WordPress API error ${response.status}: ${errorText}`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const data = (await response.json());
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
output: normalizeWordPressPost(data),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=updatePost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updatePost.js","sourceRoot":"","sources":["../../../src/integrations/wordpress/updatePost.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,8BAA8B,EAC9B,+BAA+B,EAG/B,sBAAsB,GACvB,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC;IAChD,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,gDAAgD;IAC7D,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,8BAA8B;IAC3C,YAAY,EAAE,+BAA+B;IAC7C,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE;QACZ,aAAa,EAAE,IAAI;KACpB;IACD,QAAQ,EAAE,KAAK,EAAE,KAA+B,EAAE,OAAO,EAAE,EAAE;QAC3D,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;YACvE,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;gBAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,CAAA;YACpD,CAAC;YACD,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAAA;YAE1C,MAAM,QAAQ,GAA4B,EAAE,CAAA;YAC5C,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;gBAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,KA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,15 @@
|
|
|
1
|
+
export declare const wordpressUploadMediaNode: import("@jam-nodes/core").NodeDefinition<{
|
|
2
|
+
mimeType: string;
|
|
3
|
+
filename: string;
|
|
4
|
+
contentBase64: string;
|
|
5
|
+
}, {
|
|
6
|
+
status: string;
|
|
7
|
+
id: number;
|
|
8
|
+
title: string;
|
|
9
|
+
link: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
sourceUrl: string;
|
|
12
|
+
mediaType: string;
|
|
13
|
+
mimeType: string;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=uploadMedia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadMedia.d.ts","sourceRoot":"","sources":["../../../src/integrations/wordpress/uploadMedia.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;EA0DnC,CAAA"}
|