@pipedream/rendex 0.1.0 → 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/actions/create-artifact/create-artifact.mjs +111 -0
- package/actions/create-render-link/create-render-link.mjs +256 -0
- package/actions/create-watch/create-watch.mjs +141 -0
- package/actions/delete-watch/delete-watch.mjs +34 -0
- package/actions/extract-content/extract-content.mjs +64 -0
- package/actions/get-account/get-account.mjs +33 -0
- package/actions/get-watch/get-watch.mjs +32 -0
- package/actions/list-watch-runs/list-watch-runs.mjs +48 -0
- package/actions/list-watches/list-watches.mjs +55 -0
- package/actions/render-markdown/render-markdown.mjs +49 -0
- package/actions/render-to-image/render-to-image.mjs +211 -1
- package/actions/run-watch/run-watch.mjs +32 -0
- package/actions/update-watch/update-watch.mjs +148 -0
- package/package.json +1 -1
- package/rendex.app.mjs +429 -0
- package/sources/new-change-detected/new-change-detected.mjs +151 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import rendex from "../../rendex.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "rendex-create-artifact",
|
|
5
|
+
name: "Create Artifact",
|
|
6
|
+
description: "Turn Markdown or HTML plus a small branding theme into a branded PDF + PNG and a hosted share page in one call. Returns `pdfUrl`, `pngUrl`, `shareUrl`, and `expiresAt`. [See the documentation](https://rendex.dev/docs/api-reference#post-artifact).",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
rendex,
|
|
16
|
+
content: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Content",
|
|
19
|
+
description: "The Markdown or HTML body to render into a branded artifact.",
|
|
20
|
+
},
|
|
21
|
+
inputFormat: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Input Format",
|
|
24
|
+
description: "How to interpret `content`: `markdown` is converted to styled HTML; `html` is used as a body fragment.",
|
|
25
|
+
optional: true,
|
|
26
|
+
default: "markdown",
|
|
27
|
+
options: [
|
|
28
|
+
"markdown",
|
|
29
|
+
"html",
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
formats: {
|
|
33
|
+
type: "string[]",
|
|
34
|
+
label: "Formats",
|
|
35
|
+
description: "Which artifact formats to produce. Each format charges 1 credit. Defaults to both.",
|
|
36
|
+
optional: true,
|
|
37
|
+
default: [
|
|
38
|
+
"pdf",
|
|
39
|
+
"png",
|
|
40
|
+
],
|
|
41
|
+
options: [
|
|
42
|
+
"pdf",
|
|
43
|
+
"png",
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
brandName: {
|
|
47
|
+
type: "string",
|
|
48
|
+
label: "Brand Name",
|
|
49
|
+
description: "Plain-text header line shown beside the logo (maps to `branding.header`).",
|
|
50
|
+
optional: true,
|
|
51
|
+
},
|
|
52
|
+
title: {
|
|
53
|
+
type: "string",
|
|
54
|
+
label: "Title",
|
|
55
|
+
description: "Title for the hosted share page. Falls back to **Brand Name** when set; both populate `branding.header` (the API's single header field).",
|
|
56
|
+
optional: true,
|
|
57
|
+
},
|
|
58
|
+
accentColor: {
|
|
59
|
+
type: "string",
|
|
60
|
+
label: "Accent Color",
|
|
61
|
+
description: "CSS color for the accent bar, links, and headings (e.g. `#EA580C`, `rebeccapurple`).",
|
|
62
|
+
optional: true,
|
|
63
|
+
},
|
|
64
|
+
logoUrl: {
|
|
65
|
+
type: "string",
|
|
66
|
+
label: "Logo URL",
|
|
67
|
+
description: "Absolute http(s) URL of a logo image shown in the artifact header.",
|
|
68
|
+
optional: true,
|
|
69
|
+
},
|
|
70
|
+
footer: {
|
|
71
|
+
type: "string",
|
|
72
|
+
label: "Footer",
|
|
73
|
+
description: "Plain-text footer line shown at the bottom of every page.",
|
|
74
|
+
optional: true,
|
|
75
|
+
},
|
|
76
|
+
expiresIn: {
|
|
77
|
+
propDefinition: [
|
|
78
|
+
rendex,
|
|
79
|
+
"expiresIn",
|
|
80
|
+
],
|
|
81
|
+
description: "Seconds until the hosted artifact URLs expire (3600–2592000). Defaults to `86400` (24 hours).",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
async run({ $ }) {
|
|
85
|
+
const branding = {
|
|
86
|
+
logo: this.logoUrl,
|
|
87
|
+
accentColor: this.accentColor,
|
|
88
|
+
header: this.brandName || this.title,
|
|
89
|
+
footer: this.footer,
|
|
90
|
+
};
|
|
91
|
+
const hasBranding = Object.values(branding).some((value) =>
|
|
92
|
+
value !== undefined && value !== "");
|
|
93
|
+
|
|
94
|
+
const response = await this.rendex.createArtifact({
|
|
95
|
+
$,
|
|
96
|
+
data: {
|
|
97
|
+
content: this.content,
|
|
98
|
+
inputFormat: this.inputFormat,
|
|
99
|
+
formats: this.formats,
|
|
100
|
+
branding: hasBranding
|
|
101
|
+
? branding
|
|
102
|
+
: undefined,
|
|
103
|
+
expiresIn: this.expiresIn,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const data = response.data;
|
|
108
|
+
$.export("$summary", `Created artifact (share ${data?.shareUrl})`);
|
|
109
|
+
return data;
|
|
110
|
+
},
|
|
111
|
+
};
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
|
+
import rendex from "../../rendex.app.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "rendex-create-render-link",
|
|
6
|
+
name: "Create Render Link",
|
|
7
|
+
description: "Mint a signed, hosted render URL for a page or HTML — ideal for `og:image` tags. The returned URL serves the rendered image/PDF directly. [See the documentation](https://rendex.dev/docs/api-reference#post-render-link).",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
annotations: {
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
openWorldHint: true,
|
|
13
|
+
readOnlyHint: false,
|
|
14
|
+
},
|
|
15
|
+
props: {
|
|
16
|
+
rendex,
|
|
17
|
+
url: {
|
|
18
|
+
type: "string",
|
|
19
|
+
label: "URL",
|
|
20
|
+
description: "The page URL to render. Provide either `url` or `html`.",
|
|
21
|
+
optional: true,
|
|
22
|
+
},
|
|
23
|
+
html: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
rendex,
|
|
26
|
+
"html",
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
format: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
rendex,
|
|
32
|
+
"format",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
width: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
rendex,
|
|
38
|
+
"width",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
height: {
|
|
42
|
+
propDefinition: [
|
|
43
|
+
rendex,
|
|
44
|
+
"height",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
fullPage: {
|
|
48
|
+
propDefinition: [
|
|
49
|
+
rendex,
|
|
50
|
+
"fullPage",
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
quality: {
|
|
54
|
+
propDefinition: [
|
|
55
|
+
rendex,
|
|
56
|
+
"quality",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
delay: {
|
|
60
|
+
propDefinition: [
|
|
61
|
+
rendex,
|
|
62
|
+
"delay",
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
darkMode: {
|
|
66
|
+
propDefinition: [
|
|
67
|
+
rendex,
|
|
68
|
+
"darkMode",
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
deviceScaleFactor: {
|
|
72
|
+
propDefinition: [
|
|
73
|
+
rendex,
|
|
74
|
+
"deviceScaleFactor",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
device: {
|
|
78
|
+
propDefinition: [
|
|
79
|
+
rendex,
|
|
80
|
+
"device",
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
selector: {
|
|
84
|
+
propDefinition: [
|
|
85
|
+
rendex,
|
|
86
|
+
"selector",
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
hideSelectors: {
|
|
90
|
+
propDefinition: [
|
|
91
|
+
rendex,
|
|
92
|
+
"hideSelectors",
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
blockAds: {
|
|
96
|
+
propDefinition: [
|
|
97
|
+
rendex,
|
|
98
|
+
"blockAds",
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
blockCookieBanners: {
|
|
102
|
+
propDefinition: [
|
|
103
|
+
rendex,
|
|
104
|
+
"blockCookieBanners",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
timeout: {
|
|
108
|
+
propDefinition: [
|
|
109
|
+
rendex,
|
|
110
|
+
"timeout",
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
waitUntil: {
|
|
114
|
+
propDefinition: [
|
|
115
|
+
rendex,
|
|
116
|
+
"waitUntil",
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
bestAttempt: {
|
|
120
|
+
propDefinition: [
|
|
121
|
+
rendex,
|
|
122
|
+
"bestAttempt",
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
css: {
|
|
126
|
+
propDefinition: [
|
|
127
|
+
rendex,
|
|
128
|
+
"css",
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
js: {
|
|
132
|
+
propDefinition: [
|
|
133
|
+
rendex,
|
|
134
|
+
"js",
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
userAgent: {
|
|
138
|
+
propDefinition: [
|
|
139
|
+
rendex,
|
|
140
|
+
"userAgent",
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
cookies: {
|
|
144
|
+
propDefinition: [
|
|
145
|
+
rendex,
|
|
146
|
+
"cookies",
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
headers: {
|
|
150
|
+
propDefinition: [
|
|
151
|
+
rendex,
|
|
152
|
+
"headers",
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
pdfFormat: {
|
|
156
|
+
propDefinition: [
|
|
157
|
+
rendex,
|
|
158
|
+
"pdfFormat",
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
pdfLandscape: {
|
|
162
|
+
propDefinition: [
|
|
163
|
+
rendex,
|
|
164
|
+
"pdfLandscape",
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
pdfPrintBackground: {
|
|
168
|
+
propDefinition: [
|
|
169
|
+
rendex,
|
|
170
|
+
"pdfPrintBackground",
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
pdfScale: {
|
|
174
|
+
propDefinition: [
|
|
175
|
+
rendex,
|
|
176
|
+
"pdfScale",
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
expiresIn: {
|
|
180
|
+
propDefinition: [
|
|
181
|
+
rendex,
|
|
182
|
+
"expiresIn",
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
async run({ $ }) {
|
|
187
|
+
const hasHtml = Boolean(this.html);
|
|
188
|
+
const hasUrl = Boolean(this.url);
|
|
189
|
+
if (hasHtml === hasUrl) {
|
|
190
|
+
throw new ConfigurationError("Provide exactly one of `html` or `url`.");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let cookies;
|
|
194
|
+
if (this.cookies?.length) {
|
|
195
|
+
try {
|
|
196
|
+
cookies = this.cookies.map((cookie) => {
|
|
197
|
+
const parsed = typeof cookie === "string"
|
|
198
|
+
? JSON.parse(cookie)
|
|
199
|
+
: cookie;
|
|
200
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
201
|
+
throw new Error("Invalid cookie shape");
|
|
202
|
+
}
|
|
203
|
+
return parsed;
|
|
204
|
+
});
|
|
205
|
+
} catch {
|
|
206
|
+
throw new ConfigurationError("Each cookie must be a JSON object, e.g. {\"name\":\"session\",\"value\":\"abc\"}.");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const response = await this.rendex.createRenderLink({
|
|
211
|
+
$,
|
|
212
|
+
data: {
|
|
213
|
+
url: hasUrl
|
|
214
|
+
? this.url
|
|
215
|
+
: undefined,
|
|
216
|
+
html: hasHtml
|
|
217
|
+
? this.html
|
|
218
|
+
: undefined,
|
|
219
|
+
format: this.format,
|
|
220
|
+
width: this.width,
|
|
221
|
+
height: this.height,
|
|
222
|
+
fullPage: this.fullPage,
|
|
223
|
+
quality: this.quality,
|
|
224
|
+
delay: this.delay,
|
|
225
|
+
darkMode: this.darkMode,
|
|
226
|
+
deviceScaleFactor: this.deviceScaleFactor !== undefined
|
|
227
|
+
? Number(this.deviceScaleFactor)
|
|
228
|
+
: undefined,
|
|
229
|
+
device: this.device,
|
|
230
|
+
selector: this.selector,
|
|
231
|
+
hideSelectors: this.hideSelectors,
|
|
232
|
+
blockAds: this.blockAds,
|
|
233
|
+
blockCookieBanners: this.blockCookieBanners,
|
|
234
|
+
timeout: this.timeout,
|
|
235
|
+
waitUntil: this.waitUntil,
|
|
236
|
+
bestAttempt: this.bestAttempt,
|
|
237
|
+
css: this.css,
|
|
238
|
+
js: this.js,
|
|
239
|
+
userAgent: this.userAgent,
|
|
240
|
+
cookies,
|
|
241
|
+
headers: this.headers,
|
|
242
|
+
pdfFormat: this.pdfFormat,
|
|
243
|
+
pdfLandscape: this.pdfLandscape,
|
|
244
|
+
pdfPrintBackground: this.pdfPrintBackground,
|
|
245
|
+
pdfScale: this.pdfScale !== undefined
|
|
246
|
+
? Number(this.pdfScale)
|
|
247
|
+
: undefined,
|
|
248
|
+
expiresIn: this.expiresIn,
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
const data = response.data;
|
|
253
|
+
$.export("$summary", `Created render link (expires ${data?.expiresAt})`);
|
|
254
|
+
return data;
|
|
255
|
+
},
|
|
256
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import rendex from "../../rendex.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "rendex-create-watch",
|
|
5
|
+
name: "Create Watch",
|
|
6
|
+
description: "Create a watch that monitors a page for visual or text changes. [See the documentation](https://rendex.dev/docs/watch#create-a-watch).",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
rendex,
|
|
16
|
+
url: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "URL",
|
|
19
|
+
description: "The page URL to monitor for changes.",
|
|
20
|
+
},
|
|
21
|
+
name: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
rendex,
|
|
24
|
+
"name",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
intervalMinutes: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
rendex,
|
|
30
|
+
"intervalMinutes",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
diffMode: {
|
|
34
|
+
propDefinition: [
|
|
35
|
+
rendex,
|
|
36
|
+
"diffMode",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
threshold: {
|
|
40
|
+
propDefinition: [
|
|
41
|
+
rendex,
|
|
42
|
+
"threshold",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
webhookUrl: {
|
|
46
|
+
propDefinition: [
|
|
47
|
+
rendex,
|
|
48
|
+
"webhookUrl",
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
notifyEmail: {
|
|
52
|
+
propDefinition: [
|
|
53
|
+
rendex,
|
|
54
|
+
"notifyEmail",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
paused: {
|
|
58
|
+
propDefinition: [
|
|
59
|
+
rendex,
|
|
60
|
+
"paused",
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
renderFullPage: {
|
|
64
|
+
propDefinition: [
|
|
65
|
+
rendex,
|
|
66
|
+
"renderFullPage",
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
renderSelector: {
|
|
70
|
+
propDefinition: [
|
|
71
|
+
rendex,
|
|
72
|
+
"renderSelector",
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
ignoreText: {
|
|
76
|
+
propDefinition: [
|
|
77
|
+
rendex,
|
|
78
|
+
"ignoreText",
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
minTextChars: {
|
|
82
|
+
propDefinition: [
|
|
83
|
+
rendex,
|
|
84
|
+
"minTextChars",
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
suppressWhilePresent: {
|
|
88
|
+
propDefinition: [
|
|
89
|
+
rendex,
|
|
90
|
+
"suppressWhilePresent",
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
uaMode: {
|
|
94
|
+
propDefinition: [
|
|
95
|
+
rendex,
|
|
96
|
+
"uaMode",
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
methods: {
|
|
101
|
+
// Assemble the watch's stored render knobs from the render* props. Returns
|
|
102
|
+
// undefined when every field is empty so the body omits `renderParams` and
|
|
103
|
+
// the API keeps its defaults (notably fullPage: true). Field names match
|
|
104
|
+
// the API watch schema (schemas/watch-params.ts → WatchRenderParams).
|
|
105
|
+
buildRenderParams() {
|
|
106
|
+
const renderParams = {
|
|
107
|
+
fullPage: this.renderFullPage,
|
|
108
|
+
selector: this.renderSelector,
|
|
109
|
+
ignoreText: this.ignoreText,
|
|
110
|
+
minTextChars: this.minTextChars,
|
|
111
|
+
suppressWhilePresent: this.suppressWhilePresent,
|
|
112
|
+
uaMode: this.uaMode,
|
|
113
|
+
};
|
|
114
|
+
return Object.values(renderParams).some((value) => value !== undefined)
|
|
115
|
+
? renderParams
|
|
116
|
+
: undefined;
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
async run({ $ }) {
|
|
120
|
+
const response = await this.rendex.createWatch({
|
|
121
|
+
$,
|
|
122
|
+
data: {
|
|
123
|
+
url: this.url,
|
|
124
|
+
name: this.name,
|
|
125
|
+
intervalMinutes: this.intervalMinutes,
|
|
126
|
+
diffMode: this.diffMode,
|
|
127
|
+
threshold: this.threshold !== undefined
|
|
128
|
+
? Number(this.threshold)
|
|
129
|
+
: undefined,
|
|
130
|
+
webhookUrl: this.webhookUrl,
|
|
131
|
+
notifyEmail: this.notifyEmail,
|
|
132
|
+
paused: this.paused,
|
|
133
|
+
renderParams: this.buildRenderParams(),
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const watch = response.data;
|
|
138
|
+
$.export("$summary", `Created watch ${watch?.id}`);
|
|
139
|
+
return watch;
|
|
140
|
+
},
|
|
141
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import rendex from "../../rendex.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "rendex-delete-watch",
|
|
5
|
+
name: "Delete Watch",
|
|
6
|
+
description: "Delete a watch and its run history. [See the documentation](https://rendex.dev/docs/watch#endpoints).",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: true,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: false,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
rendex,
|
|
16
|
+
watchId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
rendex,
|
|
19
|
+
"watchId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
await this.rendex.deleteWatch(this.watchId, {
|
|
25
|
+
$,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
$.export("$summary", `Deleted watch ${this.watchId}`);
|
|
29
|
+
return {
|
|
30
|
+
success: true,
|
|
31
|
+
watchId: this.watchId,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import rendex from "../../rendex.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "rendex-extract-content",
|
|
5
|
+
name: "Extract Content",
|
|
6
|
+
description: "Extract the readable content of a page as Markdown, JSON, or HTML. [See the documentation](https://rendex.dev/docs/api-reference#post-extract).",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
rendex,
|
|
16
|
+
url: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "URL",
|
|
19
|
+
description: "The page URL to extract content from.",
|
|
20
|
+
},
|
|
21
|
+
extractFormat: {
|
|
22
|
+
propDefinition: [
|
|
23
|
+
rendex,
|
|
24
|
+
"extractFormat",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
waitUntil: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
rendex,
|
|
30
|
+
"waitUntil",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
delay: {
|
|
34
|
+
propDefinition: [
|
|
35
|
+
rendex,
|
|
36
|
+
"delay",
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
timeout: {
|
|
40
|
+
type: "integer",
|
|
41
|
+
label: "Timeout (seconds)",
|
|
42
|
+
description: "Maximum time to wait for the page to load (5–60).",
|
|
43
|
+
optional: true,
|
|
44
|
+
min: 5,
|
|
45
|
+
max: 60,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
async run({ $ }) {
|
|
49
|
+
const response = await this.rendex.extract({
|
|
50
|
+
$,
|
|
51
|
+
data: {
|
|
52
|
+
url: this.url,
|
|
53
|
+
extractFormat: this.extractFormat,
|
|
54
|
+
waitUntil: this.waitUntil,
|
|
55
|
+
delay: this.delay,
|
|
56
|
+
timeout: this.timeout,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const data = response.data;
|
|
61
|
+
$.export("$summary", `Extracted content from ${this.url}`);
|
|
62
|
+
return data;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import rendex from "../../rendex.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "rendex-get-account",
|
|
5
|
+
name: "Get Account",
|
|
6
|
+
description: "Get your Rendex plan and this month's usage (credits used/limit/remaining), rate limit, and recommended upgrade. Read-only and free (no credits charged). [See the documentation](https://rendex.dev/docs/api-reference#get-account).",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
rendex,
|
|
16
|
+
},
|
|
17
|
+
async run({ $ }) {
|
|
18
|
+
const response = await this.rendex.getAccount({
|
|
19
|
+
$,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const data = response.data;
|
|
23
|
+
const usage = data?.usage ?? {};
|
|
24
|
+
const limitLabel = usage.unlimited
|
|
25
|
+
? "unlimited"
|
|
26
|
+
: usage.limit;
|
|
27
|
+
const remainingLabel = usage.unlimited
|
|
28
|
+
? "unlimited"
|
|
29
|
+
: usage.remaining;
|
|
30
|
+
$.export("$summary", `Plan: ${data?.plan} — ${remainingLabel}/${limitLabel} credits left`);
|
|
31
|
+
return data;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import rendex from "../../rendex.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "rendex-get-watch",
|
|
5
|
+
name: "Get Watch",
|
|
6
|
+
description: "Retrieve a single watch by its ID. [See the documentation](https://rendex.dev/docs/watch#endpoints).",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
rendex,
|
|
16
|
+
watchId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
rendex,
|
|
19
|
+
"watchId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
const response = await this.rendex.getWatch(this.watchId, {
|
|
25
|
+
$,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const watch = response.data;
|
|
29
|
+
$.export("$summary", `Retrieved watch ${this.watchId}`);
|
|
30
|
+
return watch;
|
|
31
|
+
},
|
|
32
|
+
};
|