mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-06 20:55:23 -05:00
Compare commits
20 Commits
feat/the-c
...
feat/copil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8aadd0e3f0 | ||
|
|
8b87a07508 | ||
|
|
728463ace7 | ||
|
|
8cea43d926 | ||
|
|
2198a6caae | ||
|
|
0ba8c0ad29 | ||
|
|
a9e2f4a82e | ||
|
|
1e99f45590 | ||
|
|
1ec0ec4c1a | ||
|
|
2ce78e8c60 | ||
|
|
ea759b2d00 | ||
|
|
09d7fc671f | ||
|
|
ea210a56a8 | ||
|
|
c05b70be1e | ||
|
|
413c53208e | ||
|
|
b8ccd71423 | ||
|
|
8f556684a6 | ||
|
|
a391019995 | ||
|
|
d6179e7691 | ||
|
|
e68e653d5c |
@@ -206,15 +206,10 @@ export const {Service}Block: BlockConfig = {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Critical Canonical Param Rules:**
|
**Critical:**
|
||||||
- `canonicalParamId` must NOT match any subblock's `id` in the block
|
- `canonicalParamId` must NOT match any other subblock's `id`, must be unique per block, and should only be used to link basic/advanced alternatives for the same parameter.
|
||||||
- `canonicalParamId` must be unique per operation/condition context
|
- `mode` only controls UI visibility, NOT serialization. Without `canonicalParamId`, both basic and advanced field values would be sent.
|
||||||
- Only use `canonicalParamId` to link basic/advanced alternatives for the same logical parameter
|
- Every subblock `id` must be unique within the block. Duplicate IDs cause conflicts even with different conditions.
|
||||||
- `mode` only controls UI visibility, NOT serialization. Without `canonicalParamId`, both basic and advanced field values would be sent
|
|
||||||
- Every subblock `id` must be unique within the block. Duplicate IDs cause conflicts even with different conditions
|
|
||||||
- **Required consistency:** If one subblock in a canonical group has `required: true`, ALL subblocks in that group must have `required: true` (prevents bypassing validation by switching modes)
|
|
||||||
- **Inputs section:** Must list canonical param IDs (e.g., `fileId`), NOT raw subblock IDs (e.g., `fileSelector`, `manualFileId`)
|
|
||||||
- **Params function:** Must use canonical param IDs, NOT raw subblock IDs (raw IDs are deleted after canonical transformation)
|
|
||||||
|
|
||||||
## Step 4: Add Icon
|
## Step 4: Add Icon
|
||||||
|
|
||||||
|
|||||||
@@ -157,36 +157,6 @@ dependsOn: { all: ['authMethod'], any: ['credential', 'botToken'] }
|
|||||||
- `'both'` - Show in both modes (default)
|
- `'both'` - Show in both modes (default)
|
||||||
- `'trigger'` - Only when block is used as trigger
|
- `'trigger'` - Only when block is used as trigger
|
||||||
|
|
||||||
### `canonicalParamId` - Link basic/advanced alternatives
|
|
||||||
|
|
||||||
Use to map multiple UI inputs to a single logical parameter:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
// Basic mode: Visual selector
|
|
||||||
{
|
|
||||||
id: 'fileSelector',
|
|
||||||
type: 'file-selector',
|
|
||||||
mode: 'basic',
|
|
||||||
canonicalParamId: 'fileId',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
// Advanced mode: Manual input
|
|
||||||
{
|
|
||||||
id: 'manualFileId',
|
|
||||||
type: 'short-input',
|
|
||||||
mode: 'advanced',
|
|
||||||
canonicalParamId: 'fileId',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
**Critical Rules:**
|
|
||||||
- `canonicalParamId` must NOT match any subblock's `id`
|
|
||||||
- `canonicalParamId` must be unique per operation/condition context
|
|
||||||
- **Required consistency:** All subblocks in a canonical group must have the same `required` status
|
|
||||||
- **Inputs section:** Must list canonical param IDs (e.g., `fileId`), NOT raw subblock IDs
|
|
||||||
- **Params function:** Must use canonical param IDs (raw IDs are deleted after canonical transformation)
|
|
||||||
|
|
||||||
**Register in `blocks/registry.ts`:**
|
**Register in `blocks/registry.ts`:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|||||||
@@ -155,36 +155,6 @@ dependsOn: { all: ['authMethod'], any: ['credential', 'botToken'] }
|
|||||||
- `'both'` - Show in both modes (default)
|
- `'both'` - Show in both modes (default)
|
||||||
- `'trigger'` - Only when block is used as trigger
|
- `'trigger'` - Only when block is used as trigger
|
||||||
|
|
||||||
### `canonicalParamId` - Link basic/advanced alternatives
|
|
||||||
|
|
||||||
Use to map multiple UI inputs to a single logical parameter:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
// Basic mode: Visual selector
|
|
||||||
{
|
|
||||||
id: 'fileSelector',
|
|
||||||
type: 'file-selector',
|
|
||||||
mode: 'basic',
|
|
||||||
canonicalParamId: 'fileId',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
// Advanced mode: Manual input
|
|
||||||
{
|
|
||||||
id: 'manualFileId',
|
|
||||||
type: 'short-input',
|
|
||||||
mode: 'advanced',
|
|
||||||
canonicalParamId: 'fileId',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
```
|
|
||||||
|
|
||||||
**Critical Rules:**
|
|
||||||
- `canonicalParamId` must NOT match any subblock's `id`
|
|
||||||
- `canonicalParamId` must be unique per operation/condition context
|
|
||||||
- **Required consistency:** All subblocks in a canonical group must have the same `required` status
|
|
||||||
- **Inputs section:** Must list canonical param IDs (e.g., `fileId`), NOT raw subblock IDs
|
|
||||||
- **Params function:** Must use canonical param IDs (raw IDs are deleted after canonical transformation)
|
|
||||||
|
|
||||||
**Register in `blocks/registry.ts`:**
|
**Register in `blocks/registry.ts`:**
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|||||||
@@ -1131,32 +1131,6 @@ export function AirtableIcon(props: SVGProps<SVGSVGElement>) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AirweaveIcon(props: SVGProps<SVGSVGElement>) {
|
|
||||||
return (
|
|
||||||
<svg
|
|
||||||
{...props}
|
|
||||||
width='143'
|
|
||||||
height='143'
|
|
||||||
viewBox='0 0 143 143'
|
|
||||||
fill='none'
|
|
||||||
xmlns='http://www.w3.org/2000/svg'
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d='M89.8854 128.872C79.9165 123.339 66.7502 115.146 60.5707 107.642L60.0432 107.018C58.7836 105.5 57.481 104.014 56.1676 102.593C51.9152 97.9641 47.3614 93.7978 42.646 90.2021C40.7405 88.7487 38.7704 87.3492 36.8111 86.0789C35.7991 85.4222 34.8302 84.8193 33.9151 84.2703C31.6221 82.903 28.8338 82.5263 26.2716 83.2476C23.8385 83.9366 21.89 85.5406 20.7596 87.7476C18.5634 92.0323 20.0814 97.3289 24.2046 99.805C27.5204 101.786 30.7608 104.111 33.8398 106.717C34.2381 107.05 34.3996 107.578 34.2596 108.062C33.1292 112.185 31.9989 118.957 31.5682 121.67C30.6424 127.429 33.4737 133.081 38.5982 135.751L38.7812 135.848C41.0204 137 43.6472 136.946 45.8219 135.697C47.9858 134.459 49.353 132.231 49.4822 129.733C49.536 128.657 49.6006 127.58 49.676 126.59C49.719 126.062 50.042 125.632 50.5264 125.459C50.6772 125.406 50.8494 125.373 51.0001 125.373C51.3554 125.373 51.6784 125.513 51.9475 125.782C56.243 130.185 60.8829 134.169 65.7167 137.625C70.3674 140.951 75.8686 142.706 81.639 142.706C83.7383 142.706 85.8376 142.469 87.8938 141.995L88.1199 141.942C90.9943 141.274 93.029 139.024 93.4488 136.085C93.8687 133.146 92.4476 130.315 89.8747 128.883H89.8639L89.8854 128.872Z'
|
|
||||||
fill='currentColor'
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d='M142.551 58.1747L142.529 58.0563C142.045 55.591 140.118 53.7069 137.598 53.2548C135.112 52.8134 132.754 53.8577 131.484 55.9893L131.408 56.1077C126.704 64.1604 120.061 71.6101 111.653 78.2956C109.446 80.0504 107.293 81.902 105.226 83.8075C103.644 85.2717 101.265 85.53 99.4452 84.4212C97.6474 83.3339 95.8495 82.1389 94.1055 80.8686C90.3268 78.1233 86.6772 74.9475 83.2753 71.4271C81.4989 69.597 79.798 67.6915 78.1939 65.7321C76.0408 63.1161 73.7477 60.5539 71.3685 58.1316C66.3195 52.9857 56.6089 45.9127 53.7453 43.878C53.3792 43.6304 53.1639 43.2428 53.0993 42.8014C53.0455 42.3601 53.1639 41.9509 53.4546 41.6064C55.274 39.4318 56.9965 37.1818 58.5683 34.921C60.2369 32.5311 60.786 29.6028 60.0862 26.8899C59.408 24.2523 57.6424 22.11 55.134 20.8827C50.9139 18.7942 45.8972 20.0968 43.2273 23.9293C40.8373 27.3636 38.0167 30.7332 34.8732 33.9306C34.5718 34.232 34.1304 34.3397 33.7213 34.1889C30.5239 33.1447 27.2296 32.2942 23.9461 31.659C23.7093 31.616 23.354 31.5514 22.9126 31.4975C16.4102 30.5286 10.1123 33.7798 7.21639 39.5717L7.1195 39.7548C6.18289 41.628 6.26902 43.8349 7.32405 45.6651C8.40061 47.5167 10.3277 48.701 12.4592 48.8194C13.4604 48.8732 14.4401 48.9378 15.3659 49.0024C15.7966 49.0347 16.1411 49.2823 16.3025 49.6914C16.4533 50.1112 16.3671 50.5419 16.0657 50.8541C12.147 54.8804 8.60515 59.1974 5.5262 63.6867C1.1446 70.0814 -0.481008 78.2095 1.08 85.9822L1.10154 86.1006C1.70441 89.0719 4.05131 91.2035 7.07644 91.5264C9.98315 91.8386 12.6099 90.3208 13.7619 87.6724L13.8265 87.5109C18.6925 75.8625 26.7559 65.5168 37.7907 56.7536C38.3182 56.3445 39.0072 56.28 39.567 56.5922C45.3373 59.768 50.8601 63.902 55.9738 68.8864C56.5982 69.4893 56.6089 70.5013 56.0168 71.1257C53.4761 73.8063 51.0862 76.6054 48.9115 79.469C47.2106 81.7083 47.5335 84.8949 49.6221 86.7358L53.3254 89.9977L53.2824 90.0409C53.8637 90.5576 54.445 91.0744 55.0264 91.5911L55.8123 92.194C56.9319 93.1844 58.3529 93.6365 59.8386 93.4858C61.3027 93.3351 62.67 92.56 63.5635 91.3758C65.1353 89.2873 66.8578 87.2525 68.6556 85.304C68.957 84.9702 69.3661 84.798 69.8075 84.7872C70.2705 84.7872 70.6257 84.9379 70.9164 85.2286C75.8147 90.0624 81.1114 94.3686 86.6772 97.9966C88.8626 99.4176 89.4978 102.26 88.1306 104.477C86.9248 106.448 85.7729 108.493 84.7179 110.539C83.5014 112.918 83.2968 115.738 84.1688 118.257C84.9978 120.68 86.7095 122.585 88.981 123.64C90.2514 124.232 91.5971 124.534 92.9859 124.534C96.5062 124.534 99.682 122.596 101.286 119.452C102.729 116.61 104.419 113.8 106.281 111.131C107.369 109.559 109.36 108.838 111.255 109.322C115.26 110.355 120.643 111.421 124.454 112.143C128.308 112.864 132.119 111.023 133.96 107.578L134.143 107.233C135.521 104.628 135.531 101.506 134.164 98.8901C132.786 96.2526 130.181 94.4655 127.21 94.121C126.478 94.0349 125.778 93.9488 125.11 93.8626C124.97 93.8411 124.852 93.8196 124.744 93.798L123.356 93.4751L124.357 92.4523C124.432 92.377 124.529 92.2801 124.658 92.194C128.771 88.8028 132.571 85.1963 135.962 81.4714C141.668 75.1951 144.122 66.4965 142.518 58.1747H142.529H142.551Z'
|
|
||||||
fill='currentColor'
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d='M56.6506 14.3371C65.5861 19.6338 77.4067 27.3743 82.9833 34.1674C83.64 34.9532 84.2967 35.7391 84.9534 36.4927C86.1591 37.8815 86.2991 39.8731 85.2979 41.4233C83.4892 44.2116 81.4115 46.9569 79.1399 49.5945C77.4713 51.5107 77.4067 54.3098 78.9785 56.2476L79.0431 56.323C79.2261 56.5598 79.4306 56.8074 79.6136 57.0442C81.2931 59.1758 83.0801 61.2213 84.9211 63.1375C85.9007 64.1603 87.2249 64.7309 88.6352 64.7309L88.7644 65.5275L88.7429 64.7309C90.207 64.6986 91.6173 64.0526 92.5969 62.933C94.8362 60.4031 96.9247 57.744 98.8302 55.0633C100.133 53.2224 102.63 52.8026 104.525 54.1052C106.463 55.4402 108.465 56.7105 110.457 57.8839C112.793 59.2511 115.614 59.5095 118.165 58.5621C120.749 57.604 122.762 55.5694 123.656 52.9533C125.055 48.9055 123.257 44.2547 119.382 41.9078C116.755 40.3145 114.15 38.5166 111.674 36.5788C110.382 35.5561 109.833 33.8767 110.296 32.2941C111.437 28.3001 112.481 23.1218 113.148 19.4831C113.837 15.7259 112.147 11.8826 108.939 9.94477L108.562 9.72944C105.871 8.12537 102.587 8.00696 99.7668 9.40649C96.9247 10.8168 95.03 13.5405 94.6855 16.6733L94.6639 16.867C94.6209 17.2546 94.384 17.5453 94.018 17.6637C93.652 17.7821 93.2859 17.6852 93.0168 17.4269C89.0012 13.1422 84.738 9.25576 80.3134 5.8646C74.3708 1.31075 66.7811 -0.583999 59.4928 0.675575L59.1805 0.729423C56.1124 1.2677 53.7547 3.60383 53.1949 6.68279C52.6351 9.72946 53.9915 12.7223 56.6722 14.3048H56.6614L56.6506 14.3371Z'
|
|
||||||
fill='currentColor'
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export function GoogleDocsIcon(props: SVGProps<SVGSVGElement>) {
|
export function GoogleDocsIcon(props: SVGProps<SVGSVGElement>) {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
A2AIcon,
|
A2AIcon,
|
||||||
AhrefsIcon,
|
AhrefsIcon,
|
||||||
AirtableIcon,
|
AirtableIcon,
|
||||||
AirweaveIcon,
|
|
||||||
ApifyIcon,
|
ApifyIcon,
|
||||||
ApolloIcon,
|
ApolloIcon,
|
||||||
ArxivIcon,
|
ArxivIcon,
|
||||||
@@ -142,7 +141,6 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
a2a: A2AIcon,
|
a2a: A2AIcon,
|
||||||
ahrefs: AhrefsIcon,
|
ahrefs: AhrefsIcon,
|
||||||
airtable: AirtableIcon,
|
airtable: AirtableIcon,
|
||||||
airweave: AirweaveIcon,
|
|
||||||
apify: ApifyIcon,
|
apify: ApifyIcon,
|
||||||
apollo: ApolloIcon,
|
apollo: ApolloIcon,
|
||||||
arxiv: ArxivIcon,
|
arxiv: ArxivIcon,
|
||||||
@@ -165,9 +163,9 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
elevenlabs: ElevenLabsIcon,
|
elevenlabs: ElevenLabsIcon,
|
||||||
enrich: EnrichSoIcon,
|
enrich: EnrichSoIcon,
|
||||||
exa: ExaAIIcon,
|
exa: ExaAIIcon,
|
||||||
file_v3: DocumentIcon,
|
file_v2: DocumentIcon,
|
||||||
firecrawl: FirecrawlIcon,
|
firecrawl: FirecrawlIcon,
|
||||||
fireflies_v2: FirefliesIcon,
|
fireflies: FirefliesIcon,
|
||||||
github_v2: GithubIcon,
|
github_v2: GithubIcon,
|
||||||
gitlab: GitLabIcon,
|
gitlab: GitLabIcon,
|
||||||
gmail_v2: GmailIcon,
|
gmail_v2: GmailIcon,
|
||||||
@@ -179,7 +177,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
google_maps: GoogleMapsIcon,
|
google_maps: GoogleMapsIcon,
|
||||||
google_search: GoogleIcon,
|
google_search: GoogleIcon,
|
||||||
google_sheets_v2: GoogleSheetsIcon,
|
google_sheets_v2: GoogleSheetsIcon,
|
||||||
google_slides_v2: GoogleSlidesIcon,
|
google_slides: GoogleSlidesIcon,
|
||||||
google_vault: GoogleVaultIcon,
|
google_vault: GoogleVaultIcon,
|
||||||
grafana: GrafanaIcon,
|
grafana: GrafanaIcon,
|
||||||
grain: GrainIcon,
|
grain: GrainIcon,
|
||||||
@@ -208,7 +206,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
microsoft_excel_v2: MicrosoftExcelIcon,
|
microsoft_excel_v2: MicrosoftExcelIcon,
|
||||||
microsoft_planner: MicrosoftPlannerIcon,
|
microsoft_planner: MicrosoftPlannerIcon,
|
||||||
microsoft_teams: MicrosoftTeamsIcon,
|
microsoft_teams: MicrosoftTeamsIcon,
|
||||||
mistral_parse_v3: MistralIcon,
|
mistral_parse_v2: MistralIcon,
|
||||||
mongodb: MongoDBIcon,
|
mongodb: MongoDBIcon,
|
||||||
mysql: MySQLIcon,
|
mysql: MySQLIcon,
|
||||||
neo4j: Neo4jIcon,
|
neo4j: Neo4jIcon,
|
||||||
@@ -223,11 +221,11 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
polymarket: PolymarketIcon,
|
polymarket: PolymarketIcon,
|
||||||
postgresql: PostgresIcon,
|
postgresql: PostgresIcon,
|
||||||
posthog: PosthogIcon,
|
posthog: PosthogIcon,
|
||||||
pulse_v2: PulseIcon,
|
pulse: PulseIcon,
|
||||||
qdrant: QdrantIcon,
|
qdrant: QdrantIcon,
|
||||||
rds: RDSIcon,
|
rds: RDSIcon,
|
||||||
reddit: RedditIcon,
|
reddit: RedditIcon,
|
||||||
reducto_v2: ReductoIcon,
|
reducto: ReductoIcon,
|
||||||
resend: ResendIcon,
|
resend: ResendIcon,
|
||||||
s3: S3Icon,
|
s3: S3Icon,
|
||||||
salesforce: SalesforceIcon,
|
salesforce: SalesforceIcon,
|
||||||
@@ -246,11 +244,11 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
ssh: SshIcon,
|
ssh: SshIcon,
|
||||||
stagehand: StagehandIcon,
|
stagehand: StagehandIcon,
|
||||||
stripe: StripeIcon,
|
stripe: StripeIcon,
|
||||||
stt_v2: STTIcon,
|
stt: STTIcon,
|
||||||
supabase: SupabaseIcon,
|
supabase: SupabaseIcon,
|
||||||
tavily: TavilyIcon,
|
tavily: TavilyIcon,
|
||||||
telegram: TelegramIcon,
|
telegram: TelegramIcon,
|
||||||
textract_v2: TextractIcon,
|
textract: TextractIcon,
|
||||||
tinybird: TinybirdIcon,
|
tinybird: TinybirdIcon,
|
||||||
translate: TranslateIcon,
|
translate: TranslateIcon,
|
||||||
trello: TrelloIcon,
|
trello: TrelloIcon,
|
||||||
@@ -259,7 +257,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
|
|||||||
twilio_voice: TwilioIcon,
|
twilio_voice: TwilioIcon,
|
||||||
typeform: TypeformIcon,
|
typeform: TypeformIcon,
|
||||||
video_generator_v2: VideoIcon,
|
video_generator_v2: VideoIcon,
|
||||||
vision_v2: EyeIcon,
|
vision: EyeIcon,
|
||||||
wealthbox: WealthboxIcon,
|
wealthbox: WealthboxIcon,
|
||||||
webflow: WebflowIcon,
|
webflow: WebflowIcon,
|
||||||
whatsapp: WhatsAppIcon,
|
whatsapp: WhatsAppIcon,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Mehrere Dateien lesen und parsen
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="file_v3"
|
type="file"
|
||||||
color="#40916C"
|
color="#40916C"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Interagieren Sie mit Fireflies.ai-Besprechungstranskripten und -auf
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="fireflies_v2"
|
type="fireflies"
|
||||||
color="#100730"
|
color="#100730"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Text aus PDF-Dokumenten extrahieren
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="mistral_parse_v3"
|
type="mistral_parse"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Switch between modes using the mode selector at the bottom of the input area.
|
|||||||
Select your preferred AI model using the model selector at the bottom right of the input area.
|
Select your preferred AI model using the model selector at the bottom right of the input area.
|
||||||
|
|
||||||
**Available Models:**
|
**Available Models:**
|
||||||
- Claude 4.6 Opus (default), 4.5 Opus, Sonnet, Haiku
|
- Claude 4.5 Opus, Sonnet (default), Haiku
|
||||||
- GPT 5.2 Codex, Pro
|
- GPT 5.2 Codex, Pro
|
||||||
- Gemini 3 Pro
|
- Gemini 3 Pro
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
"connections",
|
"connections",
|
||||||
"mcp",
|
"mcp",
|
||||||
"copilot",
|
"copilot",
|
||||||
"skills",
|
|
||||||
"knowledgebase",
|
"knowledgebase",
|
||||||
"variables",
|
"variables",
|
||||||
"execution",
|
"execution",
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
---
|
|
||||||
title: Agent Skills
|
|
||||||
---
|
|
||||||
|
|
||||||
import { Callout } from 'fumadocs-ui/components/callout'
|
|
||||||
|
|
||||||
Agent Skills are reusable packages of instructions that give your AI agents specialized capabilities. Based on the open [Agent Skills](https://agentskills.io) format, skills let you capture domain expertise, workflows, and best practices that agents can load on demand.
|
|
||||||
|
|
||||||
## How Skills Work
|
|
||||||
|
|
||||||
Skills use **progressive disclosure** to keep agent context lean:
|
|
||||||
|
|
||||||
1. **Discovery** — Only skill names and descriptions are included in the agent's system prompt (~50-100 tokens each)
|
|
||||||
2. **Activation** — When the agent decides a skill is relevant, it calls the `load_skill` tool to load the full instructions into context
|
|
||||||
3. **Execution** — The agent follows the loaded instructions to complete the task
|
|
||||||
|
|
||||||
This means you can attach many skills to an agent without bloating its context window. The agent only loads what it needs.
|
|
||||||
|
|
||||||
## Creating Skills
|
|
||||||
|
|
||||||
Go to **Settings** (gear icon) and select **Skills** under the Tools section.
|
|
||||||
|
|
||||||
Click **Add** to create a new skill with three fields:
|
|
||||||
|
|
||||||
| Field | Description |
|
|
||||||
|-------|-------------|
|
|
||||||
| **Name** | A kebab-case identifier (e.g. `sql-expert`, `code-reviewer`). Max 64 characters. |
|
|
||||||
| **Description** | A short explanation of what the skill does and when to use it. This is what the agent reads to decide whether to activate the skill. Max 1024 characters. |
|
|
||||||
| **Content** | The full skill instructions in markdown. This is loaded when the agent activates the skill. |
|
|
||||||
|
|
||||||
<Callout type="info">
|
|
||||||
The description is critical — it's the only thing the agent sees before deciding to load a skill. Be specific about when and why the skill should be used.
|
|
||||||
</Callout>
|
|
||||||
|
|
||||||
### Writing Good Skill Content
|
|
||||||
|
|
||||||
Skill content follows the same conventions as [SKILL.md files](https://agentskills.io/specification):
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
# SQL Expert
|
|
||||||
|
|
||||||
## When to use this skill
|
|
||||||
Use when the user asks you to write, optimize, or debug SQL queries.
|
|
||||||
|
|
||||||
## Instructions
|
|
||||||
1. Always ask which database engine (PostgreSQL, MySQL, SQLite)
|
|
||||||
2. Use CTEs over subqueries for readability
|
|
||||||
3. Add index recommendations when relevant
|
|
||||||
4. Explain query plans for optimization requests
|
|
||||||
|
|
||||||
## Common Patterns
|
|
||||||
...
|
|
||||||
```
|
|
||||||
|
|
||||||
## Adding Skills to an Agent
|
|
||||||
|
|
||||||
Open any **Agent** block and find the **Skills** dropdown below the tools section. Select the skills you want the agent to have access to.
|
|
||||||
|
|
||||||
Selected skills appear as chips that you can click to edit or remove.
|
|
||||||
|
|
||||||
### What Happens at Runtime
|
|
||||||
|
|
||||||
When the workflow runs:
|
|
||||||
|
|
||||||
1. The agent's system prompt includes an `<available_skills>` section listing each skill's name and description
|
|
||||||
2. A `load_skill` tool is automatically added to the agent's available tools
|
|
||||||
3. When the agent determines a skill is relevant to the current task, it calls `load_skill` with the skill name
|
|
||||||
4. The full skill content is returned as a tool response, giving the agent detailed instructions
|
|
||||||
|
|
||||||
This works across all supported LLM providers — the `load_skill` tool uses standard tool-calling, so no provider-specific configuration is needed.
|
|
||||||
|
|
||||||
## Tips
|
|
||||||
|
|
||||||
- **Keep descriptions actionable** — Instead of "Helps with SQL", write "Write optimized SQL queries for PostgreSQL, MySQL, and SQLite, including index recommendations and query plan analysis"
|
|
||||||
- **One skill per domain** — A focused `sql-expert` skill works better than a broad `database-everything` skill
|
|
||||||
- **Use markdown structure** — Headers, lists, and code blocks help the agent parse and follow instructions
|
|
||||||
- **Test iteratively** — Run your workflow and check if the agent activates the skill when expected
|
|
||||||
|
|
||||||
## Learn More
|
|
||||||
|
|
||||||
- [Agent Skills specification](https://agentskills.io) — The open format for portable agent skills
|
|
||||||
- [Example skills](https://github.com/anthropics/skills) — Browse community skill examples
|
|
||||||
- [Best practices](https://agentskills.io/what-are-skills) — Writing effective skills
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
---
|
|
||||||
title: Airweave
|
|
||||||
description: Search your synced data collections
|
|
||||||
---
|
|
||||||
|
|
||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
|
||||||
|
|
||||||
<BlockInfoCard
|
|
||||||
type="airweave"
|
|
||||||
color="#6366F1"
|
|
||||||
/>
|
|
||||||
|
|
||||||
## Usage Instructions
|
|
||||||
|
|
||||||
Search across your synced data sources using Airweave. Supports semantic search with hybrid, neural, or keyword retrieval strategies. Optionally generate AI-powered answers from search results.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Tools
|
|
||||||
|
|
||||||
### `airweave_search`
|
|
||||||
|
|
||||||
Search your synced data collections using Airweave. Supports semantic search with hybrid, neural, or keyword retrieval strategies. Optionally generate AI-powered answers from search results.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `apiKey` | string | Yes | Airweave API Key for authentication |
|
|
||||||
| `collectionId` | string | Yes | The readable ID of the collection to search |
|
|
||||||
| `query` | string | Yes | The search query text |
|
|
||||||
| `limit` | number | No | Maximum number of results to return \(default: 100\) |
|
|
||||||
| `retrievalStrategy` | string | No | Retrieval strategy: hybrid \(default\), neural, or keyword |
|
|
||||||
| `expandQuery` | boolean | No | Generate query variations to improve recall |
|
|
||||||
| `rerank` | boolean | No | Reorder results for improved relevance using LLM |
|
|
||||||
| `generateAnswer` | boolean | No | Generate a natural-language answer to the query |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `results` | array | Search results with content, scores, and metadata from your synced data |
|
|
||||||
| ↳ `entity_id` | string | Unique identifier for the search result entity |
|
|
||||||
| ↳ `source_name` | string | Name of the data source \(e.g., "GitHub", "Slack"\) |
|
|
||||||
| ↳ `md_content` | string | Markdown-formatted content of the result |
|
|
||||||
| ↳ `score` | number | Relevance score from the search |
|
|
||||||
| ↳ `metadata` | object | Additional metadata associated with the result |
|
|
||||||
| ↳ `breadcrumbs` | array | Navigation path to the result within its source |
|
|
||||||
| ↳ `url` | string | URL to the original content |
|
|
||||||
| `completion` | string | AI-generated answer to the query \(when generateAnswer is enabled\) |
|
|
||||||
|
|
||||||
|
|
||||||
@@ -49,25 +49,10 @@ Retrieve content from Confluence pages using the Confluence API.
|
|||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
| `ts` | string | Timestamp of retrieval |
|
||||||
| `pageId` | string | Confluence page ID |
|
| `pageId` | string | Confluence page ID |
|
||||||
| `title` | string | Page title |
|
|
||||||
| `content` | string | Page content with HTML tags stripped |
|
| `content` | string | Page content with HTML tags stripped |
|
||||||
| `status` | string | Page status \(current, archived, trashed, draft\) |
|
| `title` | string | Page title |
|
||||||
| `spaceId` | string | ID of the space containing the page |
|
|
||||||
| `parentId` | string | ID of the parent page |
|
|
||||||
| `authorId` | string | Account ID of the page author |
|
|
||||||
| `createdAt` | string | ISO 8601 timestamp when the page was created |
|
|
||||||
| `url` | string | URL to view the page in Confluence |
|
|
||||||
| `body` | object | Raw page body content in storage format |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| `version` | object | Page version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
|
|
||||||
### `confluence_update`
|
### `confluence_update`
|
||||||
|
|
||||||
@@ -91,25 +76,6 @@ Update a Confluence page using the Confluence API.
|
|||||||
| `ts` | string | Timestamp of update |
|
| `ts` | string | Timestamp of update |
|
||||||
| `pageId` | string | Confluence page ID |
|
| `pageId` | string | Confluence page ID |
|
||||||
| `title` | string | Updated page title |
|
| `title` | string | Updated page title |
|
||||||
| `status` | string | Page status |
|
|
||||||
| `spaceId` | string | Space ID |
|
|
||||||
| `body` | object | Page body content in storage format |
|
|
||||||
| ↳ `storage` | object | Body in storage format \(Confluence markup\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `view` | object | Body in view format \(rendered HTML\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `atlas_doc_format` | object | Body in Atlassian Document Format \(ADF\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| `version` | object | Page version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| `url` | string | URL to view the page in Confluence |
|
|
||||||
| `success` | boolean | Update operation success status |
|
| `success` | boolean | Update operation success status |
|
||||||
|
|
||||||
### `confluence_create_page`
|
### `confluence_create_page`
|
||||||
@@ -134,30 +100,11 @@ Create a new page in a Confluence space.
|
|||||||
| `ts` | string | Timestamp of creation |
|
| `ts` | string | Timestamp of creation |
|
||||||
| `pageId` | string | Created page ID |
|
| `pageId` | string | Created page ID |
|
||||||
| `title` | string | Page title |
|
| `title` | string | Page title |
|
||||||
| `status` | string | Page status |
|
|
||||||
| `spaceId` | string | Space ID |
|
|
||||||
| `parentId` | string | Parent page ID |
|
|
||||||
| `body` | object | Page body content |
|
|
||||||
| ↳ `storage` | object | Body in storage format \(Confluence markup\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `view` | object | Body in view format \(rendered HTML\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `atlas_doc_format` | object | Body in Atlassian Document Format \(ADF\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| `version` | object | Page version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| `url` | string | Page URL |
|
| `url` | string | Page URL |
|
||||||
|
|
||||||
### `confluence_delete_page`
|
### `confluence_delete_page`
|
||||||
|
|
||||||
Delete a Confluence page. By default moves to trash; use purge=true to permanently delete.
|
Delete a Confluence page (moves it to trash where it can be restored).
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
@@ -165,7 +112,6 @@ Delete a Confluence page. By default moves to trash; use purge=true to permanent
|
|||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
||||||
| `pageId` | string | Yes | Confluence page ID to delete |
|
| `pageId` | string | Yes | Confluence page ID to delete |
|
||||||
| `purge` | boolean | No | If true, permanently deletes the page instead of moving to trash \(default: false\) |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -176,229 +122,6 @@ Delete a Confluence page. By default moves to trash; use purge=true to permanent
|
|||||||
| `pageId` | string | Deleted page ID |
|
| `pageId` | string | Deleted page ID |
|
||||||
| `deleted` | boolean | Deletion status |
|
| `deleted` | boolean | Deletion status |
|
||||||
|
|
||||||
### `confluence_list_pages_in_space`
|
|
||||||
|
|
||||||
List all pages within a specific Confluence space. Supports pagination and filtering by status.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `spaceId` | string | Yes | The ID of the Confluence space to list pages from |
|
|
||||||
| `limit` | number | No | Maximum number of pages to return \(default: 50, max: 250\) |
|
|
||||||
| `status` | string | No | Filter pages by status: current, archived, trashed, or draft |
|
|
||||||
| `bodyFormat` | string | No | Format for page body content: storage, atlas_doc_format, or view. If not specified, body is not included. |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response to get the next page of results |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pages` | array | Array of pages in the space |
|
|
||||||
| ↳ `id` | string | Unique page identifier |
|
|
||||||
| ↳ `title` | string | Page title |
|
|
||||||
| ↳ `status` | string | Page status \(e.g., current, archived, trashed, draft\) |
|
|
||||||
| ↳ `spaceId` | string | ID of the space containing the page |
|
|
||||||
| ↳ `parentId` | string | ID of the parent page \(null if top-level\) |
|
|
||||||
| ↳ `authorId` | string | Account ID of the page author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp when the page was created |
|
|
||||||
| ↳ `version` | object | Page version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| ↳ `body` | object | Page body content \(if bodyFormat was specified\) |
|
|
||||||
| ↳ `storage` | object | Body in storage format \(Confluence markup\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `view` | object | Body in view format \(rendered HTML\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `atlas_doc_format` | object | Body in Atlassian Document Format \(ADF\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `webUrl` | string | URL to view the page in Confluence |
|
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_get_page_children`
|
|
||||||
|
|
||||||
Get all child pages of a specific Confluence page. Useful for navigating page hierarchies.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | The ID of the parent page to get children from |
|
|
||||||
| `limit` | number | No | Maximum number of child pages to return \(default: 50, max: 250\) |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response to get the next page of results |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `parentId` | string | ID of the parent page |
|
|
||||||
| `children` | array | Array of child pages |
|
|
||||||
| ↳ `id` | string | Child page ID |
|
|
||||||
| ↳ `title` | string | Child page title |
|
|
||||||
| ↳ `status` | string | Page status |
|
|
||||||
| ↳ `spaceId` | string | Space ID |
|
|
||||||
| ↳ `childPosition` | number | Position among siblings |
|
|
||||||
| ↳ `webUrl` | string | URL to view the page |
|
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_get_page_ancestors`
|
|
||||||
|
|
||||||
Get the ancestor (parent) pages of a specific Confluence page. Returns the full hierarchy from the page up to the root.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | The ID of the page to get ancestors for |
|
|
||||||
| `limit` | number | No | Maximum number of ancestors to return \(default: 25, max: 250\) |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pageId` | string | ID of the page whose ancestors were retrieved |
|
|
||||||
| `ancestors` | array | Array of ancestor pages, ordered from direct parent to root |
|
|
||||||
| ↳ `id` | string | Ancestor page ID |
|
|
||||||
| ↳ `title` | string | Ancestor page title |
|
|
||||||
| ↳ `status` | string | Page status |
|
|
||||||
| ↳ `spaceId` | string | Space ID |
|
|
||||||
| ↳ `webUrl` | string | URL to view the page |
|
|
||||||
|
|
||||||
### `confluence_list_page_versions`
|
|
||||||
|
|
||||||
List all versions (revision history) of a Confluence page.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | The ID of the page to get versions for |
|
|
||||||
| `limit` | number | No | Maximum number of versions to return \(default: 50, max: 250\) |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pageId` | string | ID of the page |
|
|
||||||
| `versions` | array | Array of page versions |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_get_page_version`
|
|
||||||
|
|
||||||
Get details about a specific version of a Confluence page.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | The ID of the page |
|
|
||||||
| `versionNumber` | number | Yes | The version number to retrieve \(e.g., 1, 2, 3\) |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pageId` | string | ID of the page |
|
|
||||||
| `version` | object | Detailed version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| ↳ `contentTypeModified` | boolean | Whether the content type was modified in this version |
|
|
||||||
| ↳ `collaborators` | array | List of collaborator account IDs for this version |
|
|
||||||
| ↳ `prevVersion` | number | Previous version number |
|
|
||||||
| ↳ `nextVersion` | number | Next version number |
|
|
||||||
|
|
||||||
### `confluence_list_page_properties`
|
|
||||||
|
|
||||||
List all custom properties (metadata) attached to a Confluence page.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | The ID of the page to list properties from |
|
|
||||||
| `limit` | number | No | Maximum number of properties to return \(default: 50, max: 250\) |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pageId` | string | ID of the page |
|
|
||||||
| `properties` | array | Array of content properties |
|
|
||||||
| ↳ `id` | string | Property ID |
|
|
||||||
| ↳ `key` | string | Property key |
|
|
||||||
| ↳ `value` | json | Property value \(can be any JSON\) |
|
|
||||||
| ↳ `version` | object | Version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_create_page_property`
|
|
||||||
|
|
||||||
Create a new custom property (metadata) on a Confluence page.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | The ID of the page to add the property to |
|
|
||||||
| `key` | string | Yes | The key/name for the property |
|
|
||||||
| `value` | json | Yes | The value for the property \(can be any JSON value\) |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pageId` | string | ID of the page |
|
|
||||||
| `propertyId` | string | ID of the created property |
|
|
||||||
| `key` | string | Property key |
|
|
||||||
| `value` | json | Property value |
|
|
||||||
| `version` | object | Version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
|
|
||||||
### `confluence_search`
|
### `confluence_search`
|
||||||
|
|
||||||
Search for content across Confluence pages, blog posts, and other content.
|
Search for content across Confluence pages, blog posts, and other content.
|
||||||
@@ -432,211 +155,6 @@ Search for content across Confluence pages, blog posts, and other content.
|
|||||||
| ↳ `lastModified` | string | ISO 8601 timestamp of last modification |
|
| ↳ `lastModified` | string | ISO 8601 timestamp of last modification |
|
||||||
| ↳ `entityType` | string | Entity type identifier \(e.g., content, space\) |
|
| ↳ `entityType` | string | Entity type identifier \(e.g., content, space\) |
|
||||||
|
|
||||||
### `confluence_search_in_space`
|
|
||||||
|
|
||||||
Search for content within a specific Confluence space. Optionally filter by text query and content type.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `spaceKey` | string | Yes | The key of the Confluence space to search in \(e.g., "ENG", "HR"\) |
|
|
||||||
| `query` | string | No | Text search query. If not provided, returns all content in the space. |
|
|
||||||
| `contentType` | string | No | Filter by content type: page, blogpost, attachment, or comment |
|
|
||||||
| `limit` | number | No | Maximum number of results to return \(default: 25, max: 250\) |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `spaceKey` | string | The space key that was searched |
|
|
||||||
| `totalSize` | number | Total number of matching results |
|
|
||||||
| `results` | array | Array of search results |
|
|
||||||
| ↳ `id` | string | Unique content identifier |
|
|
||||||
| ↳ `title` | string | Content title |
|
|
||||||
| ↳ `type` | string | Content type \(e.g., page, blogpost, attachment, comment\) |
|
|
||||||
| ↳ `status` | string | Content status \(e.g., current\) |
|
|
||||||
| ↳ `url` | string | URL to view the content in Confluence |
|
|
||||||
| ↳ `excerpt` | string | Text excerpt matching the search query |
|
|
||||||
| ↳ `spaceKey` | string | Key of the space containing the content |
|
|
||||||
| ↳ `space` | object | Space information for the content |
|
|
||||||
| ↳ `id` | string | Space identifier |
|
|
||||||
| ↳ `key` | string | Space key |
|
|
||||||
| ↳ `name` | string | Space name |
|
|
||||||
| ↳ `lastModified` | string | ISO 8601 timestamp of last modification |
|
|
||||||
| ↳ `entityType` | string | Entity type identifier \(e.g., content, space\) |
|
|
||||||
|
|
||||||
### `confluence_list_blogposts`
|
|
||||||
|
|
||||||
List all blog posts across all accessible Confluence spaces.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `limit` | number | No | Maximum number of blog posts to return \(default: 25, max: 250\) |
|
|
||||||
| `status` | string | No | Filter by status: current, archived, trashed, or draft |
|
|
||||||
| `sort` | string | No | Sort order: created-date, -created-date, modified-date, -modified-date, title, -title |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `blogPosts` | array | Array of blog posts |
|
|
||||||
| ↳ `id` | string | Blog post ID |
|
|
||||||
| ↳ `title` | string | Blog post title |
|
|
||||||
| ↳ `status` | string | Blog post status |
|
|
||||||
| ↳ `spaceId` | string | Space ID |
|
|
||||||
| ↳ `authorId` | string | Author account ID |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp |
|
|
||||||
| ↳ `version` | object | Version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| ↳ `webUrl` | string | URL to view the blog post |
|
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_get_blogpost`
|
|
||||||
|
|
||||||
Get a specific Confluence blog post by ID, including its content.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `blogPostId` | string | Yes | The ID of the blog post to retrieve |
|
|
||||||
| `bodyFormat` | string | No | Format for blog post body: storage, atlas_doc_format, or view |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `id` | string | Blog post ID |
|
|
||||||
| `title` | string | Blog post title |
|
|
||||||
| `status` | string | Blog post status |
|
|
||||||
| `spaceId` | string | Space ID |
|
|
||||||
| `authorId` | string | Author account ID |
|
|
||||||
| `createdAt` | string | Creation timestamp |
|
|
||||||
| `version` | object | Version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| `body` | object | Blog post body content in requested format\(s\) |
|
|
||||||
| ↳ `storage` | object | Body in storage format \(Confluence markup\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `view` | object | Body in view format \(rendered HTML\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `atlas_doc_format` | object | Body in Atlassian Document Format \(ADF\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| `webUrl` | string | URL to view the blog post |
|
|
||||||
|
|
||||||
### `confluence_create_blogpost`
|
|
||||||
|
|
||||||
Create a new blog post in a Confluence space.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `spaceId` | string | Yes | The ID of the space to create the blog post in |
|
|
||||||
| `title` | string | Yes | Title of the blog post |
|
|
||||||
| `content` | string | Yes | Blog post content in Confluence storage format \(HTML\) |
|
|
||||||
| `status` | string | No | Blog post status: current \(default\) or draft |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `id` | string | Created blog post ID |
|
|
||||||
| `title` | string | Blog post title |
|
|
||||||
| `status` | string | Blog post status |
|
|
||||||
| `spaceId` | string | Space ID |
|
|
||||||
| `authorId` | string | Author account ID |
|
|
||||||
| `body` | object | Blog post body content |
|
|
||||||
| ↳ `storage` | object | Body in storage format \(Confluence markup\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `view` | object | Body in view format \(rendered HTML\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `atlas_doc_format` | object | Body in Atlassian Document Format \(ADF\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| `version` | object | Blog post version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| `webUrl` | string | URL to view the blog post |
|
|
||||||
|
|
||||||
### `confluence_list_blogposts_in_space`
|
|
||||||
|
|
||||||
List all blog posts within a specific Confluence space.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `spaceId` | string | Yes | The ID of the Confluence space to list blog posts from |
|
|
||||||
| `limit` | number | No | Maximum number of blog posts to return \(default: 25, max: 250\) |
|
|
||||||
| `status` | string | No | Filter by status: current, archived, trashed, or draft |
|
|
||||||
| `bodyFormat` | string | No | Format for blog post body: storage, atlas_doc_format, or view |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `blogPosts` | array | Array of blog posts in the space |
|
|
||||||
| ↳ `id` | string | Blog post ID |
|
|
||||||
| ↳ `title` | string | Blog post title |
|
|
||||||
| ↳ `status` | string | Blog post status |
|
|
||||||
| ↳ `spaceId` | string | Space ID |
|
|
||||||
| ↳ `authorId` | string | Author account ID |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp |
|
|
||||||
| ↳ `version` | object | Version information |
|
|
||||||
| ↳ `number` | number | Version number |
|
|
||||||
| ↳ `message` | string | Version message |
|
|
||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
|
||||||
| ↳ `body` | object | Blog post body content |
|
|
||||||
| ↳ `storage` | object | Body in storage format \(Confluence markup\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `view` | object | Body in view format \(rendered HTML\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `atlas_doc_format` | object | Body in Atlassian Document Format \(ADF\) |
|
|
||||||
| ↳ `value` | string | The content value in the specified format |
|
|
||||||
| ↳ `representation` | string | Content representation type |
|
|
||||||
| ↳ `webUrl` | string | URL to view the blog post |
|
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_create_comment`
|
### `confluence_create_comment`
|
||||||
|
|
||||||
Add a comment to a Confluence page.
|
Add a comment to a Confluence page.
|
||||||
@@ -669,8 +187,6 @@ List all comments on a Confluence page.
|
|||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
||||||
| `pageId` | string | Yes | Confluence page ID to list comments from |
|
| `pageId` | string | Yes | Confluence page ID to list comments from |
|
||||||
| `limit` | number | No | Maximum number of comments to return \(default: 25\) |
|
| `limit` | number | No | Maximum number of comments to return \(default: 25\) |
|
||||||
| `bodyFormat` | string | No | Format for the comment body: storage, atlas_doc_format, view, or export_view \(default: storage\) |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -696,7 +212,6 @@ List all comments on a Confluence page.
|
|||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
| ↳ `authorId` | string | Account ID of the version author |
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_update_comment`
|
### `confluence_update_comment`
|
||||||
|
|
||||||
@@ -776,8 +291,7 @@ List all attachments on a Confluence page.
|
|||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
||||||
| `pageId` | string | Yes | Confluence page ID to list attachments from |
|
| `pageId` | string | Yes | Confluence page ID to list attachments from |
|
||||||
| `limit` | number | No | Maximum number of attachments to return \(default: 50, max: 250\) |
|
| `limit` | number | No | Maximum number of attachments to return \(default: 25\) |
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -802,7 +316,6 @@ List all attachments on a Confluence page.
|
|||||||
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
| ↳ `minorEdit` | boolean | Whether this is a minor edit |
|
||||||
| ↳ `authorId` | string | Account ID of the version author |
|
| ↳ `authorId` | string | Account ID of the version author |
|
||||||
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
| ↳ `createdAt` | string | ISO 8601 timestamp of version creation |
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_delete_attachment`
|
### `confluence_delete_attachment`
|
||||||
|
|
||||||
@@ -834,8 +347,6 @@ List all labels on a Confluence page.
|
|||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
||||||
| `pageId` | string | Yes | Confluence page ID to list labels from |
|
| `pageId` | string | Yes | Confluence page ID to list labels from |
|
||||||
| `limit` | number | No | Maximum number of labels to return \(default: 25, max: 250\) |
|
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -847,30 +358,6 @@ List all labels on a Confluence page.
|
|||||||
| ↳ `id` | string | Unique label identifier |
|
| ↳ `id` | string | Unique label identifier |
|
||||||
| ↳ `name` | string | Label name |
|
| ↳ `name` | string | Label name |
|
||||||
| ↳ `prefix` | string | Label prefix/type \(e.g., global, my, team\) |
|
| ↳ `prefix` | string | Label prefix/type \(e.g., global, my, team\) |
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
### `confluence_add_label`
|
|
||||||
|
|
||||||
Add a label to a Confluence page for organization and categorization.
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `pageId` | string | Yes | Confluence page ID to add the label to |
|
|
||||||
| `labelName` | string | Yes | Name of the label to add |
|
|
||||||
| `prefix` | string | No | Label prefix: global \(default\), my, team, or system |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
|
||||||
| `pageId` | string | Page ID that the label was added to |
|
|
||||||
| `labelName` | string | Name of the added label |
|
|
||||||
| `labelId` | string | ID of the added label |
|
|
||||||
|
|
||||||
### `confluence_get_space`
|
### `confluence_get_space`
|
||||||
|
|
||||||
@@ -888,19 +375,13 @@ Get details about a specific Confluence space.
|
|||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `ts` | string | ISO 8601 timestamp of the operation |
|
| `ts` | string | Timestamp of retrieval |
|
||||||
| `spaceId` | string | Space ID |
|
| `spaceId` | string | Space ID |
|
||||||
| `name` | string | Space name |
|
| `name` | string | Space name |
|
||||||
| `key` | string | Space key |
|
| `key` | string | Space key |
|
||||||
| `type` | string | Space type \(global, personal\) |
|
| `type` | string | Space type |
|
||||||
| `status` | string | Space status \(current, archived\) |
|
| `status` | string | Space status |
|
||||||
| `url` | string | URL to view the space in Confluence |
|
| `url` | string | Space URL |
|
||||||
| `authorId` | string | Account ID of the space creator |
|
|
||||||
| `createdAt` | string | ISO 8601 timestamp when the space was created |
|
|
||||||
| `homepageId` | string | ID of the space homepage |
|
|
||||||
| `description` | object | Space description content |
|
|
||||||
| ↳ `value` | string | Description text content |
|
|
||||||
| ↳ `representation` | string | Content representation format \(e.g., plain, view, storage\) |
|
|
||||||
|
|
||||||
### `confluence_list_spaces`
|
### `confluence_list_spaces`
|
||||||
|
|
||||||
@@ -911,8 +392,7 @@ List all Confluence spaces accessible to the user.
|
|||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
| `domain` | string | Yes | Your Confluence domain \(e.g., yourcompany.atlassian.net\) |
|
||||||
| `limit` | number | No | Maximum number of spaces to return \(default: 25, max: 250\) |
|
| `limit` | number | No | Maximum number of spaces to return \(default: 25\) |
|
||||||
| `cursor` | string | No | Pagination cursor from previous response |
|
|
||||||
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
| `cloudId` | string | No | Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -932,6 +412,5 @@ List all Confluence spaces accessible to the user.
|
|||||||
| ↳ `description` | object | Space description |
|
| ↳ `description` | object | Space description |
|
||||||
| ↳ `value` | string | Description text content |
|
| ↳ `value` | string | Description text content |
|
||||||
| ↳ `representation` | string | Content representation format \(e.g., plain, view, storage\) |
|
| ↳ `representation` | string | Content representation format \(e.g., plain, view, storage\) |
|
||||||
| `nextCursor` | string | Cursor for fetching the next page of results |
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ Send a message to a Discord channel
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `message` | string | Success or error message |
|
| `message` | string | Success or error message |
|
||||||
| `files` | file[] | Files attached to the message |
|
|
||||||
| `data` | object | Discord message data |
|
| `data` | object | Discord message data |
|
||||||
| ↳ `id` | string | Message ID |
|
| ↳ `id` | string | Message ID |
|
||||||
| ↳ `content` | string | Message content |
|
| ↳ `content` | string | Message content |
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ Upload a file to Dropbox
|
|||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `path` | string | Yes | The path in Dropbox where the file should be saved \(e.g., /folder/document.pdf\) |
|
| `path` | string | Yes | The path in Dropbox where the file should be saved \(e.g., /folder/document.pdf\) |
|
||||||
| `file` | file | No | The file to upload \(UserFile object\) |
|
| `fileContent` | string | Yes | The base64 encoded content of the file to upload |
|
||||||
| `fileContent` | string | No | Legacy: base64 encoded file content |
|
|
||||||
| `fileName` | string | No | Optional filename \(used if path is a folder\) |
|
| `fileName` | string | No | Optional filename \(used if path is a folder\) |
|
||||||
| `mode` | string | No | Write mode: add \(default\) or overwrite |
|
| `mode` | string | No | Write mode: add \(default\) or overwrite |
|
||||||
| `autorename` | boolean | No | If true, rename the file if there is a conflict |
|
| `autorename` | boolean | No | If true, rename the file if there is a conflict |
|
||||||
@@ -67,7 +66,7 @@ Upload a file to Dropbox
|
|||||||
|
|
||||||
### `dropbox_download`
|
### `dropbox_download`
|
||||||
|
|
||||||
Download a file from Dropbox with metadata and content
|
Download a file from Dropbox and get a temporary link
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
@@ -79,8 +78,11 @@ Download a file from Dropbox with metadata and content
|
|||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
| `file` | object | The file metadata |
|
||||||
| `metadata` | json | The file metadata |
|
| ↳ `id` | string | Unique identifier for the file |
|
||||||
|
| ↳ `name` | string | Name of the file |
|
||||||
|
| ↳ `path_display` | string | Display path of the file |
|
||||||
|
| ↳ `size` | number | Size of the file in bytes |
|
||||||
| `temporaryLink` | string | Temporary link to download the file \(valid for ~4 hours\) |
|
| `temporaryLink` | string | Temporary link to download the file \(valid for ~4 hours\) |
|
||||||
| `content` | string | Base64 encoded file content \(if fetched\) |
|
| `content` | string | Base64 encoded file content \(if fetched\) |
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Read and parse multiple files
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="file_v3"
|
type="file_v2"
|
||||||
color="#40916C"
|
color="#40916C"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ The File Parser tool is particularly useful for scenarios where your agents need
|
|||||||
|
|
||||||
## Usage Instructions
|
## Usage Instructions
|
||||||
|
|
||||||
Upload files directly or import from external URLs to get UserFile objects for use in other blocks.
|
Integrate File into the workflow. Can upload a file manually or insert a file url.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -41,15 +41,14 @@ Parse one or more uploaded files or files from URLs (text, PDF, CSV, images, etc
|
|||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `filePath` | string | No | Path to the file\(s\). Can be a single path, URL, or an array of paths. |
|
| `filePath` | string | Yes | Path to the file\(s\). Can be a single path, URL, or an array of paths. |
|
||||||
| `file` | file | No | Uploaded file\(s\) to parse |
|
|
||||||
| `fileType` | string | No | Type of file to parse \(auto-detected if not specified\) |
|
| `fileType` | string | No | Type of file to parse \(auto-detected if not specified\) |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `files` | file[] | Parsed files as UserFile objects |
|
| `files` | array | Array of parsed files with content, metadata, and file properties |
|
||||||
| `combinedContent` | string | Combined content of all parsed files |
|
| `combinedContent` | string | All file contents merged into a single text string |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Interact with Fireflies.ai meeting transcripts and recordings
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="fireflies_v2"
|
type="fireflies"
|
||||||
color="#100730"
|
color="#100730"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -692,7 +692,6 @@ Get the content of a file from a GitHub repository. Supports files up to 1MB. Co
|
|||||||
| `download_url` | string | Direct download URL |
|
| `download_url` | string | Direct download URL |
|
||||||
| `git_url` | string | Git blob API URL |
|
| `git_url` | string | Git blob API URL |
|
||||||
| `_links` | json | Related links |
|
| `_links` | json | Related links |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
|
||||||
|
|
||||||
### `github_create_file`
|
### `github_create_file`
|
||||||
|
|
||||||
|
|||||||
@@ -291,7 +291,11 @@ Download a file from Google Drive with complete metadata (exports Google Workspa
|
|||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
| `file` | object | Downloaded file data |
|
||||||
|
| ↳ `name` | string | File name |
|
||||||
|
| ↳ `mimeType` | string | MIME type of the file |
|
||||||
|
| ↳ `data` | string | File content as base64-encoded string |
|
||||||
|
| ↳ `size` | number | File size in bytes |
|
||||||
| `metadata` | object | Complete file metadata from Google Drive |
|
| `metadata` | object | Complete file metadata from Google Drive |
|
||||||
| ↳ `id` | string | Google Drive file ID |
|
| ↳ `id` | string | Google Drive file ID |
|
||||||
| ↳ `kind` | string | Resource type identifier |
|
| ↳ `kind` | string | Resource type identifier |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Read, write, and create presentations
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="google_slides_v2"
|
type="google_slides"
|
||||||
color="#E0E0E0"
|
color="#E0E0E0"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -333,28 +333,6 @@ Get all attachments from a Jira issue
|
|||||||
| `issueKey` | string | Issue key |
|
| `issueKey` | string | Issue key |
|
||||||
| `attachments` | array | Array of attachments with id, filename, size, mimeType, created, author |
|
| `attachments` | array | Array of attachments with id, filename, size, mimeType, created, author |
|
||||||
|
|
||||||
### `jira_add_attachment`
|
|
||||||
|
|
||||||
Add attachments to a Jira issue
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `domain` | string | Yes | Your Jira domain \(e.g., yourcompany.atlassian.net\) |
|
|
||||||
| `issueKey` | string | Yes | Jira issue key to add attachments to \(e.g., PROJ-123\) |
|
|
||||||
| `files` | file[] | Yes | Files to attach to the Jira issue |
|
|
||||||
| `cloudId` | string | No | Jira Cloud ID for the instance. If not provided, it will be fetched using the domain. |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `ts` | string | Timestamp of the operation |
|
|
||||||
| `issueKey` | string | Issue key |
|
|
||||||
| `attachmentIds` | json | IDs of uploaded attachments |
|
|
||||||
| `files` | file[] | Uploaded attachment files |
|
|
||||||
|
|
||||||
### `jira_delete_attachment`
|
### `jira_delete_attachment`
|
||||||
|
|
||||||
Delete an attachment from a Jira issue
|
Delete an attachment from a Jira issue
|
||||||
|
|||||||
@@ -320,7 +320,6 @@ Search for issues in Linear using full-text search
|
|||||||
| `teamId` | string | No | Filter by team ID |
|
| `teamId` | string | No | Filter by team ID |
|
||||||
| `includeArchived` | boolean | No | Include archived issues in search results |
|
| `includeArchived` | boolean | No | Include archived issues in search results |
|
||||||
| `first` | number | No | Number of results to return \(default: 50\) |
|
| `first` | number | No | Number of results to return \(default: 50\) |
|
||||||
| `after` | string | No | Cursor for pagination |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
@@ -755,10 +754,6 @@ List all labels in Linear workspace or team
|
|||||||
| ↳ `name` | string | Label name |
|
| ↳ `name` | string | Label name |
|
||||||
| ↳ `color` | string | Label color \(hex\) |
|
| ↳ `color` | string | Label color \(hex\) |
|
||||||
| ↳ `description` | string | Label description |
|
| ↳ `description` | string | Label description |
|
||||||
| ↳ `isGroup` | boolean | Whether this label is a group |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
| ↳ `team` | object | Team object |
|
||||||
| ↳ `id` | string | Team ID |
|
| ↳ `id` | string | Team ID |
|
||||||
| ↳ `name` | string | Team name |
|
| ↳ `name` | string | Team name |
|
||||||
@@ -785,10 +780,6 @@ Create a new label in Linear
|
|||||||
| ↳ `name` | string | Label name |
|
| ↳ `name` | string | Label name |
|
||||||
| ↳ `color` | string | Label color \(hex\) |
|
| ↳ `color` | string | Label color \(hex\) |
|
||||||
| ↳ `description` | string | Label description |
|
| ↳ `description` | string | Label description |
|
||||||
| ↳ `isGroup` | boolean | Whether this label is a group |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
| ↳ `team` | object | Team object |
|
||||||
| ↳ `id` | string | Team ID |
|
| ↳ `id` | string | Team ID |
|
||||||
| ↳ `name` | string | Team name |
|
| ↳ `name` | string | Team name |
|
||||||
@@ -815,10 +806,6 @@ Update an existing label in Linear
|
|||||||
| ↳ `name` | string | Label name |
|
| ↳ `name` | string | Label name |
|
||||||
| ↳ `color` | string | Label color \(hex\) |
|
| ↳ `color` | string | Label color \(hex\) |
|
||||||
| ↳ `description` | string | Label description |
|
| ↳ `description` | string | Label description |
|
||||||
| ↳ `isGroup` | boolean | Whether this label is a group |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
| ↳ `team` | object | Team object |
|
||||||
| ↳ `id` | string | Team ID |
|
| ↳ `id` | string | Team ID |
|
||||||
| ↳ `name` | string | Team name |
|
| ↳ `name` | string | Team name |
|
||||||
@@ -862,13 +849,9 @@ List all workflow states (statuses) in Linear
|
|||||||
| `states` | array | Array of workflow states |
|
| `states` | array | Array of workflow states |
|
||||||
| ↳ `id` | string | State ID |
|
| ↳ `id` | string | State ID |
|
||||||
| ↳ `name` | string | State name \(e.g., "Todo", "In Progress"\) |
|
| ↳ `name` | string | State name \(e.g., "Todo", "In Progress"\) |
|
||||||
| ↳ `description` | string | State description |
|
| ↳ `type` | string | State type \(unstarted, started, completed, canceled\) |
|
||||||
| ↳ `type` | string | State type \(triage, backlog, unstarted, started, completed, canceled\) |
|
|
||||||
| ↳ `color` | string | State color \(hex\) |
|
| ↳ `color` | string | State color \(hex\) |
|
||||||
| ↳ `position` | number | State position in workflow |
|
| ↳ `position` | number | State position in workflow |
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
| ↳ `team` | object | Team object |
|
||||||
| ↳ `id` | string | Team ID |
|
| ↳ `id` | string | Team ID |
|
||||||
| ↳ `name` | string | Team name |
|
| ↳ `name` | string | Team name |
|
||||||
@@ -894,17 +877,11 @@ Create a new workflow state (status) in Linear
|
|||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `state` | object | The created workflow state |
|
| `state` | object | The created workflow state |
|
||||||
| ↳ `id` | string | State ID |
|
| ↳ `id` | string | State ID |
|
||||||
| ↳ `name` | string | State name \(e.g., "Todo", "In Progress"\) |
|
| ↳ `name` | string | State name |
|
||||||
| ↳ `description` | string | State description |
|
| ↳ `type` | string | State type |
|
||||||
| ↳ `type` | string | State type \(triage, backlog, unstarted, started, completed, canceled\) |
|
| ↳ `color` | string | State color |
|
||||||
| ↳ `color` | string | State color \(hex\) |
|
| ↳ `position` | number | State position |
|
||||||
| ↳ `position` | number | State position in workflow |
|
| ↳ `team` | object | Team this state belongs to |
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
|
||||||
| ↳ `id` | string | Team ID |
|
|
||||||
| ↳ `name` | string | Team name |
|
|
||||||
|
|
||||||
### `linear_update_workflow_state`
|
### `linear_update_workflow_state`
|
||||||
|
|
||||||
@@ -926,17 +903,10 @@ Update an existing workflow state in Linear
|
|||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `state` | object | The updated workflow state |
|
| `state` | object | The updated workflow state |
|
||||||
| ↳ `id` | string | State ID |
|
| ↳ `id` | string | State ID |
|
||||||
| ↳ `name` | string | State name \(e.g., "Todo", "In Progress"\) |
|
| ↳ `name` | string | State name |
|
||||||
| ↳ `description` | string | State description |
|
| ↳ `type` | string | State type |
|
||||||
| ↳ `type` | string | State type \(triage, backlog, unstarted, started, completed, canceled\) |
|
| ↳ `color` | string | State color |
|
||||||
| ↳ `color` | string | State color \(hex\) |
|
| ↳ `position` | number | State position |
|
||||||
| ↳ `position` | number | State position in workflow |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
|
||||||
| ↳ `id` | string | Team ID |
|
|
||||||
| ↳ `name` | string | Team name |
|
|
||||||
|
|
||||||
### `linear_list_cycles`
|
### `linear_list_cycles`
|
||||||
|
|
||||||
@@ -965,7 +935,6 @@ List cycles (sprints/iterations) in Linear
|
|||||||
| ↳ `endsAt` | string | End date \(ISO 8601\) |
|
| ↳ `endsAt` | string | End date \(ISO 8601\) |
|
||||||
| ↳ `completedAt` | string | Completion date \(ISO 8601\) |
|
| ↳ `completedAt` | string | Completion date \(ISO 8601\) |
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
| ↳ `team` | object | Team object |
|
||||||
| ↳ `id` | string | Team ID |
|
| ↳ `id` | string | Team ID |
|
||||||
| ↳ `name` | string | Team name |
|
| ↳ `name` | string | Team name |
|
||||||
@@ -992,7 +961,6 @@ Get a single cycle by ID from Linear
|
|||||||
| ↳ `endsAt` | string | End date \(ISO 8601\) |
|
| ↳ `endsAt` | string | End date \(ISO 8601\) |
|
||||||
| ↳ `completedAt` | string | Completion date \(ISO 8601\) |
|
| ↳ `completedAt` | string | Completion date \(ISO 8601\) |
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
| ↳ `team` | object | Team object |
|
||||||
| ↳ `id` | string | Team ID |
|
| ↳ `id` | string | Team ID |
|
||||||
| ↳ `name` | string | Team name |
|
| ↳ `name` | string | Team name |
|
||||||
@@ -1018,14 +986,9 @@ Create a new cycle (sprint/iteration) in Linear
|
|||||||
| ↳ `id` | string | Cycle ID |
|
| ↳ `id` | string | Cycle ID |
|
||||||
| ↳ `number` | number | Cycle number |
|
| ↳ `number` | number | Cycle number |
|
||||||
| ↳ `name` | string | Cycle name |
|
| ↳ `name` | string | Cycle name |
|
||||||
| ↳ `startsAt` | string | Start date \(ISO 8601\) |
|
| ↳ `startsAt` | string | Start date |
|
||||||
| ↳ `endsAt` | string | End date \(ISO 8601\) |
|
| ↳ `endsAt` | string | End date |
|
||||||
| ↳ `completedAt` | string | Completion date \(ISO 8601\) |
|
| ↳ `team` | object | Team this cycle belongs to |
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
|
||||||
| ↳ `id` | string | Team ID |
|
|
||||||
| ↳ `name` | string | Team name |
|
|
||||||
|
|
||||||
### `linear_get_active_cycle`
|
### `linear_get_active_cycle`
|
||||||
|
|
||||||
@@ -1045,14 +1008,10 @@ Get the currently active cycle for a team
|
|||||||
| ↳ `id` | string | Cycle ID |
|
| ↳ `id` | string | Cycle ID |
|
||||||
| ↳ `number` | number | Cycle number |
|
| ↳ `number` | number | Cycle number |
|
||||||
| ↳ `name` | string | Cycle name |
|
| ↳ `name` | string | Cycle name |
|
||||||
| ↳ `startsAt` | string | Start date \(ISO 8601\) |
|
| ↳ `startsAt` | string | Start date |
|
||||||
| ↳ `endsAt` | string | End date \(ISO 8601\) |
|
| ↳ `endsAt` | string | End date |
|
||||||
| ↳ `completedAt` | string | Completion date \(ISO 8601\) |
|
| ↳ `progress` | number | Progress percentage |
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
| ↳ `team` | object | Team this cycle belongs to |
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `team` | object | Team object |
|
|
||||||
| ↳ `id` | string | Team ID |
|
|
||||||
| ↳ `name` | string | Team name |
|
|
||||||
|
|
||||||
### `linear_create_attachment`
|
### `linear_create_attachment`
|
||||||
|
|
||||||
@@ -1063,8 +1022,7 @@ Add an attachment to an issue in Linear
|
|||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `issueId` | string | Yes | Issue ID to attach to |
|
| `issueId` | string | Yes | Issue ID to attach to |
|
||||||
| `url` | string | No | URL of the attachment |
|
| `url` | string | Yes | URL of the attachment |
|
||||||
| `file` | file | No | File to attach |
|
|
||||||
| `title` | string | Yes | Attachment title |
|
| `title` | string | Yes | Attachment title |
|
||||||
| `subtitle` | string | No | Attachment subtitle/description |
|
| `subtitle` | string | No | Attachment subtitle/description |
|
||||||
|
|
||||||
@@ -1375,12 +1333,8 @@ Create a new customer in Linear
|
|||||||
| ↳ `domains` | array | Associated domains |
|
| ↳ `domains` | array | Associated domains |
|
||||||
| ↳ `externalIds` | array | External IDs from other systems |
|
| ↳ `externalIds` | array | External IDs from other systems |
|
||||||
| ↳ `logoUrl` | string | Logo URL |
|
| ↳ `logoUrl` | string | Logo URL |
|
||||||
| ↳ `slugId` | string | Unique URL slug |
|
|
||||||
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
||||||
| ↳ `revenue` | number | Annual revenue |
|
|
||||||
| ↳ `size` | number | Organization size |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
||||||
|
|
||||||
### `linear_list_customers`
|
### `linear_list_customers`
|
||||||
@@ -1408,12 +1362,8 @@ List all customers in Linear
|
|||||||
| ↳ `domains` | array | Associated domains |
|
| ↳ `domains` | array | Associated domains |
|
||||||
| ↳ `externalIds` | array | External IDs from other systems |
|
| ↳ `externalIds` | array | External IDs from other systems |
|
||||||
| ↳ `logoUrl` | string | Logo URL |
|
| ↳ `logoUrl` | string | Logo URL |
|
||||||
| ↳ `slugId` | string | Unique URL slug |
|
|
||||||
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
||||||
| ↳ `revenue` | number | Annual revenue |
|
|
||||||
| ↳ `size` | number | Organization size |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
||||||
|
|
||||||
### `linear_create_customer_request`
|
### `linear_create_customer_request`
|
||||||
@@ -1529,12 +1479,8 @@ Get a single customer by ID in Linear
|
|||||||
| ↳ `domains` | array | Associated domains |
|
| ↳ `domains` | array | Associated domains |
|
||||||
| ↳ `externalIds` | array | External IDs from other systems |
|
| ↳ `externalIds` | array | External IDs from other systems |
|
||||||
| ↳ `logoUrl` | string | Logo URL |
|
| ↳ `logoUrl` | string | Logo URL |
|
||||||
| ↳ `slugId` | string | Unique URL slug |
|
|
||||||
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
||||||
| ↳ `revenue` | number | Annual revenue |
|
|
||||||
| ↳ `size` | number | Organization size |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
||||||
|
|
||||||
### `linear_update_customer`
|
### `linear_update_customer`
|
||||||
@@ -1566,12 +1512,8 @@ Update a customer in Linear
|
|||||||
| ↳ `domains` | array | Associated domains |
|
| ↳ `domains` | array | Associated domains |
|
||||||
| ↳ `externalIds` | array | External IDs from other systems |
|
| ↳ `externalIds` | array | External IDs from other systems |
|
||||||
| ↳ `logoUrl` | string | Logo URL |
|
| ↳ `logoUrl` | string | Logo URL |
|
||||||
| ↳ `slugId` | string | Unique URL slug |
|
|
||||||
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
| ↳ `approximateNeedCount` | number | Number of customer needs |
|
||||||
| ↳ `revenue` | number | Annual revenue |
|
|
||||||
| ↳ `size` | number | Organization size |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
||||||
|
|
||||||
### `linear_delete_customer`
|
### `linear_delete_customer`
|
||||||
@@ -1617,8 +1559,8 @@ Create a new customer status in Linear
|
|||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `name` | string | Yes | Customer status name |
|
| `name` | string | Yes | Customer status name |
|
||||||
| `color` | string | Yes | Status color \(hex code\) |
|
| `color` | string | Yes | Status color \(hex code\) |
|
||||||
| `description` | string | No | Status description |
|
|
||||||
| `displayName` | string | No | Display name for the status |
|
| `displayName` | string | No | Display name for the status |
|
||||||
|
| `description` | string | No | Status description |
|
||||||
| `position` | number | No | Position in status list |
|
| `position` | number | No | Position in status list |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -1628,12 +1570,11 @@ Create a new customer status in Linear
|
|||||||
| `customerStatus` | object | The created customer status |
|
| `customerStatus` | object | The created customer status |
|
||||||
| ↳ `id` | string | Customer status ID |
|
| ↳ `id` | string | Customer status ID |
|
||||||
| ↳ `name` | string | Status name |
|
| ↳ `name` | string | Status name |
|
||||||
|
| ↳ `displayName` | string | Display name |
|
||||||
| ↳ `description` | string | Status description |
|
| ↳ `description` | string | Status description |
|
||||||
| ↳ `color` | string | Status color \(hex\) |
|
| ↳ `color` | string | Status color \(hex\) |
|
||||||
| ↳ `position` | number | Position in list |
|
| ↳ `position` | number | Position in list |
|
||||||
| ↳ `type` | string | Status type \(active, inactive\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
||||||
| ↳ `updatedAt` | string | Last updated timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
||||||
|
|
||||||
### `linear_update_customer_status`
|
### `linear_update_customer_status`
|
||||||
@@ -1647,8 +1588,8 @@ Update a customer status in Linear
|
|||||||
| `statusId` | string | Yes | Customer status ID to update |
|
| `statusId` | string | Yes | Customer status ID to update |
|
||||||
| `name` | string | No | Updated status name |
|
| `name` | string | No | Updated status name |
|
||||||
| `color` | string | No | Updated status color |
|
| `color` | string | No | Updated status color |
|
||||||
| `description` | string | No | Updated description |
|
|
||||||
| `displayName` | string | No | Updated display name |
|
| `displayName` | string | No | Updated display name |
|
||||||
|
| `description` | string | No | Updated description |
|
||||||
| `position` | number | No | Updated position |
|
| `position` | number | No | Updated position |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
@@ -1656,15 +1597,6 @@ Update a customer status in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `customerStatus` | object | The updated customer status |
|
| `customerStatus` | object | The updated customer status |
|
||||||
| ↳ `id` | string | Customer status ID |
|
|
||||||
| ↳ `name` | string | Status name |
|
|
||||||
| ↳ `description` | string | Status description |
|
|
||||||
| ↳ `color` | string | Status color \(hex\) |
|
|
||||||
| ↳ `position` | number | Position in list |
|
|
||||||
| ↳ `type` | string | Status type \(active, inactive\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last updated timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_delete_customer_status`
|
### `linear_delete_customer_status`
|
||||||
|
|
||||||
@@ -1690,25 +1622,19 @@ List all customer statuses in Linear
|
|||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `first` | number | No | Number of statuses to return \(default: 50\) |
|
|
||||||
| `after` | string | No | Cursor for pagination |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `pageInfo` | object | Pagination information |
|
|
||||||
| ↳ `hasNextPage` | boolean | Whether there are more results |
|
|
||||||
| ↳ `endCursor` | string | Cursor for the next page |
|
|
||||||
| `customerStatuses` | array | List of customer statuses |
|
| `customerStatuses` | array | List of customer statuses |
|
||||||
| ↳ `id` | string | Customer status ID |
|
| ↳ `id` | string | Customer status ID |
|
||||||
| ↳ `name` | string | Status name |
|
| ↳ `name` | string | Status name |
|
||||||
|
| ↳ `displayName` | string | Display name |
|
||||||
| ↳ `description` | string | Status description |
|
| ↳ `description` | string | Status description |
|
||||||
| ↳ `color` | string | Status color \(hex\) |
|
| ↳ `color` | string | Status color \(hex\) |
|
||||||
| ↳ `position` | number | Position in list |
|
| ↳ `position` | number | Position in list |
|
||||||
| ↳ `type` | string | Status type \(active, inactive\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
||||||
| ↳ `updatedAt` | string | Last updated timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
||||||
|
|
||||||
### `linear_create_customer_tier`
|
### `linear_create_customer_tier`
|
||||||
@@ -1784,16 +1710,11 @@ List all customer tiers in Linear
|
|||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `first` | number | No | Number of tiers to return \(default: 50\) |
|
|
||||||
| `after` | string | No | Cursor for pagination |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `pageInfo` | object | Pagination information |
|
|
||||||
| ↳ `hasNextPage` | boolean | Whether there are more results |
|
|
||||||
| ↳ `endCursor` | string | Cursor for the next page |
|
|
||||||
| `customerTiers` | array | List of customer tiers |
|
| `customerTiers` | array | List of customer tiers |
|
||||||
| ↳ `id` | string | Customer tier ID |
|
| ↳ `id` | string | Customer tier ID |
|
||||||
| ↳ `name` | string | Tier name |
|
| ↳ `name` | string | Tier name |
|
||||||
@@ -1839,14 +1760,6 @@ Create a new project label in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `projectLabel` | object | The created project label |
|
| `projectLabel` | object | The created project label |
|
||||||
| ↳ `id` | string | Project label ID |
|
|
||||||
| ↳ `name` | string | Label name |
|
|
||||||
| ↳ `description` | string | Label description |
|
|
||||||
| ↳ `color` | string | Label color \(hex\) |
|
|
||||||
| ↳ `isGroup` | boolean | Whether this label is a group |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_update_project_label`
|
### `linear_update_project_label`
|
||||||
|
|
||||||
@@ -1866,14 +1779,6 @@ Update a project label in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `projectLabel` | object | The updated project label |
|
| `projectLabel` | object | The updated project label |
|
||||||
| ↳ `id` | string | Project label ID |
|
|
||||||
| ↳ `name` | string | Label name |
|
|
||||||
| ↳ `description` | string | Label description |
|
|
||||||
| ↳ `color` | string | Label color \(hex\) |
|
|
||||||
| ↳ `isGroup` | boolean | Whether this label is a group |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_delete_project_label`
|
### `linear_delete_project_label`
|
||||||
|
|
||||||
@@ -1900,25 +1805,12 @@ List all project labels in Linear
|
|||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `projectId` | string | No | Optional project ID to filter labels for a specific project |
|
| `projectId` | string | No | Optional project ID to filter labels for a specific project |
|
||||||
| `first` | number | No | Number of labels to return \(default: 50\) |
|
|
||||||
| `after` | string | No | Cursor for pagination |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `pageInfo` | object | Pagination information |
|
|
||||||
| ↳ `hasNextPage` | boolean | Whether there are more results |
|
|
||||||
| ↳ `endCursor` | string | Cursor for the next page |
|
|
||||||
| `projectLabels` | array | List of project labels |
|
| `projectLabels` | array | List of project labels |
|
||||||
| ↳ `id` | string | Project label ID |
|
|
||||||
| ↳ `name` | string | Label name |
|
|
||||||
| ↳ `description` | string | Label description |
|
|
||||||
| ↳ `color` | string | Label color \(hex\) |
|
|
||||||
| ↳ `isGroup` | boolean | Whether this label is a group |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last update timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_add_label_to_project`
|
### `linear_add_label_to_project`
|
||||||
|
|
||||||
@@ -1974,16 +1866,6 @@ Create a new project milestone in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `projectMilestone` | object | The created project milestone |
|
| `projectMilestone` | object | The created project milestone |
|
||||||
| ↳ `id` | string | Project milestone ID |
|
|
||||||
| ↳ `name` | string | Milestone name |
|
|
||||||
| ↳ `description` | string | Milestone description |
|
|
||||||
| ↳ `projectId` | string | Project ID |
|
|
||||||
| ↳ `targetDate` | string | Target date \(YYYY-MM-DD\) |
|
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
|
||||||
| ↳ `sortOrder` | number | Sort order within the project |
|
|
||||||
| ↳ `status` | string | Milestone status \(done, next, overdue, unstarted\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_update_project_milestone`
|
### `linear_update_project_milestone`
|
||||||
|
|
||||||
@@ -2003,16 +1885,6 @@ Update a project milestone in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `projectMilestone` | object | The updated project milestone |
|
| `projectMilestone` | object | The updated project milestone |
|
||||||
| ↳ `id` | string | Project milestone ID |
|
|
||||||
| ↳ `name` | string | Milestone name |
|
|
||||||
| ↳ `description` | string | Milestone description |
|
|
||||||
| ↳ `projectId` | string | Project ID |
|
|
||||||
| ↳ `targetDate` | string | Target date \(YYYY-MM-DD\) |
|
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
|
||||||
| ↳ `sortOrder` | number | Sort order within the project |
|
|
||||||
| ↳ `status` | string | Milestone status \(done, next, overdue, unstarted\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_delete_project_milestone`
|
### `linear_delete_project_milestone`
|
||||||
|
|
||||||
@@ -2039,27 +1911,12 @@ List all milestones for a project in Linear
|
|||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `projectId` | string | Yes | Project ID to list milestones for |
|
| `projectId` | string | Yes | Project ID to list milestones for |
|
||||||
| `first` | number | No | Number of milestones to return \(default: 50\) |
|
|
||||||
| `after` | string | No | Cursor for pagination |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `pageInfo` | object | Pagination information |
|
|
||||||
| ↳ `hasNextPage` | boolean | Whether there are more results |
|
|
||||||
| ↳ `endCursor` | string | Cursor for the next page |
|
|
||||||
| `projectMilestones` | array | List of project milestones |
|
| `projectMilestones` | array | List of project milestones |
|
||||||
| ↳ `id` | string | Project milestone ID |
|
|
||||||
| ↳ `name` | string | Milestone name |
|
|
||||||
| ↳ `description` | string | Milestone description |
|
|
||||||
| ↳ `projectId` | string | Project ID |
|
|
||||||
| ↳ `targetDate` | string | Target date \(YYYY-MM-DD\) |
|
|
||||||
| ↳ `progress` | number | Progress percentage \(0-1\) |
|
|
||||||
| ↳ `sortOrder` | number | Sort order within the project |
|
|
||||||
| ↳ `status` | string | Milestone status \(done, next, overdue, unstarted\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_create_project_status`
|
### `linear_create_project_status`
|
||||||
|
|
||||||
@@ -2081,16 +1938,6 @@ Create a new project status in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `projectStatus` | object | The created project status |
|
| `projectStatus` | object | The created project status |
|
||||||
| ↳ `id` | string | Project status ID |
|
|
||||||
| ↳ `name` | string | Status name |
|
|
||||||
| ↳ `description` | string | Status description |
|
|
||||||
| ↳ `color` | string | Status color \(hex\) |
|
|
||||||
| ↳ `indefinite` | boolean | Whether this status is indefinite |
|
|
||||||
| ↳ `position` | number | Position in list |
|
|
||||||
| ↳ `type` | string | Status type \(backlog, planned, started, paused, completed, canceled\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last updated timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_update_project_status`
|
### `linear_update_project_status`
|
||||||
|
|
||||||
@@ -2112,16 +1959,6 @@ Update a project status in Linear
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `projectStatus` | object | The updated project status |
|
| `projectStatus` | object | The updated project status |
|
||||||
| ↳ `id` | string | Project status ID |
|
|
||||||
| ↳ `name` | string | Status name |
|
|
||||||
| ↳ `description` | string | Status description |
|
|
||||||
| ↳ `color` | string | Status color \(hex\) |
|
|
||||||
| ↳ `indefinite` | boolean | Whether this status is indefinite |
|
|
||||||
| ↳ `position` | number | Position in list |
|
|
||||||
| ↳ `type` | string | Status type \(backlog, planned, started, paused, completed, canceled\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last updated timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
### `linear_delete_project_status`
|
### `linear_delete_project_status`
|
||||||
|
|
||||||
@@ -2147,26 +1984,11 @@ List all project statuses in Linear
|
|||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `first` | number | No | Number of statuses to return \(default: 50\) |
|
|
||||||
| `after` | string | No | Cursor for pagination |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `pageInfo` | object | Pagination information |
|
|
||||||
| ↳ `hasNextPage` | boolean | Whether there are more results |
|
|
||||||
| ↳ `endCursor` | string | Cursor for the next page |
|
|
||||||
| `projectStatuses` | array | List of project statuses |
|
| `projectStatuses` | array | List of project statuses |
|
||||||
| ↳ `id` | string | Project status ID |
|
|
||||||
| ↳ `name` | string | Status name |
|
|
||||||
| ↳ `description` | string | Status description |
|
|
||||||
| ↳ `color` | string | Status color \(hex\) |
|
|
||||||
| ↳ `indefinite` | boolean | Whether this status is indefinite |
|
|
||||||
| ↳ `position` | number | Position in list |
|
|
||||||
| ↳ `type` | string | Status type \(backlog, planned, started, paused, completed, canceled\) |
|
|
||||||
| ↳ `createdAt` | string | Creation timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `updatedAt` | string | Last updated timestamp \(ISO 8601\) |
|
|
||||||
| ↳ `archivedAt` | string | Archive timestamp \(ISO 8601\) |
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"a2a",
|
"a2a",
|
||||||
"ahrefs",
|
"ahrefs",
|
||||||
"airtable",
|
"airtable",
|
||||||
"airweave",
|
|
||||||
"apify",
|
"apify",
|
||||||
"apollo",
|
"apollo",
|
||||||
"arxiv",
|
"arxiv",
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ Write or update content in a Microsoft Teams chat
|
|||||||
| `createdTime` | string | Timestamp when message was created |
|
| `createdTime` | string | Timestamp when message was created |
|
||||||
| `url` | string | Web URL to the message |
|
| `url` | string | Web URL to the message |
|
||||||
| `updatedContent` | boolean | Whether content was successfully updated |
|
| `updatedContent` | boolean | Whether content was successfully updated |
|
||||||
| `files` | file[] | Files attached to the message |
|
|
||||||
|
|
||||||
### `microsoft_teams_read_channel`
|
### `microsoft_teams_read_channel`
|
||||||
|
|
||||||
@@ -133,7 +132,6 @@ Write or send a message to a Microsoft Teams channel
|
|||||||
| `createdTime` | string | Timestamp when message was created |
|
| `createdTime` | string | Timestamp when message was created |
|
||||||
| `url` | string | Web URL to the message |
|
| `url` | string | Web URL to the message |
|
||||||
| `updatedContent` | boolean | Whether content was successfully updated |
|
| `updatedContent` | boolean | Whether content was successfully updated |
|
||||||
| `files` | file[] | Files attached to the message |
|
|
||||||
|
|
||||||
### `microsoft_teams_update_chat_message`
|
### `microsoft_teams_update_chat_message`
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Extract text from PDF documents
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="mistral_parse_v3"
|
type="mistral_parse_v2"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -35,12 +35,13 @@ Integrate Mistral Parse into the workflow. Can extract text from uploaded PDF do
|
|||||||
|
|
||||||
### `mistral_parser`
|
### `mistral_parser`
|
||||||
|
|
||||||
|
Parse PDF documents using Mistral OCR API
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `filePath` | string | No | URL to a PDF document to be processed |
|
| `filePath` | string | Yes | URL to a PDF document to be processed |
|
||||||
| `file` | file | No | Document file to be processed |
|
|
||||||
| `fileUpload` | object | No | File upload data from file-upload component |
|
| `fileUpload` | object | No | File upload data from file-upload component |
|
||||||
| `resultType` | string | No | Type of parsed result \(markdown, text, or json\). Defaults to markdown. |
|
| `resultType` | string | No | Type of parsed result \(markdown, text, or json\). Defaults to markdown. |
|
||||||
| `includeImageBase64` | boolean | No | Include base64-encoded images in the response |
|
| `includeImageBase64` | boolean | No | Include base64-encoded images in the response |
|
||||||
@@ -54,8 +55,27 @@ Integrate Mistral Parse into the workflow. Can extract text from uploaded PDF do
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `pages` | array | Array of page objects from Mistral OCR |
|
| `pages` | array | Array of page objects from Mistral OCR |
|
||||||
| `model` | string | Mistral OCR model identifier |
|
| ↳ `index` | number | Page index \(zero-based\) |
|
||||||
| `usage_info` | json | Usage statistics from the API |
|
| ↳ `markdown` | string | Extracted markdown content |
|
||||||
| `document_annotation` | string | Structured annotation data |
|
| ↳ `images` | array | Images extracted from this page with bounding boxes |
|
||||||
|
| ↳ `id` | string | Image identifier \(e.g., img-0.jpeg\) |
|
||||||
|
| ↳ `top_left_x` | number | Top-left X coordinate in pixels |
|
||||||
|
| ↳ `top_left_y` | number | Top-left Y coordinate in pixels |
|
||||||
|
| ↳ `bottom_right_x` | number | Bottom-right X coordinate in pixels |
|
||||||
|
| ↳ `bottom_right_y` | number | Bottom-right Y coordinate in pixels |
|
||||||
|
| ↳ `image_base64` | string | Base64-encoded image data \(when include_image_base64=true\) |
|
||||||
|
| ↳ `dimensions` | object | Page dimensions |
|
||||||
|
| ↳ `dpi` | number | Dots per inch |
|
||||||
|
| ↳ `height` | number | Page height in pixels |
|
||||||
|
| ↳ `width` | number | Page width in pixels |
|
||||||
|
| ↳ `tables` | array | Extracted tables as HTML/markdown \(when table_format is set\). Referenced via placeholders like \[tbl-0.html\] |
|
||||||
|
| ↳ `hyperlinks` | array | Array of URL strings detected in the page \(e.g., \["https://...", "mailto:..."\]\) |
|
||||||
|
| ↳ `header` | string | Page header content \(when extract_header=true\) |
|
||||||
|
| ↳ `footer` | string | Page footer content \(when extract_footer=true\) |
|
||||||
|
| `model` | string | Mistral OCR model identifier \(e.g., mistral-ocr-latest\) |
|
||||||
|
| `usage_info` | object | Usage and processing statistics |
|
||||||
|
| ↳ `pages_processed` | number | Total number of pages processed |
|
||||||
|
| ↳ `doc_size_bytes` | number | Document file size in bytes |
|
||||||
|
| `document_annotation` | string | Structured annotation data as JSON string \(when applicable\) |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -113,26 +113,6 @@ Create a new page in Notion
|
|||||||
| `last_edited_time` | string | ISO 8601 last edit timestamp |
|
| `last_edited_time` | string | ISO 8601 last edit timestamp |
|
||||||
| `title` | string | Page title |
|
| `title` | string | Page title |
|
||||||
|
|
||||||
### `notion_update_page`
|
|
||||||
|
|
||||||
Update properties of a Notion page
|
|
||||||
|
|
||||||
#### Input
|
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
|
||||||
| --------- | ---- | -------- | ----------- |
|
|
||||||
| `pageId` | string | Yes | The UUID of the Notion page to update |
|
|
||||||
| `properties` | json | Yes | JSON object of properties to update |
|
|
||||||
|
|
||||||
#### Output
|
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
|
||||||
| --------- | ---- | ----------- |
|
|
||||||
| `id` | string | Page UUID |
|
|
||||||
| `url` | string | Notion page URL |
|
|
||||||
| `last_edited_time` | string | ISO 8601 last edit timestamp |
|
|
||||||
| `title` | string | Page title |
|
|
||||||
|
|
||||||
### `notion_query_database`
|
### `notion_query_database`
|
||||||
|
|
||||||
Query and filter Notion database entries with advanced filtering
|
Query and filter Notion database entries with advanced filtering
|
||||||
|
|||||||
@@ -152,7 +152,6 @@ Retrieve files from Pipedrive with optional filters
|
|||||||
| `person_id` | string | No | Filter files by person ID \(e.g., "456"\) |
|
| `person_id` | string | No | Filter files by person ID \(e.g., "456"\) |
|
||||||
| `org_id` | string | No | Filter files by organization ID \(e.g., "789"\) |
|
| `org_id` | string | No | Filter files by organization ID \(e.g., "789"\) |
|
||||||
| `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) |
|
| `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) |
|
||||||
| `downloadFiles` | boolean | No | Download file contents into file outputs |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
@@ -169,7 +168,6 @@ Retrieve files from Pipedrive with optional filters
|
|||||||
| ↳ `person_id` | number | Associated person ID |
|
| ↳ `person_id` | number | Associated person ID |
|
||||||
| ↳ `org_id` | number | Associated organization ID |
|
| ↳ `org_id` | number | Associated organization ID |
|
||||||
| ↳ `url` | string | File download URL |
|
| ↳ `url` | string | File download URL |
|
||||||
| `downloadedFiles` | file[] | Downloaded files from Pipedrive |
|
|
||||||
| `total_items` | number | Total number of files returned |
|
| `total_items` | number | Total number of files returned |
|
||||||
| `success` | boolean | Operation success status |
|
| `success` | boolean | Operation success status |
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Extract text from documents using Pulse OCR
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="pulse_v2"
|
type="pulse"
|
||||||
color="#E0E0E0"
|
color="#E0E0E0"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ If you need accurate, scalable, and developer-friendly document parsing capabili
|
|||||||
|
|
||||||
## Usage Instructions
|
## Usage Instructions
|
||||||
|
|
||||||
Integrate Pulse into the workflow. Extract text from PDF documents, images, and Office files via upload or file references.
|
Integrate Pulse into the workflow. Extract text from PDF documents, images, and Office files via URL or upload.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -39,12 +39,13 @@ Integrate Pulse into the workflow. Extract text from PDF documents, images, and
|
|||||||
|
|
||||||
### `pulse_parser`
|
### `pulse_parser`
|
||||||
|
|
||||||
|
Parse documents (PDF, images, Office docs) using Pulse OCR API
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `filePath` | string | No | URL to a document to be processed |
|
| `filePath` | string | Yes | URL to a document to be processed |
|
||||||
| `file` | file | No | Document file to be processed |
|
|
||||||
| `fileUpload` | object | No | File upload data from file-upload component |
|
| `fileUpload` | object | No | File upload data from file-upload component |
|
||||||
| `pages` | string | No | Page range to process \(1-indexed, e.g., "1-2,5"\) |
|
| `pages` | string | No | Page range to process \(1-indexed, e.g., "1-2,5"\) |
|
||||||
| `extractFigure` | boolean | No | Enable figure extraction from the document |
|
| `extractFigure` | boolean | No | Enable figure extraction from the document |
|
||||||
@@ -56,6 +57,16 @@ Integrate Pulse into the workflow. Extract text from PDF documents, images, and
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `markdown` | string | Extracted content in markdown format |
|
||||||
|
| `page_count` | number | Number of pages in the document |
|
||||||
|
| `job_id` | string | Unique job identifier |
|
||||||
|
| `bounding_boxes` | json | Bounding box layout information |
|
||||||
|
| `extraction_url` | string | URL for extraction results \(for large documents\) |
|
||||||
|
| `html` | string | HTML content if requested |
|
||||||
|
| `structured_output` | json | Structured output if schema was provided |
|
||||||
|
| `chunks` | json | Chunked content if chunking was enabled |
|
||||||
|
| `figures` | json | Extracted figures if figure extraction was enabled |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Extract text from PDF documents
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="reducto_v2"
|
type="reducto"
|
||||||
color="#5c0c5c"
|
color="#5c0c5c"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ Looking for reliable and scalable PDF parsing? Reducto is optimized for develope
|
|||||||
|
|
||||||
## Usage Instructions
|
## Usage Instructions
|
||||||
|
|
||||||
Integrate Reducto Parse into the workflow. Can extract text from uploaded PDF documents or file references.
|
Integrate Reducto Parse into the workflow. Can extract text from uploaded PDF documents, or from a URL.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -37,12 +37,13 @@ Integrate Reducto Parse into the workflow. Can extract text from uploaded PDF do
|
|||||||
|
|
||||||
### `reducto_parser`
|
### `reducto_parser`
|
||||||
|
|
||||||
|
Parse PDF documents using Reducto OCR API
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
| --------- | ---- | -------- | ----------- |
|
| --------- | ---- | -------- | ----------- |
|
||||||
| `filePath` | string | No | URL to a PDF document to be processed |
|
| `filePath` | string | Yes | URL to a PDF document to be processed |
|
||||||
| `file` | file | No | Document file to be processed |
|
|
||||||
| `fileUpload` | object | No | File upload data from file-upload component |
|
| `fileUpload` | object | No | File upload data from file-upload component |
|
||||||
| `pages` | array | No | Specific pages to process \(1-indexed page numbers\) |
|
| `pages` | array | No | Specific pages to process \(1-indexed page numbers\) |
|
||||||
| `tableOutputFormat` | string | No | Table output format \(html or markdown\). Defaults to markdown. |
|
| `tableOutputFormat` | string | No | Table output format \(html or markdown\). Defaults to markdown. |
|
||||||
@@ -50,6 +51,13 @@ Integrate Reducto Parse into the workflow. Can extract text from uploaded PDF do
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `job_id` | string | Unique identifier for the processing job |
|
||||||
|
| `duration` | number | Processing time in seconds |
|
||||||
|
| `usage` | json | Resource consumption data |
|
||||||
|
| `result` | json | Parsed document content with chunks and blocks |
|
||||||
|
| `pdf_url` | string | Storage URL of converted PDF |
|
||||||
|
| `studio_link` | string | Link to Reducto studio interface |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ Retrieve an object from an AWS S3 bucket
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `url` | string | Pre-signed URL for downloading the S3 object |
|
| `url` | string | Pre-signed URL for downloading the S3 object |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
|
||||||
| `metadata` | object | File metadata including type, size, name, and last modified date |
|
| `metadata` | object | File metadata including type, size, name, and last modified date |
|
||||||
|
|
||||||
### `s3_list_objects`
|
### `s3_list_objects`
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ Send an email using SendGrid API
|
|||||||
| `bcc` | string | No | BCC email address |
|
| `bcc` | string | No | BCC email address |
|
||||||
| `replyTo` | string | No | Reply-to email address |
|
| `replyTo` | string | No | Reply-to email address |
|
||||||
| `replyToName` | string | No | Reply-to name |
|
| `replyToName` | string | No | Reply-to name |
|
||||||
| `attachments` | file[] | No | Files to attach to the email \(UserFile objects\) |
|
| `attachments` | file[] | No | Files to attach to the email as an array of attachment objects |
|
||||||
| `templateId` | string | No | SendGrid template ID to use |
|
| `templateId` | string | No | SendGrid template ID to use |
|
||||||
| `dynamicTemplateData` | json | No | JSON object of dynamic template data |
|
| `dynamicTemplateData` | json | No | JSON object of dynamic template data |
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ Download a file from a remote SFTP server
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `success` | boolean | Whether the download was successful |
|
| `success` | boolean | Whether the download was successful |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
|
||||||
| `fileName` | string | Name of the downloaded file |
|
| `fileName` | string | Name of the downloaded file |
|
||||||
| `content` | string | File content \(text or base64 encoded\) |
|
| `content` | string | File content \(text or base64 encoded\) |
|
||||||
| `size` | number | File size in bytes |
|
| `size` | number | File size in bytes |
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ Send messages to Slack channels or direct messages. Supports Slack mrkdwn format
|
|||||||
| `ts` | string | Message timestamp |
|
| `ts` | string | Message timestamp |
|
||||||
| `channel` | string | Channel ID where message was sent |
|
| `channel` | string | Channel ID where message was sent |
|
||||||
| `fileCount` | number | Number of files uploaded \(when files are attached\) |
|
| `fileCount` | number | Number of files uploaded \(when files are attached\) |
|
||||||
| `files` | file[] | Files attached to the message |
|
|
||||||
|
|
||||||
### `slack_canvas`
|
### `slack_canvas`
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ Download a file from a remote SSH server
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `downloaded` | boolean | Whether the file was downloaded successfully |
|
| `downloaded` | boolean | Whether the file was downloaded successfully |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
|
||||||
| `fileContent` | string | File content \(base64 encoded for binary files\) |
|
| `fileContent` | string | File content \(base64 encoded for binary files\) |
|
||||||
| `fileName` | string | Name of the downloaded file |
|
| `fileName` | string | Name of the downloaded file |
|
||||||
| `remotePath` | string | Source path on the remote server |
|
| `remotePath` | string | Source path on the remote server |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Convert speech to text using AI
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="stt_v2"
|
type="stt"
|
||||||
color="#181C1E"
|
color="#181C1E"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -50,6 +50,8 @@ Transcribe audio and video files to text using leading AI providers. Supports mu
|
|||||||
|
|
||||||
### `stt_whisper`
|
### `stt_whisper`
|
||||||
|
|
||||||
|
Transcribe audio to text using OpenAI Whisper
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -69,10 +71,22 @@ Transcribe audio and video files to text using leading AI providers. Supports mu
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `transcript` | string | Full transcribed text |
|
||||||
|
| `segments` | array | Timestamped segments |
|
||||||
|
| ↳ `text` | string | Transcribed text for this segment |
|
||||||
|
| ↳ `start` | number | Start time in seconds |
|
||||||
|
| ↳ `end` | number | End time in seconds |
|
||||||
|
| ↳ `speaker` | string | Speaker identifier \(if diarization enabled\) |
|
||||||
|
| ↳ `confidence` | number | Confidence score \(0-1\) |
|
||||||
|
| `language` | string | Detected or specified language |
|
||||||
|
| `duration` | number | Audio duration in seconds |
|
||||||
|
|
||||||
### `stt_deepgram`
|
### `stt_deepgram`
|
||||||
|
|
||||||
|
Transcribe audio to text using Deepgram
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -89,10 +103,23 @@ This tool does not produce any outputs.
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `transcript` | string | Full transcribed text |
|
||||||
|
| `segments` | array | Timestamped segments with speaker labels |
|
||||||
|
| ↳ `text` | string | Transcribed text for this segment |
|
||||||
|
| ↳ `start` | number | Start time in seconds |
|
||||||
|
| ↳ `end` | number | End time in seconds |
|
||||||
|
| ↳ `speaker` | string | Speaker identifier \(if diarization enabled\) |
|
||||||
|
| ↳ `confidence` | number | Confidence score \(0-1\) |
|
||||||
|
| `language` | string | Detected or specified language |
|
||||||
|
| `duration` | number | Audio duration in seconds |
|
||||||
|
| `confidence` | number | Overall confidence score |
|
||||||
|
|
||||||
### `stt_elevenlabs`
|
### `stt_elevenlabs`
|
||||||
|
|
||||||
|
Transcribe audio to text using ElevenLabs
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -108,10 +135,18 @@ This tool does not produce any outputs.
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `transcript` | string | Full transcribed text |
|
||||||
|
| `segments` | array | Timestamped segments |
|
||||||
|
| `language` | string | Detected or specified language |
|
||||||
|
| `duration` | number | Audio duration in seconds |
|
||||||
|
| `confidence` | number | Overall confidence score |
|
||||||
|
|
||||||
### `stt_assemblyai`
|
### `stt_assemblyai`
|
||||||
|
|
||||||
|
Transcribe audio to text using AssemblyAI with advanced NLP features
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -132,10 +167,35 @@ This tool does not produce any outputs.
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `transcript` | string | Full transcribed text |
|
||||||
|
| `segments` | array | Timestamped segments with speaker labels |
|
||||||
|
| ↳ `text` | string | Transcribed text for this segment |
|
||||||
|
| ↳ `start` | number | Start time in seconds |
|
||||||
|
| ↳ `end` | number | End time in seconds |
|
||||||
|
| ↳ `speaker` | string | Speaker identifier \(if diarization enabled\) |
|
||||||
|
| ↳ `confidence` | number | Confidence score \(0-1\) |
|
||||||
|
| `language` | string | Detected or specified language |
|
||||||
|
| `duration` | number | Audio duration in seconds |
|
||||||
|
| `confidence` | number | Overall confidence score |
|
||||||
|
| `sentiment` | array | Sentiment analysis results |
|
||||||
|
| ↳ `text` | string | Text that was analyzed |
|
||||||
|
| ↳ `sentiment` | string | Sentiment \(POSITIVE, NEGATIVE, NEUTRAL\) |
|
||||||
|
| ↳ `confidence` | number | Confidence score |
|
||||||
|
| ↳ `start` | number | Start time in milliseconds |
|
||||||
|
| ↳ `end` | number | End time in milliseconds |
|
||||||
|
| `entities` | array | Detected entities |
|
||||||
|
| ↳ `entity_type` | string | Entity type \(e.g., person_name, location, organization\) |
|
||||||
|
| ↳ `text` | string | Entity text |
|
||||||
|
| ↳ `start` | number | Start time in milliseconds |
|
||||||
|
| ↳ `end` | number | End time in milliseconds |
|
||||||
|
| `summary` | string | Auto-generated summary |
|
||||||
|
|
||||||
### `stt_gemini`
|
### `stt_gemini`
|
||||||
|
|
||||||
|
Transcribe audio to text using Google Gemini with multimodal capabilities
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -151,6 +211,12 @@ This tool does not produce any outputs.
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `transcript` | string | Full transcribed text |
|
||||||
|
| `segments` | array | Timestamped segments |
|
||||||
|
| `language` | string | Detected or specified language |
|
||||||
|
| `duration` | number | Audio duration in seconds |
|
||||||
|
| `confidence` | number | Overall confidence score |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -354,7 +354,6 @@ Send documents (PDF, ZIP, DOC, etc.) to Telegram channels or users through the T
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `message` | string | Success or error message |
|
| `message` | string | Success or error message |
|
||||||
| `files` | file[] | Files attached to the message |
|
|
||||||
| `data` | object | Telegram message data including document |
|
| `data` | object | Telegram message data including document |
|
||||||
| ↳ `message_id` | number | Unique Telegram message identifier |
|
| ↳ `message_id` | number | Unique Telegram message identifier |
|
||||||
| ↳ `from` | object | Information about the sender |
|
| ↳ `from` | object | Information about the sender |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Extract text, tables, and forms from documents
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="textract_v2"
|
type="textract"
|
||||||
color="linear-gradient(135deg, #055F4E 0%, #56C0A7 100%)"
|
color="linear-gradient(135deg, #055F4E 0%, #56C0A7 100%)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -35,6 +35,8 @@ Integrate AWS Textract into your workflow to extract text, tables, forms, and ke
|
|||||||
|
|
||||||
### `textract_parser`
|
### `textract_parser`
|
||||||
|
|
||||||
|
Parse documents using AWS Textract OCR and document analysis
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -44,8 +46,8 @@ Integrate AWS Textract into your workflow to extract text, tables, forms, and ke
|
|||||||
| `region` | string | Yes | AWS region for Textract service \(e.g., us-east-1\) |
|
| `region` | string | Yes | AWS region for Textract service \(e.g., us-east-1\) |
|
||||||
| `processingMode` | string | No | Document type: single-page or multi-page. Defaults to single-page. |
|
| `processingMode` | string | No | Document type: single-page or multi-page. Defaults to single-page. |
|
||||||
| `filePath` | string | No | URL to a document to be processed \(JPEG, PNG, or single-page PDF\). |
|
| `filePath` | string | No | URL to a document to be processed \(JPEG, PNG, or single-page PDF\). |
|
||||||
| `file` | file | No | Document file to be processed \(JPEG, PNG, or single-page PDF\). |
|
|
||||||
| `s3Uri` | string | No | S3 URI for multi-page processing \(s3://bucket/key\). |
|
| `s3Uri` | string | No | S3 URI for multi-page processing \(s3://bucket/key\). |
|
||||||
|
| `fileUpload` | object | No | File upload data from file-upload component |
|
||||||
| `featureTypes` | array | No | Feature types to detect: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT. If not specified, only text detection is performed. |
|
| `featureTypes` | array | No | Feature types to detect: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT. If not specified, only text detection is performed. |
|
||||||
| `items` | string | No | Feature type |
|
| `items` | string | No | Feature type |
|
||||||
| `queries` | array | No | Custom queries to extract specific information. Only used when featureTypes includes QUERIES. |
|
| `queries` | array | No | Custom queries to extract specific information. Only used when featureTypes includes QUERIES. |
|
||||||
@@ -56,6 +58,39 @@ Integrate AWS Textract into your workflow to extract text, tables, forms, and ke
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `blocks` | array | Array of Block objects containing detected text, tables, forms, and other elements |
|
||||||
|
| ↳ `BlockType` | string | Type of block \(PAGE, LINE, WORD, TABLE, CELL, KEY_VALUE_SET, etc.\) |
|
||||||
|
| ↳ `Id` | string | Unique identifier for the block |
|
||||||
|
| ↳ `Text` | string | The text content \(for LINE and WORD blocks\) |
|
||||||
|
| ↳ `TextType` | string | Type of text \(PRINTED or HANDWRITING\) |
|
||||||
|
| ↳ `Confidence` | number | Confidence score \(0-100\) |
|
||||||
|
| ↳ `Page` | number | Page number |
|
||||||
|
| ↳ `Geometry` | object | Location and bounding box information |
|
||||||
|
| ↳ `BoundingBox` | object | Height as ratio of document height |
|
||||||
|
| ↳ `Height` | number | Height as ratio of document height |
|
||||||
|
| ↳ `Left` | number | Left position as ratio of document width |
|
||||||
|
| ↳ `Top` | number | Top position as ratio of document height |
|
||||||
|
| ↳ `Width` | number | Width as ratio of document width |
|
||||||
|
| ↳ `Polygon` | array | Polygon coordinates |
|
||||||
|
| ↳ `X` | number | X coordinate |
|
||||||
|
| ↳ `Y` | number | Y coordinate |
|
||||||
|
| ↳ `Relationships` | array | Relationships to other blocks |
|
||||||
|
| ↳ `Type` | string | Relationship type \(CHILD, VALUE, ANSWER, etc.\) |
|
||||||
|
| ↳ `Ids` | array | IDs of related blocks |
|
||||||
|
| ↳ `EntityTypes` | array | Entity types for KEY_VALUE_SET \(KEY or VALUE\) |
|
||||||
|
| ↳ `SelectionStatus` | string | For checkboxes: SELECTED or NOT_SELECTED |
|
||||||
|
| ↳ `RowIndex` | number | Row index for table cells |
|
||||||
|
| ↳ `ColumnIndex` | number | Column index for table cells |
|
||||||
|
| ↳ `RowSpan` | number | Row span for merged cells |
|
||||||
|
| ↳ `ColumnSpan` | number | Column span for merged cells |
|
||||||
|
| ↳ `Query` | object | Query information for QUERY blocks |
|
||||||
|
| ↳ `Text` | string | Query text |
|
||||||
|
| ↳ `Alias` | string | Query alias |
|
||||||
|
| ↳ `Pages` | array | Pages to search |
|
||||||
|
| `documentMetadata` | object | Metadata about the analyzed document |
|
||||||
|
| ↳ `pages` | number | Number of pages in the document |
|
||||||
|
| `modelVersion` | string | Version of the Textract model used for processing |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ Retrieve call recording information and transcription (if enabled via TwiML).
|
|||||||
| `channels` | number | Number of channels \(1 for mono, 2 for dual\) |
|
| `channels` | number | Number of channels \(1 for mono, 2 for dual\) |
|
||||||
| `source` | string | How the recording was created |
|
| `source` | string | How the recording was created |
|
||||||
| `mediaUrl` | string | URL to download the recording media file |
|
| `mediaUrl` | string | URL to download the recording media file |
|
||||||
| `file` | file | Downloaded recording media file |
|
|
||||||
| `price` | string | Cost of the recording |
|
| `price` | string | Cost of the recording |
|
||||||
| `priceUnit` | string | Currency of the price |
|
| `priceUnit` | string | Currency of the price |
|
||||||
| `uri` | string | Relative URI of the recording resource |
|
| `uri` | string | Relative URI of the recording resource |
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ Download files uploaded in Typeform responses
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `fileUrl` | string | Direct download URL for the uploaded file |
|
| `fileUrl` | string | Direct download URL for the uploaded file |
|
||||||
| `file` | file | Downloaded file stored in execution files |
|
|
||||||
| `contentType` | string | MIME type of the uploaded file |
|
| `contentType` | string | MIME type of the uploaded file |
|
||||||
| `filename` | string | Original filename of the uploaded file |
|
| `filename` | string | Original filename of the uploaded file |
|
||||||
|
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ Generate videos using Runway Gen-4 with world consistency and visual references
|
|||||||
| `duration` | number | No | Video duration in seconds \(5 or 10, default: 5\) |
|
| `duration` | number | No | Video duration in seconds \(5 or 10, default: 5\) |
|
||||||
| `aspectRatio` | string | No | Aspect ratio: 16:9 \(landscape\), 9:16 \(portrait\), or 1:1 \(square\) |
|
| `aspectRatio` | string | No | Aspect ratio: 16:9 \(landscape\), 9:16 \(portrait\), or 1:1 \(square\) |
|
||||||
| `resolution` | string | No | Video resolution \(720p output\). Note: Gen-4 Turbo outputs at 720p natively |
|
| `resolution` | string | No | Video resolution \(720p output\). Note: Gen-4 Turbo outputs at 720p natively |
|
||||||
| `visualReference` | file | Yes | Reference image REQUIRED for Gen-4 \(UserFile object\). Gen-4 only supports image-to-video, not text-only generation |
|
| `visualReference` | json | Yes | Reference image REQUIRED for Gen-4 \(UserFile object\). Gen-4 only supports image-to-video, not text-only generation |
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `videoUrl` | string | Generated video URL |
|
| `videoUrl` | string | Generated video URL |
|
||||||
| `videoFile` | file | Video file object with metadata |
|
| `videoFile` | json | Video file object with metadata |
|
||||||
| `duration` | number | Video duration in seconds |
|
| `duration` | number | Video duration in seconds |
|
||||||
| `width` | number | Video width in pixels |
|
| `width` | number | Video width in pixels |
|
||||||
| `height` | number | Video height in pixels |
|
| `height` | number | Video height in pixels |
|
||||||
@@ -93,7 +93,7 @@ Generate videos using Google Veo 3/3.1 with native audio generation
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `videoUrl` | string | Generated video URL |
|
| `videoUrl` | string | Generated video URL |
|
||||||
| `videoFile` | file | Video file object with metadata |
|
| `videoFile` | json | Video file object with metadata |
|
||||||
| `duration` | number | Video duration in seconds |
|
| `duration` | number | Video duration in seconds |
|
||||||
| `width` | number | Video width in pixels |
|
| `width` | number | Video width in pixels |
|
||||||
| `height` | number | Video height in pixels |
|
| `height` | number | Video height in pixels |
|
||||||
@@ -123,7 +123,7 @@ Generate videos using Luma Dream Machine with advanced camera controls
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `videoUrl` | string | Generated video URL |
|
| `videoUrl` | string | Generated video URL |
|
||||||
| `videoFile` | file | Video file object with metadata |
|
| `videoFile` | json | Video file object with metadata |
|
||||||
| `duration` | number | Video duration in seconds |
|
| `duration` | number | Video duration in seconds |
|
||||||
| `width` | number | Video width in pixels |
|
| `width` | number | Video width in pixels |
|
||||||
| `height` | number | Video height in pixels |
|
| `height` | number | Video height in pixels |
|
||||||
@@ -151,7 +151,7 @@ Generate videos using MiniMax Hailuo through MiniMax Platform API with advanced
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `videoUrl` | string | Generated video URL |
|
| `videoUrl` | string | Generated video URL |
|
||||||
| `videoFile` | file | Video file object with metadata |
|
| `videoFile` | json | Video file object with metadata |
|
||||||
| `duration` | number | Video duration in seconds |
|
| `duration` | number | Video duration in seconds |
|
||||||
| `width` | number | Video width in pixels |
|
| `width` | number | Video width in pixels |
|
||||||
| `height` | number | Video height in pixels |
|
| `height` | number | Video height in pixels |
|
||||||
@@ -181,7 +181,7 @@ Generate videos using Fal.ai platform with access to multiple models including V
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --------- | ---- | ----------- |
|
| --------- | ---- | ----------- |
|
||||||
| `videoUrl` | string | Generated video URL |
|
| `videoUrl` | string | Generated video URL |
|
||||||
| `videoFile` | file | Video file object with metadata |
|
| `videoFile` | json | Video file object with metadata |
|
||||||
| `duration` | number | Video duration in seconds |
|
| `duration` | number | Video duration in seconds |
|
||||||
| `width` | number | Video width in pixels |
|
| `width` | number | Video width in pixels |
|
||||||
| `height` | number | Video height in pixels |
|
| `height` | number | Video height in pixels |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Analyze images with vision models
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="vision_v2"
|
type="vision"
|
||||||
color="#4D5FFF"
|
color="#4D5FFF"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -35,6 +35,8 @@ Integrate Vision into the workflow. Can analyze images with vision models.
|
|||||||
|
|
||||||
### `vision_tool`
|
### `vision_tool`
|
||||||
|
|
||||||
|
Process and analyze images using advanced vision models. Capable of understanding image content, extracting text, identifying objects, and providing detailed visual descriptions.
|
||||||
|
|
||||||
#### Input
|
#### Input
|
||||||
|
|
||||||
| Parameter | Type | Required | Description |
|
| Parameter | Type | Required | Description |
|
||||||
@@ -47,6 +49,14 @@ Integrate Vision into the workflow. Can analyze images with vision models.
|
|||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
This tool does not produce any outputs.
|
| Parameter | Type | Description |
|
||||||
|
| --------- | ---- | ----------- |
|
||||||
|
| `content` | string | The analyzed content and description of the image |
|
||||||
|
| `model` | string | The vision model that was used for analysis |
|
||||||
|
| `tokens` | number | Total tokens used for the analysis |
|
||||||
|
| `usage` | object | Detailed token usage breakdown |
|
||||||
|
| ↳ `input_tokens` | number | Tokens used for input processing |
|
||||||
|
| ↳ `output_tokens` | number | Tokens used for response generation |
|
||||||
|
| ↳ `total_tokens` | number | Total tokens consumed |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ Get all recordings for a specific Zoom meeting
|
|||||||
| `meetingId` | string | Yes | The meeting ID or meeting UUID \(e.g., "1234567890" or "4444AAABBBccccc12345=="\) |
|
| `meetingId` | string | Yes | The meeting ID or meeting UUID \(e.g., "1234567890" or "4444AAABBBccccc12345=="\) |
|
||||||
| `includeFolderItems` | boolean | No | Include items within a folder |
|
| `includeFolderItems` | boolean | No | Include items within a folder |
|
||||||
| `ttl` | number | No | Time to live for download URLs in seconds \(max 604800\) |
|
| `ttl` | number | No | Time to live for download URLs in seconds \(max 604800\) |
|
||||||
| `downloadFiles` | boolean | No | Download recording files into file outputs |
|
|
||||||
|
|
||||||
#### Output
|
#### Output
|
||||||
|
|
||||||
@@ -365,7 +364,6 @@ Get all recordings for a specific Zoom meeting
|
|||||||
| ↳ `download_url` | string | URL to download the recording |
|
| ↳ `download_url` | string | URL to download the recording |
|
||||||
| ↳ `status` | string | Recording status |
|
| ↳ `status` | string | Recording status |
|
||||||
| ↳ `recording_type` | string | Type of recording \(shared_screen, audio_only, etc.\) |
|
| ↳ `recording_type` | string | Type of recording \(shared_screen, audio_only, etc.\) |
|
||||||
| `files` | file[] | Downloaded recording files |
|
|
||||||
|
|
||||||
### `zoom_delete_recording`
|
### `zoom_delete_recording`
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Leer y analizar múltiples archivos
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="file_v3"
|
type="file"
|
||||||
color="#40916C"
|
color="#40916C"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Interactúa con transcripciones y grabaciones de reuniones de Firef
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="fireflies_v2"
|
type="fireflies"
|
||||||
color="#100730"
|
color="#100730"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Extraer texto de documentos PDF
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="mistral_parse_v3"
|
type="mistral_parse"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Lire et analyser plusieurs fichiers
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="file_v3"
|
type="file"
|
||||||
color="#40916C"
|
color="#40916C"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ description: Interagissez avec les transcriptions et enregistrements de réunion
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="fireflies_v2"
|
type="fireflies"
|
||||||
color="#100730"
|
color="#100730"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Extraire du texte à partir de documents PDF
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="mistral_parse_v3"
|
type="mistral_parse"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: 複数のファイルを読み込んで解析する
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="file_v3"
|
type="file"
|
||||||
color="#40916C"
|
color="#40916C"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: Fireflies.aiの会議文字起こしと録画を操作
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="fireflies_v2"
|
type="fireflies"
|
||||||
color="#100730"
|
color="#100730"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: PDFドキュメントからテキストを抽出する
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="mistral_parse_v3"
|
type="mistral_parse"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: 读取并解析多个文件
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="file_v3"
|
type="file"
|
||||||
color="#40916C"
|
color="#40916C"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: 与 Fireflies.ai 会议转录和录音进行交互
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="fireflies_v2"
|
type="fireflies"
|
||||||
color="#100730"
|
color="#100730"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ description: 从 PDF 文档中提取文本
|
|||||||
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
import { BlockInfoCard } from "@/components/ui/block-info-card"
|
||||||
|
|
||||||
<BlockInfoCard
|
<BlockInfoCard
|
||||||
type="mistral_parse_v3"
|
type="mistral_parse"
|
||||||
color="#000000"
|
color="#000000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
|
import { useBrandConfig } from '@/lib/branding/branding'
|
||||||
import { inter } from '@/app/_styles/fonts/inter/inter'
|
import { inter } from '@/app/_styles/fonts/inter/inter'
|
||||||
import { useBrandConfig } from '@/ee/whitelabeling'
|
|
||||||
|
|
||||||
export interface SupportFooterProps {
|
export interface SupportFooterProps {
|
||||||
/** Position style - 'fixed' for pages without AuthLayout, 'absolute' for pages with AuthLayout */
|
/** Position style - 'fixed' for pages without AuthLayout, 'absolute' for pages with AuthLayout */
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import Image from 'next/image'
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { GithubIcon } from '@/components/icons'
|
import { GithubIcon } from '@/components/icons'
|
||||||
|
import { useBrandConfig } from '@/lib/branding/branding'
|
||||||
import { isHosted } from '@/lib/core/config/feature-flags'
|
import { isHosted } from '@/lib/core/config/feature-flags'
|
||||||
import { soehne } from '@/app/_styles/fonts/soehne/soehne'
|
import { soehne } from '@/app/_styles/fonts/soehne/soehne'
|
||||||
import { getFormattedGitHubStars } from '@/app/(landing)/actions/github'
|
import { getFormattedGitHubStars } from '@/app/(landing)/actions/github'
|
||||||
import { useBrandConfig } from '@/ee/whitelabeling'
|
|
||||||
import { useBrandedButtonClass } from '@/hooks/use-branded-button-class'
|
import { useBrandedButtonClass } from '@/hooks/use-branded-button-class'
|
||||||
|
|
||||||
const logger = createLogger('nav')
|
const logger = createLogger('nav')
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpAuthorizationServerMetadataResponse(request)
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpAuthorizationServerMetadataResponse(request)
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpAuthorizationServerMetadataResponse(request)
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpProtectedResourceMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpProtectedResourceMetadataResponse(request)
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpProtectedResourceMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpProtectedResourceMetadataResponse(request)
|
|
||||||
}
|
|
||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
parseWorkflowSSEChunk,
|
parseWorkflowSSEChunk,
|
||||||
} from '@/lib/a2a/utils'
|
} from '@/lib/a2a/utils'
|
||||||
import { checkHybridAuth } from '@/lib/auth/hybrid'
|
import { checkHybridAuth } from '@/lib/auth/hybrid'
|
||||||
|
import { getBrandConfig } from '@/lib/branding/branding'
|
||||||
import { acquireLock, getRedisClient, releaseLock } from '@/lib/core/config/redis'
|
import { acquireLock, getRedisClient, releaseLock } from '@/lib/core/config/redis'
|
||||||
import { validateUrlWithDNS } from '@/lib/core/security/input-validation.server'
|
import { validateUrlWithDNS } from '@/lib/core/security/input-validation.server'
|
||||||
import { SSE_HEADERS } from '@/lib/core/utils/sse'
|
import { SSE_HEADERS } from '@/lib/core/utils/sse'
|
||||||
@@ -34,7 +35,6 @@ import {
|
|||||||
type PushNotificationSetParams,
|
type PushNotificationSetParams,
|
||||||
type TaskIdParams,
|
type TaskIdParams,
|
||||||
} from '@/app/api/a2a/serve/[agentId]/utils'
|
} from '@/app/api/a2a/serve/[agentId]/utils'
|
||||||
import { getBrandConfig } from '@/ee/whitelabeling'
|
|
||||||
|
|
||||||
const logger = createLogger('A2AServeAPI')
|
const logger = createLogger('A2AServeAPI')
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ const UpdateCostSchema = z.object({
|
|||||||
model: z.string().min(1, 'Model is required'),
|
model: z.string().min(1, 'Model is required'),
|
||||||
inputTokens: z.number().min(0).default(0),
|
inputTokens: z.number().min(0).default(0),
|
||||||
outputTokens: z.number().min(0).default(0),
|
outputTokens: z.number().min(0).default(0),
|
||||||
source: z.enum(['copilot', 'mcp_copilot']).default('copilot'),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,14 +75,12 @@ export async function POST(req: NextRequest) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const { userId, cost, model, inputTokens, outputTokens, source } = validation.data
|
const { userId, cost, model, inputTokens, outputTokens } = validation.data
|
||||||
const isMcp = source === 'mcp_copilot'
|
|
||||||
|
|
||||||
logger.info(`[${requestId}] Processing cost update`, {
|
logger.info(`[${requestId}] Processing cost update`, {
|
||||||
userId,
|
userId,
|
||||||
cost,
|
cost,
|
||||||
model,
|
model,
|
||||||
source,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Check if user stats record exists (same as ExecutionLogger)
|
// Check if user stats record exists (same as ExecutionLogger)
|
||||||
@@ -99,7 +96,7 @@ export async function POST(req: NextRequest) {
|
|||||||
return NextResponse.json({ error: 'User stats record not found' }, { status: 500 })
|
return NextResponse.json({ error: 'User stats record not found' }, { status: 500 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateFields: Record<string, unknown> = {
|
const updateFields = {
|
||||||
totalCost: sql`total_cost + ${cost}`,
|
totalCost: sql`total_cost + ${cost}`,
|
||||||
currentPeriodCost: sql`current_period_cost + ${cost}`,
|
currentPeriodCost: sql`current_period_cost + ${cost}`,
|
||||||
totalCopilotCost: sql`total_copilot_cost + ${cost}`,
|
totalCopilotCost: sql`total_copilot_cost + ${cost}`,
|
||||||
@@ -108,24 +105,17 @@ export async function POST(req: NextRequest) {
|
|||||||
lastActive: new Date(),
|
lastActive: new Date(),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also increment MCP-specific counters when source is mcp_copilot
|
|
||||||
if (isMcp) {
|
|
||||||
updateFields.totalMcpCopilotCost = sql`total_mcp_copilot_cost + ${cost}`
|
|
||||||
updateFields.currentPeriodMcpCopilotCost = sql`current_period_mcp_copilot_cost + ${cost}`
|
|
||||||
}
|
|
||||||
|
|
||||||
await db.update(userStats).set(updateFields).where(eq(userStats.userId, userId))
|
await db.update(userStats).set(updateFields).where(eq(userStats.userId, userId))
|
||||||
|
|
||||||
logger.info(`[${requestId}] Updated user stats record`, {
|
logger.info(`[${requestId}] Updated user stats record`, {
|
||||||
userId,
|
userId,
|
||||||
addedCost: cost,
|
addedCost: cost,
|
||||||
source,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Log usage for complete audit trail
|
// Log usage for complete audit trail
|
||||||
await logModelUsage({
|
await logModelUsage({
|
||||||
userId,
|
userId,
|
||||||
source: isMcp ? 'mcp_copilot' : 'copilot',
|
source: 'copilot',
|
||||||
model,
|
model,
|
||||||
inputTokens,
|
inputTokens,
|
||||||
outputTokens,
|
outputTokens,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { getSession } from '@/lib/auth'
|
import { getSession } from '@/lib/auth'
|
||||||
import { SIM_AGENT_API_URL } from '@/lib/copilot/constants'
|
import { SIM_AGENT_API_URL_DEFAULT } from '@/lib/copilot/constants'
|
||||||
import { env } from '@/lib/core/config/env'
|
import { env } from '@/lib/core/config/env'
|
||||||
|
|
||||||
const GenerateApiKeySchema = z.object({
|
const GenerateApiKeySchema = z.object({
|
||||||
@@ -17,6 +17,9 @@ export async function POST(req: NextRequest) {
|
|||||||
|
|
||||||
const userId = session.user.id
|
const userId = session.user.id
|
||||||
|
|
||||||
|
// Move environment variable access inside the function
|
||||||
|
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
|
||||||
|
|
||||||
const body = await req.json().catch(() => ({}))
|
const body = await req.json().catch(() => ({}))
|
||||||
const validationResult = GenerateApiKeySchema.safeParse(body)
|
const validationResult = GenerateApiKeySchema.safeParse(body)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
import { getSession } from '@/lib/auth'
|
import { getSession } from '@/lib/auth'
|
||||||
import { SIM_AGENT_API_URL } from '@/lib/copilot/constants'
|
import { SIM_AGENT_API_URL_DEFAULT } from '@/lib/copilot/constants'
|
||||||
import { env } from '@/lib/core/config/env'
|
import { env } from '@/lib/core/config/env'
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
@@ -12,6 +12,8 @@ export async function GET(request: NextRequest) {
|
|||||||
|
|
||||||
const userId = session.user.id
|
const userId = session.user.id
|
||||||
|
|
||||||
|
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
|
||||||
|
|
||||||
const res = await fetch(`${SIM_AGENT_API_URL}/api/validate-key/get-api-keys`, {
|
const res = await fetch(`${SIM_AGENT_API_URL}/api/validate-key/get-api-keys`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -66,6 +68,8 @@ export async function DELETE(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: 'id is required' }, { status: 400 })
|
return NextResponse.json({ error: 'id is required' }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
|
||||||
|
|
||||||
const res = await fetch(`${SIM_AGENT_API_URL}/api/validate-key/delete`, {
|
const res = await fetch(`${SIM_AGENT_API_URL}/api/validate-key/delete`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ import { and, desc, eq } from 'drizzle-orm'
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { getSession } from '@/lib/auth'
|
import { getSession } from '@/lib/auth'
|
||||||
import { buildConversationHistory } from '@/lib/copilot/chat-context'
|
|
||||||
import { resolveOrCreateChat } from '@/lib/copilot/chat-lifecycle'
|
|
||||||
import { buildCopilotRequestPayload } from '@/lib/copilot/chat-payload'
|
|
||||||
import { generateChatTitle } from '@/lib/copilot/chat-title'
|
import { generateChatTitle } from '@/lib/copilot/chat-title'
|
||||||
import { getCopilotModel } from '@/lib/copilot/config'
|
import { getCopilotModel } from '@/lib/copilot/config'
|
||||||
|
import { SIM_AGENT_VERSION } from '@/lib/copilot/constants'
|
||||||
import { COPILOT_MODEL_IDS, COPILOT_REQUEST_MODES } from '@/lib/copilot/models'
|
import { COPILOT_MODEL_IDS, COPILOT_REQUEST_MODES } from '@/lib/copilot/models'
|
||||||
import { orchestrateCopilotStream } from '@/lib/copilot/orchestrator'
|
import { orchestrateCopilotStream } from '@/lib/copilot/orchestrator'
|
||||||
import {
|
import {
|
||||||
@@ -24,8 +22,14 @@ import {
|
|||||||
createRequestTracker,
|
createRequestTracker,
|
||||||
createUnauthorizedResponse,
|
createUnauthorizedResponse,
|
||||||
} from '@/lib/copilot/request-helpers'
|
} from '@/lib/copilot/request-helpers'
|
||||||
|
import { getCredentialsServerTool } from '@/lib/copilot/tools/server/user/get-credentials'
|
||||||
|
import type { CopilotProviderConfig } from '@/lib/copilot/types'
|
||||||
import { env } from '@/lib/core/config/env'
|
import { env } from '@/lib/core/config/env'
|
||||||
|
import { CopilotFiles } from '@/lib/uploads'
|
||||||
|
import { createFileContent } from '@/lib/uploads/utils/file-utils'
|
||||||
import { resolveWorkflowIdForUser } from '@/lib/workflows/utils'
|
import { resolveWorkflowIdForUser } from '@/lib/workflows/utils'
|
||||||
|
import { tools } from '@/tools/registry'
|
||||||
|
import { getLatestVersionTools, stripVersionSuffix } from '@/tools/utils'
|
||||||
|
|
||||||
const logger = createLogger('CopilotChatAPI')
|
const logger = createLogger('CopilotChatAPI')
|
||||||
|
|
||||||
@@ -43,7 +47,7 @@ const ChatMessageSchema = z.object({
|
|||||||
chatId: z.string().optional(),
|
chatId: z.string().optional(),
|
||||||
workflowId: z.string().optional(),
|
workflowId: z.string().optional(),
|
||||||
workflowName: z.string().optional(),
|
workflowName: z.string().optional(),
|
||||||
model: z.enum(COPILOT_MODEL_IDS).optional().default('claude-4.6-opus'),
|
model: z.enum(COPILOT_MODEL_IDS).optional().default('claude-4.5-opus'),
|
||||||
mode: z.enum(COPILOT_REQUEST_MODES).optional().default('agent'),
|
mode: z.enum(COPILOT_REQUEST_MODES).optional().default('agent'),
|
||||||
prefetch: z.boolean().optional(),
|
prefetch: z.boolean().optional(),
|
||||||
createNewChat: z.boolean().optional().default(false),
|
createNewChat: z.boolean().optional().default(false),
|
||||||
@@ -174,64 +178,311 @@ export async function POST(req: NextRequest) {
|
|||||||
let conversationHistory: any[] = []
|
let conversationHistory: any[] = []
|
||||||
let actualChatId = chatId
|
let actualChatId = chatId
|
||||||
|
|
||||||
if (chatId || createNewChat) {
|
if (chatId) {
|
||||||
const defaultsForChatRow = getCopilotModel('chat')
|
// Load existing chat
|
||||||
const chatResult = await resolveOrCreateChat({
|
const [chat] = await db
|
||||||
chatId,
|
.select()
|
||||||
userId: authenticatedUserId,
|
.from(copilotChats)
|
||||||
workflowId,
|
.where(and(eq(copilotChats.id, chatId), eq(copilotChats.userId, authenticatedUserId)))
|
||||||
model: defaultsForChatRow.model,
|
.limit(1)
|
||||||
})
|
|
||||||
currentChat = chatResult.chat
|
if (chat) {
|
||||||
actualChatId = chatResult.chatId || chatId
|
currentChat = chat
|
||||||
const history = buildConversationHistory(
|
conversationHistory = Array.isArray(chat.messages) ? chat.messages : []
|
||||||
chatResult.conversationHistory,
|
}
|
||||||
(chatResult.chat?.conversationId as string | undefined) || conversationId
|
} else if (createNewChat && workflowId) {
|
||||||
|
// Create new chat
|
||||||
|
const { provider, model } = getCopilotModel('chat')
|
||||||
|
const [newChat] = await db
|
||||||
|
.insert(copilotChats)
|
||||||
|
.values({
|
||||||
|
userId: authenticatedUserId,
|
||||||
|
workflowId,
|
||||||
|
title: null,
|
||||||
|
model,
|
||||||
|
messages: [],
|
||||||
|
})
|
||||||
|
.returning()
|
||||||
|
|
||||||
|
if (newChat) {
|
||||||
|
currentChat = newChat
|
||||||
|
actualChatId = newChat.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process file attachments if present
|
||||||
|
const processedFileContents: any[] = []
|
||||||
|
if (fileAttachments && fileAttachments.length > 0) {
|
||||||
|
const processedAttachments = await CopilotFiles.processCopilotAttachments(
|
||||||
|
fileAttachments,
|
||||||
|
tracker.requestId
|
||||||
)
|
)
|
||||||
conversationHistory = history.history
|
|
||||||
|
for (const { buffer, attachment } of processedAttachments) {
|
||||||
|
const fileContent = createFileContent(buffer, attachment.media_type)
|
||||||
|
if (fileContent) {
|
||||||
|
processedFileContents.push(fileContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build messages array for sim agent with conversation history
|
||||||
|
const messages: any[] = []
|
||||||
|
|
||||||
|
// Add conversation history (need to rebuild these with file support if they had attachments)
|
||||||
|
for (const msg of conversationHistory) {
|
||||||
|
if (msg.fileAttachments && msg.fileAttachments.length > 0) {
|
||||||
|
// This is a message with file attachments - rebuild with content array
|
||||||
|
const content: any[] = [{ type: 'text', text: msg.content }]
|
||||||
|
|
||||||
|
const processedHistoricalAttachments = await CopilotFiles.processCopilotAttachments(
|
||||||
|
msg.fileAttachments,
|
||||||
|
tracker.requestId
|
||||||
|
)
|
||||||
|
|
||||||
|
for (const { buffer, attachment } of processedHistoricalAttachments) {
|
||||||
|
const fileContent = createFileContent(buffer, attachment.media_type)
|
||||||
|
if (fileContent) {
|
||||||
|
content.push(fileContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
messages.push({
|
||||||
|
role: msg.role,
|
||||||
|
content,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// Regular text-only message
|
||||||
|
messages.push({
|
||||||
|
role: msg.role,
|
||||||
|
content: msg.content,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add implicit feedback if provided
|
||||||
|
if (implicitFeedback) {
|
||||||
|
messages.push({
|
||||||
|
role: 'system',
|
||||||
|
content: implicitFeedback,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add current user message with file attachments
|
||||||
|
if (processedFileContents.length > 0) {
|
||||||
|
// Message with files - use content array format
|
||||||
|
const content: any[] = [{ type: 'text', text: message }]
|
||||||
|
|
||||||
|
// Add file contents
|
||||||
|
for (const fileContent of processedFileContents) {
|
||||||
|
content.push(fileContent)
|
||||||
|
}
|
||||||
|
|
||||||
|
messages.push({
|
||||||
|
role: 'user',
|
||||||
|
content,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// Text-only message
|
||||||
|
messages.push({
|
||||||
|
role: 'user',
|
||||||
|
content: message,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaults = getCopilotModel('chat')
|
const defaults = getCopilotModel('chat')
|
||||||
const selectedModel = model || defaults.model
|
const selectedModel = model || defaults.model
|
||||||
|
const envModel = env.COPILOT_MODEL || defaults.model
|
||||||
|
|
||||||
|
let providerConfig: CopilotProviderConfig | undefined
|
||||||
|
const providerEnv = env.COPILOT_PROVIDER as any
|
||||||
|
|
||||||
|
if (providerEnv) {
|
||||||
|
if (providerEnv === 'azure-openai') {
|
||||||
|
providerConfig = {
|
||||||
|
provider: 'azure-openai',
|
||||||
|
model: envModel,
|
||||||
|
apiKey: env.AZURE_OPENAI_API_KEY,
|
||||||
|
apiVersion: 'preview',
|
||||||
|
endpoint: env.AZURE_OPENAI_ENDPOINT,
|
||||||
|
}
|
||||||
|
} else if (providerEnv === 'vertex') {
|
||||||
|
providerConfig = {
|
||||||
|
provider: 'vertex',
|
||||||
|
model: envModel,
|
||||||
|
apiKey: env.COPILOT_API_KEY,
|
||||||
|
vertexProject: env.VERTEX_PROJECT,
|
||||||
|
vertexLocation: env.VERTEX_LOCATION,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
providerConfig = {
|
||||||
|
provider: providerEnv,
|
||||||
|
model: selectedModel,
|
||||||
|
apiKey: env.COPILOT_API_KEY,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const effectiveMode = mode === 'agent' ? 'build' : mode
|
const effectiveMode = mode === 'agent' ? 'build' : mode
|
||||||
|
const transportMode = effectiveMode === 'build' ? 'agent' : effectiveMode
|
||||||
|
|
||||||
|
// Determine conversationId to use for this request
|
||||||
const effectiveConversationId =
|
const effectiveConversationId =
|
||||||
(currentChat?.conversationId as string | undefined) || conversationId
|
(currentChat?.conversationId as string | undefined) || conversationId
|
||||||
|
|
||||||
const requestPayload = await buildCopilotRequestPayload(
|
// For agent/build mode, fetch credentials and build tool definitions
|
||||||
{
|
let integrationTools: any[] = []
|
||||||
message,
|
let baseTools: any[] = []
|
||||||
workflowId,
|
let credentials: {
|
||||||
userId: authenticatedUserId,
|
oauth: Record<
|
||||||
userMessageId: userMessageIdToUse,
|
string,
|
||||||
mode,
|
{ accessToken: string; accountId: string; name: string; expiresAt?: string }
|
||||||
model: selectedModel,
|
>
|
||||||
conversationHistory,
|
apiKeys: string[]
|
||||||
contexts: agentContexts,
|
metadata?: {
|
||||||
fileAttachments,
|
connectedOAuth: Array<{ provider: string; name: string; scopes?: string[] }>
|
||||||
commands,
|
configuredApiKeys: string[]
|
||||||
chatId: actualChatId,
|
|
||||||
implicitFeedback,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
selectedModel,
|
|
||||||
}
|
}
|
||||||
)
|
} | null = null
|
||||||
|
|
||||||
|
if (effectiveMode === 'build') {
|
||||||
|
// Build base tools (executed locally, not deferred)
|
||||||
|
// Include function_execute for code execution capability
|
||||||
|
baseTools = [
|
||||||
|
{
|
||||||
|
name: 'function_execute',
|
||||||
|
description:
|
||||||
|
'Execute JavaScript code to perform calculations, data transformations, API calls, or any programmatic task. Code runs in a secure sandbox with fetch() available. Write plain statements (not wrapped in functions). Example: const res = await fetch(url); const data = await res.json(); return data;',
|
||||||
|
input_schema: {
|
||||||
|
type: 'object',
|
||||||
|
properties: {
|
||||||
|
code: {
|
||||||
|
type: 'string',
|
||||||
|
description:
|
||||||
|
'Raw JavaScript statements to execute. Code is auto-wrapped in async context. Use fetch() for HTTP requests. Write like: const res = await fetch(url); return await res.json();',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
required: ['code'],
|
||||||
|
},
|
||||||
|
executeLocally: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
// Fetch user credentials (OAuth + API keys) - pass workflowId to get workspace env vars
|
||||||
|
try {
|
||||||
|
const rawCredentials = await getCredentialsServerTool.execute(
|
||||||
|
{ workflowId },
|
||||||
|
{ userId: authenticatedUserId }
|
||||||
|
)
|
||||||
|
|
||||||
|
// Transform OAuth credentials to map format: { [provider]: { accessToken, accountId, ... } }
|
||||||
|
const oauthMap: Record<
|
||||||
|
string,
|
||||||
|
{ accessToken: string; accountId: string; name: string; expiresAt?: string }
|
||||||
|
> = {}
|
||||||
|
const connectedOAuth: Array<{ provider: string; name: string; scopes?: string[] }> = []
|
||||||
|
for (const cred of rawCredentials?.oauth?.connected?.credentials || []) {
|
||||||
|
if (cred.accessToken) {
|
||||||
|
oauthMap[cred.provider] = {
|
||||||
|
accessToken: cred.accessToken,
|
||||||
|
accountId: cred.id,
|
||||||
|
name: cred.name,
|
||||||
|
}
|
||||||
|
connectedOAuth.push({
|
||||||
|
provider: cred.provider,
|
||||||
|
name: cred.name,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
credentials = {
|
||||||
|
oauth: oauthMap,
|
||||||
|
apiKeys: rawCredentials?.environment?.variableNames || [],
|
||||||
|
metadata: {
|
||||||
|
connectedOAuth,
|
||||||
|
configuredApiKeys: rawCredentials?.environment?.variableNames || [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Fetched credentials for build mode`, {
|
||||||
|
oauthProviders: Object.keys(oauthMap),
|
||||||
|
apiKeyCount: credentials.apiKeys.length,
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
logger.warn(`[${tracker.requestId}] Failed to fetch credentials`, {
|
||||||
|
error: error instanceof Error ? error.message : String(error),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build tool definitions (schemas only)
|
||||||
|
try {
|
||||||
|
const { createUserToolSchema } = await import('@/tools/params')
|
||||||
|
|
||||||
|
const latestTools = getLatestVersionTools(tools)
|
||||||
|
|
||||||
|
integrationTools = Object.entries(latestTools).map(([toolId, toolConfig]) => {
|
||||||
|
const userSchema = createUserToolSchema(toolConfig)
|
||||||
|
const strippedName = stripVersionSuffix(toolId)
|
||||||
|
return {
|
||||||
|
name: strippedName,
|
||||||
|
description: toolConfig.description || toolConfig.name || strippedName,
|
||||||
|
input_schema: userSchema,
|
||||||
|
defer_loading: true, // Anthropic Advanced Tool Use
|
||||||
|
...(toolConfig.oauth?.required && {
|
||||||
|
oauth: {
|
||||||
|
required: true,
|
||||||
|
provider: toolConfig.oauth.provider,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Built tool definitions for build mode`, {
|
||||||
|
integrationToolCount: integrationTools.length,
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
logger.warn(`[${tracker.requestId}] Failed to build tool definitions`, {
|
||||||
|
error: error instanceof Error ? error.message : String(error),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestPayload = {
|
||||||
|
message: message, // Just send the current user message text
|
||||||
|
workflowId,
|
||||||
|
userId: authenticatedUserId,
|
||||||
|
stream: stream,
|
||||||
|
streamToolCalls: true,
|
||||||
|
model: selectedModel,
|
||||||
|
mode: transportMode,
|
||||||
|
messageId: userMessageIdToUse,
|
||||||
|
version: SIM_AGENT_VERSION,
|
||||||
|
...(providerConfig ? { provider: providerConfig } : {}),
|
||||||
|
...(effectiveConversationId ? { conversationId: effectiveConversationId } : {}),
|
||||||
|
...(typeof prefetch === 'boolean' ? { prefetch: prefetch } : {}),
|
||||||
|
...(session?.user?.name && { userName: session.user.name }),
|
||||||
|
...(agentContexts.length > 0 && { context: agentContexts }),
|
||||||
|
...(actualChatId ? { chatId: actualChatId } : {}),
|
||||||
|
...(processedFileContents.length > 0 && { fileAttachments: processedFileContents }),
|
||||||
|
// For build/agent mode, include tools and credentials
|
||||||
|
...(integrationTools.length > 0 && { tools: integrationTools }),
|
||||||
|
...(baseTools.length > 0 && { baseTools }),
|
||||||
|
...(credentials && { credentials }),
|
||||||
|
...(commands && commands.length > 0 && { commands }),
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.info(`[${tracker.requestId}] About to call Sim Agent`, {
|
logger.info(`[${tracker.requestId}] About to call Sim Agent`, {
|
||||||
hasContext: agentContexts.length > 0,
|
hasContext: agentContexts.length > 0,
|
||||||
contextCount: agentContexts.length,
|
contextCount: agentContexts.length,
|
||||||
hasConversationId: !!effectiveConversationId,
|
hasConversationId: !!effectiveConversationId,
|
||||||
hasFileAttachments: Array.isArray(requestPayload.fileAttachments),
|
hasFileAttachments: processedFileContents.length > 0,
|
||||||
messageLength: message.length,
|
messageLength: message.length,
|
||||||
mode: effectiveMode,
|
mode: effectiveMode,
|
||||||
hasTools: Array.isArray(requestPayload.tools),
|
hasTools: integrationTools.length > 0,
|
||||||
toolCount: Array.isArray(requestPayload.tools) ? requestPayload.tools.length : 0,
|
toolCount: integrationTools.length,
|
||||||
hasBaseTools: Array.isArray(requestPayload.baseTools),
|
hasBaseTools: baseTools.length > 0,
|
||||||
baseToolCount: Array.isArray(requestPayload.baseTools)
|
baseToolCount: baseTools.length,
|
||||||
? requestPayload.baseTools.length
|
hasCredentials: !!credentials,
|
||||||
: 0,
|
|
||||||
hasCredentials: !!requestPayload.credentials,
|
|
||||||
})
|
})
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
@@ -372,10 +623,7 @@ export async function POST(req: NextRequest) {
|
|||||||
content: nonStreamingResult.content,
|
content: nonStreamingResult.content,
|
||||||
toolCalls: nonStreamingResult.toolCalls,
|
toolCalls: nonStreamingResult.toolCalls,
|
||||||
model: selectedModel,
|
model: selectedModel,
|
||||||
provider:
|
provider: providerConfig?.provider || env.COPILOT_PROVIDER || 'openai',
|
||||||
(requestPayload?.provider as Record<string, unknown>)?.provider ||
|
|
||||||
env.COPILOT_PROVIDER ||
|
|
||||||
'openai',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(`[${tracker.requestId}] Non-streaming response from orchestrator:`, {
|
logger.info(`[${tracker.requestId}] Non-streaming response from orchestrator:`, {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
import { createLogger } from '@sim/logger'
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { REDIS_TOOL_CALL_PREFIX, REDIS_TOOL_CALL_TTL_SECONDS } from '@/lib/copilot/constants'
|
|
||||||
import {
|
import {
|
||||||
authenticateCopilotRequestSessionOnly,
|
authenticateCopilotRequestSessionOnly,
|
||||||
createBadRequestResponse,
|
createBadRequestResponse,
|
||||||
@@ -24,8 +23,7 @@ const ConfirmationSchema = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the user's tool decision to Redis. The server-side orchestrator's
|
* Update tool call status in Redis
|
||||||
* waitForToolDecision() polls Redis for this value.
|
|
||||||
*/
|
*/
|
||||||
async function updateToolCallStatus(
|
async function updateToolCallStatus(
|
||||||
toolCallId: string,
|
toolCallId: string,
|
||||||
@@ -34,24 +32,57 @@ async function updateToolCallStatus(
|
|||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
const redis = getRedisClient()
|
const redis = getRedisClient()
|
||||||
if (!redis) {
|
if (!redis) {
|
||||||
logger.warn('Redis client not available for tool confirmation')
|
logger.warn('updateToolCallStatus: Redis client not available')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const key = `${REDIS_TOOL_CALL_PREFIX}${toolCallId}`
|
const key = `tool_call:${toolCallId}`
|
||||||
const payload = {
|
const timeout = 600000 // 10 minutes timeout for user confirmation
|
||||||
|
const pollInterval = 100 // Poll every 100ms
|
||||||
|
const startTime = Date.now()
|
||||||
|
|
||||||
|
logger.info('Polling for tool call in Redis', { toolCallId, key, timeout })
|
||||||
|
|
||||||
|
// Poll until the key exists or timeout
|
||||||
|
while (Date.now() - startTime < timeout) {
|
||||||
|
const exists = await redis.exists(key)
|
||||||
|
if (exists) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait before next poll
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, pollInterval))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Final check if key exists after polling
|
||||||
|
const exists = await redis.exists(key)
|
||||||
|
if (!exists) {
|
||||||
|
logger.warn('Tool call not found in Redis after polling timeout', {
|
||||||
|
toolCallId,
|
||||||
|
key,
|
||||||
|
timeout,
|
||||||
|
pollDuration: Date.now() - startTime,
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store both status and message as JSON
|
||||||
|
const toolCallData = {
|
||||||
status,
|
status,
|
||||||
message: message || null,
|
message: message || null,
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
}
|
}
|
||||||
await redis.set(key, JSON.stringify(payload), 'EX', REDIS_TOOL_CALL_TTL_SECONDS)
|
|
||||||
|
await redis.set(key, JSON.stringify(toolCallData), 'EX', 86400) // Keep 24 hour expiry
|
||||||
|
|
||||||
return true
|
return true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Failed to update tool call status', {
|
logger.error('Failed to update tool call status in Redis', {
|
||||||
toolCallId,
|
toolCallId,
|
||||||
status,
|
status,
|
||||||
error: error instanceof Error ? error.message : String(error),
|
message,
|
||||||
|
error: error instanceof Error ? error.message : 'Unknown error',
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { authenticateCopilotRequestSessionOnly } from '@/lib/copilot/request-helpers'
|
|
||||||
import { routeExecution } from '@/lib/copilot/tools/server/router'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/copilot/credentials
|
|
||||||
* Returns connected OAuth credentials for the authenticated user.
|
|
||||||
* Used by the copilot store for credential masking.
|
|
||||||
*/
|
|
||||||
export async function GET(_req: NextRequest) {
|
|
||||||
const { userId, isAuthenticated } = await authenticateCopilotRequestSessionOnly()
|
|
||||||
if (!isAuthenticated || !userId) {
|
|
||||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const result = await routeExecution('get_credentials', {}, { userId })
|
|
||||||
return NextResponse.json({ success: true, result })
|
|
||||||
} catch (error) {
|
|
||||||
return NextResponse.json(
|
|
||||||
{
|
|
||||||
success: false,
|
|
||||||
error: error instanceof Error ? error.message : 'Failed to load credentials',
|
|
||||||
},
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { createLogger } from '@sim/logger'
|
||||||
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
|
import { z } from 'zod'
|
||||||
|
import {
|
||||||
|
authenticateCopilotRequestSessionOnly,
|
||||||
|
createBadRequestResponse,
|
||||||
|
createInternalServerErrorResponse,
|
||||||
|
createRequestTracker,
|
||||||
|
createUnauthorizedResponse,
|
||||||
|
} from '@/lib/copilot/request-helpers'
|
||||||
|
import { routeExecution } from '@/lib/copilot/tools/server/router'
|
||||||
|
|
||||||
|
const logger = createLogger('ExecuteCopilotServerToolAPI')
|
||||||
|
|
||||||
|
const ExecuteSchema = z.object({
|
||||||
|
toolName: z.string(),
|
||||||
|
payload: z.unknown().optional(),
|
||||||
|
})
|
||||||
|
|
||||||
|
export async function POST(req: NextRequest) {
|
||||||
|
const tracker = createRequestTracker()
|
||||||
|
try {
|
||||||
|
const { userId, isAuthenticated } = await authenticateCopilotRequestSessionOnly()
|
||||||
|
if (!isAuthenticated || !userId) {
|
||||||
|
return createUnauthorizedResponse()
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = await req.json()
|
||||||
|
try {
|
||||||
|
const preview = JSON.stringify(body).slice(0, 300)
|
||||||
|
logger.debug(`[${tracker.requestId}] Incoming request body preview`, { preview })
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
const { toolName, payload } = ExecuteSchema.parse(body)
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Executing server tool`, { toolName })
|
||||||
|
const result = await routeExecution(toolName, payload, { userId })
|
||||||
|
|
||||||
|
try {
|
||||||
|
const resultPreview = JSON.stringify(result).slice(0, 300)
|
||||||
|
logger.debug(`[${tracker.requestId}] Server tool result preview`, { toolName, resultPreview })
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
return NextResponse.json({ success: true, result })
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof z.ZodError) {
|
||||||
|
logger.debug(`[${tracker.requestId}] Zod validation error`, { issues: error.issues })
|
||||||
|
return createBadRequestResponse('Invalid request body for execute-copilot-server-tool')
|
||||||
|
}
|
||||||
|
logger.error(`[${tracker.requestId}] Failed to execute server tool:`, error)
|
||||||
|
const errorMessage = error instanceof Error ? error.message : 'Failed to execute server tool'
|
||||||
|
return createInternalServerErrorResponse(errorMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
247
apps/sim/app/api/copilot/execute-tool/route.ts
Normal file
247
apps/sim/app/api/copilot/execute-tool/route.ts
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
import { db } from '@sim/db'
|
||||||
|
import { account, workflow } from '@sim/db/schema'
|
||||||
|
import { createLogger } from '@sim/logger'
|
||||||
|
import { and, eq } from 'drizzle-orm'
|
||||||
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
|
import { z } from 'zod'
|
||||||
|
import { getSession } from '@/lib/auth'
|
||||||
|
import {
|
||||||
|
createBadRequestResponse,
|
||||||
|
createInternalServerErrorResponse,
|
||||||
|
createRequestTracker,
|
||||||
|
createUnauthorizedResponse,
|
||||||
|
} from '@/lib/copilot/request-helpers'
|
||||||
|
import { generateRequestId } from '@/lib/core/utils/request'
|
||||||
|
import { getEffectiveDecryptedEnv } from '@/lib/environment/utils'
|
||||||
|
import { refreshTokenIfNeeded } from '@/app/api/auth/oauth/utils'
|
||||||
|
import { resolveEnvVarReferences } from '@/executor/utils/reference-validation'
|
||||||
|
import { executeTool } from '@/tools'
|
||||||
|
import { getTool, resolveToolId } from '@/tools/utils'
|
||||||
|
|
||||||
|
const logger = createLogger('CopilotExecuteToolAPI')
|
||||||
|
|
||||||
|
const ExecuteToolSchema = z.object({
|
||||||
|
toolCallId: z.string(),
|
||||||
|
toolName: z.string(),
|
||||||
|
arguments: z.record(z.any()).optional().default({}),
|
||||||
|
workflowId: z.string().optional(),
|
||||||
|
})
|
||||||
|
|
||||||
|
export async function POST(req: NextRequest) {
|
||||||
|
const tracker = createRequestTracker()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const session = await getSession()
|
||||||
|
if (!session?.user?.id) {
|
||||||
|
return createUnauthorizedResponse()
|
||||||
|
}
|
||||||
|
|
||||||
|
const userId = session.user.id
|
||||||
|
const body = await req.json()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const preview = JSON.stringify(body).slice(0, 300)
|
||||||
|
logger.debug(`[${tracker.requestId}] Incoming execute-tool request`, { preview })
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
const { toolCallId, toolName, arguments: toolArgs, workflowId } = ExecuteToolSchema.parse(body)
|
||||||
|
|
||||||
|
const resolvedToolName = resolveToolId(toolName)
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Executing tool`, {
|
||||||
|
toolCallId,
|
||||||
|
toolName,
|
||||||
|
resolvedToolName,
|
||||||
|
workflowId,
|
||||||
|
hasArgs: Object.keys(toolArgs).length > 0,
|
||||||
|
})
|
||||||
|
|
||||||
|
const toolConfig = getTool(resolvedToolName)
|
||||||
|
if (!toolConfig) {
|
||||||
|
// Find similar tool names to help debug
|
||||||
|
const { tools: allTools } = await import('@/tools/registry')
|
||||||
|
const allToolNames = Object.keys(allTools)
|
||||||
|
const prefix = toolName.split('_').slice(0, 2).join('_')
|
||||||
|
const similarTools = allToolNames
|
||||||
|
.filter((name) => name.startsWith(`${prefix.split('_')[0]}_`))
|
||||||
|
.slice(0, 10)
|
||||||
|
|
||||||
|
logger.warn(`[${tracker.requestId}] Tool not found in registry`, {
|
||||||
|
toolName,
|
||||||
|
prefix,
|
||||||
|
similarTools,
|
||||||
|
totalToolsInRegistry: allToolNames.length,
|
||||||
|
})
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
error: `Tool not found: ${toolName}. Similar tools: ${similarTools.join(', ')}`,
|
||||||
|
toolCallId,
|
||||||
|
},
|
||||||
|
{ status: 404 }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the workspaceId from the workflow (env vars are stored at workspace level)
|
||||||
|
let workspaceId: string | undefined
|
||||||
|
if (workflowId) {
|
||||||
|
const workflowResult = await db
|
||||||
|
.select({ workspaceId: workflow.workspaceId })
|
||||||
|
.from(workflow)
|
||||||
|
.where(eq(workflow.id, workflowId))
|
||||||
|
.limit(1)
|
||||||
|
workspaceId = workflowResult[0]?.workspaceId ?? undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get decrypted environment variables early so we can resolve all {{VAR}} references
|
||||||
|
const decryptedEnvVars = await getEffectiveDecryptedEnv(userId, workspaceId)
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Fetched environment variables`, {
|
||||||
|
workflowId,
|
||||||
|
workspaceId,
|
||||||
|
envVarCount: Object.keys(decryptedEnvVars).length,
|
||||||
|
envVarKeys: Object.keys(decryptedEnvVars),
|
||||||
|
})
|
||||||
|
|
||||||
|
// Build execution params starting with LLM-provided arguments
|
||||||
|
// Resolve all {{ENV_VAR}} references in the arguments (deep for nested objects)
|
||||||
|
const executionParams: Record<string, any> = resolveEnvVarReferences(
|
||||||
|
toolArgs,
|
||||||
|
decryptedEnvVars,
|
||||||
|
{ deep: true }
|
||||||
|
) as Record<string, any>
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Resolved env var references in arguments`, {
|
||||||
|
toolName,
|
||||||
|
originalArgKeys: Object.keys(toolArgs),
|
||||||
|
resolvedArgKeys: Object.keys(executionParams),
|
||||||
|
})
|
||||||
|
|
||||||
|
// Resolve OAuth access token if required
|
||||||
|
if (toolConfig.oauth?.required && toolConfig.oauth.provider) {
|
||||||
|
const provider = toolConfig.oauth.provider
|
||||||
|
logger.info(`[${tracker.requestId}] Resolving OAuth token`, { provider })
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Find the account for this provider and user
|
||||||
|
const accounts = await db
|
||||||
|
.select()
|
||||||
|
.from(account)
|
||||||
|
.where(and(eq(account.providerId, provider), eq(account.userId, userId)))
|
||||||
|
.limit(1)
|
||||||
|
|
||||||
|
if (accounts.length > 0) {
|
||||||
|
const acc = accounts[0]
|
||||||
|
const requestId = generateRequestId()
|
||||||
|
const { accessToken } = await refreshTokenIfNeeded(requestId, acc as any, acc.id)
|
||||||
|
|
||||||
|
if (accessToken) {
|
||||||
|
executionParams.accessToken = accessToken
|
||||||
|
logger.info(`[${tracker.requestId}] OAuth token resolved`, { provider })
|
||||||
|
} else {
|
||||||
|
logger.warn(`[${tracker.requestId}] No access token available`, { provider })
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
error: `OAuth token not available for ${provider}. Please reconnect your account.`,
|
||||||
|
toolCallId,
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.warn(`[${tracker.requestId}] No account found for provider`, { provider })
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
error: `No ${provider} account connected. Please connect your account first.`,
|
||||||
|
toolCallId,
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(`[${tracker.requestId}] Failed to resolve OAuth token`, {
|
||||||
|
provider,
|
||||||
|
error: error instanceof Error ? error.message : String(error),
|
||||||
|
})
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
error: `Failed to get OAuth token for ${provider}`,
|
||||||
|
toolCallId,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if tool requires an API key that wasn't resolved via {{ENV_VAR}} reference
|
||||||
|
const needsApiKey = toolConfig.params?.apiKey?.required
|
||||||
|
|
||||||
|
if (needsApiKey && !executionParams.apiKey) {
|
||||||
|
logger.warn(`[${tracker.requestId}] No API key found for tool`, { toolName })
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
error: `API key not provided for ${toolName}. Use {{YOUR_API_KEY_ENV_VAR}} to reference your environment variable.`,
|
||||||
|
toolCallId,
|
||||||
|
},
|
||||||
|
{ status: 400 }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add execution context
|
||||||
|
executionParams._context = {
|
||||||
|
workflowId,
|
||||||
|
userId,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special handling for function_execute - inject environment variables
|
||||||
|
if (toolName === 'function_execute') {
|
||||||
|
executionParams.envVars = decryptedEnvVars
|
||||||
|
executionParams.workflowVariables = {} // No workflow variables in copilot context
|
||||||
|
executionParams.blockData = {} // No block data in copilot context
|
||||||
|
executionParams.blockNameMapping = {} // No block mapping in copilot context
|
||||||
|
executionParams.language = executionParams.language || 'javascript'
|
||||||
|
executionParams.timeout = executionParams.timeout || 30000
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Injected env vars for function_execute`, {
|
||||||
|
envVarCount: Object.keys(decryptedEnvVars).length,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute the tool
|
||||||
|
logger.info(`[${tracker.requestId}] Executing tool with resolved credentials`, {
|
||||||
|
toolName,
|
||||||
|
hasAccessToken: !!executionParams.accessToken,
|
||||||
|
hasApiKey: !!executionParams.apiKey,
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = await executeTool(resolvedToolName, executionParams)
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Tool execution complete`, {
|
||||||
|
toolName,
|
||||||
|
success: result.success,
|
||||||
|
hasOutput: !!result.output,
|
||||||
|
})
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
toolCallId,
|
||||||
|
result: {
|
||||||
|
success: result.success,
|
||||||
|
output: result.output,
|
||||||
|
error: result.error,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof z.ZodError) {
|
||||||
|
logger.debug(`[${tracker.requestId}] Zod validation error`, { issues: error.issues })
|
||||||
|
return createBadRequestResponse('Invalid request body for execute-tool')
|
||||||
|
}
|
||||||
|
logger.error(`[${tracker.requestId}] Failed to execute tool:`, error)
|
||||||
|
const errorMessage = error instanceof Error ? error.message : 'Failed to execute tool'
|
||||||
|
return createInternalServerErrorResponse(errorMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { SIM_AGENT_API_URL } from '@/lib/copilot/constants'
|
import { SIM_AGENT_API_URL_DEFAULT } from '@/lib/copilot/constants'
|
||||||
import {
|
import {
|
||||||
authenticateCopilotRequestSessionOnly,
|
authenticateCopilotRequestSessionOnly,
|
||||||
createBadRequestResponse,
|
createBadRequestResponse,
|
||||||
@@ -10,6 +10,8 @@ import {
|
|||||||
} from '@/lib/copilot/request-helpers'
|
} from '@/lib/copilot/request-helpers'
|
||||||
import { env } from '@/lib/core/config/env'
|
import { env } from '@/lib/core/config/env'
|
||||||
|
|
||||||
|
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
|
||||||
|
|
||||||
const BodySchema = z.object({
|
const BodySchema = z.object({
|
||||||
messageId: z.string(),
|
messageId: z.string(),
|
||||||
diffCreated: z.boolean(),
|
diffCreated: z.boolean(),
|
||||||
|
|||||||
123
apps/sim/app/api/copilot/tools/mark-complete/route.ts
Normal file
123
apps/sim/app/api/copilot/tools/mark-complete/route.ts
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
import { createLogger } from '@sim/logger'
|
||||||
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
|
import { z } from 'zod'
|
||||||
|
import { SIM_AGENT_API_URL_DEFAULT } from '@/lib/copilot/constants'
|
||||||
|
import {
|
||||||
|
authenticateCopilotRequestSessionOnly,
|
||||||
|
createBadRequestResponse,
|
||||||
|
createInternalServerErrorResponse,
|
||||||
|
createRequestTracker,
|
||||||
|
createUnauthorizedResponse,
|
||||||
|
} from '@/lib/copilot/request-helpers'
|
||||||
|
import { env } from '@/lib/core/config/env'
|
||||||
|
|
||||||
|
const logger = createLogger('CopilotMarkToolCompleteAPI')
|
||||||
|
|
||||||
|
const SIM_AGENT_API_URL = env.SIM_AGENT_API_URL || SIM_AGENT_API_URL_DEFAULT
|
||||||
|
|
||||||
|
const MarkCompleteSchema = z.object({
|
||||||
|
id: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
status: z.number().int(),
|
||||||
|
message: z.any().optional(),
|
||||||
|
data: z.any().optional(),
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST /api/copilot/tools/mark-complete
|
||||||
|
* Proxy to Sim Agent: POST /api/tools/mark-complete
|
||||||
|
*/
|
||||||
|
export async function POST(req: NextRequest) {
|
||||||
|
const tracker = createRequestTracker()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { userId, isAuthenticated } = await authenticateCopilotRequestSessionOnly()
|
||||||
|
if (!isAuthenticated || !userId) {
|
||||||
|
return createUnauthorizedResponse()
|
||||||
|
}
|
||||||
|
|
||||||
|
const body = await req.json()
|
||||||
|
|
||||||
|
// Log raw body shape for diagnostics (avoid dumping huge payloads)
|
||||||
|
try {
|
||||||
|
const bodyPreview = JSON.stringify(body).slice(0, 300)
|
||||||
|
logger.debug(`[${tracker.requestId}] Incoming mark-complete raw body preview`, {
|
||||||
|
preview: `${bodyPreview}${bodyPreview.length === 300 ? '...' : ''}`,
|
||||||
|
})
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
const parsed = MarkCompleteSchema.parse(body)
|
||||||
|
|
||||||
|
const messagePreview = (() => {
|
||||||
|
try {
|
||||||
|
const s =
|
||||||
|
typeof parsed.message === 'string' ? parsed.message : JSON.stringify(parsed.message)
|
||||||
|
return s ? `${s.slice(0, 200)}${s.length > 200 ? '...' : ''}` : undefined
|
||||||
|
} catch {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Forwarding tool mark-complete`, {
|
||||||
|
userId,
|
||||||
|
toolCallId: parsed.id,
|
||||||
|
toolName: parsed.name,
|
||||||
|
status: parsed.status,
|
||||||
|
hasMessage: parsed.message !== undefined,
|
||||||
|
hasData: parsed.data !== undefined,
|
||||||
|
messagePreview,
|
||||||
|
agentUrl: `${SIM_AGENT_API_URL}/api/tools/mark-complete`,
|
||||||
|
})
|
||||||
|
|
||||||
|
const agentRes = await fetch(`${SIM_AGENT_API_URL}/api/tools/mark-complete`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
...(env.COPILOT_API_KEY ? { 'x-api-key': env.COPILOT_API_KEY } : {}),
|
||||||
|
},
|
||||||
|
body: JSON.stringify(parsed),
|
||||||
|
})
|
||||||
|
|
||||||
|
// Attempt to parse agent response JSON
|
||||||
|
let agentJson: any = null
|
||||||
|
let agentText: string | null = null
|
||||||
|
try {
|
||||||
|
agentJson = await agentRes.json()
|
||||||
|
} catch (_) {
|
||||||
|
try {
|
||||||
|
agentText = await agentRes.text()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info(`[${tracker.requestId}] Agent responded to mark-complete`, {
|
||||||
|
status: agentRes.status,
|
||||||
|
ok: agentRes.ok,
|
||||||
|
responseJsonPreview: agentJson ? JSON.stringify(agentJson).slice(0, 300) : undefined,
|
||||||
|
responseTextPreview: agentText ? agentText.slice(0, 300) : undefined,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (agentRes.ok) {
|
||||||
|
return NextResponse.json({ success: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
const errorMessage =
|
||||||
|
agentJson?.error || agentText || `Agent responded with status ${agentRes.status}`
|
||||||
|
const status = agentRes.status >= 500 ? 500 : 400
|
||||||
|
|
||||||
|
logger.warn(`[${tracker.requestId}] Mark-complete failed`, {
|
||||||
|
status,
|
||||||
|
error: errorMessage,
|
||||||
|
})
|
||||||
|
|
||||||
|
return NextResponse.json({ success: false, error: errorMessage }, { status })
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof z.ZodError) {
|
||||||
|
logger.warn(`[${tracker.requestId}] Invalid mark-complete request body`, {
|
||||||
|
issues: error.issues,
|
||||||
|
})
|
||||||
|
return createBadRequestResponse('Invalid request body for mark-complete')
|
||||||
|
}
|
||||||
|
logger.error(`[${tracker.requestId}] Failed to proxy mark-complete:`, error)
|
||||||
|
return createInternalServerErrorResponse('Failed to mark tool as complete')
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,7 +28,6 @@ const DEFAULT_ENABLED_MODELS: Record<CopilotModelId, boolean> = {
|
|||||||
'claude-4-sonnet': false,
|
'claude-4-sonnet': false,
|
||||||
'claude-4.5-haiku': true,
|
'claude-4.5-haiku': true,
|
||||||
'claude-4.5-sonnet': true,
|
'claude-4.5-sonnet': true,
|
||||||
'claude-4.6-opus': true,
|
|
||||||
'claude-4.5-opus': true,
|
'claude-4.5-opus': true,
|
||||||
'claude-4.1-opus': false,
|
'claude-4.1-opus': false,
|
||||||
'gemini-3-pro': true,
|
'gemini-3-pro': true,
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpAuthorizationServerMetadataResponse(request)
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { createMcpProtectedResourceMetadataResponse } from '@/lib/mcp/oauth-discovery'
|
|
||||||
|
|
||||||
export async function GET(request: NextRequest): Promise<NextResponse> {
|
|
||||||
return createMcpProtectedResourceMetadataResponse(request)
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,6 @@ const configSchema = z.object({
|
|||||||
hideFilesTab: z.boolean().optional(),
|
hideFilesTab: z.boolean().optional(),
|
||||||
disableMcpTools: z.boolean().optional(),
|
disableMcpTools: z.boolean().optional(),
|
||||||
disableCustomTools: z.boolean().optional(),
|
disableCustomTools: z.boolean().optional(),
|
||||||
disableSkills: z.boolean().optional(),
|
|
||||||
hideTemplates: z.boolean().optional(),
|
hideTemplates: z.boolean().optional(),
|
||||||
disableInvitations: z.boolean().optional(),
|
disableInvitations: z.boolean().optional(),
|
||||||
hideDeployApi: z.boolean().optional(),
|
hideDeployApi: z.boolean().optional(),
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const configSchema = z.object({
|
|||||||
hideFilesTab: z.boolean().optional(),
|
hideFilesTab: z.boolean().optional(),
|
||||||
disableMcpTools: z.boolean().optional(),
|
disableMcpTools: z.boolean().optional(),
|
||||||
disableCustomTools: z.boolean().optional(),
|
disableCustomTools: z.boolean().optional(),
|
||||||
disableSkills: z.boolean().optional(),
|
|
||||||
hideTemplates: z.boolean().optional(),
|
hideTemplates: z.boolean().optional(),
|
||||||
disableInvitations: z.boolean().optional(),
|
disableInvitations: z.boolean().optional(),
|
||||||
hideDeployApi: z.boolean().optional(),
|
hideDeployApi: z.boolean().optional(),
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
import { db } from '@sim/db'
|
|
||||||
import { skill } from '@sim/db/schema'
|
|
||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { and, desc, eq } from 'drizzle-orm'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { z } from 'zod'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { generateRequestId } from '@/lib/core/utils/request'
|
|
||||||
import { upsertSkills } from '@/lib/workflows/skills/operations'
|
|
||||||
import { getUserEntityPermissions } from '@/lib/workspaces/permissions/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('SkillsAPI')
|
|
||||||
|
|
||||||
const SkillSchema = z.object({
|
|
||||||
skills: z.array(
|
|
||||||
z.object({
|
|
||||||
id: z.string().optional(),
|
|
||||||
name: z
|
|
||||||
.string()
|
|
||||||
.min(1, 'Skill name is required')
|
|
||||||
.max(64)
|
|
||||||
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Name must be kebab-case (e.g. my-skill)'),
|
|
||||||
description: z.string().min(1, 'Description is required').max(1024),
|
|
||||||
content: z.string().min(1, 'Content is required').max(50000, 'Content is too large'),
|
|
||||||
})
|
|
||||||
),
|
|
||||||
workspaceId: z.string().optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
/** GET - Fetch all skills for a workspace */
|
|
||||||
export async function GET(request: NextRequest) {
|
|
||||||
const requestId = generateRequestId()
|
|
||||||
const searchParams = request.nextUrl.searchParams
|
|
||||||
const workspaceId = searchParams.get('workspaceId')
|
|
||||||
|
|
||||||
try {
|
|
||||||
const authResult = await checkSessionOrInternalAuth(request, { requireWorkflowId: false })
|
|
||||||
if (!authResult.success || !authResult.userId) {
|
|
||||||
logger.warn(`[${requestId}] Unauthorized skills access attempt`)
|
|
||||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const userId = authResult.userId
|
|
||||||
|
|
||||||
if (!workspaceId) {
|
|
||||||
logger.warn(`[${requestId}] Missing workspaceId`)
|
|
||||||
return NextResponse.json({ error: 'workspaceId is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const userPermission = await getUserEntityPermissions(userId, 'workspace', workspaceId)
|
|
||||||
if (!userPermission) {
|
|
||||||
logger.warn(`[${requestId}] User ${userId} does not have access to workspace ${workspaceId}`)
|
|
||||||
return NextResponse.json({ error: 'Access denied' }, { status: 403 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await db
|
|
||||||
.select()
|
|
||||||
.from(skill)
|
|
||||||
.where(eq(skill.workspaceId, workspaceId))
|
|
||||||
.orderBy(desc(skill.createdAt))
|
|
||||||
|
|
||||||
return NextResponse.json({ data: result }, { status: 200 })
|
|
||||||
} catch (error) {
|
|
||||||
logger.error(`[${requestId}] Error fetching skills:`, error)
|
|
||||||
return NextResponse.json({ error: 'Failed to fetch skills' }, { status: 500 })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** POST - Create or update skills */
|
|
||||||
export async function POST(req: NextRequest) {
|
|
||||||
const requestId = generateRequestId()
|
|
||||||
|
|
||||||
try {
|
|
||||||
const authResult = await checkSessionOrInternalAuth(req, { requireWorkflowId: false })
|
|
||||||
if (!authResult.success || !authResult.userId) {
|
|
||||||
logger.warn(`[${requestId}] Unauthorized skills update attempt`)
|
|
||||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const userId = authResult.userId
|
|
||||||
const body = await req.json()
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { skills, workspaceId } = SkillSchema.parse(body)
|
|
||||||
|
|
||||||
if (!workspaceId) {
|
|
||||||
logger.warn(`[${requestId}] Missing workspaceId in request body`)
|
|
||||||
return NextResponse.json({ error: 'workspaceId is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const userPermission = await getUserEntityPermissions(userId, 'workspace', workspaceId)
|
|
||||||
if (!userPermission || (userPermission !== 'admin' && userPermission !== 'write')) {
|
|
||||||
logger.warn(
|
|
||||||
`[${requestId}] User ${userId} does not have write permission for workspace ${workspaceId}`
|
|
||||||
)
|
|
||||||
return NextResponse.json({ error: 'Write permission required' }, { status: 403 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const resultSkills = await upsertSkills({
|
|
||||||
skills,
|
|
||||||
workspaceId,
|
|
||||||
userId,
|
|
||||||
requestId,
|
|
||||||
})
|
|
||||||
|
|
||||||
return NextResponse.json({ success: true, data: resultSkills })
|
|
||||||
} catch (validationError) {
|
|
||||||
if (validationError instanceof z.ZodError) {
|
|
||||||
logger.warn(`[${requestId}] Invalid skills data`, {
|
|
||||||
errors: validationError.errors,
|
|
||||||
})
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: 'Invalid request data', details: validationError.errors },
|
|
||||||
{ status: 400 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (validationError instanceof Error && validationError.message.includes('already exists')) {
|
|
||||||
return NextResponse.json({ error: validationError.message }, { status: 409 })
|
|
||||||
}
|
|
||||||
throw validationError
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
logger.error(`[${requestId}] Error updating skills`, error)
|
|
||||||
return NextResponse.json({ error: 'Failed to update skills' }, { status: 500 })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** DELETE - Delete a skill by ID */
|
|
||||||
export async function DELETE(request: NextRequest) {
|
|
||||||
const requestId = generateRequestId()
|
|
||||||
const searchParams = request.nextUrl.searchParams
|
|
||||||
const skillId = searchParams.get('id')
|
|
||||||
const workspaceId = searchParams.get('workspaceId')
|
|
||||||
|
|
||||||
try {
|
|
||||||
const authResult = await checkSessionOrInternalAuth(request, { requireWorkflowId: false })
|
|
||||||
if (!authResult.success || !authResult.userId) {
|
|
||||||
logger.warn(`[${requestId}] Unauthorized skill deletion attempt`)
|
|
||||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const userId = authResult.userId
|
|
||||||
|
|
||||||
if (!skillId) {
|
|
||||||
logger.warn(`[${requestId}] Missing skill ID for deletion`)
|
|
||||||
return NextResponse.json({ error: 'Skill ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!workspaceId) {
|
|
||||||
logger.warn(`[${requestId}] Missing workspaceId for deletion`)
|
|
||||||
return NextResponse.json({ error: 'workspaceId is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const userPermission = await getUserEntityPermissions(userId, 'workspace', workspaceId)
|
|
||||||
if (!userPermission || (userPermission !== 'admin' && userPermission !== 'write')) {
|
|
||||||
logger.warn(
|
|
||||||
`[${requestId}] User ${userId} does not have write permission for workspace ${workspaceId}`
|
|
||||||
)
|
|
||||||
return NextResponse.json({ error: 'Write permission required' }, { status: 403 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const existingSkill = await db.select().from(skill).where(eq(skill.id, skillId)).limit(1)
|
|
||||||
|
|
||||||
if (existingSkill.length === 0) {
|
|
||||||
logger.warn(`[${requestId}] Skill not found: ${skillId}`)
|
|
||||||
return NextResponse.json({ error: 'Skill not found' }, { status: 404 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (existingSkill[0].workspaceId !== workspaceId) {
|
|
||||||
logger.warn(`[${requestId}] Skill ${skillId} does not belong to workspace ${workspaceId}`)
|
|
||||||
return NextResponse.json({ error: 'Skill not found' }, { status: 404 })
|
|
||||||
}
|
|
||||||
|
|
||||||
await db.delete(skill).where(and(eq(skill.id, skillId), eq(skill.workspaceId, workspaceId)))
|
|
||||||
|
|
||||||
logger.info(`[${requestId}] Deleted skill: ${skillId}`)
|
|
||||||
return NextResponse.json({ success: true })
|
|
||||||
} catch (error) {
|
|
||||||
logger.error(`[${requestId}] Error deleting skill:`, error)
|
|
||||||
return NextResponse.json({ error: 'Failed to delete skill' }, { status: 500 })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,8 +21,7 @@ export async function GET(request: NextRequest) {
|
|||||||
const accessToken = searchParams.get('accessToken')
|
const accessToken = searchParams.get('accessToken')
|
||||||
const pageId = searchParams.get('pageId')
|
const pageId = searchParams.get('pageId')
|
||||||
const providedCloudId = searchParams.get('cloudId')
|
const providedCloudId = searchParams.get('cloudId')
|
||||||
const limit = searchParams.get('limit') || '50'
|
const limit = searchParams.get('limit') || '25'
|
||||||
const cursor = searchParams.get('cursor')
|
|
||||||
|
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
||||||
@@ -48,12 +47,7 @@ export async function GET(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/attachments?limit=${limit}`
|
||||||
queryParams.append('limit', String(Math.min(Number(limit), 250)))
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/attachments?${queryParams.toString()}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -83,20 +77,9 @@ export async function GET(request: NextRequest) {
|
|||||||
fileSize: attachment.fileSize || 0,
|
fileSize: attachment.fileSize || 0,
|
||||||
mediaType: attachment.mediaType || '',
|
mediaType: attachment.mediaType || '',
|
||||||
downloadUrl: attachment.downloadLink || attachment._links?.download || '',
|
downloadUrl: attachment.downloadLink || attachment._links?.download || '',
|
||||||
status: attachment.status ?? null,
|
|
||||||
webuiUrl: attachment._links?.webui ?? null,
|
|
||||||
pageId: attachment.pageId ?? null,
|
|
||||||
blogPostId: attachment.blogPostId ?? null,
|
|
||||||
comment: attachment.comment ?? null,
|
|
||||||
version: attachment.version ?? null,
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({ attachments })
|
||||||
attachments,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error listing Confluence attachments:', error)
|
logger.error('Error listing Confluence attachments:', error)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|||||||
@@ -1,285 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { z } from 'zod'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluenceBlogPostsAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
const getBlogPostSchema = z
|
|
||||||
.object({
|
|
||||||
domain: z.string().min(1, 'Domain is required'),
|
|
||||||
accessToken: z.string().min(1, 'Access token is required'),
|
|
||||||
cloudId: z.string().optional(),
|
|
||||||
blogPostId: z.string().min(1, 'Blog post ID is required'),
|
|
||||||
bodyFormat: z.string().optional(),
|
|
||||||
})
|
|
||||||
.refine(
|
|
||||||
(data) => {
|
|
||||||
const validation = validateAlphanumericId(data.blogPostId, 'blogPostId', 255)
|
|
||||||
return validation.isValid
|
|
||||||
},
|
|
||||||
(data) => {
|
|
||||||
const validation = validateAlphanumericId(data.blogPostId, 'blogPostId', 255)
|
|
||||||
return { message: validation.error || 'Invalid blog post ID', path: ['blogPostId'] }
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const createBlogPostSchema = z.object({
|
|
||||||
domain: z.string().min(1, 'Domain is required'),
|
|
||||||
accessToken: z.string().min(1, 'Access token is required'),
|
|
||||||
cloudId: z.string().optional(),
|
|
||||||
spaceId: z.string().min(1, 'Space ID is required'),
|
|
||||||
title: z.string().min(1, 'Title is required'),
|
|
||||||
content: z.string().min(1, 'Content is required'),
|
|
||||||
status: z.enum(['current', 'draft']).optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List all blog posts or get a specific blog post
|
|
||||||
*/
|
|
||||||
export async function GET(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const { searchParams } = new URL(request.url)
|
|
||||||
const domain = searchParams.get('domain')
|
|
||||||
const accessToken = searchParams.get('accessToken')
|
|
||||||
const providedCloudId = searchParams.get('cloudId')
|
|
||||||
const limit = searchParams.get('limit') || '25'
|
|
||||||
const status = searchParams.get('status')
|
|
||||||
const sortOrder = searchParams.get('sort')
|
|
||||||
const cursor = searchParams.get('cursor')
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(Number(limit), 250)))
|
|
||||||
|
|
||||||
if (status) {
|
|
||||||
queryParams.append('status', status)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sortOrder) {
|
|
||||||
queryParams.append('sort', sortOrder)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/blogposts?${queryParams.toString()}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to list blog posts (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const blogPosts = (data.results || []).map((post: any) => ({
|
|
||||||
id: post.id,
|
|
||||||
title: post.title,
|
|
||||||
status: post.status ?? null,
|
|
||||||
spaceId: post.spaceId ?? null,
|
|
||||||
authorId: post.authorId ?? null,
|
|
||||||
createdAt: post.createdAt ?? null,
|
|
||||||
version: post.version ?? null,
|
|
||||||
webUrl: post._links?.webui ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
blogPosts,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error listing blog posts:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a specific blog post by ID
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
|
|
||||||
// Check if this is a create or get request
|
|
||||||
if (body.title && body.content && body.spaceId) {
|
|
||||||
// Create blog post
|
|
||||||
const validation = createBlogPostSchema.safeParse(body)
|
|
||||||
if (!validation.success) {
|
|
||||||
const firstError = validation.error.errors[0]
|
|
||||||
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
spaceId,
|
|
||||||
title,
|
|
||||||
content,
|
|
||||||
status,
|
|
||||||
} = validation.data
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/blogposts`
|
|
||||||
|
|
||||||
const createBody = {
|
|
||||||
spaceId,
|
|
||||||
status: status || 'current',
|
|
||||||
title,
|
|
||||||
body: {
|
|
||||||
representation: 'storage',
|
|
||||||
value: content,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
body: JSON.stringify(createBody),
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to create blog post (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
return NextResponse.json({
|
|
||||||
id: data.id,
|
|
||||||
title: data.title,
|
|
||||||
spaceId: data.spaceId,
|
|
||||||
webUrl: data._links?.webui ?? null,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// Get blog post by ID
|
|
||||||
const validation = getBlogPostSchema.safeParse(body)
|
|
||||||
if (!validation.success) {
|
|
||||||
const firstError = validation.error.errors[0]
|
|
||||||
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
blogPostId,
|
|
||||||
bodyFormat,
|
|
||||||
} = validation.data
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
if (bodyFormat) {
|
|
||||||
queryParams.append('body-format', bodyFormat)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/blogposts/${blogPostId}${queryParams.toString() ? `?${queryParams.toString()}` : ''}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to get blog post (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
return NextResponse.json({
|
|
||||||
id: data.id,
|
|
||||||
title: data.title,
|
|
||||||
status: data.status ?? null,
|
|
||||||
spaceId: data.spaceId ?? null,
|
|
||||||
authorId: data.authorId ?? null,
|
|
||||||
createdAt: data.createdAt ?? null,
|
|
||||||
version: data.version ?? null,
|
|
||||||
body: data.body ?? null,
|
|
||||||
webUrl: data._links?.webui ?? null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error with blog post operation:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -105,8 +105,6 @@ export async function GET(request: NextRequest) {
|
|||||||
const pageId = searchParams.get('pageId')
|
const pageId = searchParams.get('pageId')
|
||||||
const providedCloudId = searchParams.get('cloudId')
|
const providedCloudId = searchParams.get('cloudId')
|
||||||
const limit = searchParams.get('limit') || '25'
|
const limit = searchParams.get('limit') || '25'
|
||||||
const bodyFormat = searchParams.get('bodyFormat') || 'storage'
|
|
||||||
const cursor = searchParams.get('cursor')
|
|
||||||
|
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
||||||
@@ -132,13 +130,7 @@ export async function GET(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/footer-comments?limit=${limit}`
|
||||||
queryParams.append('limit', String(Math.min(Number(limit), 250)))
|
|
||||||
queryParams.append('body-format', bodyFormat)
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/footer-comments?${queryParams.toString()}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -162,31 +154,14 @@ export async function GET(request: NextRequest) {
|
|||||||
|
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
|
|
||||||
const comments = (data.results || []).map((comment: any) => {
|
const comments = (data.results || []).map((comment: any) => ({
|
||||||
const bodyValue = comment.body?.storage?.value || comment.body?.view?.value || ''
|
id: comment.id,
|
||||||
return {
|
body: comment.body?.storage?.value || comment.body?.view?.value || '',
|
||||||
id: comment.id,
|
createdAt: comment.createdAt || '',
|
||||||
body: {
|
authorId: comment.authorId || '',
|
||||||
value: bodyValue,
|
}))
|
||||||
representation: bodyFormat,
|
|
||||||
},
|
|
||||||
createdAt: comment.createdAt || '',
|
|
||||||
authorId: comment.authorId || '',
|
|
||||||
status: comment.status ?? null,
|
|
||||||
title: comment.title ?? null,
|
|
||||||
pageId: comment.pageId ?? null,
|
|
||||||
blogPostId: comment.blogPostId ?? null,
|
|
||||||
parentCommentId: comment.parentCommentId ?? null,
|
|
||||||
version: comment.version ?? null,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({ comments })
|
||||||
comments,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error listing Confluence comments:', error)
|
logger.error('Error listing Confluence comments:', error)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export async function POST(request: NextRequest) {
|
|||||||
cloudId: providedCloudId,
|
cloudId: providedCloudId,
|
||||||
pageId,
|
pageId,
|
||||||
labelName,
|
labelName,
|
||||||
prefix: labelPrefix,
|
|
||||||
} = await request.json()
|
} = await request.json()
|
||||||
|
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
@@ -53,14 +52,12 @@ export async function POST(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/rest/api/content/${pageId}/label`
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/labels`
|
||||||
|
|
||||||
const body = [
|
const body = {
|
||||||
{
|
prefix: 'global',
|
||||||
prefix: labelPrefix || 'global',
|
name: labelName,
|
||||||
name: labelName,
|
}
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -85,14 +82,7 @@ export async function POST(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
const addedLabel = data.results?.[0] || data[0] || data
|
return NextResponse.json({ ...data, pageId, labelName })
|
||||||
return NextResponse.json({
|
|
||||||
id: addedLabel.id ?? '',
|
|
||||||
name: addedLabel.name ?? labelName,
|
|
||||||
prefix: addedLabel.prefix ?? labelPrefix ?? 'global',
|
|
||||||
pageId,
|
|
||||||
labelName,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error adding Confluence label:', error)
|
logger.error('Error adding Confluence label:', error)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
@@ -115,8 +105,6 @@ export async function GET(request: NextRequest) {
|
|||||||
const accessToken = searchParams.get('accessToken')
|
const accessToken = searchParams.get('accessToken')
|
||||||
const pageId = searchParams.get('pageId')
|
const pageId = searchParams.get('pageId')
|
||||||
const providedCloudId = searchParams.get('cloudId')
|
const providedCloudId = searchParams.get('cloudId')
|
||||||
const limit = searchParams.get('limit') || '25'
|
|
||||||
const cursor = searchParams.get('cursor')
|
|
||||||
|
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
||||||
@@ -142,12 +130,7 @@ export async function GET(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/labels`
|
||||||
queryParams.append('limit', String(Math.min(Number(limit), 250)))
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/labels?${queryParams.toString()}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -177,12 +160,7 @@ export async function GET(request: NextRequest) {
|
|||||||
prefix: label.prefix || 'global',
|
prefix: label.prefix || 'global',
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({ labels })
|
||||||
labels,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error listing Confluence labels:', error)
|
logger.error('Error listing Confluence labels:', error)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluencePageAncestorsAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get ancestors (parent pages) of a specific Confluence page.
|
|
||||||
* Uses GET /wiki/api/v2/pages/{id}/ancestors
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
const { domain, accessToken, pageId, cloudId: providedCloudId, limit = 25 } = body
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pageId) {
|
|
||||||
return NextResponse.json({ error: 'Page ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(limit, 250)))
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/ancestors?${queryParams.toString()}`
|
|
||||||
|
|
||||||
logger.info(`Fetching ancestors for page ${pageId}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to get page ancestors (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const ancestors = (data.results || []).map((page: any) => ({
|
|
||||||
id: page.id,
|
|
||||||
title: page.title,
|
|
||||||
status: page.status ?? null,
|
|
||||||
spaceId: page.spaceId ?? null,
|
|
||||||
webUrl: page._links?.webui ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
ancestors,
|
|
||||||
pageId,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error getting page ancestors:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluencePageChildrenAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get child pages of a specific Confluence page.
|
|
||||||
* Uses GET /wiki/api/v2/pages/{id}/children
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
const { domain, accessToken, pageId, cloudId: providedCloudId, limit = 50, cursor } = body
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pageId) {
|
|
||||||
return NextResponse.json({ error: 'Page ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(limit, 250)))
|
|
||||||
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/children?${queryParams.toString()}`
|
|
||||||
|
|
||||||
logger.info(`Fetching child pages for page ${pageId}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to get child pages (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const children = (data.results || []).map((page: any) => ({
|
|
||||||
id: page.id,
|
|
||||||
title: page.title,
|
|
||||||
status: page.status ?? null,
|
|
||||||
spaceId: page.spaceId ?? null,
|
|
||||||
childPosition: page.childPosition ?? null,
|
|
||||||
webUrl: page._links?.webui ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
children,
|
|
||||||
parentId: pageId,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error getting child pages:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,365 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { z } from 'zod'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluencePagePropertiesAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
const createPropertySchema = z.object({
|
|
||||||
domain: z.string().min(1, 'Domain is required'),
|
|
||||||
accessToken: z.string().min(1, 'Access token is required'),
|
|
||||||
cloudId: z.string().optional(),
|
|
||||||
pageId: z.string().min(1, 'Page ID is required'),
|
|
||||||
key: z.string().min(1, 'Property key is required'),
|
|
||||||
value: z.any(),
|
|
||||||
})
|
|
||||||
|
|
||||||
const updatePropertySchema = z.object({
|
|
||||||
domain: z.string().min(1, 'Domain is required'),
|
|
||||||
accessToken: z.string().min(1, 'Access token is required'),
|
|
||||||
cloudId: z.string().optional(),
|
|
||||||
pageId: z.string().min(1, 'Page ID is required'),
|
|
||||||
propertyId: z.string().min(1, 'Property ID is required'),
|
|
||||||
key: z.string().min(1, 'Property key is required'),
|
|
||||||
value: z.any(),
|
|
||||||
versionNumber: z.number().min(1, 'Version number is required'),
|
|
||||||
})
|
|
||||||
|
|
||||||
const deletePropertySchema = z.object({
|
|
||||||
domain: z.string().min(1, 'Domain is required'),
|
|
||||||
accessToken: z.string().min(1, 'Access token is required'),
|
|
||||||
cloudId: z.string().optional(),
|
|
||||||
pageId: z.string().min(1, 'Page ID is required'),
|
|
||||||
propertyId: z.string().min(1, 'Property ID is required'),
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List all content properties on a page.
|
|
||||||
*/
|
|
||||||
export async function GET(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const { searchParams } = new URL(request.url)
|
|
||||||
const domain = searchParams.get('domain')
|
|
||||||
const accessToken = searchParams.get('accessToken')
|
|
||||||
const pageId = searchParams.get('pageId')
|
|
||||||
const providedCloudId = searchParams.get('cloudId')
|
|
||||||
const limit = searchParams.get('limit') || '50'
|
|
||||||
const cursor = searchParams.get('cursor')
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pageId) {
|
|
||||||
return NextResponse.json({ error: 'Page ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(Number(limit), 250)))
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/properties?${queryParams.toString()}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage =
|
|
||||||
errorData?.message || `Failed to list page properties (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const properties = (data.results || []).map((prop: any) => ({
|
|
||||||
id: prop.id,
|
|
||||||
key: prop.key,
|
|
||||||
value: prop.value ?? null,
|
|
||||||
version: prop.version ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
properties,
|
|
||||||
pageId,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error listing page properties:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new content property on a page.
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
|
|
||||||
const validation = createPropertySchema.safeParse(body)
|
|
||||||
if (!validation.success) {
|
|
||||||
const firstError = validation.error.errors[0]
|
|
||||||
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const { domain, accessToken, cloudId: providedCloudId, pageId, key, value } = validation.data
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/properties`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
body: JSON.stringify({ key, value }),
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage =
|
|
||||||
errorData?.message || `Failed to create page property (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
return NextResponse.json({
|
|
||||||
id: data.id,
|
|
||||||
key: data.key,
|
|
||||||
value: data.value,
|
|
||||||
version: data.version,
|
|
||||||
pageId,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error creating page property:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update a content property on a page.
|
|
||||||
*/
|
|
||||||
export async function PUT(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
|
|
||||||
const validation = updatePropertySchema.safeParse(body)
|
|
||||||
if (!validation.success) {
|
|
||||||
const firstError = validation.error.errors[0]
|
|
||||||
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
pageId,
|
|
||||||
propertyId,
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
versionNumber,
|
|
||||||
} = validation.data
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const propertyIdValidation = validateAlphanumericId(propertyId, 'propertyId', 255)
|
|
||||||
if (!propertyIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: propertyIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/properties/${propertyId}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'PUT',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
version: { number: versionNumber },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage =
|
|
||||||
errorData?.message || `Failed to update page property (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
return NextResponse.json({
|
|
||||||
id: data.id,
|
|
||||||
key: data.key,
|
|
||||||
value: data.value,
|
|
||||||
version: data.version,
|
|
||||||
pageId,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error updating page property:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete a content property from a page.
|
|
||||||
*/
|
|
||||||
export async function DELETE(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
|
|
||||||
const validation = deletePropertySchema.safeParse(body)
|
|
||||||
if (!validation.success) {
|
|
||||||
const firstError = validation.error.errors[0]
|
|
||||||
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const { domain, accessToken, cloudId: providedCloudId, pageId, propertyId } = validation.data
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const propertyIdValidation = validateAlphanumericId(propertyId, 'propertyId', 255)
|
|
||||||
if (!propertyIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: propertyIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/properties/${propertyId}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'DELETE',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage =
|
|
||||||
errorData?.message || `Failed to delete page property (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
return NextResponse.json({ propertyId, pageId, deleted: true })
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error deleting page property:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluencePageVersionsAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List all versions of a page or get a specific version.
|
|
||||||
* Uses GET /wiki/api/v2/pages/{id}/versions
|
|
||||||
* and GET /wiki/api/v2/pages/{page-id}/versions/{version-number}
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
pageId,
|
|
||||||
versionNumber,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
limit = 50,
|
|
||||||
cursor,
|
|
||||||
} = body
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pageId) {
|
|
||||||
return NextResponse.json({ error: 'Page ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const pageIdValidation = validateAlphanumericId(pageId, 'pageId', 255)
|
|
||||||
if (!pageIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: pageIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
// If versionNumber is provided, get specific version
|
|
||||||
if (versionNumber !== undefined && versionNumber !== null) {
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/versions/${versionNumber}`
|
|
||||||
|
|
||||||
logger.info(`Fetching version ${versionNumber} for page ${pageId}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to get page version (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
version: {
|
|
||||||
number: data.number,
|
|
||||||
message: data.message ?? null,
|
|
||||||
minorEdit: data.minorEdit ?? false,
|
|
||||||
authorId: data.authorId ?? null,
|
|
||||||
createdAt: data.createdAt ?? null,
|
|
||||||
},
|
|
||||||
pageId,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// List all versions
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(limit, 250)))
|
|
||||||
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/versions?${queryParams.toString()}`
|
|
||||||
|
|
||||||
logger.info(`Fetching versions for page ${pageId}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to list page versions (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const versions = (data.results || []).map((version: any) => ({
|
|
||||||
number: version.number,
|
|
||||||
message: version.message ?? null,
|
|
||||||
minorEdit: version.minorEdit ?? false,
|
|
||||||
authorId: version.authorId ?? null,
|
|
||||||
createdAt: version.createdAt ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
versions,
|
|
||||||
pageId,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error with page versions:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -62,7 +62,6 @@ const deletePageSchema = z
|
|||||||
accessToken: z.string().min(1, 'Access token is required'),
|
accessToken: z.string().min(1, 'Access token is required'),
|
||||||
cloudId: z.string().optional(),
|
cloudId: z.string().optional(),
|
||||||
pageId: z.string().min(1, 'Page ID is required'),
|
pageId: z.string().min(1, 'Page ID is required'),
|
||||||
purge: z.boolean().optional(),
|
|
||||||
})
|
})
|
||||||
.refine(
|
.refine(
|
||||||
(data) => {
|
(data) => {
|
||||||
@@ -99,7 +98,7 @@ export async function POST(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}?body-format=storage`
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}?expand=body.storage,body.view,body.atlas_doc_format`
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -131,18 +130,16 @@ export async function POST(request: NextRequest) {
|
|||||||
id: data.id,
|
id: data.id,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
body: {
|
body: {
|
||||||
storage: {
|
view: {
|
||||||
value: data.body?.storage?.value ?? null,
|
value:
|
||||||
representation: 'storage',
|
data.body?.storage?.value ||
|
||||||
|
data.body?.view?.value ||
|
||||||
|
data.body?.atlas_doc_format?.value ||
|
||||||
|
data.content || // try alternative fields
|
||||||
|
data.description ||
|
||||||
|
`Content for page ${data.title}`, // fallback content
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
status: data.status ?? null,
|
|
||||||
spaceId: data.spaceId ?? null,
|
|
||||||
parentId: data.parentId ?? null,
|
|
||||||
authorId: data.authorId ?? null,
|
|
||||||
createdAt: data.createdAt ?? null,
|
|
||||||
version: data.version ?? null,
|
|
||||||
_links: data._links ?? null,
|
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error fetching Confluence page:', error)
|
logger.error('Error fetching Confluence page:', error)
|
||||||
@@ -277,7 +274,7 @@ export async function DELETE(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
return NextResponse.json({ error: firstError.message }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const { domain, accessToken, cloudId: providedCloudId, pageId, purge } = validation.data
|
const { domain, accessToken, cloudId: providedCloudId, pageId } = validation.data
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
||||||
|
|
||||||
@@ -286,12 +283,7 @@ export async function DELETE(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}`
|
||||||
if (purge) {
|
|
||||||
queryParams.append('purge', 'true')
|
|
||||||
}
|
|
||||||
const queryString = queryParams.toString()
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}${queryString ? `?${queryString}` : ''}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export async function POST(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use provided cloudId or fetch it if not provided
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
||||||
@@ -39,6 +40,7 @@ export async function POST(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Build the URL with query parameters
|
||||||
const baseUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages`
|
const baseUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages`
|
||||||
const queryParams = new URLSearchParams()
|
const queryParams = new URLSearchParams()
|
||||||
|
|
||||||
@@ -55,6 +57,7 @@ export async function POST(request: NextRequest) {
|
|||||||
|
|
||||||
logger.info(`Fetching Confluence pages from: ${url}`)
|
logger.info(`Fetching Confluence pages from: ${url}`)
|
||||||
|
|
||||||
|
// Make the request to Confluence API with OAuth Bearer token
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -76,6 +79,7 @@ export async function POST(request: NextRequest) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error('Could not parse error response as JSON:', e)
|
logger.error('Could not parse error response as JSON:', e)
|
||||||
|
|
||||||
|
// Try to get the response text for more context
|
||||||
try {
|
try {
|
||||||
const text = await response.text()
|
const text = await response.text()
|
||||||
logger.error('Response text:', text)
|
logger.error('Response text:', text)
|
||||||
|
|||||||
@@ -1,120 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluenceSearchInSpaceAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Search for content within a specific Confluence space using CQL.
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
spaceKey,
|
|
||||||
query,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
limit = 25,
|
|
||||||
contentType,
|
|
||||||
} = body
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!spaceKey) {
|
|
||||||
return NextResponse.json({ error: 'Space key is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const spaceKeyValidation = validateAlphanumericId(spaceKey, 'spaceKey', 255)
|
|
||||||
if (!spaceKeyValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: spaceKeyValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const escapeCqlValue = (value: string) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
|
|
||||||
|
|
||||||
let cql = `space = "${escapeCqlValue(spaceKey)}"`
|
|
||||||
|
|
||||||
if (query) {
|
|
||||||
cql += ` AND text ~ "${escapeCqlValue(query)}"`
|
|
||||||
}
|
|
||||||
|
|
||||||
if (contentType) {
|
|
||||||
cql += ` AND type = "${escapeCqlValue(contentType)}"`
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchParams = new URLSearchParams({
|
|
||||||
cql,
|
|
||||||
limit: String(Math.min(limit, 250)),
|
|
||||||
})
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/rest/api/search?${searchParams.toString()}`
|
|
||||||
|
|
||||||
logger.info(`Searching in space ${spaceKey} with CQL: ${cql}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage = errorData?.message || `Failed to search in space (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const results = (data.results || []).map((result: any) => ({
|
|
||||||
id: result.content?.id ?? result.id,
|
|
||||||
title: result.content?.title ?? result.title,
|
|
||||||
type: result.content?.type ?? result.type,
|
|
||||||
status: result.content?.status ?? null,
|
|
||||||
url: result.url ?? result._links?.webui ?? '',
|
|
||||||
excerpt: result.excerpt ?? '',
|
|
||||||
lastModified: result.lastModified ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
results,
|
|
||||||
spaceKey,
|
|
||||||
totalSize: data.totalSize ?? results.length,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error searching in space:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -42,10 +42,8 @@ export async function POST(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const escapeCqlValue = (value: string) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
|
|
||||||
|
|
||||||
const searchParams = new URLSearchParams({
|
const searchParams = new URLSearchParams({
|
||||||
cql: `text ~ "${escapeCqlValue(query)}"`,
|
cql: `text ~ "${query}"`,
|
||||||
limit: limit.toString(),
|
limit: limit.toString(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -72,27 +70,13 @@ export async function POST(request: NextRequest) {
|
|||||||
|
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
|
|
||||||
const results = (data.results || []).map((result: any) => {
|
const results = (data.results || []).map((result: any) => ({
|
||||||
const spaceData = result.resultGlobalContainer || result.content?.space
|
id: result.content?.id || result.id,
|
||||||
return {
|
title: result.content?.title || result.title,
|
||||||
id: result.content?.id || result.id,
|
type: result.content?.type || result.type,
|
||||||
title: result.content?.title || result.title,
|
url: result.url || result._links?.webui || '',
|
||||||
type: result.content?.type || result.type,
|
excerpt: result.excerpt || '',
|
||||||
url: result.url || result._links?.webui || '',
|
}))
|
||||||
excerpt: result.excerpt || '',
|
|
||||||
status: result.content?.status ?? null,
|
|
||||||
spaceKey: result.resultGlobalContainer?.key ?? result.content?.space?.key ?? null,
|
|
||||||
space: spaceData
|
|
||||||
? {
|
|
||||||
id: spaceData.id ?? null,
|
|
||||||
key: spaceData.key ?? null,
|
|
||||||
name: spaceData.name ?? spaceData.title ?? null,
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
lastModified: result.lastModified ?? result.content?.history?.lastUpdated?.when ?? null,
|
|
||||||
entityType: result.entityType ?? null,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return NextResponse.json({ results })
|
return NextResponse.json({ results })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,124 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluenceSpaceBlogPostsAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List all blog posts in a specific Confluence space.
|
|
||||||
* Uses GET /wiki/api/v2/spaces/{id}/blogposts
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
spaceId,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
limit = 25,
|
|
||||||
status,
|
|
||||||
bodyFormat,
|
|
||||||
cursor,
|
|
||||||
} = body
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!spaceId) {
|
|
||||||
return NextResponse.json({ error: 'Space ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const spaceIdValidation = validateAlphanumericId(spaceId, 'spaceId', 255)
|
|
||||||
if (!spaceIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: spaceIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(limit, 250)))
|
|
||||||
|
|
||||||
if (status) {
|
|
||||||
queryParams.append('status', status)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bodyFormat) {
|
|
||||||
queryParams.append('body-format', bodyFormat)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/spaces/${spaceId}/blogposts?${queryParams.toString()}`
|
|
||||||
|
|
||||||
logger.info(`Fetching blog posts in space ${spaceId}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage =
|
|
||||||
errorData?.message || `Failed to list blog posts in space (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const blogPosts = (data.results || []).map((post: any) => ({
|
|
||||||
id: post.id,
|
|
||||||
title: post.title,
|
|
||||||
status: post.status ?? null,
|
|
||||||
spaceId: post.spaceId ?? null,
|
|
||||||
authorId: post.authorId ?? null,
|
|
||||||
createdAt: post.createdAt ?? null,
|
|
||||||
version: post.version ?? null,
|
|
||||||
body: post.body ?? null,
|
|
||||||
webUrl: post._links?.webui ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
blogPosts,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error listing blog posts in space:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
import { createLogger } from '@sim/logger'
|
|
||||||
import { type NextRequest, NextResponse } from 'next/server'
|
|
||||||
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
|
|
||||||
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
|
|
||||||
import { getConfluenceCloudId } from '@/tools/confluence/utils'
|
|
||||||
|
|
||||||
const logger = createLogger('ConfluenceSpacePagesAPI')
|
|
||||||
|
|
||||||
export const dynamic = 'force-dynamic'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List all pages in a specific Confluence space.
|
|
||||||
* Uses GET /wiki/api/v2/spaces/{id}/pages
|
|
||||||
*/
|
|
||||||
export async function POST(request: NextRequest) {
|
|
||||||
try {
|
|
||||||
const auth = await checkSessionOrInternalAuth(request)
|
|
||||||
if (!auth.success || !auth.userId) {
|
|
||||||
return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const body = await request.json()
|
|
||||||
const {
|
|
||||||
domain,
|
|
||||||
accessToken,
|
|
||||||
spaceId,
|
|
||||||
cloudId: providedCloudId,
|
|
||||||
limit = 50,
|
|
||||||
status,
|
|
||||||
bodyFormat,
|
|
||||||
cursor,
|
|
||||||
} = body
|
|
||||||
|
|
||||||
if (!domain) {
|
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accessToken) {
|
|
||||||
return NextResponse.json({ error: 'Access token is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!spaceId) {
|
|
||||||
return NextResponse.json({ error: 'Space ID is required' }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const spaceIdValidation = validateAlphanumericId(spaceId, 'spaceId', 255)
|
|
||||||
if (!spaceIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: spaceIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const cloudId = providedCloudId || (await getConfluenceCloudId(domain, accessToken))
|
|
||||||
|
|
||||||
const cloudIdValidation = validateJiraCloudId(cloudId, 'cloudId')
|
|
||||||
if (!cloudIdValidation.isValid) {
|
|
||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
|
||||||
queryParams.append('limit', String(Math.min(limit, 250)))
|
|
||||||
|
|
||||||
if (status) {
|
|
||||||
queryParams.append('status', status)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bodyFormat) {
|
|
||||||
queryParams.append('body-format', bodyFormat)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/spaces/${spaceId}/pages?${queryParams.toString()}`
|
|
||||||
|
|
||||||
logger.info(`Fetching pages in space ${spaceId}`)
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Accept: 'application/json',
|
|
||||||
Authorization: `Bearer ${accessToken}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
const errorData = await response.json().catch(() => null)
|
|
||||||
logger.error('Confluence API error response:', {
|
|
||||||
status: response.status,
|
|
||||||
statusText: response.statusText,
|
|
||||||
error: JSON.stringify(errorData, null, 2),
|
|
||||||
})
|
|
||||||
const errorMessage =
|
|
||||||
errorData?.message || `Failed to list pages in space (${response.status})`
|
|
||||||
return NextResponse.json({ error: errorMessage }, { status: response.status })
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json()
|
|
||||||
|
|
||||||
const pages = (data.results || []).map((page: any) => ({
|
|
||||||
id: page.id,
|
|
||||||
title: page.title,
|
|
||||||
status: page.status ?? null,
|
|
||||||
spaceId: page.spaceId ?? null,
|
|
||||||
parentId: page.parentId ?? null,
|
|
||||||
authorId: page.authorId ?? null,
|
|
||||||
createdAt: page.createdAt ?? null,
|
|
||||||
version: page.version ?? null,
|
|
||||||
body: page.body ?? null,
|
|
||||||
webUrl: page._links?.webui ?? null,
|
|
||||||
}))
|
|
||||||
|
|
||||||
return NextResponse.json({
|
|
||||||
pages,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
|
||||||
logger.error('Error listing pages in space:', error)
|
|
||||||
return NextResponse.json(
|
|
||||||
{ error: (error as Error).message || 'Internal server error' },
|
|
||||||
{ status: 500 }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,6 @@ export async function GET(request: NextRequest) {
|
|||||||
const accessToken = searchParams.get('accessToken')
|
const accessToken = searchParams.get('accessToken')
|
||||||
const providedCloudId = searchParams.get('cloudId')
|
const providedCloudId = searchParams.get('cloudId')
|
||||||
const limit = searchParams.get('limit') || '25'
|
const limit = searchParams.get('limit') || '25'
|
||||||
const cursor = searchParams.get('cursor')
|
|
||||||
|
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
return NextResponse.json({ error: 'Domain is required' }, { status: 400 })
|
||||||
@@ -38,12 +37,7 @@ export async function GET(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryParams = new URLSearchParams()
|
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/spaces?limit=${limit}`
|
||||||
queryParams.append('limit', String(Math.min(Number(limit), 250)))
|
|
||||||
if (cursor) {
|
|
||||||
queryParams.append('cursor', cursor)
|
|
||||||
}
|
|
||||||
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/spaces?${queryParams.toString()}`
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -73,18 +67,9 @@ export async function GET(request: NextRequest) {
|
|||||||
key: space.key,
|
key: space.key,
|
||||||
type: space.type,
|
type: space.type,
|
||||||
status: space.status,
|
status: space.status,
|
||||||
authorId: space.authorId ?? null,
|
|
||||||
createdAt: space.createdAt ?? null,
|
|
||||||
homepageId: space.homepageId ?? null,
|
|
||||||
description: space.description ?? null,
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({ spaces })
|
||||||
spaces,
|
|
||||||
nextCursor: data._links?.next
|
|
||||||
? new URL(data._links.next, 'https://placeholder').searchParams.get('cursor')
|
|
||||||
: null,
|
|
||||||
})
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Error listing Confluence spaces:', error)
|
logger.error('Error listing Confluence spaces:', error)
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|||||||
@@ -73,11 +73,13 @@ export async function POST(req: NextRequest) {
|
|||||||
message: parsed.message,
|
message: parsed.message,
|
||||||
workflowId: resolved.workflowId,
|
workflowId: resolved.workflowId,
|
||||||
userId: auth.userId,
|
userId: auth.userId,
|
||||||
|
stream: true,
|
||||||
|
streamToolCalls: true,
|
||||||
model: selectedModel,
|
model: selectedModel,
|
||||||
mode: transportMode,
|
mode: transportMode,
|
||||||
messageId: crypto.randomUUID(),
|
messageId: crypto.randomUUID(),
|
||||||
version: SIM_AGENT_VERSION,
|
version: SIM_AGENT_VERSION,
|
||||||
headless: true,
|
headless: true, // Enable cross-workflow operations via workflowId params
|
||||||
chatId,
|
chatId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { GithubIcon } from '@/components/icons'
|
import { GithubIcon } from '@/components/icons'
|
||||||
|
import { useBrandConfig } from '@/lib/branding/branding'
|
||||||
import { inter } from '@/app/_styles/fonts/inter/inter'
|
import { inter } from '@/app/_styles/fonts/inter/inter'
|
||||||
import { useBrandConfig } from '@/ee/whitelabeling'
|
|
||||||
|
|
||||||
interface ChatHeaderProps {
|
interface ChatHeaderProps {
|
||||||
chatConfig: {
|
chatConfig: {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
|
import { useBrandConfig } from '@/lib/branding/branding'
|
||||||
import { inter } from '@/app/_styles/fonts/inter/inter'
|
import { inter } from '@/app/_styles/fonts/inter/inter'
|
||||||
import { useBrandConfig } from '@/ee/whitelabeling'
|
|
||||||
|
|
||||||
export function PoweredBySim() {
|
export function PoweredBySim() {
|
||||||
const brandConfig = useBrandConfig()
|
const brandConfig = useBrandConfig()
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ import type { Metadata, Viewport } from 'next'
|
|||||||
import Script from 'next/script'
|
import Script from 'next/script'
|
||||||
import { PublicEnvScript } from 'next-runtime-env'
|
import { PublicEnvScript } from 'next-runtime-env'
|
||||||
import { BrandedLayout } from '@/components/branded-layout'
|
import { BrandedLayout } from '@/components/branded-layout'
|
||||||
|
import { generateThemeCSS } from '@/lib/branding/inject-theme'
|
||||||
|
import { generateBrandedMetadata, generateStructuredData } from '@/lib/branding/metadata'
|
||||||
import { PostHogProvider } from '@/app/_shell/providers/posthog-provider'
|
import { PostHogProvider } from '@/app/_shell/providers/posthog-provider'
|
||||||
import {
|
|
||||||
generateBrandedMetadata,
|
|
||||||
generateStructuredData,
|
|
||||||
generateThemeCSS,
|
|
||||||
} from '@/ee/whitelabeling'
|
|
||||||
import '@/app/_styles/globals.css'
|
import '@/app/_styles/globals.css'
|
||||||
import { OneDollarStats } from '@/components/analytics/onedollarstats'
|
import { OneDollarStats } from '@/components/analytics/onedollarstats'
|
||||||
import { isReactGrabEnabled, isReactScanEnabled } from '@/lib/core/config/feature-flags'
|
import { isReactGrabEnabled, isReactScanEnabled } from '@/lib/core/config/feature-flags'
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ An execution is a single run of a workflow. It includes:
|
|||||||
### LLM Orchestration
|
### LLM Orchestration
|
||||||
Sim supports all major LLM providers:
|
Sim supports all major LLM providers:
|
||||||
- OpenAI (GPT-5.2, GPT-5.1, GPT-5, GPT-4o, GPT-4.1)
|
- OpenAI (GPT-5.2, GPT-5.1, GPT-5, GPT-4o, GPT-4.1)
|
||||||
- Anthropic (Claude Opus 4.6, Claude Opus 4.5, Claude Sonnet 4.5, Claude Haiku 4.5)
|
- Anthropic (Claude Opus 4.5, Claude Opus 4.1, Claude Sonnet 4.5, Claude Haiku 4.5)
|
||||||
- Google (Gemini Pro 3, Gemini Pro 3 Preview, Gemini 2.5 Pro, Gemini 2.5 Flash)
|
- Google (Gemini Pro 3, Gemini Pro 3 Preview, Gemini 2.5 Pro, Gemini 2.5 Flash)
|
||||||
- Mistral (Mistral Large, Mistral Medium)
|
- Mistral (Mistral Large, Mistral Medium)
|
||||||
- xAI (Grok)
|
- xAI (Grok)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { MetadataRoute } from 'next'
|
import type { MetadataRoute } from 'next'
|
||||||
import { getBrandConfig } from '@/ee/whitelabeling'
|
import { getBrandConfig } from '@/lib/branding/branding'
|
||||||
|
|
||||||
export default function manifest(): MetadataRoute.Manifest {
|
export default function manifest(): MetadataRoute.Manifest {
|
||||||
const brand = getBrandConfig()
|
const brand = getBrandConfig()
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user