The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Prepare Microsoft Teams v1 marketplace release (#28543)
nitin39ec44a586dd
diff --git a/packages/twenty-apps/public/teams/README.md b/packages/twenty-apps/public/teams/README.mdindex f2c7148e042..3f0f329e1a0 100644--- a/packages/twenty-apps/public/teams/README.md+++ b/packages/twenty-apps/public/teams/README.md@@ -1,22 +1,56 @@# Microsoft Teams-**Microsoft Teams chat and meeting transcripts, right inside your CRM.**+**Your Microsoft Teams meeting transcripts and AI summaries, right inside your CRM.**## β¨ What you get-- **A Microsoft connection** for your work or school account-- **List My Teams Transcripts**, an AI and workflow action for the meetings you organized-- **Sync Teams Transcript**, an AI and workflow action that imports one of those transcripts into a Call Recording-- **AI summary** of each imported transcript, written on its Call Recording once turned on in the app settings-- **Generate call summary**, a command on Call Recordings and calendar events that writes or rewrites the summary of their Teams recordings+- **Teams transcripts saved to Call Recordings**, with calendar links when the+ meeting is synced in Twenty+- **New transcripts synced as Microsoft publishes them**+- **Your last 31 days imported when you connect**+- **Optional AI summaries**, plus **Generate call summary** to write or rewrite+ summaries from Call Recordings and calendar events+- **List My Teams Transcripts** and **Sync Teams Transcript** actions for AI chat+ and workflows-## π Heads up+## π³ Billing++**Free to run**: no per-seat, per-transcript or per-import charge. Optional AI+summaries and AI actions use AI credits based on the model's token usage.+Summaries are off by default.++## π Getting started-- **Still in development.** Chat and transcript import are off by default and- not available in this version. Connecting an account only stores its- credentials; nothing is imported.-- **Work or school accounts only.** Personal Microsoft accounts are not- supported.+1. Install **Microsoft Teams** from **Settings β Applications**.+2. Have your Microsoft 365 admin enable **Microsoft Graph access** under+ **Teams admin center β Meetings β Meeting settings β Transcript API access**.+ Enable **Include speaker attribution** there to import speaker names too.+ Your organization may also require admin consent when connecting.+3. Open the app's **Settings** tab, click **Add connection**, and sign in with+ your Microsoft work or school account. Your last 31 days of transcripts+ start importing, and new transcripts sync automatically.+4. To add AI summaries, turn on **Enable transcript summaries** in the app's+ **Settings** tab. Use **Generate call summary** on existing Teams Call+ Recordings or their calendar events to summarize them, up to 20 calls at a+ time.-**Self-hosting?** Your admin registers the Microsoft app first: see the+**Self-hosting?** Your admin registers the Microsoft app and configures a public+HTTPS server URL first: see the[setup guide](https://github.com/twentyhq/twenty/blob/main/packages/twenty-apps/public/teams/SETUP.md).++## π Heads up++- **Work or school accounts, and meetings you organize.** Personal Microsoft+ accounts and meetings where you are only an attendee are not supported.+ Start transcription in Teams during the scheduled meeting; the app imports+ the transcript Microsoft creates.+- **Imports are shared with your workspace.** Transcripts and summaries land on+ Call Recordings that members with access can read, including imports from a+ personal connection.+- **Transcripts and summaries only.** Audio and video are not imported. The+ Teams chat assistant and the settings control for importing older history+ are not available in this release.+- **Calendar links need a synced meeting.** A transcript can import without a+ calendar link. For a recurring meeting, it links to the series' event.+- **Deleting a Call Recording keeps it deleted.** Syncing the same transcript+ again updates the existing record but does not restore one deleted in Twenty.diff --git a/packages/twenty-apps/public/teams/SETUP.md b/packages/twenty-apps/public/teams/SETUP.mdindex 9940b9830e0..509ad1f3a7b 100644--- a/packages/twenty-apps/public/teams/SETUP.md+++ b/packages/twenty-apps/public/teams/SETUP.md@@ -26,9 +26,10 @@ with PKCE through Twenty's connection provider.These OAuth credentials are separate from the `TEAMS_BOT_*` credentials used bythe chat Bot Connector. They are optional at registration so Teams can be-installed without transcript setup. Both must be configured before users can add-a Microsoft connection. See [Bot server variables](#bot-server-variables) for the-bot configuration.+installed without transcript setup. Both `MICROSOFT_CLIENT_ID` and+`MICROSOFT_CLIENT_SECRET` must be configured before users can add a Microsoft+connection. Bot credentials are not needed for transcript imports. See+[Bot server variables](#bot-server-variables) for the unreleased chat feature.## Microsoft 365 organization settings@@ -48,6 +49,9 @@ requires it.## Bot server variables+These variables are for the Teams chat assistant, which is not available in+this release. Skip this section when setting up transcript imports.+The bot's identity is an Entra app registration behind an Azure Bot resource.An admin configures these on the Teams application registration under**Settings β Applications**. They are optional at registration so marketplace@@ -62,6 +66,9 @@ three credentials before bot operations can run.## Chat+Chat is not available in this release. The following setup is for development+and a future chat release.+Chat lets workspace members message the Teams Assistant bot from MicrosoftTeams. It needs the [bot server variables](#bot-server-variables), the`IS_CHAT_ASSISTANT_RELEASED` release flag, and the workspace's **Enable chat**@@ -86,24 +93,53 @@ account under **Linked Teams accounts**, and replies with a short notice when nomember matches. Members who can manage roles can remove a link there; anaccount matched on email is linked again on its next message.+## Twenty registration and shared webhook++The transcript webhook uses a server route shared by all installations on a+Twenty instance. Its resolver runs in the application's **owner workspace**.+Before users connect Microsoft accounts:++1. After publishing and catalog sync, [claim the+ app](https://docs.twenty.com/developers/extend/apps/operations/publishing#claiming-your-app)+ in **Settings β Developers β Apps** using `@twentyhq/teams`. This requires+ npm provenance from the public GitHub repository and an authorized GitHub+ owner. Ownership is separate on each Twenty instance.+2. Open the registration under **My apps**, then set `MICROSOFT_CLIENT_ID` and+ `MICROSOFT_CLIENT_SECRET` in **Config β Server Variables**.+3. In **Distribution**, choose **See on marketplace** and install the app in+ the owner workspace. Keep that installation enabled: removing it interrupts+ transcript webhooks for every workspace on the instance.+4. Install in a second workspace and verify that connecting an account creates+ a Graph subscription and that a new meeting transcript imports. Check both+ the resolver's logs in the owner workspace and the target function's logs in+ the second workspace.++An unclaimed app, or one not installed in its owner workspace, returns `404`+(`LOGIC_FUNCTION_NOT_FOUND`) on the shared webhook even if another workspace+has installed it. See [server-route+setup](https://docs.twenty.com/developers/extend/apps/operations/publishing#setting-up-server-routes).+## ConnectOpen **Settings > Applications > Microsoft Teams > Settings**, select**Add connection**, and sign in with your Microsoft work or school account.-The transcript release flag is off by default, and connecting an account does-not enable it. With it on, connecting an account also creates a Microsoft Graph subscription to the transcripts of the meetings-that account organizes. Graph delivers its notifications to+Transcript imports are on by default. Connecting an account creates a Microsoft+Graph subscription to the transcripts of the meetings that account organizes.+Graph delivers its notifications to`https://<your-twenty-host>/webhooks/server/d62e36e1-82bb-4f78-b2ab-54a31faaafab`,so the Twenty server must be reachable from the internet over HTTPS. Newtranscripts then import automatically into Call Recordings as Microsoft-publishes them. A connection added while transcripts were off has no-subscription: reconnect it after turning transcripts on. Disconnecting the-account or uninstalling the app deletes the subscription.+publishes them. If upgrading from a development build with transcript imports+disabled, reconnect existing accounts to start their subscription and initial+import. Disconnecting the account or uninstalling the app deletes the+subscription.Connecting also imports the transcripts of the last 31 days, once perconnection. Reconnecting starts it again only when that import failed or-stalled. Use the **Sync Teams Transcript** action for a single transcript, such as one that Microsoft had not published about two and a half+stalled. The settings control for choosing a separate history import is not+available in this release. Use the **Sync Teams Transcript** action for a single+transcript, such as one that Microsoft had not published about two and a halfhours after the meeting or whose import keeps failing.Transcripts link to the meeting's calendar event when that calendar is synced in@@ -114,7 +150,8 @@ AI summaries are off by default. Turn on **Enable transcript summaries** inRecording that Microsoft Teams imports, including the 31-day import on connect.Each summary uses AI credits. Run **Generate call summary** on selected CallRecordings, or on calendar events for the latest Teams recording of each, to-write or rewrite their summary, up to 20 calls at a time.+write or rewrite their summary, up to 20 calls at a time. This command also+requires **Enable transcript summaries** to be on.## Test the transcript actions@@ -151,15 +188,15 @@ plus [Teams transcript API access settings](https://learn.microsoft.com/en-us/mi`TEAMS_TRANSCRIPTS_ENABLED` and `TEAMS_TRANSCRIPT_SUMMARY_ENABLED` are Booleanapplication variables. **Settings β Applications β Microsoft Teams βSettings** manages chat and transcript summaries; transcripts are on by- default and have no switch, and summaries are off by default. Updates use the metadata API, which requires- permission to manage applications.+ default and have no switch, and summaries are off by default. Updates use the+ metadata API, which requires permission to manage applications.- **Release flags** are developer-controlled release decisions, defined in`src/constants/release-flags.ts` and bundled with the app. They are not theserver's workspace feature flags, so they are named `IS_β¦_RELEASED`. Changingthem requires a new build and deployment; a workspace setting cannot overridethem.-`IS_CHAT_ASSISTANT_RELEASED` controls availability of chat in this scaffold, and+`IS_CHAT_ASSISTANT_RELEASED` controls availability of chat, and`IS_TRANSCRIPT_HISTORY_IMPORT_RELEASED` shows the Import history section. Bothstart as `false`. Settings hides chat and Import history until their flags areon, retaining any saved workspace preference. Transcript imports and summaries@@ -208,16 +245,40 @@ Installation tests use a disposable Twenty workspace. ConfigureThe test setup installs and uninstalls the application; do not use the shared QAworkspace. Public apps use the monorepo CI workflows.+## Release checklist++- Deploy the Twenty server changes that add Teams to the vetted and+ billing-exempt application lists **before publishing and the first catalog+ sync**. Publishing the npm package alone does not make imports free. Vetting+ is set when the catalog first creates the registration; a later catalog sync+ does not change an existing registration's vetted status.+- Confirm the release version in `package.json`, run the development checks+ above, and inspect the built package before publishing with npm provenance.+ Publish through the Twenty CLI so the manifest and built files are included.+- Complete [registration and shared-webhook setup](#twenty-registration-and-shared-webhook).+ Confirm the app appears with **Vetted only** enabled and that its owner+ workspace and Microsoft OAuth credentials are configured.+- Run a live pilot from a second workspace: consent and connection, the 31-day+ initial import, a newly transcribed meeting, calendar linking, and a repeated+ sync without duplicate Call Recordings. Verify the summaries switch, automatic+ and manual summaries, and expected AI-credit usage. Confirm ordinary transcript+ imports consume no logic-function credits, and check failed-consent/API errors+ and disconnect cleanup. Record the results before announcing availability.+## Troubleshooting+- Webhook returns `404` / `LOGIC_FUNCTION_NOT_FOUND`: claim the registration and+ install the app in its owner workspace as described above.- No Add connection button: check that the provider was deployed and its twoserver variables are filled.- Redirect mismatch: register the exact `/auth/apps/callback` URI on the **Web**platform, including the correct scheme and hostname.- Admin approval required: the Microsoft tenant administrator must consent tothe delegated permissions before the connection can finish.-- `Teams transcripts are not enabled`: enable the transcript release flag in- the build.+- `Teams transcripts are not enabled`: check that the application variable+ `TEAMS_TRANSCRIPTS_ENABLED` is `true`. It defaults to `true` in this release;+ there is no transcript release flag. Reconnect accounts added while imports+ were disabled.- `Microsoft Teams is not connected`: the requesting user has no personalconnection and the workspace has no shared one.- `GraphAccessToTranscriptsDisabled`: enable Microsoft Graph transcript accessdiff --git a/packages/twenty-apps/public/teams/package.json b/packages/twenty-apps/public/teams/package.jsonindex c3628e791c5..f6602d6fcdb 100644--- a/packages/twenty-apps/public/teams/package.json+++ b/packages/twenty-apps/public/teams/package.json@@ -1,7 +1,8 @@{"name": "@twentyhq/teams","version": "0.1.0",- "description": "Microsoft Teams assistant and workflow steps for Twenty",+ "description": "Sync Microsoft Teams meeting transcripts into Twenty Call Recordings, with optional AI summaries.",+ "author": "Twenty","license": "MIT","engines": {"twenty": ">=2.46.0",diff --git a/packages/twenty-apps/public/teams/src/application.config.ts b/packages/twenty-apps/public/teams/src/application.config.tsindex 2d92cc4c9bb..db989a0076d 100644--- a/packages/twenty-apps/public/teams/src/application.config.ts+++ b/packages/twenty-apps/public/teams/src/application.config.ts@@ -14,7 +14,7 @@ export default defineApplication({universalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,displayName: 'Microsoft Teams',description:- 'Your CRM, in the conversation. Mention the bot or message it directly to read, create, update and soft-delete records without leaving Teams, and post messages from your workflows. Connect your Microsoft account for meeting transcripts.',+ 'Sync Microsoft Teams meeting transcripts into Call Recordings, including an initial import of the last 31 days. Optionally generate AI summaries using your workspace AI credits.',logo: 'public/teams.svg',author: 'Twenty',category: 'Communication',diff --git a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-billing-exempt-applications.constant.ts b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-billing-exempt-applications.constant.tsindex cca50fc3e17..875a4d192a7 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-billing-exempt-applications.constant.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-billing-exempt-applications.constant.ts@@ -8,4 +8,5 @@ export const MARKETPLACE_BILLING_EXEMPT_UNIVERSAL_IDENTIFIERS: string[] = [TWENTY_PUBLIC_APP_UNIVERSAL_IDENTIFIERS.SLACK,TWENTY_PUBLIC_APP_UNIVERSAL_IDENTIFIERS.FATHOM,TWENTY_PUBLIC_APP_UNIVERSAL_IDENTIFIERS.GRANOLA,+ TWENTY_PUBLIC_APP_UNIVERSAL_IDENTIFIERS.TEAMS,];diff --git a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-vetted-applications.constant.ts b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-vetted-applications.constant.tsindex 15aff23eedc..ddfbb3ca997 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-vetted-applications.constant.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/marketplace-vetted-applications.constant.ts@@ -31,4 +31,9 @@ export const MARKETPLACE_VETTED_APPLICATIONS: {sourcePackage: '@twentyhq/slack',position: 5,},+ {+ universalIdentifier: TWENTY_PUBLIC_APP_UNIVERSAL_IDENTIFIERS.TEAMS,+ sourcePackage: '@twentyhq/teams',+ position: 6,+ },];diff --git a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/twenty-public-app-universal-identifiers.constant.ts b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/twenty-public-app-universal-identifiers.constant.tsindex a483bc25634..b83cf3e572a 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/twenty-public-app-universal-identifiers.constant.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/constants/twenty-public-app-universal-identifiers.constant.ts@@ -7,4 +7,5 @@ export const TWENTY_PUBLIC_APP_UNIVERSAL_IDENTIFIERS = {LAST_CONTACT: '66a504cc-0a75-410e-a43f-cdeae1db1522',PEOPLE_DATA_LABS: '4a1178c1-3535-4a47-b592-231d3216b36f',SLACK: 'a8c47f21-3b9e-4d2a-8f61-9c0e7d4a2b51',+ TEAMS: '5955f8fe-6724-4749-b770-b849d63d5330',} as const;diff --git a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/utils/__tests__/is-billing-exempt-application.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/utils/__tests__/is-billing-exempt-application.util.spec.tsindex 0d96c655ac5..c6bcce95de4 100644--- a/packages/twenty-server/src/engine/core-modules/application/application-marketplace/utils/__tests__/is-billing-exempt-application.util.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/application/application-marketplace/utils/__tests__/is-billing-exempt-application.util.spec.ts@@ -7,6 +7,7 @@ describe('isBillingExemptApplication', () => {'a8c47f21-3b9e-4d2a-8f61-9c0e7d4a2b51','c5fb24b3-15b0-48fb-a9b5-f182ba231e6c','ffcc3979-0ee6-4d7d-912b-c12997d9f0f4',+ '5955f8fe-6724-4749-b770-b849d63d5330',])('should return true for billing-exempt app %s', (universalIdentifier) => {expect(isBillingExemptApplication(universalIdentifier)).toBe(true);});diff --git a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/utils/__tests__/build-logic-function-execution-usage.util.spec.ts b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/utils/__tests__/build-logic-function-execution-usage.util.spec.tsindex 5abaf9e7d94..bcdab457e2f 100644--- a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/utils/__tests__/build-logic-function-execution-usage.util.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/utils/__tests__/build-logic-function-execution-usage.util.spec.ts@@ -1,4 +1,3 @@-import { MARKETPLACE_BILLING_EXEMPT_UNIVERSAL_IDENTIFIERS } from 'src/engine/core-modules/application/application-marketplace/constants/marketplace-billing-exempt-applications.constant';import { isBillingExemptApplication } from 'src/engine/core-modules/application/application-marketplace/utils/is-billing-exempt-application.util';import { buildLogicFunctionExecutionUsage } from 'src/engine/core-modules/logic-function/logic-function-executor/utils/build-logic-function-execution-usage.util';import { UsageOperationType } from 'src/engine/core-modules/usage/enums/usage-operation-type.enum';@@ -32,27 +31,31 @@ const buildExpectedUsageEvent = ({});describe('buildLogicFunctionExecutionUsage', () => {- it('counts the run of a billing-exempt app at no credits and no runtime', () => {- expect(- buildLogicFunctionExecutionUsage({- durationMs: 5_000,- isBillingExempt: isBillingExemptApplication(- MARKETPLACE_BILLING_EXEMPT_UNIVERSAL_IDENTIFIERS[0],- ),- resourceId: LOGIC_FUNCTION_ID,- spenders: SPENDERS,- }),- ).toEqual([- buildExpectedUsageEvent({- creditsUsedMicro: 0,- quantity: 1,- unit: UsageUnit.INVOCATION,- }),- buildExpectedUsageEvent({- creditsUsedMicro: 0,- quantity: 0,- unit: UsageUnit.MILLISECOND,- }),- ]);- });+ it.each([+ ['Call Recorder', '8da4b8b5-5edf-4880-b51f-ab6e679ec617'],+ ['Microsoft Teams', '5955f8fe-6724-4749-b770-b849d63d5330'],+ ])(+ 'counts a %s run at no credits and no runtime',+ (_, universalIdentifier) => {+ expect(+ buildLogicFunctionExecutionUsage({+ durationMs: 5_000,+ isBillingExempt: isBillingExemptApplication(universalIdentifier),+ resourceId: LOGIC_FUNCTION_ID,+ spenders: SPENDERS,+ }),+ ).toEqual([+ buildExpectedUsageEvent({+ creditsUsedMicro: 0,+ quantity: 1,+ unit: UsageUnit.INVOCATION,+ }),+ buildExpectedUsageEvent({+ creditsUsedMicro: 0,+ quantity: 0,+ unit: UsageUnit.MILLISECOND,+ }),+ ]);+ },+ );});