Expand Connectors Extensions: AzureBlob, OneDrive, and additional Office 365 / Teams triggers - #132
Expand Connectors Extensions: AzureBlob, OneDrive, and additional Office 365 / Teams triggers#132Swapnil Nagar (swapnil-nagar) wants to merge 3 commits into
Conversation
Tsuyoshi Ushio (TsuyoshiUshio)
left a comment
There was a problem hiding this comment.
Thanks for adding the expanded connector surface. The package build/lint/tests pass locally for me, but the sample app does not install/build from a clean checkout.
azure-functions-nodejs-extensions-connectors/samples/connectorTriggerSample/package-lock.json now resolves @azure/functions-extensions-connectors@0.0.2-preview to file:../../azure-functions-extensions-connectors-0.0.2-preview.tgz, but that tarball is not committed/generated by the documented sample steps. Running from the sample directory:
npm ci
npm run buildfails with:
ENOENT: no such file or directory, open '.../azure-functions-extensions-connectors-0.0.2-preview.tgz'
TS2307: Cannot find module '@azure/functions-extensions-connectors'
Please regenerate the sample lockfile so it is reproducible from the repo, for example by keeping the existing local package link pattern or by resolving to a published package once 0.0.2-preview is available. As-is, the sample app and the PR's local test instructions fail on a clean checkout.
One smaller follow-up: the package README's Supported Connectors / Exported Types sections still list only the old trigger surface, even though README is included in the npm package. It would be good to update that table for the new Azure Blob, OneDrive, Office 365, and Teams registrations before publishing.
Summary
Updates
@azure/functions-extensions-connectorsto0.0.2-preview, aligning the first-class trigger surface with the new connectors and trigger methods shipped in@azure/connectors@0.2.0-preview. This release adds two brand-new connector namespaces (azureblob,onedrive) and six additional trigger registrations across the existingoffice365andteamsnamespaces, plus 13 new sample functions demonstrating each new trigger.Motivation
@azure/connectors@0.2.0-previewadded:Azureblobextension with anonUpdatedFilesAsynctrigger.Onedriveforbusinessextension withonNewFile/onUpdatedFile(single + batch) triggers.Office365(onFlaggedEmail,onNewMentionMeEmail,onUpcomingEvents) andTeams(onNewChannelMessageMentioningMe,onGroupMembershipAdd,onGroupMembershipRemoval).Without this PR, customers would have to fall back to the raw
app.connectorTrigger()API and manually cast payloads for any of these scenarios. This PR brings them up to the same strongly-typed, named-alias developer experience the existing first-class triggers already provide.Customer Experience
Full Supported Trigger Matrix (post-PR)
connectors.azureblob.onUpdatedFile()AzureBlobFileTriggerContextfilesAzureBlobMetadata[]connectors.onedrive.onNewFile()OneDriveFileTriggerContextfilesOneDriveBlobMetadata[]connectors.onedrive.onUpdatedFile()OneDriveFileTriggerContextfilesOneDriveBlobMetadata[]connectors.office365.onNewEmail()EmailTriggerContextemailsGraphClientReceiveMessage[]connectors.office365.onFlaggedEmail()EmailTriggerContextemailsGraphClientReceiveMessage[]connectors.office365.onNewMentionMeEmail()EmailTriggerContextemailsGraphClientReceiveMessage[]connectors.office365.onNewCalendarEvent()CalendarEventTriggerContextcalendarEventsGraphCalendarEventClientReceive[]connectors.office365.onUpcomingEvent()CalendarEventTriggerContextcalendarEventsGraphCalendarEventClientReceive[]connectors.sharepoint.onNewFile()FileTriggerContextfilesBlobMetadata[]connectors.sharepoint.onUpdatedFile()FileTriggerContextfilesBlobMetadata[]connectors.teams.onNewChannelMessage()ChannelMessageTriggerContextmessagesChatMessage[]connectors.teams.onNewChannelMessageMentioningMe()ChannelMessageTriggerContextmessagesChatMessage[]connectors.teams.onGroupMembershipAdd()GroupMembershipTriggerContextmembersRecord<string, unknown>[]connectors.teams.onGroupMembershipRemoval()GroupMembershipTriggerContextmembersRecord<string, unknown>[]connectors.kusto.onQueryResult()QueryResultTriggerContextrowsKustoRow[]Connectors Not Included (Action-Only)
A scan of
@azure/connectors@0.2.0-previewconfirmed the following six connectors have no trigger methods (noon*AsyncSDK methods, no/triggers/endpoints). They are action-only and therefore intentionally not exposed as first-class triggers in this package — customers consume them by instantiating their clients directly from@azure/connectors:arm— resource management actionsazuremonitorlogs— query actionsmq— queue actions (read/receive/send/delete; no push triggers)msgraphgroupsanduser— directory lookup actionsoffice365users— user profile actionssmtp—sendEmailactionPackage Structure Changes
Dependencies
@azure/functions4.15.1-preview@azure/connectors^0.2.0-preview^0.1.1-previewTest Results
test/connectorSpecificTriggers.test.tscases cover registration, bindings, and named-alias projection for every new trigger.test/connectorsNamespace.test.tsupdated to assert the namespace exposes exactly['azureblob', 'kusto', 'office365', 'onedrive', 'sharepoint', 'teams'].npm run build).npm run buildinsidesamples/connectorTriggerSample).How to Test Locally
Key Design Decisions
connectorTrigger<TItem>()wrapper that adds a named alias (files,emails,calendarEvents,messages,members) overcontext.items. No new core helpers were introduced.AzureBlobMetadataandOneDriveBlobMetadataare re-exported from their respective SDK extension modules to give each connector its own precisefileselement type, instead of collapsing both onto the SharePointBlobMetadata.memberstyped asRecord<string, unknown>. The SDK currently exposesGroupMembershipChangeas an open record; we surface that as-is rather than guessing a shape.@azure/connectors.