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
180 lines
5.1 KiB
TypeScript
180 lines
5.1 KiB
TypeScript
import { LinearIcon } from '@/components/icons'
|
|
import {
|
|
buildLinearV2SubBlocks,
|
|
linearSetupInstructions,
|
|
userOutputs,
|
|
} from '@/triggers/linear/utils'
|
|
import type { TriggerConfig } from '@/triggers/types'
|
|
|
|
export const linearWebhookTrigger: TriggerConfig = {
|
|
id: 'linear_webhook',
|
|
name: 'Linear Webhook',
|
|
provider: 'linear',
|
|
description:
|
|
'Trigger workflow from Linear events you select when creating the webhook in Linear (not guaranteed to be every model or event type).',
|
|
version: '1.0.0',
|
|
icon: LinearIcon,
|
|
|
|
subBlocks: [
|
|
{
|
|
id: 'webhookUrlDisplay',
|
|
title: 'Webhook URL',
|
|
type: 'short-input',
|
|
readOnly: true,
|
|
showCopyButton: true,
|
|
useWebhookUrl: true,
|
|
placeholder: 'Webhook URL will be generated',
|
|
mode: 'trigger',
|
|
condition: {
|
|
field: 'selectedTriggerId',
|
|
value: 'linear_webhook',
|
|
},
|
|
},
|
|
{
|
|
id: 'webhookSecret',
|
|
title: 'Webhook Secret',
|
|
type: 'short-input',
|
|
placeholder: 'Enter a strong secret',
|
|
description: 'Validates that webhook deliveries originate from Linear.',
|
|
password: true,
|
|
required: false,
|
|
mode: 'trigger',
|
|
condition: {
|
|
field: 'selectedTriggerId',
|
|
value: 'linear_webhook',
|
|
},
|
|
},
|
|
{
|
|
id: 'triggerInstructions',
|
|
title: 'Setup Instructions',
|
|
hideFromPreview: true,
|
|
type: 'text',
|
|
defaultValue: linearSetupInstructions(
|
|
'all events',
|
|
'When you select resource types in Linear, you receive those data-change events only (see <a href="https://linear.app/developers/webhooks" target="_blank" rel="noopener noreferrer">Linear webhooks</a> for supported models). This is not every possible Linear event. Use the <code>type</code> and <code>action</code> fields in the payload to filter further.'
|
|
),
|
|
mode: 'trigger',
|
|
condition: {
|
|
field: 'selectedTriggerId',
|
|
value: 'linear_webhook',
|
|
},
|
|
},
|
|
],
|
|
|
|
outputs: {
|
|
action: {
|
|
type: 'string',
|
|
description: 'Action performed (create, update, remove)',
|
|
},
|
|
type: {
|
|
type: 'string',
|
|
description: 'Entity type (Issue, Comment, Project, Cycle, IssueLabel, ProjectUpdate, etc.)',
|
|
},
|
|
webhookId: {
|
|
type: 'string',
|
|
description: 'Webhook ID',
|
|
},
|
|
webhookTimestamp: {
|
|
type: 'number',
|
|
description: 'Webhook timestamp (milliseconds)',
|
|
},
|
|
organizationId: {
|
|
type: 'string',
|
|
description: 'Organization ID',
|
|
},
|
|
createdAt: {
|
|
type: 'string',
|
|
description: 'Event creation timestamp',
|
|
},
|
|
url: {
|
|
type: 'string',
|
|
description: 'URL of the subject entity in Linear (top-level webhook payload)',
|
|
},
|
|
actor: userOutputs,
|
|
data: {
|
|
type: 'object',
|
|
description: 'Complete entity data object',
|
|
},
|
|
updatedFrom: {
|
|
type: 'object',
|
|
description: 'Previous values for changed fields (only present on update)',
|
|
},
|
|
},
|
|
|
|
webhook: {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Linear-Event': 'Issue',
|
|
'Linear-Delivery': '234d1a4e-b617-4388-90fe-adc3633d6b72',
|
|
'Linear-Signature': '766e1d90a96e2f5ecec342a99c5552999dd95d49250171b902d703fd674f5086',
|
|
'User-Agent': 'Linear-Webhook',
|
|
},
|
|
},
|
|
}
|
|
|
|
export const linearWebhookV2Trigger: TriggerConfig = {
|
|
id: 'linear_webhook_v2',
|
|
name: 'Linear Webhook',
|
|
provider: 'linear',
|
|
description:
|
|
'Trigger workflow from Linear events you select when creating the webhook in Linear (not guaranteed to be every model or event type).',
|
|
version: '2.0.0',
|
|
icon: LinearIcon,
|
|
subBlocks: buildLinearV2SubBlocks({
|
|
triggerId: 'linear_webhook_v2',
|
|
eventType: 'All Events',
|
|
additionalNotes:
|
|
'This webhook will receive all Linear events. Use the <code>type</code> and <code>action</code> fields in the payload to filter and handle different event types.',
|
|
}),
|
|
outputs: {
|
|
action: {
|
|
type: 'string',
|
|
description: 'Action performed (create, update, remove)',
|
|
},
|
|
type: {
|
|
type: 'string',
|
|
description: 'Entity type (Issue, Comment, Project, Cycle, IssueLabel, ProjectUpdate, etc.)',
|
|
},
|
|
webhookId: {
|
|
type: 'string',
|
|
description: 'Webhook ID',
|
|
},
|
|
webhookTimestamp: {
|
|
type: 'number',
|
|
description: 'Webhook timestamp (milliseconds)',
|
|
},
|
|
organizationId: {
|
|
type: 'string',
|
|
description: 'Organization ID',
|
|
},
|
|
createdAt: {
|
|
type: 'string',
|
|
description: 'Event creation timestamp',
|
|
},
|
|
url: {
|
|
type: 'string',
|
|
description: 'URL of the subject entity in Linear (top-level webhook payload)',
|
|
},
|
|
actor: userOutputs,
|
|
data: {
|
|
type: 'object',
|
|
description: 'Complete entity data object',
|
|
},
|
|
updatedFrom: {
|
|
type: 'object',
|
|
description: 'Previous values for changed fields (only present on update)',
|
|
},
|
|
},
|
|
webhook: {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'Linear-Event': 'Issue',
|
|
'Linear-Delivery': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
'Linear-Signature': 'sha256...',
|
|
'User-Agent': 'Linear-Webhook',
|
|
},
|
|
},
|
|
}
|