chore: import upstream snapshot with attribution
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
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
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { PagerDutyIcon } from '@/components/icons'
|
||||
import { buildTriggerSubBlocks } from '@/triggers'
|
||||
import {
|
||||
buildPagerDutyExtraFields,
|
||||
buildPagerDutyIncidentOutputs,
|
||||
pagerdutySetupInstructions,
|
||||
pagerdutyTriggerOptions,
|
||||
} from '@/triggers/pagerduty/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const pagerdutyIncidentAcknowledgedTrigger: TriggerConfig = {
|
||||
id: 'pagerduty_incident_acknowledged',
|
||||
name: 'PagerDuty Incident Acknowledged',
|
||||
provider: 'pagerduty',
|
||||
description: 'Trigger workflow when an incident is acknowledged in PagerDuty',
|
||||
version: '1.0.0',
|
||||
icon: PagerDutyIcon,
|
||||
subBlocks: buildTriggerSubBlocks({
|
||||
triggerId: 'pagerduty_incident_acknowledged',
|
||||
triggerOptions: pagerdutyTriggerOptions,
|
||||
setupInstructions: pagerdutySetupInstructions('Incident Acknowledged'),
|
||||
extraFields: buildPagerDutyExtraFields('pagerduty_incident_acknowledged'),
|
||||
}),
|
||||
outputs: buildPagerDutyIncidentOutputs(),
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-PagerDuty-Signature': 'v1=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { PagerDutyIcon } from '@/components/icons'
|
||||
import { buildTriggerSubBlocks } from '@/triggers'
|
||||
import {
|
||||
buildPagerDutyExtraFields,
|
||||
buildPagerDutyIncidentOutputs,
|
||||
pagerdutySetupInstructions,
|
||||
pagerdutyTriggerOptions,
|
||||
} from '@/triggers/pagerduty/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const pagerdutyIncidentEscalatedTrigger: TriggerConfig = {
|
||||
id: 'pagerduty_incident_escalated',
|
||||
name: 'PagerDuty Incident Escalated',
|
||||
provider: 'pagerduty',
|
||||
description: 'Trigger workflow when an incident is escalated in PagerDuty',
|
||||
version: '1.0.0',
|
||||
icon: PagerDutyIcon,
|
||||
subBlocks: buildTriggerSubBlocks({
|
||||
triggerId: 'pagerduty_incident_escalated',
|
||||
triggerOptions: pagerdutyTriggerOptions,
|
||||
setupInstructions: pagerdutySetupInstructions('Incident Escalated'),
|
||||
extraFields: buildPagerDutyExtraFields('pagerduty_incident_escalated'),
|
||||
}),
|
||||
outputs: buildPagerDutyIncidentOutputs(),
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-PagerDuty-Signature': 'v1=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { PagerDutyIcon } from '@/components/icons'
|
||||
import { buildTriggerSubBlocks } from '@/triggers'
|
||||
import {
|
||||
buildPagerDutyExtraFields,
|
||||
buildPagerDutyIncidentOutputs,
|
||||
pagerdutySetupInstructions,
|
||||
pagerdutyTriggerOptions,
|
||||
} from '@/triggers/pagerduty/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const pagerdutyIncidentReassignedTrigger: TriggerConfig = {
|
||||
id: 'pagerduty_incident_reassigned',
|
||||
name: 'PagerDuty Incident Reassigned',
|
||||
provider: 'pagerduty',
|
||||
description: 'Trigger workflow when an incident is reassigned in PagerDuty',
|
||||
version: '1.0.0',
|
||||
icon: PagerDutyIcon,
|
||||
subBlocks: buildTriggerSubBlocks({
|
||||
triggerId: 'pagerduty_incident_reassigned',
|
||||
triggerOptions: pagerdutyTriggerOptions,
|
||||
setupInstructions: pagerdutySetupInstructions('Incident Reassigned'),
|
||||
extraFields: buildPagerDutyExtraFields('pagerduty_incident_reassigned'),
|
||||
}),
|
||||
outputs: buildPagerDutyIncidentOutputs(),
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-PagerDuty-Signature': 'v1=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { PagerDutyIcon } from '@/components/icons'
|
||||
import { buildTriggerSubBlocks } from '@/triggers'
|
||||
import {
|
||||
buildPagerDutyExtraFields,
|
||||
buildPagerDutyIncidentOutputs,
|
||||
pagerdutySetupInstructions,
|
||||
pagerdutyTriggerOptions,
|
||||
} from '@/triggers/pagerduty/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const pagerdutyIncidentResolvedTrigger: TriggerConfig = {
|
||||
id: 'pagerduty_incident_resolved',
|
||||
name: 'PagerDuty Incident Resolved',
|
||||
provider: 'pagerduty',
|
||||
description: 'Trigger workflow when an incident is resolved in PagerDuty',
|
||||
version: '1.0.0',
|
||||
icon: PagerDutyIcon,
|
||||
subBlocks: buildTriggerSubBlocks({
|
||||
triggerId: 'pagerduty_incident_resolved',
|
||||
triggerOptions: pagerdutyTriggerOptions,
|
||||
setupInstructions: pagerdutySetupInstructions('Incident Resolved'),
|
||||
extraFields: buildPagerDutyExtraFields('pagerduty_incident_resolved'),
|
||||
}),
|
||||
outputs: buildPagerDutyIncidentOutputs(),
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-PagerDuty-Signature': 'v1=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { PagerDutyIcon } from '@/components/icons'
|
||||
import { buildTriggerSubBlocks } from '@/triggers'
|
||||
import {
|
||||
buildPagerDutyExtraFields,
|
||||
buildPagerDutyIncidentOutputs,
|
||||
pagerdutySetupInstructions,
|
||||
pagerdutyTriggerOptions,
|
||||
} from '@/triggers/pagerduty/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const pagerdutyIncidentTriggeredTrigger: TriggerConfig = {
|
||||
id: 'pagerduty_incident_triggered',
|
||||
name: 'PagerDuty Incident Triggered',
|
||||
provider: 'pagerduty',
|
||||
description: 'Trigger workflow when a new incident is triggered in PagerDuty',
|
||||
version: '1.0.0',
|
||||
icon: PagerDutyIcon,
|
||||
subBlocks: buildTriggerSubBlocks({
|
||||
triggerId: 'pagerduty_incident_triggered',
|
||||
triggerOptions: pagerdutyTriggerOptions,
|
||||
includeDropdown: true,
|
||||
setupInstructions: pagerdutySetupInstructions('Incident Triggered'),
|
||||
extraFields: buildPagerDutyExtraFields('pagerduty_incident_triggered'),
|
||||
}),
|
||||
outputs: buildPagerDutyIncidentOutputs(),
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-PagerDuty-Signature': 'v1=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export { pagerdutyIncidentAcknowledgedTrigger } from './incident_acknowledged'
|
||||
export { pagerdutyIncidentEscalatedTrigger } from './incident_escalated'
|
||||
export { pagerdutyIncidentReassignedTrigger } from './incident_reassigned'
|
||||
export { pagerdutyIncidentResolvedTrigger } from './incident_resolved'
|
||||
export { pagerdutyIncidentTriggeredTrigger } from './incident_triggered'
|
||||
export { pagerdutyWebhookTrigger } from './webhook'
|
||||
@@ -0,0 +1,131 @@
|
||||
import type { SubBlockConfig } from '@/blocks/types'
|
||||
import type { TriggerOutput } from '@/triggers/types'
|
||||
|
||||
/**
|
||||
* Shared trigger dropdown options for all PagerDuty triggers
|
||||
*/
|
||||
export const pagerdutyTriggerOptions = [
|
||||
{ label: 'Incident Triggered', id: 'pagerduty_incident_triggered' },
|
||||
{ label: 'Incident Acknowledged', id: 'pagerduty_incident_acknowledged' },
|
||||
{ label: 'Incident Resolved', id: 'pagerduty_incident_resolved' },
|
||||
{ label: 'Incident Escalated', id: 'pagerduty_incident_escalated' },
|
||||
{ label: 'Incident Reassigned', id: 'pagerduty_incident_reassigned' },
|
||||
{ label: 'All Incident Events', id: 'pagerduty_webhook' },
|
||||
]
|
||||
|
||||
/**
|
||||
* Maps each PagerDuty trigger to the V3 webhook `event_type` it listens for.
|
||||
* `pagerduty_webhook` is intentionally absent — it matches every incident event.
|
||||
*/
|
||||
const TRIGGER_EVENT_TYPES: Record<string, string> = {
|
||||
pagerduty_incident_triggered: 'incident.triggered',
|
||||
pagerduty_incident_acknowledged: 'incident.acknowledged',
|
||||
pagerduty_incident_resolved: 'incident.resolved',
|
||||
pagerduty_incident_escalated: 'incident.escalated',
|
||||
pagerduty_incident_reassigned: 'incident.reassigned',
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the V3 webhook event types to subscribe to for a given trigger.
|
||||
* `pagerduty_webhook` subscribes to every supported incident event.
|
||||
*/
|
||||
export function getPagerDutyEvents(triggerId: string): string[] {
|
||||
const specific = TRIGGER_EVENT_TYPES[triggerId]
|
||||
return specific ? [specific] : Object.values(TRIGGER_EVENT_TYPES)
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate setup instructions for a specific PagerDuty incident event. The
|
||||
* webhook is created automatically on deploy, so the user only supplies an API key.
|
||||
*/
|
||||
export function pagerdutySetupInstructions(eventLabel: string): string {
|
||||
const instructions = [
|
||||
'Create a <strong>General Access REST API Key</strong> under <strong>PagerDuty > Integrations > API Access Keys</strong>.',
|
||||
'Enter the API key above.',
|
||||
`Deploy the workflow — Sim creates the account-level webhook subscription in PagerDuty automatically and listens for <strong>${eventLabel}</strong>.`,
|
||||
'Undeploying the workflow removes the webhook subscription from PagerDuty.',
|
||||
]
|
||||
return instructions
|
||||
.map(
|
||||
(instruction, index) =>
|
||||
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
|
||||
)
|
||||
.join('')
|
||||
}
|
||||
|
||||
/**
|
||||
* API key Sim uses to create and delete the PagerDuty webhook subscription.
|
||||
*/
|
||||
export function buildPagerDutyExtraFields(triggerId: string): SubBlockConfig[] {
|
||||
return [
|
||||
{
|
||||
id: 'apiKey',
|
||||
title: 'API Key',
|
||||
type: 'short-input',
|
||||
placeholder: 'PagerDuty General Access REST API key',
|
||||
description: 'Used to create the webhook subscription. Must be a read/write REST API key.',
|
||||
password: true,
|
||||
paramVisibility: 'user-only',
|
||||
required: true,
|
||||
mode: 'trigger',
|
||||
condition: { field: 'selectedTriggerId', value: triggerId },
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* Output schema shared by every PagerDuty incident trigger — V3 webhook
|
||||
* payloads share the same `event` envelope and `event.data` incident shape.
|
||||
*/
|
||||
export function buildPagerDutyIncidentOutputs(): Record<string, TriggerOutput> {
|
||||
return {
|
||||
event_id: { type: 'string', description: 'Unique ID of the webhook event' },
|
||||
event_type: {
|
||||
type: 'string',
|
||||
description: 'Event type (e.g. incident.triggered, incident.resolved)',
|
||||
},
|
||||
occurred_at: { type: 'string', description: 'When the event occurred (ISO 8601)' },
|
||||
agent: {
|
||||
type: 'json',
|
||||
description: 'The user or service that caused the event (may be null)',
|
||||
},
|
||||
incident: {
|
||||
id: { type: 'string', description: 'Incident ID' },
|
||||
number: { type: 'number', description: 'Incident number' },
|
||||
title: { type: 'string', description: 'Incident title' },
|
||||
status: {
|
||||
type: 'string',
|
||||
description: 'Incident status (triggered, acknowledged, resolved)',
|
||||
},
|
||||
urgency: { type: 'string', description: 'Incident urgency (high or low)' },
|
||||
html_url: { type: 'string', description: 'Web URL of the incident' },
|
||||
created_at: { type: 'string', description: 'Incident creation timestamp' },
|
||||
priority: { type: 'string', description: 'Priority label (may be null)' },
|
||||
service: {
|
||||
id: { type: 'string', description: 'Service ID' },
|
||||
summary: { type: 'string', description: 'Service name' },
|
||||
html_url: { type: 'string', description: 'Service web URL' },
|
||||
},
|
||||
escalation_policy: {
|
||||
id: { type: 'string', description: 'Escalation policy ID' },
|
||||
summary: { type: 'string', description: 'Escalation policy name' },
|
||||
html_url: { type: 'string', description: 'Escalation policy web URL' },
|
||||
},
|
||||
assignees: {
|
||||
type: 'json',
|
||||
description: 'Array of assignee references ({ id, summary, html_url })',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when an incoming V3 webhook event matches the configured trigger.
|
||||
*/
|
||||
export function isPagerDutyEventMatch(triggerId: string, eventType: string): boolean {
|
||||
const expected = TRIGGER_EVENT_TYPES[triggerId]
|
||||
if (!expected) {
|
||||
return true
|
||||
}
|
||||
return expected === eventType
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { PagerDutyIcon } from '@/components/icons'
|
||||
import { buildTriggerSubBlocks } from '@/triggers'
|
||||
import {
|
||||
buildPagerDutyExtraFields,
|
||||
buildPagerDutyIncidentOutputs,
|
||||
pagerdutySetupInstructions,
|
||||
pagerdutyTriggerOptions,
|
||||
} from '@/triggers/pagerduty/utils'
|
||||
import type { TriggerConfig } from '@/triggers/types'
|
||||
|
||||
export const pagerdutyWebhookTrigger: TriggerConfig = {
|
||||
id: 'pagerduty_webhook',
|
||||
name: 'PagerDuty Incident Event',
|
||||
provider: 'pagerduty',
|
||||
description: 'Trigger workflow from any PagerDuty incident event',
|
||||
version: '1.0.0',
|
||||
icon: PagerDutyIcon,
|
||||
subBlocks: buildTriggerSubBlocks({
|
||||
triggerId: 'pagerduty_webhook',
|
||||
triggerOptions: pagerdutyTriggerOptions,
|
||||
setupInstructions: pagerdutySetupInstructions('all incident events'),
|
||||
extraFields: buildPagerDutyExtraFields('pagerduty_webhook'),
|
||||
}),
|
||||
outputs: buildPagerDutyIncidentOutputs(),
|
||||
webhook: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-PagerDuty-Signature': 'v1=...',
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user