runline 0.2.0 → 0.2.2
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 +1 -1
- package/dist/plugins/actionNetwork/src/index.js +118 -25
- package/dist/plugins/activeCampaign/src/index.js +184 -38
- package/dist/plugins/adalo/src/index.js +40 -8
- package/dist/plugins/affinity/src/index.js +100 -20
- package/dist/plugins/agileCrm/src/index.js +115 -27
- package/dist/plugins/airtable/src/index.js +94 -19
- package/dist/plugins/airtop/src/index.js +266 -62
- package/dist/plugins/apiTemplateIo/src/index.js +25 -5
- package/dist/plugins/asana/src/index.js +195 -41
- package/dist/plugins/autopilot/src/index.js +39 -8
- package/dist/plugins/bambooHr/src/index.js +109 -22
- package/dist/plugins/bannerbear/src/index.js +36 -8
- package/dist/plugins/baserow/src/index.js +35 -7
- package/dist/plugins/beeminder/src/index.js +198 -40
- package/dist/plugins/bitly/src/index.js +46 -10
- package/dist/plugins/bitwarden/src/index.js +167 -36
- package/dist/plugins/box/src/index.js +172 -37
- package/dist/plugins/brandfetch/src/index.js +5 -1
- package/dist/plugins/brevo/src/index.js +136 -29
- package/dist/plugins/bubble/src/index.js +76 -17
- package/dist/plugins/chargebee/src/index.js +35 -7
- package/dist/plugins/circleci/src/index.js +50 -10
- package/dist/plugins/ciscoWebex/src/index.js +131 -27
- package/dist/plugins/clearbit/src/index.js +76 -17
- package/dist/plugins/clickup/src/index.js +500 -107
- package/dist/plugins/clockify/src/index.js +229 -47
- package/dist/plugins/cloudflare/src/index.js +28 -6
- package/dist/plugins/cockpit/src/index.js +54 -12
- package/dist/plugins/coda/src/index.js +81 -19
- package/dist/plugins/coingecko/src/index.js +157 -33
- package/dist/plugins/contentful/src/index.js +85 -17
- package/dist/plugins/convertkit/src/index.js +74 -18
- package/dist/plugins/copper/src/index.js +59 -11
- package/dist/plugins/cortex/src/index.js +55 -13
- package/dist/plugins/currents/src/index.js +310 -71
- package/dist/plugins/customerIo/src/index.js +112 -23
- package/dist/plugins/databricks/src/index.js +549 -115
- package/dist/plugins/deepl/src/index.js +26 -6
- package/dist/plugins/demio/src/index.js +56 -11
- package/dist/plugins/dhl/src/index.js +16 -3
- package/dist/plugins/discord/src/index.js +141 -31
- package/dist/plugins/discourse/src/index.js +136 -31
- package/dist/plugins/disqus/src/index.js +96 -20
- package/dist/plugins/docker/src/index.js +20 -4
- package/dist/plugins/drift/src/index.js +19 -5
- package/dist/plugins/dropbox/src/index.js +139 -30
- package/dist/plugins/dropcontact/src/index.js +21 -4
- package/dist/plugins/egoi/src/index.js +61 -15
- package/dist/plugins/elasticsearch/src/index.js +59 -13
- package/dist/plugins/emelia/src/index.js +95 -19
- package/dist/plugins/erpnext/src/index.js +74 -15
- package/dist/plugins/facebookGraph/src/index.js +52 -11
- package/dist/plugins/freshdesk/src/index.js +220 -48
- package/dist/plugins/freshservice/src/index.js +39 -9
- package/dist/plugins/freshworksCrm/src/index.js +58 -12
- package/dist/plugins/getresponse/src/index.js +87 -18
- package/dist/plugins/ghost/src/index.js +114 -26
- package/dist/plugins/github/src/index.js +483 -109
- package/dist/plugins/gitlab/src/index.js +193 -45
- package/dist/plugins/gong/src/index.js +68 -14
- package/dist/plugins/gotify/src/index.js +43 -9
- package/dist/plugins/gotowebinar/src/index.js +233 -47
- package/dist/plugins/grafana/src/index.js +92 -21
- package/dist/plugins/graphql/src/index.js +38 -8
- package/dist/plugins/grist/src/index.js +52 -10
- package/dist/plugins/hackernews/src/index.js +32 -6
- package/dist/plugins/halopsa/src/index.js +131 -26
- package/dist/plugins/harvest/src/index.js +182 -42
- package/dist/plugins/helpscout/src/index.js +153 -31
- package/dist/plugins/highlevel/src/index.js +291 -58
- package/dist/plugins/homeAssistant/src/index.js +124 -26
- package/dist/plugins/hubspot/src/index.js +163 -29
- package/dist/plugins/humanticAi/src/index.js +54 -5
- package/dist/plugins/hunter/src/index.js +21 -4
- package/dist/plugins/intercom/src/index.js +95 -20
- package/dist/plugins/iterable/src/index.js +96 -20
- package/dist/plugins/jenkins/src/index.js +75 -17
- package/dist/plugins/jira/src/index.js +193 -43
- package/dist/plugins/keap/src/index.js +222 -56
- package/dist/plugins/kobotoolbox/src/index.js +113 -25
- package/dist/plugins/lemlist/src/index.js +79 -18
- package/dist/plugins/linear/src/index.js +86 -19
- package/dist/plugins/lingvanex/src/index.js +38 -8
- package/dist/plugins/linkedin/src/index.js +37 -8
- package/dist/plugins/lonescale/src/index.js +41 -9
- package/dist/plugins/magento/src/index.js +98 -27
- package/dist/plugins/mailcheck/src/index.js +11 -2
- package/dist/plugins/mailchimp/src/index.js +193 -42
- package/dist/plugins/mailerlite/src/index.js +61 -12
- package/dist/plugins/mailgun/src/index.js +39 -7
- package/dist/plugins/mailjet/src/index.js +141 -30
- package/dist/plugins/mandrill/src/index.js +67 -14
- package/dist/plugins/marketstack/src/index.js +56 -10
- package/dist/plugins/matrix/src/index.js +97 -20
- package/dist/plugins/mattermost/src/index.js +124 -26
- package/dist/plugins/mautic/src/index.js +129 -26
- package/dist/plugins/medium/src/index.js +64 -13
- package/dist/plugins/messagebird/src/index.js +80 -15
- package/dist/plugins/metabase/src/index.js +57 -12
- package/dist/plugins/misp/src/index.js +135 -33
- package/dist/plugins/mocean/src/index.js +33 -7
- package/dist/plugins/monday/src/index.js +97 -23
- package/dist/plugins/monicaCrm/src/index.js +112 -23
- package/dist/plugins/msg91/src/index.js +11 -2
- package/dist/plugins/nasa/src/index.js +108 -21
- package/dist/plugins/netlify/src/index.js +28 -6
- package/dist/plugins/netscalerAdc/src/index.js +144 -29
- package/dist/plugins/nextcloud/src/index.js +103 -20
- package/dist/plugins/nocodb/src/index.js +57 -11
- package/dist/plugins/notion/src/index.js +148 -37
- package/dist/plugins/npm/src/index.js +59 -12
- package/dist/plugins/odoo/src/index.js +102 -20
- package/dist/plugins/okta/src/index.js +50 -10
- package/dist/plugins/oneSimpleApi/src/index.js +84 -17
- package/dist/plugins/onfleet/src/index.js +139 -32
- package/dist/plugins/openThesaurus/src/index.js +46 -9
- package/dist/plugins/openweathermap/src/index.js +31 -6
- package/dist/plugins/oura/src/index.js +36 -7
- package/dist/plugins/paddle/src/index.js +80 -17
- package/dist/plugins/pagerduty/src/index.js +53 -12
- package/dist/plugins/paypal/src/index.js +51 -11
- package/dist/plugins/peekalink/src/index.js +12 -3
- package/dist/plugins/phantombuster/src/index.js +39 -8
- package/dist/plugins/philipsHue/src/index.js +64 -13
- package/dist/plugins/pipedrive/src/index.js +167 -45
- package/dist/plugins/plivo/src/index.js +43 -8
- package/dist/plugins/postbin/src/index.js +9 -2
- package/dist/plugins/posthog/src/index.js +50 -13
- package/dist/plugins/profitwell/src/index.js +24 -5
- package/dist/plugins/pushbullet/src/index.js +45 -9
- package/dist/plugins/pushcut/src/index.js +31 -6
- package/dist/plugins/pushover/src/index.js +51 -10
- package/dist/plugins/quickbase/src/index.js +66 -13
- package/dist/plugins/quickbooks/src/index.js +86 -19
- package/dist/plugins/quickchart/src/index.js +35 -7
- package/dist/plugins/raindrop/src/index.js +54 -13
- package/dist/plugins/reddit/src/index.js +73 -18
- package/dist/plugins/rocketchat/src/index.js +47 -9
- package/dist/plugins/rundeck/src/index.js +26 -5
- package/dist/plugins/salesforce/src/index.js +161 -31
- package/dist/plugins/salesmate/src/index.js +75 -16
- package/dist/plugins/securityScorecard/src/index.js +73 -15
- package/dist/plugins/segment/src/index.js +21 -4
- package/dist/plugins/sendgrid/src/index.js +102 -24
- package/dist/plugins/sendy/src/index.js +54 -11
- package/dist/plugins/sentry/src/index.js +174 -34
- package/dist/plugins/servicenow/src/index.js +120 -27
- package/dist/plugins/shopify/src/index.js +53 -12
- package/dist/plugins/signl4/src/index.js +16 -3
- package/dist/plugins/slack/src/index.js +407 -105
- package/dist/plugins/sms77/src/index.js +26 -5
- package/dist/plugins/splunk/src/index.js +186 -45
- package/dist/plugins/spotify/src/index.js +265 -66
- package/dist/plugins/stackby/src/index.js +18 -6
- package/dist/plugins/storyblok/src/index.js +57 -11
- package/dist/plugins/strapi/src/index.js +63 -12
- package/dist/plugins/strava/src/index.js +58 -13
- package/dist/plugins/stripe/src/index.js +143 -30
- package/dist/plugins/supabase/src/index.js +49 -10
- package/dist/plugins/syncromsp/src/index.js +245 -67
- package/dist/plugins/tapfiliate/src/index.js +57 -14
- package/dist/plugins/telegram/src/index.js +202 -39
- package/dist/plugins/thehive/src/index.js +271 -66
- package/dist/plugins/thehiveProject/src/index.js +457 -89
- package/dist/plugins/todoist/src/index.js +326 -77
- package/dist/plugins/travisci/src/index.js +35 -8
- package/dist/plugins/trello/src/index.js +204 -46
- package/dist/plugins/twake/src/index.js +10 -2
- package/dist/plugins/twilio/src/index.js +56 -11
- package/dist/plugins/twist/src/index.js +241 -48
- package/dist/plugins/twitter/src/index.js +128 -30
- package/dist/plugins/unleashedSoftware/src/index.js +30 -6
- package/dist/plugins/uplead/src/index.js +9 -2
- package/dist/plugins/uproc/src/index.js +31 -6
- package/dist/plugins/uptimerobot/src/index.js +119 -25
- package/dist/plugins/urlscanio/src/index.js +25 -6
- package/dist/plugins/vero/src/index.js +68 -13
- package/dist/plugins/vonage/src/index.js +32 -6
- package/dist/plugins/wekan/src/index.js +297 -52
- package/dist/plugins/woocommerce/src/index.js +57 -12
- package/dist/plugins/wordpress/src/index.js +94 -18
- package/dist/plugins/xero/src/index.js +79 -13
- package/dist/plugins/yourls/src/index.js +33 -6
- package/dist/plugins/zammad/src/index.js +139 -36
- package/dist/plugins/zendesk/src/index.js +201 -48
- package/dist/plugins/zoho/src/index.js +88 -21
- package/dist/plugins/zoom/src/index.js +41 -7
- package/dist/plugins/zulip/src/index.js +101 -20
- package/package.json +1 -1
|
@@ -14,7 +14,10 @@ async function apiRequest(apiKey, method, endpoint, body, qs) {
|
|
|
14
14
|
"Content-Type": "application/json",
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
-
if (body &&
|
|
17
|
+
if (body &&
|
|
18
|
+
Object.keys(body).length > 0 &&
|
|
19
|
+
method !== "GET" &&
|
|
20
|
+
method !== "DELETE") {
|
|
18
21
|
opts.body = JSON.stringify(body);
|
|
19
22
|
}
|
|
20
23
|
const res = await fetch(url.toString(), opts);
|
|
@@ -28,18 +31,39 @@ export default function getresponse(rl) {
|
|
|
28
31
|
rl.setName("getresponse");
|
|
29
32
|
rl.setVersion("0.1.0");
|
|
30
33
|
rl.setConnectionSchema({
|
|
31
|
-
apiKey: {
|
|
34
|
+
apiKey: {
|
|
35
|
+
type: "string",
|
|
36
|
+
required: true,
|
|
37
|
+
description: "GetResponse API key",
|
|
38
|
+
env: "GETRESPONSE_API_KEY",
|
|
39
|
+
},
|
|
32
40
|
});
|
|
33
41
|
const key = (ctx) => ctx.connection.config.apiKey;
|
|
34
42
|
rl.registerAction("contact.create", {
|
|
35
43
|
description: "Create a contact",
|
|
36
44
|
inputSchema: {
|
|
37
45
|
email: { type: "string", required: true, description: "Email address" },
|
|
38
|
-
campaignId: {
|
|
46
|
+
campaignId: {
|
|
47
|
+
type: "string",
|
|
48
|
+
required: true,
|
|
49
|
+
description: "Campaign ID to subscribe to",
|
|
50
|
+
},
|
|
39
51
|
name: { type: "string", required: false, description: "Contact name" },
|
|
40
|
-
dayOfCycle: {
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
dayOfCycle: {
|
|
53
|
+
type: "number",
|
|
54
|
+
required: false,
|
|
55
|
+
description: "Day of autoresponder cycle",
|
|
56
|
+
},
|
|
57
|
+
tags: {
|
|
58
|
+
type: "array",
|
|
59
|
+
required: false,
|
|
60
|
+
description: "Array of {tagId} objects",
|
|
61
|
+
},
|
|
62
|
+
customFieldValues: {
|
|
63
|
+
type: "array",
|
|
64
|
+
required: false,
|
|
65
|
+
description: "Custom fields as [{customFieldId, value: [values]}]",
|
|
66
|
+
},
|
|
43
67
|
},
|
|
44
68
|
async execute(input, ctx) {
|
|
45
69
|
const { email, campaignId, name, dayOfCycle, tags, customFieldValues } = input;
|
|
@@ -60,7 +84,11 @@ export default function getresponse(rl) {
|
|
|
60
84
|
description: "Get a contact by ID",
|
|
61
85
|
inputSchema: {
|
|
62
86
|
contactId: { type: "string", required: true, description: "Contact ID" },
|
|
63
|
-
fields: {
|
|
87
|
+
fields: {
|
|
88
|
+
type: "string",
|
|
89
|
+
required: false,
|
|
90
|
+
description: "Comma-separated fields to return",
|
|
91
|
+
},
|
|
64
92
|
},
|
|
65
93
|
async execute(input, ctx) {
|
|
66
94
|
const { contactId, fields } = (input ?? {});
|
|
@@ -73,15 +101,36 @@ export default function getresponse(rl) {
|
|
|
73
101
|
rl.registerAction("contact.list", {
|
|
74
102
|
description: "List contacts",
|
|
75
103
|
inputSchema: {
|
|
76
|
-
limit: {
|
|
77
|
-
|
|
104
|
+
limit: {
|
|
105
|
+
type: "number",
|
|
106
|
+
required: false,
|
|
107
|
+
description: "Max results (default: 100)",
|
|
108
|
+
},
|
|
109
|
+
email: {
|
|
110
|
+
type: "string",
|
|
111
|
+
required: false,
|
|
112
|
+
description: "Filter by email",
|
|
113
|
+
},
|
|
78
114
|
name: { type: "string", required: false, description: "Filter by name" },
|
|
79
|
-
campaignId: {
|
|
80
|
-
|
|
81
|
-
|
|
115
|
+
campaignId: {
|
|
116
|
+
type: "string",
|
|
117
|
+
required: false,
|
|
118
|
+
description: "Filter by campaign ID",
|
|
119
|
+
},
|
|
120
|
+
sortBy: {
|
|
121
|
+
type: "string",
|
|
122
|
+
required: false,
|
|
123
|
+
description: "Sort field: email, name, createdOn",
|
|
124
|
+
},
|
|
125
|
+
sortOrder: {
|
|
126
|
+
type: "string",
|
|
127
|
+
required: false,
|
|
128
|
+
description: "ASC or DESC",
|
|
129
|
+
},
|
|
82
130
|
},
|
|
83
131
|
async execute(input, ctx) {
|
|
84
|
-
const { limit, email, name, campaignId, sortBy, sortOrder } = (input ??
|
|
132
|
+
const { limit, email, name, campaignId, sortBy, sortOrder } = (input ??
|
|
133
|
+
{});
|
|
85
134
|
const qs = {};
|
|
86
135
|
if (limit)
|
|
87
136
|
qs.perPage = limit;
|
|
@@ -101,9 +150,21 @@ export default function getresponse(rl) {
|
|
|
101
150
|
inputSchema: {
|
|
102
151
|
contactId: { type: "string", required: true, description: "Contact ID" },
|
|
103
152
|
name: { type: "string", required: false, description: "New name" },
|
|
104
|
-
campaignId: {
|
|
105
|
-
|
|
106
|
-
|
|
153
|
+
campaignId: {
|
|
154
|
+
type: "string",
|
|
155
|
+
required: false,
|
|
156
|
+
description: "Move to campaign",
|
|
157
|
+
},
|
|
158
|
+
tags: {
|
|
159
|
+
type: "array",
|
|
160
|
+
required: false,
|
|
161
|
+
description: "Tags as [{tagId}]",
|
|
162
|
+
},
|
|
163
|
+
customFieldValues: {
|
|
164
|
+
type: "array",
|
|
165
|
+
required: false,
|
|
166
|
+
description: "Custom fields as [{customFieldId, value: [values]}]",
|
|
167
|
+
},
|
|
107
168
|
},
|
|
108
169
|
async execute(input, ctx) {
|
|
109
170
|
const { contactId, name, campaignId, tags, customFieldValues } = input;
|
|
@@ -123,8 +184,16 @@ export default function getresponse(rl) {
|
|
|
123
184
|
description: "Delete a contact",
|
|
124
185
|
inputSchema: {
|
|
125
186
|
contactId: { type: "string", required: true, description: "Contact ID" },
|
|
126
|
-
messageId: {
|
|
127
|
-
|
|
187
|
+
messageId: {
|
|
188
|
+
type: "string",
|
|
189
|
+
required: false,
|
|
190
|
+
description: "ID of removal confirmation message",
|
|
191
|
+
},
|
|
192
|
+
ipAddress: {
|
|
193
|
+
type: "string",
|
|
194
|
+
required: false,
|
|
195
|
+
description: "IP address for GDPR consent",
|
|
196
|
+
},
|
|
128
197
|
},
|
|
129
198
|
async execute(input, ctx) {
|
|
130
199
|
const { contactId, messageId, ipAddress } = (input ?? {});
|
|
@@ -10,7 +10,9 @@ async function apiRequest(url, adminApiKey, method, endpoint, body, qs) {
|
|
|
10
10
|
const cryptoKey = await crypto.subtle.importKey("raw", keyData, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
11
11
|
const sig = await crypto.subtle.sign("HMAC", cryptoKey, enc.encode(`${header}.${payload}`));
|
|
12
12
|
const sigStr = btoa(String.fromCharCode(...new Uint8Array(sig)))
|
|
13
|
-
.replace(/\+/g, "-")
|
|
13
|
+
.replace(/\+/g, "-")
|
|
14
|
+
.replace(/\//g, "_")
|
|
15
|
+
.replace(/=/g, "");
|
|
14
16
|
const token = `${header}.${payload}.${sigStr}`;
|
|
15
17
|
const base = url.replace(/\/$/, "");
|
|
16
18
|
const fullUrl = new URL(`${base}/ghost/api/v2/admin${endpoint}`);
|
|
@@ -22,9 +24,15 @@ async function apiRequest(url, adminApiKey, method, endpoint, body, qs) {
|
|
|
22
24
|
}
|
|
23
25
|
const opts = {
|
|
24
26
|
method,
|
|
25
|
-
headers: {
|
|
27
|
+
headers: {
|
|
28
|
+
Authorization: `Ghost ${token}`,
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
},
|
|
26
31
|
};
|
|
27
|
-
if (body &&
|
|
32
|
+
if (body &&
|
|
33
|
+
Object.keys(body).length > 0 &&
|
|
34
|
+
method !== "GET" &&
|
|
35
|
+
method !== "DELETE") {
|
|
28
36
|
opts.body = JSON.stringify(body);
|
|
29
37
|
}
|
|
30
38
|
const res = await fetch(fullUrl.toString(), opts);
|
|
@@ -48,24 +56,62 @@ export default function ghost(rl) {
|
|
|
48
56
|
rl.setName("ghost");
|
|
49
57
|
rl.setVersion("0.1.0");
|
|
50
58
|
rl.setConnectionSchema({
|
|
51
|
-
url: {
|
|
52
|
-
|
|
59
|
+
url: {
|
|
60
|
+
type: "string",
|
|
61
|
+
required: true,
|
|
62
|
+
description: "Ghost site URL (e.g. https://myblog.com)",
|
|
63
|
+
env: "GHOST_URL",
|
|
64
|
+
},
|
|
65
|
+
adminApiKey: {
|
|
66
|
+
type: "string",
|
|
67
|
+
required: true,
|
|
68
|
+
description: "Admin API key (format: {id}:{secret})",
|
|
69
|
+
env: "GHOST_ADMIN_API_KEY",
|
|
70
|
+
},
|
|
53
71
|
});
|
|
54
72
|
rl.registerAction("post.create", {
|
|
55
73
|
description: "Create a post",
|
|
56
74
|
inputSchema: {
|
|
57
75
|
title: { type: "string", required: true, description: "Post title" },
|
|
58
|
-
html: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
html: {
|
|
77
|
+
type: "string",
|
|
78
|
+
required: false,
|
|
79
|
+
description: "Post content as HTML",
|
|
80
|
+
},
|
|
81
|
+
lexical: {
|
|
82
|
+
type: "string",
|
|
83
|
+
required: false,
|
|
84
|
+
description: "Post content as Lexical JSON",
|
|
85
|
+
},
|
|
86
|
+
status: {
|
|
87
|
+
type: "string",
|
|
88
|
+
required: false,
|
|
89
|
+
description: "draft (default), published, or scheduled",
|
|
90
|
+
},
|
|
91
|
+
publishedAt: {
|
|
92
|
+
type: "string",
|
|
93
|
+
required: false,
|
|
94
|
+
description: "Publish date (ISO 8601, required for scheduled)",
|
|
95
|
+
},
|
|
96
|
+
tags: {
|
|
97
|
+
type: "array",
|
|
98
|
+
required: false,
|
|
99
|
+
description: "Array of tag names or {name} objects",
|
|
100
|
+
},
|
|
101
|
+
authors: {
|
|
102
|
+
type: "array",
|
|
103
|
+
required: false,
|
|
104
|
+
description: "Array of {id} objects",
|
|
105
|
+
},
|
|
106
|
+
featured: {
|
|
107
|
+
type: "boolean",
|
|
108
|
+
required: false,
|
|
109
|
+
description: "Mark as featured",
|
|
110
|
+
},
|
|
65
111
|
slug: { type: "string", required: false, description: "Custom slug" },
|
|
66
112
|
},
|
|
67
113
|
async execute(input, ctx) {
|
|
68
|
-
const { title, html, lexical, status, publishedAt, tags, authors, featured, slug } = input;
|
|
114
|
+
const { title, html, lexical, status, publishedAt, tags, authors, featured, slug, } = input;
|
|
69
115
|
const post = { title };
|
|
70
116
|
const qs = {};
|
|
71
117
|
if (html) {
|
|
@@ -95,7 +141,11 @@ export default function ghost(rl) {
|
|
|
95
141
|
inputSchema: {
|
|
96
142
|
id: { type: "string", required: false, description: "Post ID" },
|
|
97
143
|
slug: { type: "string", required: false, description: "Post slug" },
|
|
98
|
-
formats: {
|
|
144
|
+
formats: {
|
|
145
|
+
type: "string",
|
|
146
|
+
required: false,
|
|
147
|
+
description: "Response formats: html, mobiledoc, lexical",
|
|
148
|
+
},
|
|
99
149
|
},
|
|
100
150
|
async execute(input, ctx) {
|
|
101
151
|
const { id, slug, formats } = (input ?? {});
|
|
@@ -116,11 +166,27 @@ export default function ghost(rl) {
|
|
|
116
166
|
rl.registerAction("post.list", {
|
|
117
167
|
description: "List posts",
|
|
118
168
|
inputSchema: {
|
|
119
|
-
limit: {
|
|
169
|
+
limit: {
|
|
170
|
+
type: "number",
|
|
171
|
+
required: false,
|
|
172
|
+
description: "Max results (default: 15)",
|
|
173
|
+
},
|
|
120
174
|
page: { type: "number", required: false, description: "Page number" },
|
|
121
|
-
filter: {
|
|
122
|
-
|
|
123
|
-
|
|
175
|
+
filter: {
|
|
176
|
+
type: "string",
|
|
177
|
+
required: false,
|
|
178
|
+
description: "Ghost filter string (e.g. 'tag:news')",
|
|
179
|
+
},
|
|
180
|
+
formats: {
|
|
181
|
+
type: "string",
|
|
182
|
+
required: false,
|
|
183
|
+
description: "Response formats",
|
|
184
|
+
},
|
|
185
|
+
order: {
|
|
186
|
+
type: "string",
|
|
187
|
+
required: false,
|
|
188
|
+
description: "Order (e.g. 'published_at desc')",
|
|
189
|
+
},
|
|
124
190
|
},
|
|
125
191
|
async execute(input, ctx) {
|
|
126
192
|
const { limit, page, filter, formats, order } = (input ?? {});
|
|
@@ -144,20 +210,40 @@ export default function ghost(rl) {
|
|
|
144
210
|
inputSchema: {
|
|
145
211
|
postId: { type: "string", required: true, description: "Post ID" },
|
|
146
212
|
title: { type: "string", required: false, description: "New title" },
|
|
147
|
-
html: {
|
|
148
|
-
|
|
213
|
+
html: {
|
|
214
|
+
type: "string",
|
|
215
|
+
required: false,
|
|
216
|
+
description: "New HTML content",
|
|
217
|
+
},
|
|
218
|
+
lexical: {
|
|
219
|
+
type: "string",
|
|
220
|
+
required: false,
|
|
221
|
+
description: "New Lexical JSON content",
|
|
222
|
+
},
|
|
149
223
|
status: { type: "string", required: false, description: "New status" },
|
|
150
|
-
publishedAt: {
|
|
224
|
+
publishedAt: {
|
|
225
|
+
type: "string",
|
|
226
|
+
required: false,
|
|
227
|
+
description: "New publish date",
|
|
228
|
+
},
|
|
151
229
|
tags: { type: "array", required: false, description: "New tags" },
|
|
152
|
-
featured: {
|
|
230
|
+
featured: {
|
|
231
|
+
type: "boolean",
|
|
232
|
+
required: false,
|
|
233
|
+
description: "Featured flag",
|
|
234
|
+
},
|
|
153
235
|
slug: { type: "string", required: false, description: "New slug" },
|
|
154
236
|
},
|
|
155
237
|
async execute(input, ctx) {
|
|
156
|
-
const { postId, title, html, lexical, status, publishedAt, tags, featured, slug } = input;
|
|
238
|
+
const { postId, title, html, lexical, status, publishedAt, tags, featured, slug, } = input;
|
|
157
239
|
// Need updated_at for optimistic locking
|
|
158
|
-
const existing = (await req(ctx, "GET", `/posts/${postId}/`, undefined, {
|
|
240
|
+
const existing = (await req(ctx, "GET", `/posts/${postId}/`, undefined, {
|
|
241
|
+
fields: "id,updated_at",
|
|
242
|
+
}));
|
|
159
243
|
const currentPost = existing.posts[0];
|
|
160
|
-
const post = {
|
|
244
|
+
const post = {
|
|
245
|
+
updated_at: currentPost.updated_at,
|
|
246
|
+
};
|
|
161
247
|
const qs = {};
|
|
162
248
|
if (title)
|
|
163
249
|
post.title = title;
|
|
@@ -183,7 +269,9 @@ export default function ghost(rl) {
|
|
|
183
269
|
});
|
|
184
270
|
rl.registerAction("post.delete", {
|
|
185
271
|
description: "Delete a post",
|
|
186
|
-
inputSchema: {
|
|
272
|
+
inputSchema: {
|
|
273
|
+
postId: { type: "string", required: true, description: "Post ID" },
|
|
274
|
+
},
|
|
187
275
|
async execute(input, ctx) {
|
|
188
276
|
await req(ctx, "DELETE", `/posts/${input.postId}/`);
|
|
189
277
|
return { success: true };
|