runline 0.11.5 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/actions.js +3 -1
- package/dist/core/engine.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/plugin/api.d.ts +2 -1
- package/dist/plugin/types.d.ts +2 -0
- package/dist/plugins/actionNetwork/src/index.js +23 -0
- package/dist/plugins/activeCampaign/src/index.js +48 -0
- package/dist/plugins/adalo/src/index.js +5 -0
- package/dist/plugins/affinity/src/index.js +16 -0
- package/dist/plugins/agileCrm/src/index.js +15 -0
- package/dist/plugins/airtable/src/index.js +10 -0
- package/dist/plugins/airtop/src/index.js +24 -0
- package/dist/plugins/apiTemplateIo/src/index.js +4 -0
- package/dist/plugins/asana/src/index.js +22 -0
- package/dist/plugins/autopilot/src/index.js +11 -0
- package/dist/plugins/bambooHr/src/index.js +11 -0
- package/dist/plugins/bannerbear/src/index.js +4 -0
- package/dist/plugins/baserow/src/index.js +8 -0
- package/dist/plugins/beeminder/src/index.js +18 -0
- package/dist/plugins/bitly/src/index.js +3 -0
- package/dist/plugins/bitwarden/src/index.js +19 -0
- package/dist/plugins/box/src/index.js +11 -0
- package/dist/plugins/brandfetch/src/index.js +5 -0
- package/dist/plugins/brevo/src/index.js +15 -0
- package/dist/plugins/bubble/src/index.js +5 -0
- package/dist/plugins/chargebee/src/index.js +5 -0
- package/dist/plugins/circleci/src/index.js +3 -0
- package/dist/plugins/ciscoWebex/src/index.js +10 -0
- package/dist/plugins/clearbit/src/index.js +3 -0
- package/dist/plugins/clickup/src/index.js +61 -0
- package/dist/plugins/clockify/src/index.js +25 -0
- package/dist/plugins/cloudflare/src/index.js +4 -0
- package/dist/plugins/cockpit/src/index.js +5 -0
- package/dist/plugins/coda/src/index.js +18 -0
- package/dist/plugins/coingecko/src/index.js +10 -0
- package/dist/plugins/contentful/src/index.js +7 -0
- package/dist/plugins/convertkit/src/index.js +16 -0
- package/dist/plugins/copper/src/index.js +7 -0
- package/dist/plugins/cortex/src/index.js +4 -0
- package/dist/plugins/currents/src/index.js +22 -0
- package/dist/plugins/customerIo/src/index.js +9 -0
- package/dist/plugins/databricks/src/index.js +34 -0
- package/dist/plugins/deepl/src/index.js +2 -0
- package/dist/plugins/demio/src/index.js +4 -0
- package/dist/plugins/dhl/src/index.js +1 -0
- package/dist/plugins/discord/src/index.js +13 -0
- package/dist/plugins/discourse/src/index.js +16 -0
- package/dist/plugins/disqus/src/index.js +4 -0
- package/dist/plugins/docker/src/index.js +5 -0
- package/dist/plugins/drift/src/index.js +5 -0
- package/dist/plugins/dropbox/src/index.js +9 -0
- package/dist/plugins/dropcontact/src/index.js +2 -0
- package/dist/plugins/egoi/src/index.js +4 -0
- package/dist/plugins/elasticsearch/src/index.js +9 -0
- package/dist/plugins/emelia/src/index.js +9 -0
- package/dist/plugins/erpnext/src/index.js +5 -0
- package/dist/plugins/facebookGraph/src/index.js +1 -0
- package/dist/plugins/freshdesk/src/index.js +10 -0
- package/dist/plugins/freshservice/src/index.js +7 -0
- package/dist/plugins/freshworksCrm/src/index.js +7 -0
- package/dist/plugins/getresponse/src/index.js +5 -0
- package/dist/plugins/ghost/src/index.js +5 -0
- package/dist/plugins/github/src/index.js +37 -0
- package/dist/plugins/gitlab/src/index.js +17 -0
- package/dist/plugins/gmail/src/index.js +32 -0
- package/dist/plugins/gong/src/index.js +4 -0
- package/dist/plugins/googleAppsScript/src/index.js +10 -0
- package/dist/plugins/googleCalendar/src/index.js +22 -0
- package/dist/plugins/googleContacts/src/index.js +10 -0
- package/dist/plugins/googleDocs/src/documents.js +4 -0
- package/dist/plugins/googleDocs/src/formatting.js +2 -0
- package/dist/plugins/googleDocs/src/images.js +2 -0
- package/dist/plugins/googleDocs/src/structure.js +13 -0
- package/dist/plugins/googleDocs/src/tables.js +11 -0
- package/dist/plugins/googleDocs/src/tabs.js +3 -0
- package/dist/plugins/googleDocs/src/text.js +9 -0
- package/dist/plugins/googleDrive/src/index.js +47 -0
- package/dist/plugins/googleImage/src/index.js +1 -0
- package/dist/plugins/googleSheets/src/index.js +23 -0
- package/dist/plugins/googleSlides/src/index.js +7 -0
- package/dist/plugins/googleTasks/src/index.js +12 -0
- package/dist/plugins/gotify/src/index.js +3 -0
- package/dist/plugins/gotowebinar/src/index.js +20 -0
- package/dist/plugins/grafana/src/index.js +17 -0
- package/dist/plugins/graphql/src/index.js +2 -0
- package/dist/plugins/grist/src/index.js +4 -0
- package/dist/plugins/hackernews/src/index.js +6 -0
- package/dist/plugins/halopsa/src/index.js +5 -0
- package/dist/plugins/harvest/src/index.js +14 -0
- package/dist/plugins/helpscout/src/index.js +13 -0
- package/dist/plugins/highlevel/src/index.js +17 -0
- package/dist/plugins/homeAssistant/src/index.js +13 -0
- package/dist/plugins/hubspot/src/index.js +14 -0
- package/dist/plugins/humanticAi/src/index.js +3 -0
- package/dist/plugins/hunter/src/index.js +3 -0
- package/dist/plugins/intercom/src/index.js +10 -0
- package/dist/plugins/iterable/src/index.js +6 -0
- package/dist/plugins/jenkins/src/index.js +11 -0
- package/dist/plugins/jira/src/index.js +16 -0
- package/dist/plugins/keap/src/index.js +28 -0
- package/dist/plugins/kobotoolbox/src/index.js +17 -0
- package/dist/plugins/lemlist/src/index.js +15 -0
- package/dist/plugins/linear/src/attachments.js +6 -0
- package/dist/plugins/linear/src/comments.js +5 -0
- package/dist/plugins/linear/src/cycles.js +2 -0
- package/dist/plugins/linear/src/initiatives.js +5 -0
- package/dist/plugins/linear/src/issues.js +14 -0
- package/dist/plugins/linear/src/labels.js +5 -0
- package/dist/plugins/linear/src/organization.js +1 -0
- package/dist/plugins/linear/src/projects.js +11 -0
- package/dist/plugins/linear/src/shared.js +2 -0
- package/dist/plugins/linear/src/states.js +2 -0
- package/dist/plugins/linear/src/teams.js +3 -0
- package/dist/plugins/linear/src/users.js +2 -0
- package/dist/plugins/linear/src/views.js +4 -0
- package/dist/plugins/linear/src/webhooks.js +4 -0
- package/dist/plugins/lingvanex/src/index.js +1 -0
- package/dist/plugins/linkedin/src/index.js +1 -0
- package/dist/plugins/lonescale/src/index.js +4 -0
- package/dist/plugins/magento/src/index.js +15 -0
- package/dist/plugins/mailcheck/src/index.js +1 -0
- package/dist/plugins/mailchimp/src/index.js +14 -0
- package/dist/plugins/mailerlite/src/index.js +4 -0
- package/dist/plugins/mailgun/src/index.js +1 -0
- package/dist/plugins/mailjet/src/index.js +3 -0
- package/dist/plugins/mandrill/src/index.js +2 -0
- package/dist/plugins/marketstack/src/index.js +3 -0
- package/dist/plugins/matrix/src/index.js +10 -0
- package/dist/plugins/mattermost/src/index.js +19 -0
- package/dist/plugins/mautic/src/index.js +20 -0
- package/dist/plugins/medium/src/index.js +3 -0
- package/dist/plugins/messagebird/src/index.js +2 -0
- package/dist/plugins/metabase/src/index.js +10 -0
- package/dist/plugins/microsoftCalendar/src/index.js +2 -0
- package/dist/plugins/microsoftFiles/src/index.js +5 -0
- package/dist/plugins/microsoftMail/src/index.js +4 -0
- package/dist/plugins/misp/src/index.js +44 -0
- package/dist/plugins/mocean/src/index.js +2 -0
- package/dist/plugins/monday/src/index.js +18 -0
- package/dist/plugins/monicaCrm/src/index.js +5 -0
- package/dist/plugins/msg91/src/index.js +1 -0
- package/dist/plugins/nasa/src/index.js +7 -0
- package/dist/plugins/netlify/src/index.js +7 -0
- package/dist/plugins/netscalerAdc/src/index.js +3 -0
- package/dist/plugins/nextcloud/src/index.js +13 -0
- package/dist/plugins/nocodb/src/index.js +5 -0
- package/dist/plugins/node/src/index.js +38 -0
- package/dist/plugins/notion/src/index.js +14 -0
- package/dist/plugins/npm/src/index.js +5 -0
- package/dist/plugins/odoo/src/index.js +6 -0
- package/dist/plugins/okta/src/index.js +5 -0
- package/dist/plugins/oneSimpleApi/src/index.js +10 -0
- package/dist/plugins/onfleet/src/index.js +24 -0
- package/dist/plugins/openThesaurus/src/index.js +1 -0
- package/dist/plugins/openai/src/index.js +1 -0
- package/dist/plugins/openweathermap/src/index.js +2 -0
- package/dist/plugins/oura/src/index.js +2 -0
- package/dist/plugins/paddle/src/index.js +9 -0
- package/dist/plugins/pagerduty/src/index.js +9 -0
- package/dist/plugins/parallel/src/index.js +1 -0
- package/dist/plugins/paypal/src/index.js +4 -0
- package/dist/plugins/peekalink/src/index.js +2 -0
- package/dist/plugins/phantombuster/src/index.js +5 -0
- package/dist/plugins/philipsHue/src/index.js +4 -0
- package/dist/plugins/pipedrive/src/index.js +14 -0
- package/dist/plugins/plivo/src/index.js +3 -0
- package/dist/plugins/postbin/src/index.js +6 -0
- package/dist/plugins/posthog/src/index.js +5 -0
- package/dist/plugins/profitwell/src/index.js +2 -0
- package/dist/plugins/pushbullet/src/index.js +4 -0
- package/dist/plugins/pushcut/src/index.js +1 -0
- package/dist/plugins/pushover/src/index.js +1 -0
- package/dist/plugins/quickbase/src/index.js +8 -0
- package/dist/plugins/quickbooks/src/index.js +5 -0
- package/dist/plugins/quickchart/src/index.js +1 -0
- package/dist/plugins/raindrop/src/index.js +13 -0
- package/dist/plugins/recraft/src/index.js +1 -0
- package/dist/plugins/reddit/src/index.js +10 -0
- package/dist/plugins/replicate/src/index.js +1 -0
- package/dist/plugins/rocketchat/src/index.js +1 -0
- package/dist/plugins/rundeck/src/index.js +2 -0
- package/dist/plugins/salesforce/src/metadata.js +4 -0
- package/dist/plugins/salesforce/src/query.js +5 -0
- package/dist/plugins/salesforce/src/sobjects.js +12 -0
- package/dist/plugins/salesmate/src/index.js +5 -0
- package/dist/plugins/securityScorecard/src/index.js +14 -0
- package/dist/plugins/segment/src/index.js +4 -0
- package/dist/plugins/sendgrid/src/index.js +10 -0
- package/dist/plugins/sendy/src/index.js +6 -0
- package/dist/plugins/sentry/src/index.js +24 -0
- package/dist/plugins/servicenow/src/index.js +10 -0
- package/dist/plugins/shiftLabs/src/index.js +15 -0
- package/dist/plugins/shiftLabs/src/issues.js +74 -0
- package/dist/plugins/shiftLabs/src/pages.js +148 -0
- package/dist/plugins/shiftLabs/src/shared.js +69 -0
- package/dist/plugins/shopify/src/index.js +10 -0
- package/dist/plugins/signl4/src/index.js +2 -0
- package/dist/plugins/slack/src/index.js +38 -0
- package/dist/plugins/sms77/src/index.js +2 -0
- package/dist/plugins/splunk/src/index.js +16 -0
- package/dist/plugins/spotify/src/index.js +30 -0
- package/dist/plugins/stackby/src/index.js +4 -0
- package/dist/plugins/steel/src/browser.js +7 -0
- package/dist/plugins/steel/src/captchas.js +3 -0
- package/dist/plugins/steel/src/credentials.js +4 -0
- package/dist/plugins/steel/src/extensions.js +5 -0
- package/dist/plugins/steel/src/files.js +10 -0
- package/dist/plugins/steel/src/profiles.js +4 -0
- package/dist/plugins/steel/src/sessions.js +11 -0
- package/dist/plugins/storyblok/src/index.js +7 -0
- package/dist/plugins/strapi/src/index.js +5 -0
- package/dist/plugins/strava/src/index.js +6 -0
- package/dist/plugins/stripe/src/index.js +20 -0
- package/dist/plugins/supabase/src/index.js +5 -0
- package/dist/plugins/syncromsp/src/index.js +20 -0
- package/dist/plugins/tapfiliate/src/index.js +11 -0
- package/dist/plugins/telegram/src/index.js +21 -0
- package/dist/plugins/thehive/src/index.js +23 -0
- package/dist/plugins/thehiveProject/src/index.js +31 -0
- package/dist/plugins/todoist/src/index.js +31 -0
- package/dist/plugins/together/src/index.js +1 -0
- package/dist/plugins/travisci/src/index.js +5 -0
- package/dist/plugins/trello/src/index.js +37 -0
- package/dist/plugins/twake/src/index.js +1 -0
- package/dist/plugins/twilio/src/index.js +2 -0
- package/dist/plugins/twist/src/index.js +22 -0
- package/dist/plugins/twitter/src/index.js +8 -0
- package/dist/plugins/unleashedSoftware/src/index.js +3 -0
- package/dist/plugins/uplead/src/index.js +2 -0
- package/dist/plugins/uproc/src/index.js +1 -0
- package/dist/plugins/uptimerobot/src/index.js +22 -0
- package/dist/plugins/urlscanio/src/index.js +3 -0
- package/dist/plugins/vercel/src/account.js +1 -0
- package/dist/plugins/vercel/src/deployments.js +5 -0
- package/dist/plugins/vercel/src/env.js +4 -0
- package/dist/plugins/vercel/src/projects.js +2 -0
- package/dist/plugins/vercel/src/shared.js +1 -0
- package/dist/plugins/vero/src/index.js +6 -0
- package/dist/plugins/vonage/src/index.js +1 -0
- package/dist/plugins/wekan/src/index.js +24 -0
- package/dist/plugins/woocommerce/src/index.js +5 -0
- package/dist/plugins/wordpress/src/index.js +10 -0
- package/dist/plugins/xai/src/index.js +1 -0
- package/dist/plugins/xero/src/index.js +8 -0
- package/dist/plugins/yourls/src/index.js +3 -0
- package/dist/plugins/zammad/src/index.js +12 -0
- package/dist/plugins/zendesk/src/index.js +18 -0
- package/dist/plugins/zoho/src/index.js +6 -0
- package/dist/plugins/zoom/src/index.js +5 -0
- package/dist/plugins/zulip/src/index.js +15 -0
- package/dist/sdk.d.ts +2 -1
- package/dist/sdk.js +1 -0
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ const TABLES = {
|
|
|
40
40
|
};
|
|
41
41
|
function registerTableResource(rl, resource, table, conn) {
|
|
42
42
|
rl.registerAction(`${resource}.create`, {
|
|
43
|
+
access: "write",
|
|
43
44
|
description: `Create a ${resource}`,
|
|
44
45
|
inputSchema: { data: { type: "object", required: true } },
|
|
45
46
|
async execute(input, ctx) {
|
|
@@ -48,6 +49,7 @@ function registerTableResource(rl, resource, table, conn) {
|
|
|
48
49
|
},
|
|
49
50
|
});
|
|
50
51
|
rl.registerAction(`${resource}.get`, {
|
|
52
|
+
access: "read",
|
|
51
53
|
description: `Get a ${resource} by sys_id`,
|
|
52
54
|
inputSchema: { sysId: { type: "string", required: true } },
|
|
53
55
|
async execute(input, ctx) {
|
|
@@ -56,6 +58,7 @@ function registerTableResource(rl, resource, table, conn) {
|
|
|
56
58
|
},
|
|
57
59
|
});
|
|
58
60
|
rl.registerAction(`${resource}.list`, {
|
|
61
|
+
access: "read",
|
|
59
62
|
description: `List ${resource}s`,
|
|
60
63
|
inputSchema: {
|
|
61
64
|
limit: { type: "number", required: false },
|
|
@@ -84,6 +87,7 @@ function registerTableResource(rl, resource, table, conn) {
|
|
|
84
87
|
},
|
|
85
88
|
});
|
|
86
89
|
rl.registerAction(`${resource}.update`, {
|
|
90
|
+
access: "write",
|
|
87
91
|
description: `Update a ${resource}`,
|
|
88
92
|
inputSchema: {
|
|
89
93
|
sysId: { type: "string", required: true },
|
|
@@ -96,6 +100,7 @@ function registerTableResource(rl, resource, table, conn) {
|
|
|
96
100
|
},
|
|
97
101
|
});
|
|
98
102
|
rl.registerAction(`${resource}.delete`, {
|
|
103
|
+
access: "write",
|
|
99
104
|
description: `Delete a ${resource}`,
|
|
100
105
|
inputSchema: { sysId: { type: "string", required: true } },
|
|
101
106
|
async execute(input, ctx) {
|
|
@@ -132,6 +137,7 @@ export default function servicenow(rl) {
|
|
|
132
137
|
}
|
|
133
138
|
// ── Generic Table Record ────────────────────────────
|
|
134
139
|
rl.registerAction("tableRecord.create", {
|
|
140
|
+
access: "write",
|
|
135
141
|
description: "Create a record in any table",
|
|
136
142
|
inputSchema: {
|
|
137
143
|
tableName: { type: "string", required: true },
|
|
@@ -144,6 +150,7 @@ export default function servicenow(rl) {
|
|
|
144
150
|
},
|
|
145
151
|
});
|
|
146
152
|
rl.registerAction("tableRecord.get", {
|
|
153
|
+
access: "read",
|
|
147
154
|
description: "Get a record from any table",
|
|
148
155
|
inputSchema: {
|
|
149
156
|
tableName: { type: "string", required: true },
|
|
@@ -156,6 +163,7 @@ export default function servicenow(rl) {
|
|
|
156
163
|
},
|
|
157
164
|
});
|
|
158
165
|
rl.registerAction("tableRecord.list", {
|
|
166
|
+
access: "read",
|
|
159
167
|
description: "List records from any table",
|
|
160
168
|
inputSchema: {
|
|
161
169
|
tableName: { type: "string", required: true },
|
|
@@ -174,6 +182,7 @@ export default function servicenow(rl) {
|
|
|
174
182
|
},
|
|
175
183
|
});
|
|
176
184
|
rl.registerAction("tableRecord.update", {
|
|
185
|
+
access: "write",
|
|
177
186
|
description: "Update a record in any table",
|
|
178
187
|
inputSchema: {
|
|
179
188
|
tableName: { type: "string", required: true },
|
|
@@ -187,6 +196,7 @@ export default function servicenow(rl) {
|
|
|
187
196
|
},
|
|
188
197
|
});
|
|
189
198
|
rl.registerAction("tableRecord.delete", {
|
|
199
|
+
access: "write",
|
|
190
200
|
description: "Delete a record from any table",
|
|
191
201
|
inputSchema: {
|
|
192
202
|
tableName: { type: "string", required: true },
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as t from "typebox";
|
|
2
|
+
import { registerIssueActions } from "./issues.js";
|
|
3
|
+
import { registerPageActions } from "./pages.js";
|
|
4
|
+
export default function shiftLabs(rl) {
|
|
5
|
+
rl.setName("shiftLabs");
|
|
6
|
+
rl.setVersion("0.1.0");
|
|
7
|
+
rl.setConnectionSchema(t.Object({
|
|
8
|
+
apiKey: t.String({
|
|
9
|
+
description: "Shift Labs API key",
|
|
10
|
+
env: "SHIFT_LABS_API_KEY",
|
|
11
|
+
}),
|
|
12
|
+
}));
|
|
13
|
+
registerIssueActions(rl);
|
|
14
|
+
registerPageActions(rl);
|
|
15
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as t from "typebox";
|
|
2
|
+
import { enumSchema, ISSUE_KIND, ISSUE_PRIORITY, ISSUE_SEVERITY, ISSUE_SOURCE, ISSUE_STATUS, request, } from "./shared.js";
|
|
3
|
+
export function registerIssueActions(rl) {
|
|
4
|
+
rl.registerAction("issue.list", {
|
|
5
|
+
access: "read",
|
|
6
|
+
description: "List Shift Labs issues for the API key's organization.",
|
|
7
|
+
inputSchema: t.Object({
|
|
8
|
+
status: t.Optional(enumSchema("Issue status", ISSUE_STATUS)),
|
|
9
|
+
assigneeUserId: t.Optional(t.String()),
|
|
10
|
+
source: t.Optional(enumSchema("Issue source", ISSUE_SOURCE)),
|
|
11
|
+
limit: t.Optional(t.Number({ description: "Max results, default 50" })),
|
|
12
|
+
}),
|
|
13
|
+
async execute(input, ctx) {
|
|
14
|
+
const fields = (input ?? {});
|
|
15
|
+
const params = new URLSearchParams();
|
|
16
|
+
for (const key of ["status", "assigneeUserId", "source", "limit"]) {
|
|
17
|
+
const value = fields[key];
|
|
18
|
+
if (value !== undefined)
|
|
19
|
+
params.set(key, String(value));
|
|
20
|
+
}
|
|
21
|
+
const body = await request(ctx, `/v1/issues?${params}`);
|
|
22
|
+
return body.issues;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
rl.registerAction("issue.get", {
|
|
26
|
+
access: "read",
|
|
27
|
+
description: "Get a Shift Labs issue by ID.",
|
|
28
|
+
inputSchema: t.Object({ id: t.String({ description: "Issue ID" }) }),
|
|
29
|
+
async execute(input, ctx) {
|
|
30
|
+
const { id } = input;
|
|
31
|
+
const body = await request(ctx, `/v1/issues/${encodeURIComponent(id)}`);
|
|
32
|
+
return body.issue;
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
rl.registerAction("issue.create", {
|
|
36
|
+
access: "write",
|
|
37
|
+
description: "Create a Shift Labs issue. The issue starts in triage.",
|
|
38
|
+
inputSchema: t.Object({
|
|
39
|
+
title: t.String({ description: "Issue title" }),
|
|
40
|
+
description: t.Optional(t.String({ description: "Issue description" })),
|
|
41
|
+
kind: t.Optional(enumSchema("Issue kind", ISSUE_KIND)),
|
|
42
|
+
priority: t.Optional(enumSchema("Issue priority", ISSUE_PRIORITY)),
|
|
43
|
+
severity: t.Optional(enumSchema("Issue severity", ISSUE_SEVERITY)),
|
|
44
|
+
source: t.Optional(enumSchema("Issue source", ISSUE_SOURCE)),
|
|
45
|
+
deploymentId: t.Optional(t.String()),
|
|
46
|
+
workspaceId: t.Optional(t.String()),
|
|
47
|
+
sessionId: t.Optional(t.String()),
|
|
48
|
+
traceId: t.Optional(t.String()),
|
|
49
|
+
fingerprint: t.Optional(t.String()),
|
|
50
|
+
labels: t.Optional(t.Array(t.String())),
|
|
51
|
+
metadata: t.Optional(t.Object({}, { description: "Issue metadata" })),
|
|
52
|
+
}),
|
|
53
|
+
async execute(input, ctx) {
|
|
54
|
+
const body = await request(ctx, "/v1/issues", {
|
|
55
|
+
method: "POST",
|
|
56
|
+
body: JSON.stringify(input),
|
|
57
|
+
});
|
|
58
|
+
return body.issue;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
rl.registerAction("issue.comment", {
|
|
62
|
+
access: "write",
|
|
63
|
+
description: "Add a comment to a Shift Labs issue.",
|
|
64
|
+
inputSchema: t.Object({
|
|
65
|
+
id: t.String({ description: "Issue ID" }),
|
|
66
|
+
body: t.String({ description: "Comment body" }),
|
|
67
|
+
}),
|
|
68
|
+
async execute(input, ctx) {
|
|
69
|
+
const { id, body } = input;
|
|
70
|
+
const response = await request(ctx, `/v1/issues/${encodeURIComponent(id)}/comments`, { method: "POST", body: JSON.stringify({ body }) });
|
|
71
|
+
return response.event;
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as t from "typebox";
|
|
2
|
+
import { enumSchema, PAGE_STATUS, PAGE_VISIBILITY, pageRenderUrl, request, } from "./shared.js";
|
|
3
|
+
export function registerPageActions(rl) {
|
|
4
|
+
rl.registerAction("page.list", {
|
|
5
|
+
access: "read",
|
|
6
|
+
description: "List Shift Labs pages for the API key's organization.",
|
|
7
|
+
inputSchema: t.Object({
|
|
8
|
+
status: t.Optional(enumSchema("Page status", PAGE_STATUS)),
|
|
9
|
+
limit: t.Optional(t.Number({ description: "Max results, default 50" })),
|
|
10
|
+
}),
|
|
11
|
+
async execute(input, ctx) {
|
|
12
|
+
const fields = (input ?? {});
|
|
13
|
+
const params = new URLSearchParams();
|
|
14
|
+
if (fields.status)
|
|
15
|
+
params.set("status", String(fields.status));
|
|
16
|
+
if (fields.limit)
|
|
17
|
+
params.set("limit", String(fields.limit));
|
|
18
|
+
const body = await request(ctx, `/v1/pages?${params}`);
|
|
19
|
+
return body.pages;
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
rl.registerAction("page.get", {
|
|
23
|
+
access: "read",
|
|
24
|
+
description: "Get a Shift Labs page by ID.",
|
|
25
|
+
inputSchema: t.Object({ id: t.String({ description: "Page ID" }) }),
|
|
26
|
+
async execute(input, ctx) {
|
|
27
|
+
const { id } = input;
|
|
28
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(id)}`);
|
|
29
|
+
return body.page;
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
rl.registerAction("page.create", {
|
|
33
|
+
access: "write",
|
|
34
|
+
description: "Create a draft hosted HTML page. Agents can publish it with page.publish.",
|
|
35
|
+
inputSchema: t.Object({
|
|
36
|
+
slug: t.String({ description: "Lowercase kebab-case page slug" }),
|
|
37
|
+
title: t.String({ description: "Page title" }),
|
|
38
|
+
html: t.Optional(t.String({ description: "Hosted HTML content" })),
|
|
39
|
+
visibility: t.Optional(enumSchema("Page visibility", PAGE_VISIBILITY)),
|
|
40
|
+
}),
|
|
41
|
+
async execute(input, ctx) {
|
|
42
|
+
const fields = input;
|
|
43
|
+
const body = await request(ctx, "/v1/pages", {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body: JSON.stringify({
|
|
46
|
+
type: "hosted_html",
|
|
47
|
+
visibility: "org",
|
|
48
|
+
...fields,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
return body.page;
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
rl.registerAction("page.update", {
|
|
55
|
+
access: "write",
|
|
56
|
+
description: "Update a hosted HTML page's slug, title, visibility, or HTML.",
|
|
57
|
+
inputSchema: t.Object({
|
|
58
|
+
id: t.String({ description: "Page ID" }),
|
|
59
|
+
slug: t.Optional(t.String({ description: "Lowercase kebab-case page slug" })),
|
|
60
|
+
title: t.Optional(t.String({ description: "Page title" })),
|
|
61
|
+
visibility: t.Optional(enumSchema("Page visibility", PAGE_VISIBILITY)),
|
|
62
|
+
html: t.Optional(t.String({ description: "Hosted HTML content" })),
|
|
63
|
+
}),
|
|
64
|
+
async execute(input, ctx) {
|
|
65
|
+
const { id, ...fields } = input;
|
|
66
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(id)}`, {
|
|
67
|
+
method: "PATCH",
|
|
68
|
+
body: JSON.stringify(fields),
|
|
69
|
+
});
|
|
70
|
+
return body.page;
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
rl.registerAction("page.publish", {
|
|
74
|
+
access: "write",
|
|
75
|
+
description: "Publish a Shift Labs hosted HTML page.",
|
|
76
|
+
inputSchema: t.Object({ id: t.String({ description: "Page ID" }) }),
|
|
77
|
+
async execute(input, ctx) {
|
|
78
|
+
const { id } = input;
|
|
79
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(id)}/publish`, { method: "POST" });
|
|
80
|
+
return body.page;
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
rl.registerAction("page.archive", {
|
|
84
|
+
access: "write",
|
|
85
|
+
description: "Archive a Shift Labs page.",
|
|
86
|
+
inputSchema: t.Object({ id: t.String({ description: "Page ID" }) }),
|
|
87
|
+
async execute(input, ctx) {
|
|
88
|
+
const { id } = input;
|
|
89
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(id)}/archive`, { method: "POST" });
|
|
90
|
+
return body.page;
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
rl.registerAction("page.shares", {
|
|
94
|
+
access: "read",
|
|
95
|
+
description: "List shares for a Shift Labs page.",
|
|
96
|
+
inputSchema: t.Object({ pageId: t.String({ description: "Page ID" }) }),
|
|
97
|
+
async execute(input, ctx) {
|
|
98
|
+
const { pageId } = input;
|
|
99
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(pageId)}/shares`);
|
|
100
|
+
return body.shares;
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
rl.registerAction("page.share", {
|
|
104
|
+
access: "write",
|
|
105
|
+
description: "Create a viewer share for a Shift Labs page.",
|
|
106
|
+
inputSchema: t.Object({
|
|
107
|
+
pageId: t.String({ description: "Page ID" }),
|
|
108
|
+
email: t.String({ description: "Viewer email address" }),
|
|
109
|
+
expiresAt: t.Optional(t.String({ description: "Optional ISO expiration" })),
|
|
110
|
+
}),
|
|
111
|
+
async execute(input, ctx) {
|
|
112
|
+
const { pageId, ...fields } = input;
|
|
113
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(pageId)}/shares`, {
|
|
114
|
+
method: "POST",
|
|
115
|
+
body: JSON.stringify(fields),
|
|
116
|
+
});
|
|
117
|
+
return body.share;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
rl.registerAction("page.revokeShare", {
|
|
121
|
+
access: "write",
|
|
122
|
+
description: "Revoke a Shift Labs page share.",
|
|
123
|
+
inputSchema: t.Object({
|
|
124
|
+
shareId: t.String({ description: "Page share ID" }),
|
|
125
|
+
}),
|
|
126
|
+
async execute(input, ctx) {
|
|
127
|
+
const { shareId } = input;
|
|
128
|
+
await request(ctx, `/v1/pages/shares/${encodeURIComponent(shareId)}`, {
|
|
129
|
+
method: "DELETE",
|
|
130
|
+
});
|
|
131
|
+
return { success: true };
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
rl.registerAction("page.renderUrl", {
|
|
135
|
+
access: "read",
|
|
136
|
+
description: "Return the authenticated render URL for a page.",
|
|
137
|
+
inputSchema: t.Object({
|
|
138
|
+
pageId: t.String({ description: "Page ID" }),
|
|
139
|
+
}),
|
|
140
|
+
async execute(input, ctx) {
|
|
141
|
+
const { pageId } = input;
|
|
142
|
+
const body = await request(ctx, `/v1/pages/${encodeURIComponent(pageId)}`);
|
|
143
|
+
return {
|
|
144
|
+
url: pageRenderUrl(body.page.organizationId, body.page.slug),
|
|
145
|
+
};
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as t from "typebox";
|
|
2
|
+
const SHIFT_LABS_API_URL = "https://d1ood6y5zobtne.cloudfront.net";
|
|
3
|
+
export function baseUrl() {
|
|
4
|
+
return `${SHIFT_LABS_API_URL}/`;
|
|
5
|
+
}
|
|
6
|
+
export async function request(ctx, path, init = {}) {
|
|
7
|
+
const headers = new Headers(init.headers);
|
|
8
|
+
const apiKey = ctx.connection.config.apiKey;
|
|
9
|
+
if (typeof apiKey !== "string" || !apiKey) {
|
|
10
|
+
throw new Error("Shift Labs apiKey is required");
|
|
11
|
+
}
|
|
12
|
+
headers.set("authorization", `Bearer ${apiKey}`);
|
|
13
|
+
if (init.body && !headers.has("content-type")) {
|
|
14
|
+
headers.set("content-type", "application/json");
|
|
15
|
+
}
|
|
16
|
+
const response = await fetch(new URL(path, baseUrl()), {
|
|
17
|
+
...init,
|
|
18
|
+
headers,
|
|
19
|
+
});
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
throw new Error(`Shift Labs API error ${response.status}: ${await response.text()}`);
|
|
22
|
+
}
|
|
23
|
+
if (response.status === 204)
|
|
24
|
+
return undefined;
|
|
25
|
+
return (await response.json());
|
|
26
|
+
}
|
|
27
|
+
export function pathSegment(value) {
|
|
28
|
+
return encodeURIComponent(value);
|
|
29
|
+
}
|
|
30
|
+
export function pageRenderUrl(organizationId, slug) {
|
|
31
|
+
return new URL(`/pages/${pathSegment(organizationId)}/${pathSegment(slug)}`, baseUrl()).toString();
|
|
32
|
+
}
|
|
33
|
+
export const ISSUE_STATUS = [
|
|
34
|
+
"triage",
|
|
35
|
+
"open",
|
|
36
|
+
"in_progress",
|
|
37
|
+
"resolved",
|
|
38
|
+
"closed",
|
|
39
|
+
];
|
|
40
|
+
export const ISSUE_KIND = [
|
|
41
|
+
"bug",
|
|
42
|
+
"support",
|
|
43
|
+
"feature_request",
|
|
44
|
+
"incident",
|
|
45
|
+
"task",
|
|
46
|
+
];
|
|
47
|
+
export const ISSUE_PRIORITY = [
|
|
48
|
+
"none",
|
|
49
|
+
"low",
|
|
50
|
+
"medium",
|
|
51
|
+
"high",
|
|
52
|
+
"urgent",
|
|
53
|
+
];
|
|
54
|
+
export const ISSUE_SEVERITY = ["info", "warning", "error", "critical"];
|
|
55
|
+
export const ISSUE_SOURCE = [
|
|
56
|
+
"user",
|
|
57
|
+
"agent",
|
|
58
|
+
"system",
|
|
59
|
+
"api",
|
|
60
|
+
"integration",
|
|
61
|
+
];
|
|
62
|
+
export const PAGE_STATUS = ["draft", "published", "archived"];
|
|
63
|
+
export const PAGE_VISIBILITY = ["org", "invited"];
|
|
64
|
+
export function enumDescription(name, values) {
|
|
65
|
+
return `${name}: ${values.join(" | ")}`;
|
|
66
|
+
}
|
|
67
|
+
export function enumSchema(name, values) {
|
|
68
|
+
return t.Union(values.map((value) => t.Literal(value)), { description: enumDescription(name, values) });
|
|
69
|
+
}
|
|
@@ -75,6 +75,7 @@ export default function shopify(rl) {
|
|
|
75
75
|
});
|
|
76
76
|
// ── Order ───────────────────────────────────────────
|
|
77
77
|
rl.registerAction("order.create", {
|
|
78
|
+
access: "write",
|
|
78
79
|
description: "Create an order",
|
|
79
80
|
inputSchema: {
|
|
80
81
|
lineItems: {
|
|
@@ -110,6 +111,7 @@ export default function shopify(rl) {
|
|
|
110
111
|
},
|
|
111
112
|
});
|
|
112
113
|
rl.registerAction("order.get", {
|
|
114
|
+
access: "read",
|
|
113
115
|
description: "Get an order by ID",
|
|
114
116
|
inputSchema: {
|
|
115
117
|
orderId: { type: "string", required: true },
|
|
@@ -125,6 +127,7 @@ export default function shopify(rl) {
|
|
|
125
127
|
},
|
|
126
128
|
});
|
|
127
129
|
rl.registerAction("order.list", {
|
|
130
|
+
access: "read",
|
|
128
131
|
description: "List orders",
|
|
129
132
|
inputSchema: {
|
|
130
133
|
status: {
|
|
@@ -155,6 +158,7 @@ export default function shopify(rl) {
|
|
|
155
158
|
},
|
|
156
159
|
});
|
|
157
160
|
rl.registerAction("order.update", {
|
|
161
|
+
access: "write",
|
|
158
162
|
description: "Update an order",
|
|
159
163
|
inputSchema: {
|
|
160
164
|
orderId: { type: "string", required: true },
|
|
@@ -176,6 +180,7 @@ export default function shopify(rl) {
|
|
|
176
180
|
},
|
|
177
181
|
});
|
|
178
182
|
rl.registerAction("order.delete", {
|
|
183
|
+
access: "write",
|
|
179
184
|
description: "Delete an order",
|
|
180
185
|
inputSchema: { orderId: { type: "string", required: true } },
|
|
181
186
|
async execute(input, ctx) {
|
|
@@ -185,6 +190,7 @@ export default function shopify(rl) {
|
|
|
185
190
|
});
|
|
186
191
|
// ── Product ─────────────────────────────────────────
|
|
187
192
|
rl.registerAction("product.create", {
|
|
193
|
+
access: "write",
|
|
188
194
|
description: "Create a product",
|
|
189
195
|
inputSchema: {
|
|
190
196
|
title: { type: "string", required: true },
|
|
@@ -202,6 +208,7 @@ export default function shopify(rl) {
|
|
|
202
208
|
},
|
|
203
209
|
});
|
|
204
210
|
rl.registerAction("product.get", {
|
|
211
|
+
access: "read",
|
|
205
212
|
description: "Get a product by ID",
|
|
206
213
|
inputSchema: {
|
|
207
214
|
productId: { type: "string", required: true },
|
|
@@ -217,6 +224,7 @@ export default function shopify(rl) {
|
|
|
217
224
|
},
|
|
218
225
|
});
|
|
219
226
|
rl.registerAction("product.list", {
|
|
227
|
+
access: "read",
|
|
220
228
|
description: "List products",
|
|
221
229
|
inputSchema: {
|
|
222
230
|
limit: { type: "number", required: false },
|
|
@@ -237,6 +245,7 @@ export default function shopify(rl) {
|
|
|
237
245
|
},
|
|
238
246
|
});
|
|
239
247
|
rl.registerAction("product.update", {
|
|
248
|
+
access: "write",
|
|
240
249
|
description: "Update a product",
|
|
241
250
|
inputSchema: {
|
|
242
251
|
productId: { type: "string", required: true },
|
|
@@ -253,6 +262,7 @@ export default function shopify(rl) {
|
|
|
253
262
|
},
|
|
254
263
|
});
|
|
255
264
|
rl.registerAction("product.delete", {
|
|
265
|
+
access: "write",
|
|
256
266
|
description: "Delete a product",
|
|
257
267
|
inputSchema: { productId: { type: "string", required: true } },
|
|
258
268
|
async execute(input, ctx) {
|
|
@@ -11,6 +11,7 @@ export default function signl4(rl) {
|
|
|
11
11
|
});
|
|
12
12
|
const url = (ctx) => `https://connect.signl4.com/webhook/${ctx.connection.config.teamSecret}`;
|
|
13
13
|
rl.registerAction("alert.send", {
|
|
14
|
+
access: "write",
|
|
14
15
|
description: "Send a SIGNL4 alert",
|
|
15
16
|
inputSchema: {
|
|
16
17
|
message: { type: "string", required: true },
|
|
@@ -55,6 +56,7 @@ export default function signl4(rl) {
|
|
|
55
56
|
},
|
|
56
57
|
});
|
|
57
58
|
rl.registerAction("alert.resolve", {
|
|
59
|
+
access: "write",
|
|
58
60
|
description: "Resolve a SIGNL4 alert by external ID",
|
|
59
61
|
inputSchema: {
|
|
60
62
|
externalId: { type: "string", required: true },
|