Skip to content

feat(pipes): Add Data Integration operations and models#1653

Open
gjtorikian wants to merge 2 commits into
mainfrom
pipes-updates
Open

feat(pipes): Add Data Integration operations and models#1653
gjtorikian wants to merge 2 commits into
mainfrom
pipes-updates

Conversation

@gjtorikian

Copy link
Copy Markdown
Contributor

Summary

  • Add Data Integration CRUD methods to the Pipes module: listDataIntegrations, createDataIntegration, getDataIntegration, updateDataIntegration, and deleteDataIntegration
  • Add user connected account operations: createUserConnectedAccount and updateUserConnectedAccount
  • Add supporting interfaces for data integrations, custom provider definitions, credentials, and connected account DTOs
  • Add serializers and JSON fixtures backing the new models
  • Add unit tests (pipes.spec.ts, serializers.spec.ts) covering the new operations and serialization round-trips
  • Generated via oagen from the updated API spec

Test plan

  • yarn test src/pipes passes
  • Lint/build succeeds (yarn build)
  • New serializers round-trip fixtures correctly

@gjtorikian gjtorikian requested review from a team as code owners July 2, 2026 16:24
@gjtorikian gjtorikian requested a review from nicknisi July 2, 2026 16:24
@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Data Integration management support to the Pipes SDK. The main changes are:

  • Data Integration CRUD methods for list, create, get, update, and delete flows.
  • Connected-account import and update operations for user/provider pairs.
  • New interfaces, serializers, JSON fixtures, and unit tests for the added models.

Confidence Score: 4/5

The Data Integration additions are mostly self-contained, but the connected-account state export needs correction before this is safe to merge.

The main implementation and tests cover the new API surface, while the missing disconnected state creates a concrete TypeScript compatibility break for valid connected-account responses.

src/pipes/interfaces/connected-account-state.interface.ts

T-Rex T-Rex Logs

What T-Rex did

  • Verified the disconnected state restoration issue by reproducing the TypeScript import error for ConnectedAccountState.Disconnected and confirming that the runtime serializer preserves a disconnected state payload.
  • Compared the before and after data-integration-crud runs, and observed that the head execution now records deserialized returns and request details for all five endpoints.
  • Validated user-connected-account-ops improvements by observing undefined methods prior to the run and functioning methods with POST/PUT call records after the head run.
  • Validated pipes-serializers-models updates by confirming all targeted exports and fixtures pass after the changes, with serializer/deserializer fixture calls succeeding and the tests and build reporting success.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/pipes/interfaces/connected-account-state.interface.ts:3-6
**Restore disconnected state**
`ConnectedAccount` still documents `disconnected` as a possible API state, and the existing connected-account serializers type `response.state` as `ConnectedAccountState`. Removing `Disconnected` from this exported const makes valid disconnected responses unrepresentable in TypeScript and breaks callers using `ConnectedAccountState.Disconnected` for delete/list states.

Reviews (2): Last reviewed commit: "fix(pipes): preserve omitted fields in u..." | Re-trigger Greptile

Comment thread src/pipes/serializers/update-data-integration.serializer.ts Outdated
Comment thread src/pipes/serializers/update-custom-provider-definition.serializer.ts Outdated

@thompsongl thompsongl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the greptile P1s are valid. null does reset intentionally, with undefined being noop

Regenerate the Pipes service with the fixed oagen emitter. Optional+nullable
request-body fields no longer coalesce to `?? null`, so a partial update omits
untouched fields (no-op) instead of sending explicit null (which the API treats
as a reset/clear). Fixes the two Greptile P1s on update-data-integration and
update-custom-provider-definition, plus the same pattern in the create and
custom-provider serializers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment on lines 3 to 6
export const ConnectedAccountState = {
Connected: 'connected',
NeedsReauthorization: 'needs_reauthorization',
Disconnected: 'disconnected',
} as const;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Restore disconnected state
ConnectedAccount still documents disconnected as a possible API state, and the existing connected-account serializers type response.state as ConnectedAccountState. Removing Disconnected from this exported const makes valid disconnected responses unrepresentable in TypeScript and breaks callers using ConnectedAccountState.Disconnected for delete/list states.

Artifacts

Repro: TypeScript source that imports ConnectedAccountState.Disconnected from the real SDK interface

  • Contains supporting evidence from the run (text/typescript; charset=utf-8).

Repro: tsc output showing ConnectedAccountState.Disconnected is not exported

  • Keeps the command output available without making the summary code-heavy.

Repro: runtime serializer source showing disconnected payload pass-through

  • Contains supporting evidence from the run (text/typescript; charset=utf-8).

Repro: runtime output showing serializer preserves disconnected state

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/pipes/interfaces/connected-account-state.interface.ts
Line: 3-6

Comment:
**Restore disconnected state**
`ConnectedAccount` still documents `disconnected` as a possible API state, and the existing connected-account serializers type `response.state` as `ConnectedAccountState`. Removing `Disconnected` from this exported const makes valid disconnected responses unrepresentable in TypeScript and breaks callers using `ConnectedAccountState.Disconnected` for delete/list states.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think disconnected should be restored, because it's not a state the API actually returns—but I could be completely wrong.

The enum dropped to two values because this is the first PR to pull in the Pipes connected-account schemas, and those (ConnectedAccountDto and the create/update-connected-account options) only define connected / needs_reauthorization. disconnected only ever lived in the ConnectedAccount response schema (added in https://github.com/workos/workos/pull/50448), but it was never wired through the backend:

  • The domain entity is z.enum(['connected', 'needs_reauthorization'])
  • On disconnect we delete the installation row rather than setting state: 'disconnected'. The pipes.connected_account.disconnected webhook is the event; there's no lingering object carrying that state

So no response has ever come back with state: 'disconnected'. Adding it back to the SDK type would just re-introduce a value the API doesn't emit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a convincing clarification — if the domain entity is z.enum(['connected', 'needs_reauthorization']) and disconnect is modeled as a row deletion + webhook event rather than a state transition, then Disconnected was never a valid SDK value to expose. The removal is correct.

Happy to dismiss this comment. No rule needed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants