Skip to content

Commit 5ad319d

Browse files
committed
Revert "change to microsoftteams"
This reverts commit 217f808.
1 parent 217f808 commit 5ad319d

10 files changed

Lines changed: 22 additions & 22 deletions

File tree

apps/sim/app/api/cron/renew-subscriptions/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function GET(request: NextRequest) {
3535
})
3636
.from(webhookTable)
3737
.innerJoin(workflowTable, eq(webhookTable.workflowId, workflowTable.id))
38-
.where(and(eq(webhookTable.isActive, true), eq(webhookTable.provider, 'microsoftteams')))
38+
.where(and(eq(webhookTable.isActive, true), eq(webhookTable.provider, 'microsoft-teams')))
3939

4040
logger.info(
4141
`Found ${webhooksWithWorkflows.length} active Teams webhooks, checking for expiring subscriptions`

apps/sim/app/api/webhooks/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export async function POST(request: NextRequest) {
137137
const isCredentialBased = credentialBasedProviders.includes(provider)
138138
// Treat Microsoft Teams chat subscription as credential-based for path generation purposes
139139
const isMicrosoftTeamsChatSubscription =
140-
provider === 'microsoftteams' &&
140+
provider === 'microsoft-teams' &&
141141
typeof providerConfig === 'object' &&
142142
providerConfig?.triggerId === 'microsoftteams_chat_subscription'
143143

@@ -297,7 +297,7 @@ export async function POST(request: NextRequest) {
297297
}
298298
}
299299

300-
if (provider === 'microsoftteams') {
300+
if (provider === 'microsoft-teams') {
301301
const { createTeamsSubscription } = await import('@/lib/webhooks/webhook-helpers')
302302
logger.info(`[${requestId}] Creating Teams subscription before saving to database`)
303303
try {

apps/sim/app/api/webhooks/test/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export async function GET(request: NextRequest) {
441441
})
442442
}
443443

444-
case 'microsoftteams': {
444+
case 'microsoft-teams': {
445445
const hmacSecret = providerConfig.hmacSecret
446446

447447
if (!hmacSecret) {

apps/sim/executor/handlers/trigger/trigger-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class TriggerBlockHandler implements BlockHandler {
5555
}
5656
}
5757

58-
if (provider === 'microsoftteams') {
58+
if (provider === 'microsoft-teams') {
5959
const providerData = (starterOutput as any)[provider] || webhookData[provider] || {}
6060
const payloadSource = providerData?.message?.raw || webhookData.payload || {}
6161
return {

apps/sim/lib/webhooks/processor.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export async function verifyProviderAuth(
250250
const rawProviderConfig = (foundWebhook.providerConfig as Record<string, any>) || {}
251251
const providerConfig = resolveProviderConfigEnvVars(rawProviderConfig, decryptedEnvVars)
252252

253-
if (foundWebhook.provider === 'microsoftteams') {
253+
if (foundWebhook.provider === 'microsoft-teams') {
254254
if (providerConfig.hmacSecret) {
255255
const authHeader = request.headers.get('authorization')
256256

@@ -556,7 +556,7 @@ export async function checkRateLimits(
556556
traceSpans: [],
557557
})
558558

559-
if (foundWebhook.provider === 'microsoftteams') {
559+
if (foundWebhook.provider === 'microsoft-teams') {
560560
return NextResponse.json(
561561
{
562562
type: 'message',
@@ -634,7 +634,7 @@ export async function checkUsageLimits(
634634
traceSpans: [],
635635
})
636636

637-
if (foundWebhook.provider === 'microsoftteams') {
637+
if (foundWebhook.provider === 'microsoft-teams') {
638638
return NextResponse.json(
639639
{
640640
type: 'message',
@@ -783,7 +783,7 @@ export async function queueWebhookExecution(
783783

784784
// For Microsoft Teams Graph notifications, extract unique identifiers for idempotency
785785
if (
786-
foundWebhook.provider === 'microsoftteams' &&
786+
foundWebhook.provider === 'microsoft-teams' &&
787787
body?.value &&
788788
Array.isArray(body.value) &&
789789
body.value.length > 0
@@ -835,7 +835,7 @@ export async function queueWebhookExecution(
835835
)
836836
}
837837

838-
if (foundWebhook.provider === 'microsoftteams') {
838+
if (foundWebhook.provider === 'microsoft-teams') {
839839
const providerConfig = (foundWebhook.providerConfig as Record<string, any>) || {}
840840
const triggerId = providerConfig.triggerId as string | undefined
841841

@@ -886,7 +886,7 @@ export async function queueWebhookExecution(
886886
} catch (error: any) {
887887
logger.error(`[${options.requestId}] Failed to queue webhook execution:`, error)
888888

889-
if (foundWebhook.provider === 'microsoftteams') {
889+
if (foundWebhook.provider === 'microsoft-teams') {
890890
return NextResponse.json(
891891
{
892892
type: 'message',

apps/sim/lib/webhooks/provider-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const PROVIDER_EXTRACTORS: Record<string, (body: any) => string | null> = {
7171
hubspot: extractHubSpotIdentifier,
7272
linear: extractLinearIdentifier,
7373
jira: extractJiraIdentifier,
74-
microsoftteams: extractMicrosoftTeamsIdentifier,
74+
'microsoft-teams': extractMicrosoftTeamsIdentifier,
7575
airtable: extractAirtableIdentifier,
7676
}
7777

apps/sim/lib/webhooks/utils.server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async function formatTeamsGraphNotification(
133133
input: 'Teams notification received',
134134
webhook: {
135135
data: {
136-
provider: 'microsoftteams',
136+
provider: 'microsoft-teams',
137137
path: foundWebhook?.path || '',
138138
providerConfig: foundWebhook?.providerConfig || {},
139139
payload: body,
@@ -397,7 +397,7 @@ async function formatTeamsGraphNotification(
397397
},
398398
webhook: {
399399
data: {
400-
provider: 'microsoftteams',
400+
provider: 'microsoft-teams',
401401
path: foundWebhook?.path || '',
402402
providerConfig: foundWebhook?.providerConfig || {},
403403
payload: body,
@@ -446,7 +446,7 @@ async function formatTeamsGraphNotification(
446446
},
447447
webhook: {
448448
data: {
449-
provider: 'microsoftteams',
449+
provider: 'microsoft-teams',
450450
path: foundWebhook?.path || '',
451451
providerConfig: foundWebhook?.providerConfig || {},
452452
payload: body,
@@ -818,7 +818,7 @@ export async function formatWebhookInput(
818818
}
819819
}
820820

821-
if (foundWebhook.provider === 'microsoftteams') {
821+
if (foundWebhook.provider === 'microsoft-teams') {
822822
// Check if this is a Microsoft Graph change notification
823823
if (body?.value && Array.isArray(body.value) && body.value.length > 0) {
824824
return await formatTeamsGraphNotification(body, foundWebhook, foundWorkflow, request)
@@ -875,7 +875,7 @@ export async function formatWebhookInput(
875875

876876
webhook: {
877877
data: {
878-
provider: 'microsoftteams',
878+
provider: 'microsoft-teams',
879879
path: foundWebhook.path,
880880
providerConfig: foundWebhook.providerConfig,
881881
payload: body,
@@ -1653,7 +1653,7 @@ export function verifyProviderWebhook(
16531653

16541654
break
16551655
}
1656-
case 'microsoftteams':
1656+
case 'microsoft-teams':
16571657
break
16581658
case 'generic':
16591659
if (providerConfig.requireAuth) {

apps/sim/lib/webhooks/webhook-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ export async function cleanupExternalWebhook(
623623
): Promise<void> {
624624
if (webhook.provider === 'airtable') {
625625
await deleteAirtableWebhook(webhook, workflow, requestId)
626-
} else if (webhook.provider === 'microsoftteams') {
626+
} else if (webhook.provider === 'microsoft-teams') {
627627
await deleteTeamsSubscription(webhook, workflow, requestId)
628628
} else if (webhook.provider === 'telegram') {
629629
await deleteTelegramWebhook(webhook, requestId)

apps/sim/triggers/microsoftteams/chat_webhook.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { TriggerConfig } from '@/triggers/types'
44
export const microsoftTeamsChatSubscriptionTrigger: TriggerConfig = {
55
id: 'microsoftteams_chat_subscription',
66
name: 'Microsoft Teams Chat',
7-
provider: 'microsoftteams',
7+
provider: 'microsoft-teams',
88
description:
99
'Trigger workflow from new messages in Microsoft Teams chats via Microsoft Graph subscriptions',
1010
version: '1.0.0',
@@ -16,7 +16,7 @@ export const microsoftTeamsChatSubscriptionTrigger: TriggerConfig = {
1616
title: 'Credentials',
1717
type: 'oauth-input',
1818
description: 'This trigger requires microsoft teams credentials to access your account.',
19-
provider: 'microsoftteams',
19+
provider: 'microsoft-teams',
2020
requiredScopes: [
2121
'openid',
2222
'profile',

apps/sim/triggers/microsoftteams/webhook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { TriggerConfig } from '../types'
44
export const microsoftTeamsWebhookTrigger: TriggerConfig = {
55
id: 'microsoftteams_webhook',
66
name: 'Microsoft Teams Channel',
7-
provider: 'microsoftteams',
7+
provider: 'microsoft-teams',
88
description: 'Trigger workflow from Microsoft Teams channel messages via outgoing webhooks',
99
version: '1.0.0',
1010
icon: MicrosoftTeamsIcon,

0 commit comments

Comments
 (0)