Files
wehub-resource-sync d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:20:55 +08:00

104 lines
3.3 KiB
TypeScript

import { xIcon } from '@/components/icons'
import type { ConnectorMeta } from '@/connectors/types'
export const DEFAULT_MAX_POSTS = 200
export const xConnectorMeta: ConnectorMeta = {
id: 'x',
name: 'X',
description: 'Sync posts from X (formerly Twitter) into your knowledge base',
version: '1.0.0',
icon: xIcon,
auth: {
mode: 'oauth',
provider: 'x',
requiredScopes: ['tweet.read', 'users.read', 'bookmark.read', 'like.read', 'offline.access'],
},
configFields: [
{
id: 'syncMode',
title: 'Sync Mode',
type: 'dropdown',
required: false,
description: 'Which posts to sync into the knowledge base',
options: [
{ label: 'My posts', id: 'me' },
{ label: 'Another user', id: 'user' },
{ label: 'My mentions', id: 'mentions' },
{ label: 'My bookmarks', id: 'bookmarks' },
{ label: 'My likes', id: 'likes' },
],
},
{
id: 'username',
title: 'Username(s)',
type: 'short-input',
required: false,
multi: true,
placeholder: 'e.g. jack, xdevelopers (required for "Another user")',
description:
'One or more X usernames to sync posts from (comma-separated). Only used when Sync Mode is "Another user".',
},
{
id: 'includeReplies',
title: 'Include Replies',
type: 'dropdown',
required: false,
options: [
{ label: 'Exclude replies', id: 'false' },
{ label: 'Include replies', id: 'true' },
],
description: 'Whether to include reply posts. Applies to "My posts" and "Another user".',
},
{
id: 'includeRetweets',
title: 'Include Retweets',
type: 'dropdown',
required: false,
options: [
{ label: 'Exclude retweets', id: 'false' },
{ label: 'Include retweets', id: 'true' },
],
description: 'Whether to include retweets. Applies to "My posts" and "Another user".',
},
{
id: 'startTime',
title: 'Start Time',
type: 'short-input',
required: false,
mode: 'advanced',
placeholder: 'e.g. 2024-01-01T00:00:00Z',
description:
'Oldest post time (ISO 8601 UTC). Applies to posts and mentions; ignored for bookmarks and likes.',
},
{
id: 'endTime',
title: 'End Time',
type: 'short-input',
required: false,
mode: 'advanced',
placeholder: 'e.g. 2024-12-31T23:59:59Z',
description:
'Newest post time (ISO 8601 UTC). Applies to posts and mentions; ignored for bookmarks and likes.',
},
{
id: 'maxPosts',
title: 'Max Posts',
type: 'short-input',
required: false,
placeholder: `e.g. 100 (default: ${DEFAULT_MAX_POSTS})`,
description:
'Maximum number of posts to sync (across all configured users). Posts beyond this limit are not deleted from the knowledge base; X also only exposes a limited recent window (≈3,200 timeline posts, ≈800 bookmarks), so posts that age out of that window are removed on the next sync.',
},
],
tagDefinitions: [
{ id: 'author', displayName: 'Author', fieldType: 'text' },
{ id: 'createdAt', displayName: 'Created Date', fieldType: 'date' },
{ id: 'likeCount', displayName: 'Like Count', fieldType: 'number' },
{ id: 'retweetCount', displayName: 'Retweet Count', fieldType: 'number' },
],
}