@jskit-ai/connectors-catalog 0.1.1
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 +192 -0
- package/docs/ai-upstream-notices.md +51 -0
- package/docs/ai.md +191 -0
- package/docs/airtable.md +130 -0
- package/docs/algolia.md +190 -0
- package/docs/amazon-redshift.md +229 -0
- package/docs/amplitude.md +210 -0
- package/docs/apify.md +162 -0
- package/docs/apollo-io.md +200 -0
- package/docs/asana.md +126 -0
- package/docs/ashby.md +188 -0
- package/docs/atlassian.md +224 -0
- package/docs/attention.md +162 -0
- package/docs/aws-athena.md +150 -0
- package/docs/aws-credentials.md +75 -0
- package/docs/aws-s3.md +193 -0
- package/docs/bigquery.md +146 -0
- package/docs/brevo.md +122 -0
- package/docs/calendly.md +158 -0
- package/docs/canva.md +191 -0
- package/docs/chargebee.md +192 -0
- package/docs/clay.md +194 -0
- package/docs/clickhouse.md +242 -0
- package/docs/confidence-exp.md +74 -0
- package/docs/confidence-flags.md +75 -0
- package/docs/confidence-oauth.md +137 -0
- package/docs/contentful.md +123 -0
- package/docs/databricks.md +180 -0
- package/docs/dbt-semantic-layer.md +175 -0
- package/docs/elevenlabs.md +102 -0
- package/docs/figma.md +132 -0
- package/docs/firebase-cloud-messaging.md +262 -0
- package/docs/firecrawl.md +137 -0
- package/docs/fireflies.md +95 -0
- package/docs/fireworks-ai.md +53 -0
- package/docs/gatewayapi.md +113 -0
- package/docs/gemini-enterprise.md +224 -0
- package/docs/github-api.md +133 -0
- package/docs/gitlab-api.md +138 -0
- package/docs/gmail.md +133 -0
- package/docs/gong.md +205 -0
- package/docs/google-ads.md +156 -0
- package/docs/google-analytics.md +202 -0
- package/docs/google-docs.md +105 -0
- package/docs/google-drive.md +108 -0
- package/docs/google-maps-platform.md +208 -0
- package/docs/google-oauth.md +123 -0
- package/docs/google-search-console.md +124 -0
- package/docs/google-sheets.md +94 -0
- package/docs/google-slides.md +95 -0
- package/docs/granola.md +178 -0
- package/docs/hex.md +161 -0
- package/docs/heygen.md +124 -0
- package/docs/hubspot.md +142 -0
- package/docs/incident-io.md +118 -0
- package/docs/inngest.md +178 -0
- package/docs/klipy.md +149 -0
- package/docs/lexware.md +144 -0
- package/docs/lightspeed.md +193 -0
- package/docs/linear.md +137 -0
- package/docs/linkedin.md +196 -0
- package/docs/logo-dev.md +152 -0
- package/docs/mailgun.md +153 -0
- package/docs/mapbox.md +174 -0
- package/docs/microsoft-excel.md +97 -0
- package/docs/microsoft-fabric.md +249 -0
- package/docs/microsoft-oauth.md +143 -0
- package/docs/microsoft-onedrive.md +76 -0
- package/docs/microsoft-onenote.md +75 -0
- package/docs/microsoft-outlook.md +90 -0
- package/docs/microsoft-powerpoint.md +119 -0
- package/docs/microsoft-sharepoint.md +75 -0
- package/docs/microsoft-teams.md +72 -0
- package/docs/microsoft-word.md +119 -0
- package/docs/miro.md +117 -0
- package/docs/n8n.md +169 -0
- package/docs/notion.md +137 -0
- package/docs/oura.md +161 -0
- package/docs/paddle.md +168 -0
- package/docs/perplexity.md +85 -0
- package/docs/pipedrive.md +120 -0
- package/docs/polar.md +63 -0
- package/docs/posthog.md +227 -0
- package/docs/prestashop.md +151 -0
- package/docs/replicate.md +60 -0
- package/docs/resend.md +153 -0
- package/docs/salesforce.md +234 -0
- package/docs/sanity.md +122 -0
- package/docs/semrush.md +276 -0
- package/docs/sentry.md +112 -0
- package/docs/sevdesk.md +107 -0
- package/docs/shopify.md +206 -0
- package/docs/slack.md +257 -0
- package/docs/snowflake.md +271 -0
- package/docs/storyblok.md +130 -0
- package/docs/stripe.md +77 -0
- package/docs/supabase.md +51 -0
- package/docs/tally.md +105 -0
- package/docs/telegram.md +165 -0
- package/docs/tiktok.md +201 -0
- package/docs/twilio.md +284 -0
- package/docs/twitch.md +428 -0
- package/docs/wave.md +440 -0
- package/docs/wix.md +1249 -0
- package/docs/wiz.md +177 -0
- package/docs/woocommerce.md +400 -0
- package/docs/wordpress-com.md +358 -0
- package/docs/wordpress-self-hosted.md +252 -0
- package/docs/workday.md +292 -0
- package/docs/x-twitter.md +188 -0
- package/docs/xero.md +429 -0
- package/docs/zoho-books.md +214 -0
- package/docs/zoho-crm.md +192 -0
- package/package.json +153 -0
- package/patterns/ai-connections/PATTERN.md +84 -0
- package/patterns/ai-connections/example/ai-model.js +11 -0
- package/patterns/ai-connections/example/perplexity-answer.js +29 -0
- package/patterns/api-key-connection/PATTERN.md +368 -0
- package/patterns/api-key-connection/example/connections.js +18 -0
- package/patterns/api-key-connection/example/integrations.json +19 -0
- package/patterns/assistant-mcp/PATTERN.md +110 -0
- package/patterns/assistant-mcp/example/integrations.json +13 -0
- package/patterns/assistant-mcp-oauth/PATTERN.md +235 -0
- package/patterns/assistant-mcp-oauth/example/integrations.json +102 -0
- package/patterns/aws-storage-queries/PATTERN.md +169 -0
- package/patterns/aws-storage-queries/example/formats/data-formats.js +35 -0
- package/patterns/aws-storage-queries/example/formats/package-lock.json +49 -0
- package/patterns/aws-storage-queries/example/formats/package.json +12 -0
- package/patterns/aws-storage-queries/example/formats/verify-formats.mjs +37 -0
- package/patterns/aws-storage-queries/example/integrations.json +38 -0
- package/patterns/aws-storage-queries/example/s3-transfer.js +34 -0
- package/patterns/event-delivery/PATTERN.md +151 -0
- package/patterns/event-delivery/example/integrations.json +17 -0
- package/patterns/firebase-messaging/PATTERN.md +156 -0
- package/patterns/firebase-messaging/example/server/notifications.js +23 -0
- package/patterns/google-ads-search/PATTERN.md +92 -0
- package/patterns/google-ads-search/example/ads-setup.js +25 -0
- package/patterns/oauth-connection/PATTERN.md +724 -0
- package/patterns/oauth-connection/example/integrations.json +20 -0
- package/patterns/paddle-catalogue/PATTERN.md +78 -0
- package/patterns/paddle-catalogue/example/create-products.js +38 -0
- package/patterns/public-image/PATTERN.md +84 -0
- package/patterns/public-image/example/integrations.json +13 -0
- package/patterns/public-image/example/logo-url.js +16 -0
- package/patterns/redshift-queries/PATTERN.md +150 -0
- package/patterns/redshift-queries/example/integrations.json +33 -0
- package/patterns/source-scanning/PATTERN.md +83 -0
- package/patterns/source-scanning/example/source-scanner.js +13 -0
- package/src/client/firebase-cloud-messaging.js +10 -0
- package/src/client/google-analytics.js +72 -0
- package/src/client/google-maps-platform.js +39 -0
- package/src/client/logo-dev.js +36 -0
- package/src/server/ai.js +46 -0
- package/src/server/airtable.js +67 -0
- package/src/server/algolia.js +63 -0
- package/src/server/amazon-redshift.js +96 -0
- package/src/server/amplitude.js +31 -0
- package/src/server/apify.js +68 -0
- package/src/server/apollo-io.js +85 -0
- package/src/server/asana.js +64 -0
- package/src/server/ashby.js +61 -0
- package/src/server/atlassian.js +32 -0
- package/src/server/attention.js +93 -0
- package/src/server/aws-athena.js +82 -0
- package/src/server/aws-s3.js +49 -0
- package/src/server/awsTransport.js +75 -0
- package/src/server/bigquery.js +97 -0
- package/src/server/brevo.js +97 -0
- package/src/server/calendly.js +77 -0
- package/src/server/canva.js +13 -0
- package/src/server/chargebee.js +88 -0
- package/src/server/clay.js +78 -0
- package/src/server/clickhouse.js +66 -0
- package/src/server/confidence.js +29 -0
- package/src/server/contentful.js +40 -0
- package/src/server/databricks.js +55 -0
- package/src/server/dbt-semantic-layer.js +95 -0
- package/src/server/elevenlabs.js +81 -0
- package/src/server/figma.js +24 -0
- package/src/server/firebase-cloud-messaging.js +111 -0
- package/src/server/firecrawl.js +70 -0
- package/src/server/fireflies.js +31 -0
- package/src/server/fireworks-ai.js +16 -0
- package/src/server/gatewayapi.js +48 -0
- package/src/server/gemini-enterprise.js +47 -0
- package/src/server/github-api.js +90 -0
- package/src/server/gitlab-api.js +67 -0
- package/src/server/gmail.js +60 -0
- package/src/server/gong.js +52 -0
- package/src/server/google-ads-search.js +134 -0
- package/src/server/google-ads.js +80 -0
- package/src/server/google-docs.js +36 -0
- package/src/server/google-drive.js +71 -0
- package/src/server/google-maps-platform.js +90 -0
- package/src/server/google-search-console.js +31 -0
- package/src/server/google-sheets.js +60 -0
- package/src/server/google-slides.js +36 -0
- package/src/server/google.js +61 -0
- package/src/server/granola.js +115 -0
- package/src/server/graphqlOperation.js +15 -0
- package/src/server/hex.js +29 -0
- package/src/server/heygen.js +54 -0
- package/src/server/hubspot.js +85 -0
- package/src/server/incident-io.js +68 -0
- package/src/server/inngest.js +86 -0
- package/src/server/jsonOperation.js +34 -0
- package/src/server/klipy.js +34 -0
- package/src/server/lexware.js +59 -0
- package/src/server/lightspeed.js +82 -0
- package/src/server/linear.js +52 -0
- package/src/server/linkedin.js +74 -0
- package/src/server/mailgun.js +76 -0
- package/src/server/mapbox.js +46 -0
- package/src/server/mcpRegistration.js +41 -0
- package/src/server/mcpTransport.js +60 -0
- package/src/server/microsoft-excel.js +67 -0
- package/src/server/microsoft-fabric.js +81 -0
- package/src/server/microsoft-onedrive.js +58 -0
- package/src/server/microsoft-onenote.js +52 -0
- package/src/server/microsoft-outlook.js +58 -0
- package/src/server/microsoft-powerpoint.js +5 -0
- package/src/server/microsoft-sharepoint.js +46 -0
- package/src/server/microsoft-teams.js +29 -0
- package/src/server/microsoft-word.js +5 -0
- package/src/server/microsoft.js +88 -0
- package/src/server/miro.js +29 -0
- package/src/server/n8n.js +78 -0
- package/src/server/notion.js +76 -0
- package/src/server/oura.js +48 -0
- package/src/server/paddle.js +83 -0
- package/src/server/perplexity.js +15 -0
- package/src/server/pipedrive.js +95 -0
- package/src/server/polar.js +20 -0
- package/src/server/posthog.js +44 -0
- package/src/server/prestashop.js +42 -0
- package/src/server/replicate.js +42 -0
- package/src/server/resend.js +93 -0
- package/src/server/salesforce.js +84 -0
- package/src/server/sanity.js +31 -0
- package/src/server/semrush.js +359 -0
- package/src/server/sentry.js +30 -0
- package/src/server/sevdesk.js +20 -0
- package/src/server/shopify.js +99 -0
- package/src/server/slack.js +143 -0
- package/src/server/snowflake.js +139 -0
- package/src/server/storyblok.js +49 -0
- package/src/server/stripe.js +13 -0
- package/src/server/supabase.js +13 -0
- package/src/server/tally.js +78 -0
- package/src/server/telegram.js +55 -0
- package/src/server/tiktok.js +86 -0
- package/src/server/twilio.js +90 -0
- package/src/server/twitch.js +409 -0
- package/src/server/wave.js +520 -0
- package/src/server/wix.js +1048 -0
- package/src/server/wiz.js +117 -0
- package/src/server/woocommerce.js +412 -0
- package/src/server/wordpress-com.js +236 -0
- package/src/server/wordpress-self-hosted.js +134 -0
- package/src/server/workday.js +136 -0
- package/src/server/x-twitter.js +110 -0
- package/src/server/xero.js +397 -0
- package/src/server/zoho-books.js +90 -0
- package/src/server/zoho-crm.js +89 -0
- package/src/server/zohoOAuth.js +21 -0
- package/src/shared/ai-models.json +8049 -0
- package/src/shared/ai.js +63 -0
- package/src/shared/algolia.js +29 -0
- package/src/shared/amazon-redshift.js +51 -0
- package/src/shared/amplitude.js +28 -0
- package/src/shared/atlassian.js +43 -0
- package/src/shared/aws.js +72 -0
- package/src/shared/canva.js +66 -0
- package/src/shared/chargebee.js +26 -0
- package/src/shared/clickhouse.js +38 -0
- package/src/shared/confidence.js +28 -0
- package/src/shared/databricks.js +33 -0
- package/src/shared/dbt-semantic-layer.js +32 -0
- package/src/shared/definitions.js +140 -0
- package/src/shared/figma.js +21 -0
- package/src/shared/firebase-cloud-messaging.js +45 -0
- package/src/shared/gemini-enterprise.js +33 -0
- package/src/shared/gong.js +33 -0
- package/src/shared/google-ads-search.js +31 -0
- package/src/shared/google-ads.js +28 -0
- package/src/shared/google-maps-platform.js +28 -0
- package/src/shared/google.js +133 -0
- package/src/shared/granola.js +25 -0
- package/src/shared/hex.js +28 -0
- package/src/shared/inngest.js +35 -0
- package/src/shared/lightspeed.js +75 -0
- package/src/shared/linkedin.js +27 -0
- package/src/shared/logo-dev.js +21 -0
- package/src/shared/mapbox.js +38 -0
- package/src/shared/mcp.js +92 -0
- package/src/shared/microsoft-fabric.js +47 -0
- package/src/shared/microsoft.js +231 -0
- package/src/shared/miro.js +27 -0
- package/src/shared/oura.js +23 -0
- package/src/shared/posthog.js +33 -0
- package/src/shared/prestashop.js +23 -0
- package/src/shared/salesforce.js +36 -0
- package/src/shared/semrush.js +24 -0
- package/src/shared/shopify.js +51 -0
- package/src/shared/siteUrl.js +12 -0
- package/src/shared/slack.js +88 -0
- package/src/shared/snowflake.js +55 -0
- package/src/shared/tiktok.js +22 -0
- package/src/shared/tokens.js +747 -0
- package/src/shared/twilio.js +41 -0
- package/src/shared/twitch.js +49 -0
- package/src/shared/wave.js +52 -0
- package/src/shared/wix.js +40 -0
- package/src/shared/wiz.js +41 -0
- package/src/shared/wordpress-com.js +30 -0
- package/src/shared/wordpress.js +69 -0
- package/src/shared/workday.js +50 -0
- package/src/shared/x-twitter.js +19 -0
- package/src/shared/xero.js +46 -0
- package/src/shared/zoho-books.js +39 -0
- package/src/shared/zoho-crm.js +43 -0
- package/src/shared/zoho-regions.js +12 -0
- package/test/ai.test.js +136 -0
- package/test/airtable.test.js +125 -0
- package/test/algolia.test.js +207 -0
- package/test/amazon-redshift.test.js +272 -0
- package/test/amplitude.test.js +239 -0
- package/test/apify.test.js +93 -0
- package/test/apollo-io.test.js +125 -0
- package/test/asana.test.js +99 -0
- package/test/ashby.test.js +97 -0
- package/test/atlassian.test.js +249 -0
- package/test/attention.test.js +79 -0
- package/test/aws.test.js +405 -0
- package/test/brevo.test.js +71 -0
- package/test/calendly.test.js +136 -0
- package/test/canva.test.js +258 -0
- package/test/chargebee.test.js +195 -0
- package/test/clickhouse.test.js +278 -0
- package/test/confidence.test.js +205 -0
- package/test/databricks.test.js +253 -0
- package/test/dbt-semantic-layer.test.js +221 -0
- package/test/designMcp.test.js +336 -0
- package/test/elevenlabs.test.js +52 -0
- package/test/firebase-cloud-messaging.test.js +242 -0
- package/test/firecrawl.test.js +66 -0
- package/test/gemini-enterprise.test.js +218 -0
- package/test/github-api.test.js +167 -0
- package/test/gitlab-api.test.js +160 -0
- package/test/gong.test.js +192 -0
- package/test/google-ads.test.js +350 -0
- package/test/google-maps-platform.test.js +191 -0
- package/test/google.test.js +710 -0
- package/test/granola.test.js +240 -0
- package/test/hex.test.js +253 -0
- package/test/heygen.test.js +121 -0
- package/test/hubspot.test.js +103 -0
- package/test/inngest.test.js +219 -0
- package/test/lightspeed.test.js +250 -0
- package/test/linear.test.js +146 -0
- package/test/linkedin.test.js +243 -0
- package/test/logo-dev.test.js +79 -0
- package/test/mailgun.test.js +107 -0
- package/test/mapbox.test.js +181 -0
- package/test/mcp.test.js +227 -0
- package/test/microsoft-fabric.test.js +258 -0
- package/test/microsoft.test.js +554 -0
- package/test/n8nOAuth.test.js +188 -0
- package/test/notionOAuth.test.js +183 -0
- package/test/oura.test.js +211 -0
- package/test/paddleCatalogue.test.js +51 -0
- package/test/paddlePermissions.test.js +101 -0
- package/test/perplexityComposition.test.js +39 -0
- package/test/pipedriveOAuth.test.js +140 -0
- package/test/posthog.test.js +200 -0
- package/test/prestashop.test.js +207 -0
- package/test/resend.test.js +163 -0
- package/test/salesforce.test.js +276 -0
- package/test/semrush.test.js +479 -0
- package/test/sentry.test.js +35 -0
- package/test/shopify.test.js +247 -0
- package/test/slack.test.js +320 -0
- package/test/snowflake.test.js +391 -0
- package/test/tally.test.js +75 -0
- package/test/telegram.test.js +58 -0
- package/test/tiktok.test.js +243 -0
- package/test/tokens.test.js +1079 -0
- package/test/twilio.test.js +221 -0
- package/test/twitch.test.js +573 -0
- package/test/wave.test.js +678 -0
- package/test/wix.test.js +1099 -0
- package/test/wiz.test.js +185 -0
- package/test/wordpress-com.test.js +469 -0
- package/test/wordpress.test.js +660 -0
- package/test/workday.test.js +314 -0
- package/test/x-twitter.test.js +256 -0
- package/test/xero.test.js +700 -0
- package/test/zoho-books.test.js +253 -0
- package/test/zoho-crm.test.js +223 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createSchema } from "json-rest-schema";
|
|
2
|
+
import { validateSchemaPayload } from "@jskit-ai/kernel/shared/validators";
|
|
3
|
+
import { ConnectorError } from "@jskit-ai/connectors-core/server";
|
|
4
|
+
import { elevenlabsDefinition } from "../shared/tokens.js";
|
|
5
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
6
|
+
|
|
7
|
+
const voiceId = { type: "string", required: true, minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9_-]+$" };
|
|
8
|
+
const speechSchema = createSchema({
|
|
9
|
+
voiceId, text: { type: "string", required: true, minLength: 1, maxLength: 5000 },
|
|
10
|
+
model_id: { type: "string", required: true, minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9_-]+$" },
|
|
11
|
+
output_format: { type: "string", enum: ["mp3_44100_128", "mp3_22050_32", "pcm_16000", "ulaw_8000"], defaultTo: "mp3_44100_128" },
|
|
12
|
+
language_code: { type: "string", pattern: "^[a-z]{2}$" },
|
|
13
|
+
voice_settings: { type: "object", schema: createSchema({
|
|
14
|
+
stability: { type: "number", min: 0, max: 1 }, similarity_boost: { type: "number", min: 0, max: 1 },
|
|
15
|
+
style: { type: "number", min: 0, max: 1 }, use_speaker_boost: { type: "boolean" }, speed: { type: "number", min: 0.7, max: 1.2 }
|
|
16
|
+
}) }
|
|
17
|
+
});
|
|
18
|
+
const cloneSchema = createSchema({
|
|
19
|
+
name: { type: "string", required: true, minLength: 1, maxLength: 100 },
|
|
20
|
+
description: { type: "string", maxLength: 1000 },
|
|
21
|
+
consentConfirmed: { type: "boolean", required: true, validator: value => value === true || "Confirm permission to clone this voice." },
|
|
22
|
+
remove_background_noise: { type: "boolean", defaultTo: false },
|
|
23
|
+
files: { type: "array", required: true, validator: value => (value.length >= 1 && value.length <= 5) || "Supply one to five audio samples.",
|
|
24
|
+
items: { type: "object", schema: createSchema({
|
|
25
|
+
name: { type: "string", required: true, minLength: 1, maxLength: 100, pattern: "^[A-Za-z0-9_.-]+$" },
|
|
26
|
+
contentType: { type: "string", required: true, enum: ["audio/mpeg", "audio/wav", "audio/x-wav", "audio/mp4", "audio/flac", "audio/ogg"] },
|
|
27
|
+
base64: { type: "string", required: true, minLength: 4, maxLength: 12 * 1024 * 1024,
|
|
28
|
+
validator: value => (/^[A-Za-z0-9+/]*={0,2}$/u.test(value) && Buffer.from(value, "base64").toString("base64") === value) || "Supply canonical base64 audio." }
|
|
29
|
+
}) } }
|
|
30
|
+
});
|
|
31
|
+
const elevenlabsProvider = Object.freeze({
|
|
32
|
+
...elevenlabsDefinition, apiOrigins: ["https://api.elevenlabs.io"],
|
|
33
|
+
apiKey: { headers: (key) => ({ "xi-api-key": key }) },
|
|
34
|
+
checkOperation: "account.read",
|
|
35
|
+
async exchange(url, options, { request, fetchImpl }) {
|
|
36
|
+
if (!new URL(url).pathname.startsWith("/v1/text-to-speech/")) return request(url, options);
|
|
37
|
+
const response = await fetchImpl(url, { ...options, body: JSON.stringify(options.body),
|
|
38
|
+
headers: { ...options.headers, "Content-Type": "application/json", Accept: "audio/*" }, credentials: "omit", redirect: "error" });
|
|
39
|
+
if (!response.ok) { await response.body?.cancel(); throw Object.assign(new Error("ElevenLabs speech request failed."), { status: response.status }); }
|
|
40
|
+
const contentType = response.headers.get("content-type")?.split(";")[0] || "application/octet-stream";
|
|
41
|
+
if (!contentType.startsWith("audio/") && contentType !== "application/octet-stream") {
|
|
42
|
+
await response.body?.cancel(); throw new ConnectorError("connector_response_invalid", "ElevenLabs did not return audio.", { statusCode: 502 });
|
|
43
|
+
}
|
|
44
|
+
const reader = response.body?.getReader(); const chunks = []; let size = 0;
|
|
45
|
+
if (reader) try {
|
|
46
|
+
while (true) {
|
|
47
|
+
const { done, value } = await reader.read(); if (done) break;
|
|
48
|
+
size += value.byteLength;
|
|
49
|
+
if (size > 16 * 1024 * 1024) { await reader.cancel(); throw new ConnectorError("connector_response_too_large", "Use native streaming for audio above 16 MiB.", { statusCode: 413 }); }
|
|
50
|
+
chunks.push(value);
|
|
51
|
+
}
|
|
52
|
+
} finally { reader.releaseLock(); }
|
|
53
|
+
if (!size) throw new ConnectorError("connector_response_invalid", "ElevenLabs returned empty audio.", { statusCode: 502 });
|
|
54
|
+
return { bodyBase64: Buffer.concat(chunks).toString("base64"), contentType, size };
|
|
55
|
+
},
|
|
56
|
+
operations: {
|
|
57
|
+
"speech.create": { scopes: [], request(input) {
|
|
58
|
+
const { voiceId, output_format, ...body } = validateSchemaPayload({ schema: speechSchema, mode: "replace" }, input, { statusCode: 422 });
|
|
59
|
+
return { method: "POST", url: `https://api.elevenlabs.io/v1/text-to-speech/${voiceId}?output_format=${output_format}`, body };
|
|
60
|
+
}, validateResult: result => typeof result?.bodyBase64 === "string" && result.size > 0 },
|
|
61
|
+
"voices.clone": { scopes: [], request(input) {
|
|
62
|
+
const { files, consentConfirmed, ...values } = validateSchemaPayload({ schema: cloneSchema, mode: "replace" }, input, { statusCode: 422 });
|
|
63
|
+
const body = new FormData(); let total = 0;
|
|
64
|
+
for (const file of files) {
|
|
65
|
+
const bytes = Buffer.from(file.base64, "base64"); total += bytes.byteLength;
|
|
66
|
+
if (total > 16 * 1024 * 1024) throw new ConnectorError("connector_input_invalid", "Audio samples must total at most 16 MiB.", { statusCode: 422 });
|
|
67
|
+
body.append("files", new Blob([bytes], { type: file.contentType }), file.name);
|
|
68
|
+
}
|
|
69
|
+
for (const [key, value] of Object.entries(values)) body.append(key, String(value));
|
|
70
|
+
return { method: "POST", url: "https://api.elevenlabs.io/v1/voices/add", body };
|
|
71
|
+
}, validateResult: result => typeof result?.voice_id === "string" && typeof result.requires_verification === "boolean" },
|
|
72
|
+
"models.list": jsonOperation("https://api.elevenlabs.io/v1/models", {}, Array.isArray),
|
|
73
|
+
"account.read": jsonOperation("https://api.elevenlabs.io/v1/user", {}, (result) => typeof result?.user_id === "string"),
|
|
74
|
+
"voices.list": jsonOperation("https://api.elevenlabs.io/v2/voices", {
|
|
75
|
+
search: { type: "string", maxLength: 4096 },
|
|
76
|
+
page_size: { type: "integer", min: 1, max: 100, defaultTo: 10 },
|
|
77
|
+
next_page_token: { type: "string", minLength: 1, maxLength: 4096 }
|
|
78
|
+
}, (result) => Array.isArray(result?.voices) && typeof result.has_more === "boolean")
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export { elevenlabsProvider };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createSchema } from "json-rest-schema";
|
|
2
|
+
import { validateSchemaPayload } from "@jskit-ai/kernel/shared/validators";
|
|
3
|
+
import { figmaDefinition } from "../shared/figma.js";
|
|
4
|
+
import { mcpOperations, exchangeMcp } from "./mcpTransport.js";
|
|
5
|
+
import { mcpRegistrationFields, registerMcpClient } from "./mcpRegistration.js";
|
|
6
|
+
|
|
7
|
+
const resource = "https://mcp.figma.com/mcp";
|
|
8
|
+
const oauth = Object.freeze({
|
|
9
|
+
issuer: "https://api.figma.com", authorization_endpoint: "https://www.figma.com/oauth/mcp",
|
|
10
|
+
token_endpoint: "https://api.figma.com/v1/oauth/token", registration_endpoint: "https://api.figma.com/v1/oauth/mcp/register",
|
|
11
|
+
response_types_supported: ["code"], authorization_response_iss_parameter_supported: true
|
|
12
|
+
});
|
|
13
|
+
const figmaProvider = Object.freeze({
|
|
14
|
+
...figmaDefinition, oauth, oauthResource: resource, apiOrigins: ["https://mcp.figma.com"],
|
|
15
|
+
checkOperation: "tools.list", exchange: exchangeMcp, operations: mcpOperations(() => resource)
|
|
16
|
+
});
|
|
17
|
+
const registrationSchema = createSchema(mcpRegistrationFields);
|
|
18
|
+
|
|
19
|
+
async function registerFigmaClient(input, options) {
|
|
20
|
+
const values = validateSchemaPayload({ schema: registrationSchema, mode: "replace" }, input, { statusCode: 422 });
|
|
21
|
+
return registerMcpClient("Figma", oauth, { ...values, scopes: ["mcp:connect"] }, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { figmaProvider, registerFigmaClient };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { importPKCS8, SignJWT } from "jose";
|
|
2
|
+
import { createSchema } from "json-rest-schema";
|
|
3
|
+
import { validateSchemaPayload } from "@jskit-ai/kernel/shared/validators";
|
|
4
|
+
import { ConnectorError } from "@jskit-ai/connectors-core/server";
|
|
5
|
+
import { firebaseCloudMessagingDefinition, firebaseMessagingScope, firebaseProjectId } from "../shared/firebase-cloud-messaging.js";
|
|
6
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
7
|
+
|
|
8
|
+
const tokenUrl = "https://oauth2.googleapis.com/token";
|
|
9
|
+
const endpoint = ({ projectId }) => `https://fcm.googleapis.com/v1/projects/${projectId}/messages:send`;
|
|
10
|
+
const credentialSchema = createSchema({ project_id: firebaseProjectId });
|
|
11
|
+
const invalidCredential = () => new ConnectorError("connector_binding_missing", "Use a valid Firebase service-account JSON credential for the default Google API domain.");
|
|
12
|
+
|
|
13
|
+
async function serviceAccountGrant({ credential, scopes, fetchImpl, signal, now }) {
|
|
14
|
+
let account, key;
|
|
15
|
+
try {
|
|
16
|
+
account = JSON.parse(credential);
|
|
17
|
+
if (account?.type !== "service_account" || account.token_uri !== tokenUrl ||
|
|
18
|
+
(account.universe_domain !== undefined && account.universe_domain !== "googleapis.com") ||
|
|
19
|
+
typeof account.client_email !== "string" || !/^[a-z0-9][a-z0-9._-]*@(?:[a-z0-9-]+\.iam|developer)\.gserviceaccount\.com$/u.test(account.client_email) ||
|
|
20
|
+
typeof account.private_key_id !== "string" || !/^[a-f0-9]{1,128}$/u.test(account.private_key_id) ||
|
|
21
|
+
typeof account.private_key !== "string") throw invalidCredential();
|
|
22
|
+
validateSchemaPayload({ schema: credentialSchema, mode: "replace" }, { project_id: account.project_id });
|
|
23
|
+
key = await importPKCS8(account.private_key, "RS256");
|
|
24
|
+
} catch { throw invalidCredential(); }
|
|
25
|
+
const seconds = Math.floor(now / 1000);
|
|
26
|
+
const assertion = await new SignJWT({ scope: scopes.join(" ") })
|
|
27
|
+
.setProtectedHeader({ alg: "RS256", typ: "JWT", kid: account.private_key_id })
|
|
28
|
+
.setIssuer(account.client_email).setAudience(tokenUrl).setIssuedAt(seconds).setExpirationTime(seconds + 3600).sign(key);
|
|
29
|
+
signal.throwIfAborted();
|
|
30
|
+
const response = await fetchImpl(tokenUrl, {
|
|
31
|
+
method: "POST", redirect: "error", credentials: "omit", signal,
|
|
32
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" },
|
|
33
|
+
body: new URLSearchParams({ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", assertion }).toString()
|
|
34
|
+
});
|
|
35
|
+
if (response.redirected || (response.status >= 300 && response.status < 400)) {
|
|
36
|
+
throw new ConnectorError("connector_response_invalid", "Google returned an unexpected token redirect.", { statusCode: 502 });
|
|
37
|
+
}
|
|
38
|
+
let value;
|
|
39
|
+
try { value = await response.json(); } catch {
|
|
40
|
+
throw new ConnectorError("connector_response_invalid", "Google returned an invalid token response.", { statusCode: 502 });
|
|
41
|
+
}
|
|
42
|
+
if (!response.ok) {
|
|
43
|
+
const denied = response.status === 401 || ["invalid_grant", "invalid_client"].includes(value?.error);
|
|
44
|
+
throw new ConnectorError(denied ? "connector_reconnect_required" : response.status === 403 ? "connector_permission_denied" : response.status === 429 ? "connector_rate_limited" : "connector_provider_failed",
|
|
45
|
+
"Google could not authorize the service account. Check the credential and project permissions.", { statusCode: denied ? 401 : [403, 429].includes(response.status) ? response.status : 502 });
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const target = { type: "string", noTrim: true, minLength: 1, maxLength: 4096, pattern: "^[^\\s]+$" };
|
|
51
|
+
const notification = createSchema({
|
|
52
|
+
title: { type: "string", noTrim: true, maxLength: 1024 }, body: { type: "string", noTrim: true, maxLength: 4096 },
|
|
53
|
+
image: { type: "string", maxLength: 2048, validator: (value) => {
|
|
54
|
+
try { const url = new URL(value); return (url.protocol === "https:" && !url.username && !url.password) || "Use an HTTPS image URL."; } catch { return "Use an HTTPS image URL."; }
|
|
55
|
+
} }
|
|
56
|
+
});
|
|
57
|
+
const messageSchema = createSchema({
|
|
58
|
+
fid: { ...target, maxLength: 128 }, token: target,
|
|
59
|
+
topic: { ...target, maxLength: 900, pattern: "^[A-Za-z0-9_.~%\\-]+$" },
|
|
60
|
+
condition: { type: "string", noTrim: true, minLength: 1, maxLength: 2048 },
|
|
61
|
+
notification: { type: "object", schema: notification },
|
|
62
|
+
data: { type: "object", additionalProperties: true, validator: (value) => Object.entries(value).every(([key, item]) =>
|
|
63
|
+
key.length > 0 && !["from", "message_type"].includes(key) && !key.startsWith("google.") && !key.startsWith("gcm.notification.") && typeof item === "string") || "Use string values and non-reserved Firebase data keys." }
|
|
64
|
+
});
|
|
65
|
+
const messageFields = { message: { type: "object", required: true, schema: messageSchema,
|
|
66
|
+
validator: (value) => (["fid", "token", "topic", "condition"].filter((key) => Object.hasOwn(value, key)).length === 1 &&
|
|
67
|
+
((value.notification && Object.values(value.notification).some(Boolean)) || Object.keys(value.data || {}).length > 0) &&
|
|
68
|
+
new TextEncoder().encode(JSON.stringify(value)).length <= (value.topic || value.condition ? 2048 : 4096)) || "Supply one target and a notification or data payload within the message size limit." } };
|
|
69
|
+
const receipt = (value) => typeof value?.name === "string" && /^projects\/[^/\s]+\/messages\/[^/\s]+$/u.test(value.name);
|
|
70
|
+
function messageOperation(validateOnly) {
|
|
71
|
+
const operation = jsonOperation(endpoint, messageFields, receipt, "POST");
|
|
72
|
+
return { ...operation, scopes: [firebaseMessagingScope], request(input, settings) {
|
|
73
|
+
const request = operation.request(input, settings);
|
|
74
|
+
return { ...request, body: { ...request.body, validate_only: validateOnly } };
|
|
75
|
+
} };
|
|
76
|
+
}
|
|
77
|
+
const check = jsonOperation(endpoint, {}, receipt, "POST");
|
|
78
|
+
const firebaseCloudMessagingProvider = Object.freeze({
|
|
79
|
+
...firebaseCloudMessagingDefinition, apiOrigins: ["https://fcm.googleapis.com"], serviceAccountGrant,
|
|
80
|
+
checkOperation: "connection.check",
|
|
81
|
+
operations: {
|
|
82
|
+
"connection.check": { ...check, scopes: [firebaseMessagingScope], request(input, settings) {
|
|
83
|
+
return { ...check.request(input, settings), body: { validate_only: true, message: { topic: "jskit-connection-check", data: { connectionCheck: "true" } } } };
|
|
84
|
+
} },
|
|
85
|
+
"messages.validate": messageOperation(true), "messages.send": messageOperation(false)
|
|
86
|
+
},
|
|
87
|
+
async exchange(address, options, { fetchImpl, settings }) {
|
|
88
|
+
const response = await fetchImpl(address, { ...options, body: JSON.stringify(options.body), credentials: "omit", redirect: "error",
|
|
89
|
+
headers: { ...options.headers, "Content-Type": "application/json" } });
|
|
90
|
+
let result;
|
|
91
|
+
try { result = await response.json(); }
|
|
92
|
+
catch { throw new ConnectorError("connector_response_invalid", "Firebase returned invalid message JSON.", { statusCode: 502 }); }
|
|
93
|
+
if (!response.ok) {
|
|
94
|
+
const details = result?.error?.details;
|
|
95
|
+
const fcmError = Array.isArray(details) ? details.find(detail => detail?.["@type"] === "type.googleapis.com/google.firebase.fcm.v1.FcmError")?.errorCode : undefined;
|
|
96
|
+
if (response.status === 404 && fcmError === "UNREGISTERED" && (options.body.message.token || options.body.message.fid)) {
|
|
97
|
+
throw new ConnectorError("connector_recipient_unregistered", "This Firebase recipient is no longer registered. Remove its association and wait for client registration again.", { statusCode: 410 });
|
|
98
|
+
}
|
|
99
|
+
if (response.status === 400) {
|
|
100
|
+
throw new ConnectorError("connector_message_invalid", "Firebase rejected the message or target. Do not delete a registration unless the payload is known to be valid.", { statusCode: 422 });
|
|
101
|
+
}
|
|
102
|
+
throw Object.assign(new Error("Firebase message request failed."), { status: response.status });
|
|
103
|
+
}
|
|
104
|
+
if (!receipt(result) || !result.name.startsWith(`projects/${settings.projectId}/messages/`)) {
|
|
105
|
+
throw new ConnectorError("connector_response_invalid", "Firebase returned an unexpected message receipt.", { statusCode: 502 });
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export { firebaseCloudMessagingProvider };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { validatedOperation } from "./jsonOperation.js";
|
|
2
|
+
import { createSchema } from "json-rest-schema";
|
|
3
|
+
import { validateSchemaPayload } from "@jskit-ai/kernel/shared/validators";
|
|
4
|
+
import { ConnectorError } from "@jskit-ai/connectors-core/server";
|
|
5
|
+
import { firecrawlDefinition } from "../shared/definitions.js";
|
|
6
|
+
|
|
7
|
+
const empty = createSchema({});
|
|
8
|
+
const pageUrl = {
|
|
9
|
+
type: "string", required: true, minLength: 1, maxLength: 8192,
|
|
10
|
+
validator(value) {
|
|
11
|
+
try {
|
|
12
|
+
const url = new URL(value);
|
|
13
|
+
return (["https:", "http:"].includes(url.protocol) && !url.username && !url.password) || "Use an HTTP or HTTPS page URL without credentials.";
|
|
14
|
+
} catch { return "Use an HTTP or HTTPS page URL without credentials."; }
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const scrape = createSchema({ url: pageUrl,
|
|
18
|
+
onlyMainContent: { type: "boolean", defaultTo: true }
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const jobId = { type: "string", required: true, pattern: "^[A-Za-z0-9-]{1,128}$" };
|
|
22
|
+
const firecrawlProvider = Object.freeze({
|
|
23
|
+
...firecrawlDefinition,
|
|
24
|
+
apiOrigins: ["https://api.firecrawl.dev"],
|
|
25
|
+
apiKey: { headers: (key) => ({ Authorization: `Bearer ${key}` }) },
|
|
26
|
+
checkOperation: "credits.read",
|
|
27
|
+
operations: {
|
|
28
|
+
"pages.search": validatedOperation({ query: { type: "string", required: true, minLength: 1, maxLength: 4096 },
|
|
29
|
+
limit: { type: "integer", min: 1, max: 100, defaultTo: 5 }, includeContent: { type: "boolean", defaultTo: false }
|
|
30
|
+
}, ({ includeContent, ...body }) => ({ method: "POST", url: "https://api.firecrawl.dev/v2/search", body: {
|
|
31
|
+
...body, sources: ["web"], ...(includeContent ? { scrapeOptions: { formats: ["markdown"] } } : {})
|
|
32
|
+
} }), result => result?.success === true && Array.isArray(result.data?.web)),
|
|
33
|
+
"sites.map": validatedOperation({ url: pageUrl, limit: { type: "integer", required: true, min: 1, max: 1000 }, search: { type: "string", minLength: 1, maxLength: 1000 } },
|
|
34
|
+
body => ({ method: "POST", url: "https://api.firecrawl.dev/v2/map", body }), result => result?.success === true && Array.isArray(result.links)),
|
|
35
|
+
"pages.extract": validatedOperation({ url: pageUrl, schema: { type: "object", required: true, additionalProperties: true,
|
|
36
|
+
validator: value => JSON.stringify(value).length <= 32000 || "Use a schema below 32,000 characters." }, prompt: { type: "string", maxLength: 4000 }
|
|
37
|
+
}, ({ url, schema, prompt }) => ({ method: "POST", url: "https://api.firecrawl.dev/v2/scrape", body: { url, formats: [{ type: "json", schema, ...(prompt ? { prompt } : {}) }] } }),
|
|
38
|
+
result => result?.success === true && result.data != null && Object.hasOwn(result.data, "json")),
|
|
39
|
+
"crawls.start": validatedOperation({ url: pageUrl, limit: { type: "integer", required: true, min: 1, max: 1000 },
|
|
40
|
+
maxDiscoveryDepth: { type: "integer", min: 0, max: 10, defaultTo: 2 }
|
|
41
|
+
}, body => ({ method: "POST", url: "https://api.firecrawl.dev/v2/crawl", body: { ...body,
|
|
42
|
+
allowExternalLinks: false, allowSubdomains: false, scrapeOptions: { formats: ["markdown"], onlyMainContent: true }
|
|
43
|
+
} }), result => result?.success === true && typeof result.id === "string"),
|
|
44
|
+
"crawls.get": validatedOperation({ id: jobId, next: { type: "string", maxLength: 8192 } }, ({ id, next }) => {
|
|
45
|
+
const expected = `https://api.firecrawl.dev/v2/crawl/${id}`;
|
|
46
|
+
let url; try { url = new URL(next || expected); } catch { throw new ConnectorError("connector_input_invalid", "Use the returned next-page URL for this crawl."); }
|
|
47
|
+
if (url.origin + url.pathname !== expected || url.username || url.password || url.hash) throw new ConnectorError("connector_input_invalid", "Use the returned next-page URL for this crawl.");
|
|
48
|
+
return { method: "GET", url: url.href };
|
|
49
|
+
}, result => typeof result?.status === "string" && Array.isArray(result.data) && Number.isInteger(result.total) && result.total >= 0 && Number.isInteger(result.completed) && result.completed >= 0),
|
|
50
|
+
"crawls.errors": validatedOperation({ id: jobId }, ({ id }) => ({ method: "GET", url: `https://api.firecrawl.dev/v2/crawl/${id}/errors` }), result => Array.isArray(result?.errors)),
|
|
51
|
+
"crawls.cancel": validatedOperation({ id: jobId }, ({ id }) => ({ method: "DELETE", url: `https://api.firecrawl.dev/v2/crawl/${id}` }), result => result?.status === "cancelled" || result?.success === true),
|
|
52
|
+
"credits.read": {
|
|
53
|
+
scopes: [],
|
|
54
|
+
request(input) {
|
|
55
|
+
validateSchemaPayload({ schema: empty, mode: "replace" }, input, { statusCode: 422 });
|
|
56
|
+
return { method: "GET", url: "https://api.firecrawl.dev/v2/team/credit-usage" };
|
|
57
|
+
},
|
|
58
|
+
validateResult: (result) => result?.success === true && Number.isFinite(result.data?.remainingCredits)
|
|
59
|
+
},
|
|
60
|
+
"pages.scrape": {
|
|
61
|
+
scopes: [],
|
|
62
|
+
request(input) {
|
|
63
|
+
const body = validateSchemaPayload({ schema: scrape, mode: "replace" }, input, { statusCode: 422 });
|
|
64
|
+
return { method: "POST", url: "https://api.firecrawl.dev/v2/scrape", body: { ...body, formats: ["markdown"] } };
|
|
65
|
+
},
|
|
66
|
+
validateResult: (result) => result?.success === true && typeof result.data?.markdown === "string"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export { firecrawlProvider };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { firefliesDefinition } from "../shared/tokens.js";
|
|
2
|
+
import { graphqlOperation } from "./graphqlOperation.js";
|
|
3
|
+
|
|
4
|
+
const firefliesProvider = Object.freeze({
|
|
5
|
+
...firefliesDefinition, apiOrigins: ["https://api.fireflies.ai"],
|
|
6
|
+
apiKey: { headers: (key) => ({ Authorization: `Bearer ${key}` }) },
|
|
7
|
+
checkOperation: "profile.read",
|
|
8
|
+
operations: {
|
|
9
|
+
"profile.read": graphqlOperation("https://api.fireflies.ai/graphql", "query ConnectorUser { user { user_id name email } }", {},
|
|
10
|
+
(data) => typeof data?.user?.user_id === "string"),
|
|
11
|
+
"transcripts.get": graphqlOperation("https://api.fireflies.ai/graphql",
|
|
12
|
+
"query ConnectorTranscript($id: String!) { transcript(id: $id) { id title date duration participants calendar_type meeting_link transcript_url speakers { id name } sentences { index speaker_name speaker_id text start_time end_time } summary { keywords action_items outline overview } } }", {
|
|
13
|
+
id: { type: "string", required: true, minLength: 1, maxLength: 256 }
|
|
14
|
+
}, data => typeof data?.transcript?.id === "string" && (data.transcript.sentences === null || Array.isArray(data.transcript.sentences))),
|
|
15
|
+
"transcripts.search": graphqlOperation("https://api.fireflies.ai/graphql",
|
|
16
|
+
"query ConnectorSearch($keyword: String!, $scope: TranscriptsQueryScope!, $limit: Int!, $skip: Int!, $mine: Boolean!) { transcripts(keyword: $keyword, scope: $scope, limit: $limit, skip: $skip, mine: $mine) { id title date duration participants } }", {
|
|
17
|
+
keyword: { type: "string", required: true, minLength: 1, maxLength: 255 },
|
|
18
|
+
scope: { type: "string", enum: ["title", "sentences", "all"], defaultTo: "all" },
|
|
19
|
+
limit: { type: "integer", min: 1, max: 50, defaultTo: 25 },
|
|
20
|
+
skip: { type: "integer", min: 0, max: 2147483647, defaultTo: 0 },
|
|
21
|
+
mine: { type: "boolean", defaultTo: true }
|
|
22
|
+
}, data => Array.isArray(data?.transcripts)),
|
|
23
|
+
"transcripts.list": graphqlOperation("https://api.fireflies.ai/graphql",
|
|
24
|
+
"query ConnectorTranscripts($limit: Int!, $skip: Int!, $mine: Boolean!) { transcripts(limit: $limit, skip: $skip, mine: $mine) { id title } }", {
|
|
25
|
+
limit: { type: "integer", min: 1, max: 50, defaultTo: 25 },
|
|
26
|
+
skip: { type: "integer", min: 0, max: 2147483647, defaultTo: 0 },
|
|
27
|
+
mine: { type: "boolean", defaultTo: true }
|
|
28
|
+
}, (data) => Array.isArray(data?.transcripts))
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export { firefliesProvider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fireworksAiDefinition } from "../shared/tokens.js";
|
|
2
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
3
|
+
|
|
4
|
+
const fireworksAiProvider = Object.freeze({
|
|
5
|
+
...fireworksAiDefinition, apiOrigins: ["https://api.fireworks.ai"],
|
|
6
|
+
apiKey: { headers: (key) => ({ Authorization: `Bearer ${key}`, "Content-Type": "application/json" }) },
|
|
7
|
+
checkOperation: "accounts.list",
|
|
8
|
+
operations: {
|
|
9
|
+
"accounts.list": jsonOperation("https://api.fireworks.ai/v1/accounts", {
|
|
10
|
+
pageSize: { type: "integer", min: 1, max: 200, defaultTo: 50 },
|
|
11
|
+
pageToken: { type: "string", maxLength: 4096 },
|
|
12
|
+
filter: { type: "string", maxLength: 2048 }
|
|
13
|
+
}, (result) => Array.isArray(result?.accounts))
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export { fireworksAiProvider };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { ConnectorError } from "@jskit-ai/connectors-core/server";
|
|
3
|
+
import { createSchema } from "json-rest-schema";
|
|
4
|
+
import { gatewayApiDefinition } from "../shared/tokens.js";
|
|
5
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
6
|
+
|
|
7
|
+
const origins = { global: "https://gatewayapi.com", eu: "https://gatewayapi.eu" };
|
|
8
|
+
const messagingOrigins = { global: "https://messaging.gatewayapi.com", eu: "https://messaging.gatewayapi.eu" };
|
|
9
|
+
const messageFields = {
|
|
10
|
+
sender: { type: "string", required: true, minLength: 3, maxLength: 15,
|
|
11
|
+
validator: value => (/^[0-9]{3,15}$/.test(value) || /^[A-Za-z0-9]{3,11}$/.test(value)) || "Use 3–11 alphanumeric or 3–15 numeric sender characters." },
|
|
12
|
+
recipient: { type: "integer", required: true, min: 1001, max: 999999999999999 },
|
|
13
|
+
message: { type: "string", required: true, minLength: 1, maxLength: 39015 },
|
|
14
|
+
reference: { type: "string", required: true, minLength: 1, maxLength: 256 },
|
|
15
|
+
label: { type: "string", maxLength: 128 },
|
|
16
|
+
priority: { type: "string", enum: ["normal", "urgent"], defaultTo: "normal" }
|
|
17
|
+
};
|
|
18
|
+
const messageSchema = createSchema(messageFields);
|
|
19
|
+
const validReceipt = result => typeof result?.msg_id === "string" && Number.isSafeInteger(result.recipient) && (typeof result.reference === "string" || result.reference === null);
|
|
20
|
+
const gatewayApiProvider = Object.freeze({
|
|
21
|
+
...gatewayApiDefinition, apiOrigins: [...Object.values(origins), ...Object.values(messagingOrigins)],
|
|
22
|
+
apiKey: { headers: (key) => ({ Authorization: `Token ${key}` }) },
|
|
23
|
+
checkOperation: "balance.read",
|
|
24
|
+
operations: {
|
|
25
|
+
"messages.send": jsonOperation(settings => `${messagingOrigins[settings.region]}/mobile/single`, messageFields, validReceipt, "POST"),
|
|
26
|
+
"messages.sendBatch": jsonOperation(settings => `${messagingOrigins[settings.region]}/mobile/multi`, {
|
|
27
|
+
messages: { type: "array", required: true, items: { type: "object", schema: messageSchema },
|
|
28
|
+
validator: value => value.length >= 1 && value.length <= 1000 || "Send 1–1000 messages per batch." }
|
|
29
|
+
}, result => Array.isArray(result?.responses) && result.responses.every(validReceipt), "POST"),
|
|
30
|
+
"balance.read": jsonOperation((settings) => `${origins[settings.region]}/rest/me`, {},
|
|
31
|
+
(result) => Number.isInteger(result?.id) && typeof result.credit === "string" && typeof result.currency === "string")
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
// Call at the application's webhook route before trusting or persisting its body.
|
|
35
|
+
function verifyGatewayApiEvent({ rawBody, signature, secret }) {
|
|
36
|
+
if (!(rawBody instanceof Uint8Array) || rawBody.byteLength > 1048576 || typeof secret !== "string" || secret.length < 1 || typeof signature !== "string" || !/^v1=[a-fA-F0-9]{64}$/.test(signature)) {
|
|
37
|
+
throw new ConnectorError("connector_webhook_invalid", "Invalid GatewayAPI webhook signature.");
|
|
38
|
+
}
|
|
39
|
+
const expected = createHmac("sha256", secret).update(rawBody).digest();
|
|
40
|
+
if (!timingSafeEqual(expected, Buffer.from(signature.slice(3), "hex"))) throw new ConnectorError("connector_webhook_invalid", "Invalid GatewayAPI webhook signature.");
|
|
41
|
+
let event;
|
|
42
|
+
try { event = JSON.parse(Buffer.from(rawBody).toString("utf8")); } catch { throw new ConnectorError("connector_webhook_invalid", "Invalid GatewayAPI webhook event."); }
|
|
43
|
+
if (typeof event?.event_id !== "string" || !event.event_id || typeof event.event_type !== "string" || !Number.isFinite(Date.parse(event.timestamp)) || !event.event || typeof event.event !== "object" || Array.isArray(event.event)) {
|
|
44
|
+
throw new ConnectorError("connector_webhook_invalid", "Invalid GatewayAPI webhook event.");
|
|
45
|
+
}
|
|
46
|
+
return event;
|
|
47
|
+
}
|
|
48
|
+
export { gatewayApiProvider, verifyGatewayApiEvent };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createSchema } from "json-rest-schema";
|
|
2
|
+
import { geminiEnterpriseDefinition, geminiEnterpriseScope } from "../shared/gemini-enterprise.js";
|
|
3
|
+
import { googleProvider } from "./google.js";
|
|
4
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
5
|
+
|
|
6
|
+
function apiOrigin({ location = "global" } = {}) {
|
|
7
|
+
return `https://${location === "global" ? "" : `${location}-`}discoveryengine.googleapis.com`;
|
|
8
|
+
}
|
|
9
|
+
function engineUrl(settings) {
|
|
10
|
+
return `${apiOrigin(settings)}/v1/projects/${settings.projectId}/locations/${settings.location || "global"}/collections/default_collection/engines/${settings.engineId}`;
|
|
11
|
+
}
|
|
12
|
+
const object = (value) => Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
13
|
+
const text = (value) => typeof value === "string" && value.length > 0;
|
|
14
|
+
const geminiEnterpriseProvider = Object.freeze({
|
|
15
|
+
...googleProvider(geminiEnterpriseDefinition, apiOrigin(), "engine.get", {
|
|
16
|
+
"engine.get": {
|
|
17
|
+
...jsonOperation(engineUrl, {}, (result) => object(result) && !result.error && text(result.displayName)
|
|
18
|
+
&& typeof result.name === "string" && /^projects\/[a-z0-9-]+\/locations\/(global|us|eu)\/collections\/default_collection\/engines\/[a-z0-9][a-z0-9_-]{0,62}$/u.test(result.name)),
|
|
19
|
+
scopes: [geminiEnterpriseScope]
|
|
20
|
+
},
|
|
21
|
+
search: {
|
|
22
|
+
...jsonOperation((settings) => `${engineUrl(settings)}/servingConfigs/default_serving_config:search`, {
|
|
23
|
+
query: { type: "string", required: true, minLength: 1, maxLength: 4096, noTrim: true },
|
|
24
|
+
pageSize: { type: "integer", min: 1, max: 25, defaultTo: 10 },
|
|
25
|
+
contentSearchSpec: { type: "object", schema: createSchema({
|
|
26
|
+
snippetSpec: { type: "object", schema: createSchema({ returnSnippet: { type: "boolean", required: true } }) },
|
|
27
|
+
summarySpec: { type: "object", schema: createSchema({
|
|
28
|
+
summaryResultCount: { type: "integer", required: true, min: 1, max: 10 },
|
|
29
|
+
includeCitations: { type: "boolean", defaultTo: true },
|
|
30
|
+
ignoreAdversarialQuery: { type: "boolean", defaultTo: true },
|
|
31
|
+
ignoreNonSummarySeekingQuery: { type: "boolean", defaultTo: true },
|
|
32
|
+
ignoreLowRelevantContent: { type: "boolean", defaultTo: true }
|
|
33
|
+
}) }
|
|
34
|
+
}) },
|
|
35
|
+
pageToken: { type: "string", minLength: 1, maxLength: 16000, noTrim: true }
|
|
36
|
+
}, (result) => object(result) && !result.error && text(result.attributionToken)
|
|
37
|
+
&& (result.totalSize === undefined || Number.isInteger(result.totalSize) && result.totalSize >= 0)
|
|
38
|
+
&& (result.nextPageToken === undefined || typeof result.nextPageToken === "string")
|
|
39
|
+
&& (result.redirectUri === undefined || typeof result.redirectUri === "string")
|
|
40
|
+
&& (result.results === undefined || Array.isArray(result.results) && result.results.length <= 25
|
|
41
|
+
&& result.results.every((item) => object(item) && text(item.id) && object(item.document))), "POST"),
|
|
42
|
+
scopes: [geminiEnterpriseScope]
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
apiOrigins: (settings) => [apiOrigin(settings)]
|
|
46
|
+
});
|
|
47
|
+
export { geminiEnterpriseProvider };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { createSchema } from "json-rest-schema";
|
|
2
|
+
import { validateSchemaPayload } from "@jskit-ai/kernel/shared/validators";
|
|
3
|
+
import { ConnectorError } from "@jskit-ai/connectors-core/server";
|
|
4
|
+
import { githubApiDefinition } from "../shared/tokens.js";
|
|
5
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
6
|
+
|
|
7
|
+
async function normalizeTokenResponse(response) {
|
|
8
|
+
if (!response.ok) return response;
|
|
9
|
+
let value;
|
|
10
|
+
try { value = await response.clone().json(); } catch {
|
|
11
|
+
throw new ConnectorError("connector_response_invalid", "GitHub returned an invalid token response.", { statusCode: 502 });
|
|
12
|
+
}
|
|
13
|
+
if (value.error || value.scope === undefined) return response;
|
|
14
|
+
if (typeof value.scope !== "string" || !/^[a-zA-Z0-9_:.-]*(?:,[a-zA-Z0-9_:.-]+)*$/u.test(value.scope)) {
|
|
15
|
+
throw new ConnectorError("connector_response_invalid", "GitHub returned an invalid permission grant.", { statusCode: 502 });
|
|
16
|
+
}
|
|
17
|
+
return Response.json({ ...value, scope: value.scope.replaceAll(",", " ") }, { status: response.status });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const repositoryFields = {
|
|
21
|
+
owner: { type: "string", required: true, minLength: 1, maxLength: 100, pattern: "^[A-Za-z0-9][A-Za-z0-9-]*$" },
|
|
22
|
+
repo: { type: "string", required: true, minLength: 1, maxLength: 100, pattern: "^[A-Za-z0-9_][A-Za-z0-9_.-]*$" }
|
|
23
|
+
};
|
|
24
|
+
const pageFields = { per_page: { type: "integer", min: 1, max: 100, defaultTo: 30 }, page: { type: "integer", min: 1, max: 1000000, defaultTo: 1 } };
|
|
25
|
+
const numberField = { type: "integer", required: true, min: 1, max: Number.MAX_SAFE_INTEGER };
|
|
26
|
+
const issueResult = value => Number.isSafeInteger(value?.number) && typeof value.title === "string";
|
|
27
|
+
function repositoryOperation(suffix, fields, validateResult, method = "GET") {
|
|
28
|
+
const schema = createSchema({ ...repositoryFields, ...fields });
|
|
29
|
+
return { scopes: [], request(input) {
|
|
30
|
+
const { owner, repo, number, path, ...values } = validateSchemaPayload({ schema, mode: "replace" }, input, { statusCode: 422 });
|
|
31
|
+
const tail = typeof suffix === "function" ? suffix({ number, path }) : suffix;
|
|
32
|
+
const url = new URL(`https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}${tail}`);
|
|
33
|
+
if (method === "GET") {
|
|
34
|
+
for (const [key, value] of Object.entries(values)) url.searchParams.set(key, String(value));
|
|
35
|
+
return { method, url: url.href };
|
|
36
|
+
}
|
|
37
|
+
if (!Object.keys(values).length) throw new ConnectorError("connector_input_invalid", "Supply at least one change.");
|
|
38
|
+
return { method, url: url.href, body: values };
|
|
39
|
+
}, validateResult };
|
|
40
|
+
}
|
|
41
|
+
const issueChanges = { title: { type: "string", minLength: 1, maxLength: 256 }, body: { type: "string", maxLength: 65536 }, state: { type: "string", enum: ["open", "closed"] } };
|
|
42
|
+
|
|
43
|
+
const githubApiProvider = Object.freeze({
|
|
44
|
+
...githubApiDefinition, apiOrigins: ["https://api.github.com"],
|
|
45
|
+
apiKey: { headers: (key) => ({
|
|
46
|
+
Authorization: `Bearer ${key}`, Accept: "application/vnd.github+json",
|
|
47
|
+
"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "jskit-connectors"
|
|
48
|
+
}) },
|
|
49
|
+
oauth: {
|
|
50
|
+
issuer: "https://github.com",
|
|
51
|
+
authorization_endpoint: "https://github.com/login/oauth/authorize",
|
|
52
|
+
token_endpoint: "https://github.com/login/oauth/access_token"
|
|
53
|
+
},
|
|
54
|
+
normalizeTokenResponse,
|
|
55
|
+
oauthHeaders: () => ({ Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2026-03-10", "User-Agent": "jskit-connectors" }),
|
|
56
|
+
checkOperation: "account.read",
|
|
57
|
+
operations: {
|
|
58
|
+
"repositories.get": repositoryOperation("", {}, value => Number.isSafeInteger(value?.id) && typeof value.full_name === "string"),
|
|
59
|
+
"branches.list": repositoryOperation("/branches", pageFields, Array.isArray),
|
|
60
|
+
"commits.list": repositoryOperation("/commits", pageFields, Array.isArray),
|
|
61
|
+
"releases.list": repositoryOperation("/releases", pageFields, Array.isArray),
|
|
62
|
+
"workflows.runs": repositoryOperation("/actions/runs", pageFields, value => Array.isArray(value?.workflow_runs)),
|
|
63
|
+
"contents.get": repositoryOperation(({ path }) => `/contents/${path.split("/").map(encodeURIComponent).join("/")}`, {
|
|
64
|
+
path: { type: "string", required: true, minLength: 1, maxLength: 4096,
|
|
65
|
+
validator: value => !value.includes("\\") && value.split("/").every(segment => segment && segment !== "." && segment !== "..") || "Use a repository-relative file path." },
|
|
66
|
+
ref: { type: "string", minLength: 1, maxLength: 256 }
|
|
67
|
+
}, value => Array.isArray(value) || typeof value?.type === "string" && typeof value.path === "string"),
|
|
68
|
+
"issues.list": repositoryOperation("/issues", { ...pageFields, state: { type: "string", enum: ["open", "closed", "all"], defaultTo: "open" } }, Array.isArray),
|
|
69
|
+
"issues.get": repositoryOperation(({ number }) => `/issues/${number}`, { number: numberField }, issueResult),
|
|
70
|
+
"issues.create": repositoryOperation("/issues", { title: { ...issueChanges.title, required: true }, body: issueChanges.body }, issueResult, "POST"),
|
|
71
|
+
"issues.update": repositoryOperation(({ number }) => `/issues/${number}`, { number: numberField, ...issueChanges }, issueResult, "PATCH"),
|
|
72
|
+
"pulls.list": repositoryOperation("/pulls", { ...pageFields, state: { type: "string", enum: ["open", "closed", "all"], defaultTo: "open" } }, Array.isArray),
|
|
73
|
+
"pulls.reviews": repositoryOperation(({ number }) => `/pulls/${number}/reviews`, { number: numberField, ...pageFields }, Array.isArray),
|
|
74
|
+
"issues.comments": repositoryOperation(({ number }) => `/issues/${number}/comments`, { number: numberField, ...pageFields }, Array.isArray),
|
|
75
|
+
"pulls.get": repositoryOperation(({ number }) => `/pulls/${number}`, { number: numberField }, issueResult),
|
|
76
|
+
"pulls.create": repositoryOperation("/pulls", {
|
|
77
|
+
title: { ...issueChanges.title, required: true }, body: issueChanges.body,
|
|
78
|
+
head: { type: "string", required: true, minLength: 1, maxLength: 256 }, base: { type: "string", required: true, minLength: 1, maxLength: 256 }, draft: { type: "boolean", defaultTo: false }
|
|
79
|
+
}, issueResult, "POST"),
|
|
80
|
+
"pulls.update": repositoryOperation(({ number }) => `/pulls/${number}`, { number: numberField, ...issueChanges }, issueResult, "PATCH"),
|
|
81
|
+
"account.read": jsonOperation("https://api.github.com/user", {}, (result) => Number.isInteger(result?.id) && typeof result.login === "string"),
|
|
82
|
+
"repositories.list": jsonOperation("https://api.github.com/user/repos", {
|
|
83
|
+
per_page: { type: "integer", min: 1, max: 100, defaultTo: 30 },
|
|
84
|
+
page: { type: "integer", min: 1, defaultTo: 1 },
|
|
85
|
+
sort: { type: "string", enum: ["created", "updated", "pushed", "full_name"], defaultTo: "full_name" },
|
|
86
|
+
direction: { type: "string", enum: ["asc", "desc"], defaultTo: "asc" }
|
|
87
|
+
}, (result) => Array.isArray(result))
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export { githubApiProvider };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createSchema } from "json-rest-schema";
|
|
2
|
+
import { validateSchemaPayload } from "@jskit-ai/kernel/shared/validators";
|
|
3
|
+
import { ConnectorError } from "@jskit-ai/connectors-core/server";
|
|
4
|
+
import { gitlabApiDefinition } from "../shared/tokens.js";
|
|
5
|
+
import { jsonOperation } from "./jsonOperation.js";
|
|
6
|
+
|
|
7
|
+
const origin = (settings = {}) => new URL(settings.instanceUrl || "https://gitlab.com").origin;
|
|
8
|
+
|
|
9
|
+
const pageFields = { per_page: { type: "integer", min: 1, max: 100, defaultTo: 20 }, page: { type: "integer", min: 1, max: 1000000, defaultTo: 1 } };
|
|
10
|
+
const iidField = { type: "integer", required: true, min: 1, max: Number.MAX_SAFE_INTEGER };
|
|
11
|
+
const changes = { title: { type: "string", minLength: 1, maxLength: 255 }, description: { type: "string", maxLength: 65536 }, state_event: { type: "string", enum: ["close", "reopen"] } };
|
|
12
|
+
const itemResult = value => Number.isSafeInteger(value?.iid) && typeof value.title === "string";
|
|
13
|
+
function projectOperation(suffix, fields, validateResult, method = "GET") {
|
|
14
|
+
const schema = createSchema({ project: { type: "string", required: true, minLength: 1, maxLength: 512,
|
|
15
|
+
validator: value => value.split("/").every(part => /^[A-Za-z0-9_][A-Za-z0-9_.-]*$/.test(part)) || "Use a numeric project ID or full namespace/project path." }, ...fields });
|
|
16
|
+
return { scopes: [], request(input, settings) {
|
|
17
|
+
const { project, iid, filePath, ...values } = validateSchemaPayload({ schema, mode: "replace" }, input, { statusCode: 422 });
|
|
18
|
+
const tail = typeof suffix === "function" ? suffix({ iid, filePath }) : suffix;
|
|
19
|
+
const url = new URL(`${origin(settings)}/api/v4/projects/${encodeURIComponent(project)}${tail}`);
|
|
20
|
+
if (method === "GET") {
|
|
21
|
+
for (const [key, value] of Object.entries(values)) url.searchParams.set(key, String(value));
|
|
22
|
+
return { method, url: url.href };
|
|
23
|
+
}
|
|
24
|
+
if (!Object.keys(values).length) throw new ConnectorError("connector_input_invalid", "Supply at least one change.");
|
|
25
|
+
return { method, url: url.href, body: values };
|
|
26
|
+
}, validateResult };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const gitlabApiProvider = Object.freeze({
|
|
30
|
+
...gitlabApiDefinition, apiOrigins: (settings) => [origin(settings)],
|
|
31
|
+
oauth: (settings) => ({ issuer: origin(settings), authorization_endpoint: `${origin(settings)}/oauth/authorize`, token_endpoint: `${origin(settings)}/oauth/token` }),
|
|
32
|
+
refreshRequiresRedirectUri: true,
|
|
33
|
+
apiKey: { headers: (key) => ({ "PRIVATE-TOKEN": key }) },
|
|
34
|
+
checkOperation: "profile.read",
|
|
35
|
+
operations: {
|
|
36
|
+
"projects.get": projectOperation("", {}, value => Number.isSafeInteger(value?.id) && typeof value.path_with_namespace === "string"),
|
|
37
|
+
"branches.list": projectOperation("/repository/branches", pageFields, Array.isArray),
|
|
38
|
+
"commits.list": projectOperation("/repository/commits", pageFields, Array.isArray),
|
|
39
|
+
"pipelines.list": projectOperation("/pipelines", pageFields, Array.isArray),
|
|
40
|
+
"files.get": projectOperation(({ filePath }) => `/repository/files/${encodeURIComponent(filePath)}`, {
|
|
41
|
+
filePath: { type: "string", required: true, minLength: 1, maxLength: 4096,
|
|
42
|
+
validator: value => !value.includes("\\") && value.split("/").every(part => part && part !== "." && part !== "..") || "Use a repository-relative file path." },
|
|
43
|
+
ref: { type: "string", required: true, minLength: 1, maxLength: 256 }
|
|
44
|
+
}, value => typeof value?.file_path === "string" && typeof value.content === "string"),
|
|
45
|
+
"issues.list": projectOperation("/issues", { ...pageFields, state: { type: "string", enum: ["opened", "closed", "all"], defaultTo: "opened" }, search: { type: "string", maxLength: 256 } }, Array.isArray),
|
|
46
|
+
"issues.get": projectOperation(({ iid }) => `/issues/${iid}`, { iid: iidField }, itemResult),
|
|
47
|
+
"issues.notes": projectOperation(({ iid }) => `/issues/${iid}/notes`, { iid: iidField, ...pageFields }, Array.isArray),
|
|
48
|
+
"issues.create": projectOperation("/issues", { title: { ...changes.title, required: true }, description: changes.description }, itemResult, "POST"),
|
|
49
|
+
"issues.update": projectOperation(({ iid }) => `/issues/${iid}`, { iid: iidField, ...changes }, itemResult, "PUT"),
|
|
50
|
+
"mergeRequests.list": projectOperation("/merge_requests", { ...pageFields, state: { type: "string", enum: ["opened", "closed", "merged", "all"], defaultTo: "opened" } }, Array.isArray),
|
|
51
|
+
"mergeRequests.get": projectOperation(({ iid }) => `/merge_requests/${iid}`, { iid: iidField }, itemResult),
|
|
52
|
+
"mergeRequests.notes": projectOperation(({ iid }) => `/merge_requests/${iid}/notes`, { iid: iidField, ...pageFields }, Array.isArray),
|
|
53
|
+
"mergeRequests.create": projectOperation("/merge_requests", { title: { ...changes.title, required: true }, description: changes.description,
|
|
54
|
+
source_branch: { type: "string", required: true, minLength: 1, maxLength: 256 }, target_branch: { type: "string", required: true, minLength: 1, maxLength: 256 }
|
|
55
|
+
}, itemResult, "POST"),
|
|
56
|
+
"mergeRequests.update": projectOperation(({ iid }) => `/merge_requests/${iid}`, { iid: iidField, ...changes }, itemResult, "PUT"),
|
|
57
|
+
"profile.read": jsonOperation((settings) => `${origin(settings)}/api/v4/user`, {},
|
|
58
|
+
(result) => Number.isInteger(result?.id) && typeof result.username === "string"),
|
|
59
|
+
"projects.list": jsonOperation((settings) => `${origin(settings)}/api/v4/projects`, {
|
|
60
|
+
per_page: { type: "integer", min: 1, max: 100, defaultTo: 20 },
|
|
61
|
+
page: { type: "integer", min: 1, defaultTo: 1 },
|
|
62
|
+
membership: { type: "boolean", enum: [true], defaultTo: true },
|
|
63
|
+
simple: { type: "boolean", enum: [true], defaultTo: true }
|
|
64
|
+
}, Array.isArray)
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export { gitlabApiProvider };
|