Skip to content

Commit 648c430

Browse files
authored
feat: dedupe 5 duplicate connectors into canonicals + release 0.39.0 (#98) (#101)
* feat: dedupe 5 duplicate connectors into canonicals + release 0.39.0 (ai#98) Retire microsoft-onedrive / -sharepoint / -outlook / -outlook-calendar / notion-database into their canonicals (onedrive / sharepoint / outlook-mail / microsoft-calendar / notion), harvesting each duplicate's unique capabilities first. Notion: promote to canonical — scopes [] + extraAuthParams {owner:user}, +databases.create/update, and a notion(opts) factory carrying Notion's required HTTP Basic exchangeOAuth/refreshToken (mirrors the twitter const+factory split; creds injected, no process.env in the lib). Flip registry/spec aliases (notion-database -> notion). SharePoint: +get_site_info, copy_item, lists.create, lists.items.update/delete/find, pages.publish; connect scope Sites.Read.All -> Sites.ReadWrite.All (existing connections need re-consent). Outlook: +forward_message, move_message, set_labels, send_draft, download_attachment. Calendar: +delete_event, list_events, rich book_slot fields. Also: add microsoft-onedrive/-sharepoint -> canonical aliases; export google-analytics + google-meet (implemented but previously unexported) so the platform can bundle them. BREAKING: removes notionDatabase + microsoft* duplicate exports. typecheck + 4039 tests + build all green. Closes #98. * fix(notion): databases.update partial updates + Notion-Version header; tests for harvested caps Addresses the PR review on #101. #1 (blocking): databases.update threw on title-only / schema-only updates because the declarative renderer resolves exact-match body placeholders via readRequiredPath. Hand-roll a conditional body reusing the shared executeRestRequest (now exported). Also add the missing Notion-Version defaultHeaders: the declarative data ops never sent it (the retired notion-database did), so the promoted notion would 400 in prod. #3: behavioral tests for the tricky harvested branches — notion databases.update (partial), sharepoint copy_item(202 monitor)/lists.items.update(412)/delete(404 tombstone)+happy paths, outlook download_attachment/set_labels/forward/move/send_draft, and a NEW microsoft-calendar.test.ts (list_events calendarId-omit, delete_event 404 tombstone + If-Match). +27 tests, 4066 total; typecheck + build green. Skipped per validated triage: #2 (Idempotency-Key is a pre-existing renderer-wide gap, not introduced here), #4 (retired duplicate capabilities had no consumers; kind aliases cover back-compat). Nits confirmed non-issues.
1 parent 9c6ef9a commit 648c430

30 files changed

Lines changed: 2170 additions & 2048 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ code should route through `IntegrationHub` either way.
202202

203203
Use `buildDefaultIntegrationRegistry()` before creating tool catalogs or
204204
connection pickers. It produces one canonical connector per integration,
205-
dedupes aliases such as `notion -> notion-database`, keeps source provenance in
205+
dedupes aliases such as `notion-database -> notion`, keeps source provenance in
206206
metadata, and marks the configured execution state for each connector:
207207

208208
```txt

docs/adapter-triage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ behavior behind the `ConnectorAdapter` contract.
3030
| `microsoft-calendar` | OAuth2 | read/write | first-party executable |
3131
| `hubspot` | OAuth2 | read/write | first-party executable |
3232
| `slack` | OAuth2 | read/write | first-party executable |
33-
| `notion-database` | OAuth2 | read/write | first-party executable |
33+
| `notion` | OAuth2 | read/write | first-party executable |
3434
| `salesforce` | OAuth2 | read/write | first-party executable |
3535
| `twilio-sms` | API key | read/write | first-party executable |
3636
| `stripe-pack` | API key | read/write | first-party executable |
@@ -45,7 +45,7 @@ behavior behind the `ConnectorAdapter` contract.
4545
Aliases matter when comparing coverage:
4646

4747
- `outlook-calendar` maps to `microsoft-calendar`.
48-
- `notion` maps to `notion-database`.
48+
- `notion-database` maps to `notion`.
4949
- `stripe` maps to `stripe-pack` for outbound payment actions.
5050
- `twilio` maps to `twilio-sms`.
5151

@@ -75,7 +75,7 @@ lookups.
7575
Four Tier 0 entries are canonicalized aliases:
7676

7777
- `outlook-calendar` should resolve to `microsoft-calendar`.
78-
- `notion` should resolve to `notion-database`.
78+
- `notion-database` should resolve to `notion`.
7979
- `stripe` should resolve to `stripe-pack` for outbound payment actions and
8080
`stripe` for inbound webhooks.
8181
- `twilio` should resolve to `twilio-sms`.

docs/catalog-registry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ const matches = searchIntegrationTools(tools, 'send a slack message', {
5757
})
5858
```
5959

60-
Aliases such as `notion -> notion-database`, `stripe -> stripe-pack`,
60+
Aliases such as `notion-database -> notion`, `stripe -> stripe-pack`,
6161
`twilio -> twilio-sms`, and `outlook-calendar -> microsoft-calendar` resolve to
6262
one canonical entry while preserving lookup by either name.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tangle-network/agent-integrations",
3-
"version": "0.38.0",
3+
"version": "0.39.0",
44
"description": "Vendor-neutral integration contracts and runtime helpers for sandbox and agent apps.",
55
"homepage": "https://github.com/tangle-network/agent-integrations#readme",
66
"repository": {

src/connectors/adapters/__tests__/notion.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ describe('notionConnector', () => {
1414
// `400 invalid_request_url`, so the connect flow never reaches consent.
1515
expect(auth.authorizationUrl).toBe('https://api.notion.com/v1/oauth/authorize')
1616
expect(auth.tokenUrl).toBe('https://api.notion.com/v1/oauth/token')
17-
expect(auth.scopes).toEqual(['read', 'write'])
17+
expect(auth.scopes).toEqual([])
18+
expect(auth.extraAuthParams).toEqual({ owner: 'user' })
1819
expect(auth.clientIdEnv).toBe('NOTION_OAUTH_CLIENT_ID')
1920
expect(auth.clientSecretEnv).toBe('NOTION_OAUTH_CLIENT_SECRET')
2021
})

src/connectors/adapters/declarative-rest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function readOperation(spec: RestConnectorSpec, name: string, expected: 'read' |
125125
return op
126126
}
127127

128-
async function executeRestRequest(
128+
export async function executeRestRequest(
129129
spec: RestConnectorSpec,
130130
request: RestRequestSpec,
131131
inv: ConnectorInvocation,

src/connectors/adapters/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export { gmail, type GmailOptions } from './gmail.js'
2525
export { microsoftCalendar, type MicrosoftCalendarOptions } from './microsoft-calendar.js'
2626
export { hubspot, type HubSpotOptions } from './hubspot.js'
2727
export { slack, type SlackOptions } from './slack.js'
28-
export { notionDatabase, type NotionDatabaseOptions } from './notion-database.js'
2928
export { docuseal, type DocuSealOptions } from './docuseal.js'
3029
export {
3130
declarativeRestConnector,
@@ -315,6 +314,8 @@ export { freshserviceConnector } from './freshservice.js'
315314
export { ghostcmsConnector } from './ghostcms.js'
316315
export { gistlyConnector } from './gistly.js'
317316
export { googleSearchConsoleConnector } from './google-search-console.js'
317+
export { googleAnalyticsConnector } from './google-analytics.js'
318+
export { googleMeetConnector } from './google-meet.js'
318319
export { youtubeDataConnector } from './youtube-data.js'
319320
export { googleCloudStorageConnector } from './google-cloud-storage.js'
320321
export { googleBigqueryConnector } from './google-bigquery.js'
@@ -392,12 +393,9 @@ export { microsoftDynamicsCrmConnector } from './microsoft-dynamics-crm.js'
392393
export { microsoftDynamics365BusinessCentralConnector } from './microsoft-dynamics-365-business-central.js'
393394
export { microsoft365PlannerConnector } from './microsoft-365-planner.js'
394395
export { microsoftPowerBiConnector } from './microsoft-power-bi.js'
395-
export { microsoftOutlookCalendarConnector } from './microsoft-outlook-calendar.js'
396396
export { microsoftOnenoteConnector } from './microsoft-onenote.js'
397-
export { microsoftOutlookConnector } from './microsoft-outlook.js'
398397
export { microsoftExcel365Connector } from './microsoft-excel-365.js'
399398
export { microsoftTodoConnector } from './microsoft-todo.js'
400-
export { microsoftSharepointConnector } from './microsoft-sharepoint.js'
401399
export { millionverifierConnector } from './millionverifier.js'
402400
export { mindeeConnector } from './mindee.js'
403401
export { mixmaxConnector } from './mixmax.js'
@@ -428,12 +426,11 @@ export { medullarConnector } from './medullar.js'
428426
export { mollieConnector } from './mollie.js'
429427
export { metabaseConnector } from './metabase.js'
430428
export { mindStudioConnector } from './mind-studio.js'
431-
export { microsoftOnedriveConnector } from './microsoft-onedrive.js'
432429
export { mongodbConnector } from './mongodb.js'
433430
export { niftyConnector } from './nifty.js'
434431
export { ninjapipeConnector } from './ninjapipe.js'
435432
export { nocodbConnector } from './nocodb.js'
436-
export { notionConnector } from './notion.js'
433+
export { notionConnector, notion, type NotionOptions } from './notion.js'
437434
export { ntfyConnector } from './ntfy.js'
438435
export { odooConnector } from './odoo.js'
439436
export { omniCoConnector } from './omni-co.js'

0 commit comments

Comments
 (0)