-
Notifications
You must be signed in to change notification settings - Fork 55
feat(pipes): Add Data Integration operations and models #1653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "access_token": "gho_16C7e42F292c6912E7710c838347Ae178B4a", | ||
| "refresh_token": "ghr_xxxxxxxxxxxxxxxxxxxx", | ||
| "expires_at": "2025-12-31T23:59:59.000Z", | ||
| "scopes": ["repo", "user:email"], | ||
| "state": "connected" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "provider": "github", | ||
| "description": "Production GitHub app", | ||
| "enabled": true, | ||
| "scopes": ["repo", "read:org"], | ||
| "credentials": { | ||
| "type": "custom", | ||
| "client_id": "Iv1.abc123", | ||
| "client_secret": "secret_…" | ||
| }, | ||
| "custom_provider": { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "type": "custom", | ||
| "client_id": "Iv1.abc123", | ||
| "redacted_client_secret": "6789" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "type": "custom", | ||
| "client_id": "Iv1.abc123", | ||
| "client_secret": "secret_…" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "object": "data_integration", | ||
| "id": "data_integration_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "slug": "github", | ||
| "integration_type": "github", | ||
| "description": "Production GitHub app", | ||
| "enabled": true, | ||
| "state": "valid", | ||
| "scopes": ["repo", "read:org"], | ||
| "redirect_uri": "https://api.workos.com/data-integrations/github/dik_01EHZNVPK3SFK441A1RGBFSHRT/callback", | ||
| "credentials": { | ||
| "type": "custom", | ||
| "client_id": "Iv1.abc123", | ||
| "redacted_client_secret": "6789" | ||
| }, | ||
| "custom_provider": { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| }, | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "data": [ | ||
| { | ||
| "object": "data_integration", | ||
| "id": "data_integration_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "slug": "github", | ||
| "integration_type": "github", | ||
| "description": "Production GitHub app", | ||
| "enabled": true, | ||
| "state": "valid", | ||
| "scopes": ["repo", "read:org"], | ||
| "redirect_uri": "https://api.workos.com/data-integrations/github/dik_01EHZNVPK3SFK441A1RGBFSHRT/callback", | ||
| "credentials": { | ||
| "type": "custom", | ||
| "client_id": "Iv1.abc123", | ||
| "redacted_client_secret": "6789" | ||
| }, | ||
| "custom_provider": { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| }, | ||
| "created_at": "2026-01-15T12:00:00.000Z", | ||
| "updated_at": "2026-01-15T12:00:00.000Z" | ||
| } | ||
| ], | ||
| "list_metadata": { | ||
| "before": null, | ||
| "after": null | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "description": "Production GitHub app", | ||
| "enabled": true, | ||
| "scopes": ["repo", "read:org"], | ||
| "credentials": { | ||
| "type": "custom", | ||
| "client_id": "Iv1.abc123", | ||
| "client_secret": "secret_…" | ||
| }, | ||
| "custom_provider": { | ||
| "name": "My OAuth App", | ||
| "authorization_url": "https://provider.example.com/oauth/authorize", | ||
| "token_url": "https://provider.example.com/oauth/token", | ||
| "refresh_token_url": "https://provider.example.com/oauth/token", | ||
| "pkce_enabled": true, | ||
| "request_scope_separator": " ", | ||
| "scopes_required": false, | ||
| "client_secret_required": true, | ||
| "additional_authorization_parameters": { | ||
| "prompt": "consent" | ||
| }, | ||
| "token_body_content_type": "application/x-www-form-urlencoded", | ||
| "authenticate_via": "request_body" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| import type { ConnectedAccountState } from './connected-account-state.interface'; | ||
|
|
||
| export interface ConnectedAccountDto { | ||
| /** The OAuth access token for the connected account. */ | ||
| accessToken?: string; | ||
| /** The OAuth refresh token for the connected account. */ | ||
| refreshToken?: string; | ||
| /** The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. */ | ||
| expiresAt?: Date; | ||
| /** The OAuth scopes granted for this connection. */ | ||
| scopes?: string[]; | ||
| /** Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. */ | ||
| state?: ConnectedAccountState; | ||
| } | ||
|
|
||
| export interface ConnectedAccountDtoResponse { | ||
| access_token?: string; | ||
| refresh_token?: string; | ||
| expires_at?: string; | ||
| scopes?: string[]; | ||
| state?: ConnectedAccountState; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/pipes/interfaces/create-data-integration-options.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| import type { DataIntegrationCredentialsDto } from './data-integration-credentials-dto.interface'; | ||
| import type { CustomProviderDefinition } from './custom-provider-definition.interface'; | ||
|
|
||
| export interface CreateDataIntegrationOptions { | ||
| /** The provider to create a Data Integration for. For a built-in provider use its slug (e.g. `github`, `slack`). For a custom provider, this is the new provider slug and `custom_provider` must be supplied. A custom provider slug cannot shadow an existing global provider slug. */ | ||
| provider: string; | ||
| /** An optional description of the Data Integration. */ | ||
| description?: string | null; | ||
| /** Whether the Data Integration is enabled. Defaults to `false`. */ | ||
| enabled?: boolean; | ||
| /** The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted. */ | ||
| scopes?: string[] | null; | ||
| /** The credentials to configure for the Data Integration. Required for both built-in and custom providers. */ | ||
| credentials?: DataIntegrationCredentialsDto; | ||
| /** The OAuth definition for a custom provider. Supply this to define a custom provider; omit it to create an integration for a built-in provider. */ | ||
| customProvider?: CustomProviderDefinition; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| import type { | ||
| DataIntegrationCredentialsDto, | ||
| DataIntegrationCredentialsDtoResponse, | ||
| } from './data-integration-credentials-dto.interface'; | ||
| import type { | ||
| CustomProviderDefinition, | ||
| CustomProviderDefinitionResponse, | ||
| } from './custom-provider-definition.interface'; | ||
|
|
||
| export interface CreateDataIntegration { | ||
| /** The provider to create a Data Integration for. For a built-in provider use its slug (e.g. `github`, `slack`). For a custom provider, this is the new provider slug and `custom_provider` must be supplied. A custom provider slug cannot shadow an existing global provider slug. */ | ||
| provider: string; | ||
| /** An optional description of the Data Integration. */ | ||
| description?: string | null; | ||
| /** Whether the Data Integration is enabled. Defaults to `false`. */ | ||
| enabled?: boolean; | ||
| /** The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted. */ | ||
| scopes?: string[] | null; | ||
| /** The credentials to configure for the Data Integration. Required for both built-in and custom providers. */ | ||
| credentials?: DataIntegrationCredentialsDto; | ||
| /** The OAuth definition for a custom provider. Supply this to define a custom provider; omit it to create an integration for a built-in provider. */ | ||
| customProvider?: CustomProviderDefinition; | ||
| } | ||
|
|
||
| export interface CreateDataIntegrationResponse { | ||
| provider: string; | ||
| description?: string | null; | ||
| enabled?: boolean; | ||
| scopes?: string[] | null; | ||
| credentials?: DataIntegrationCredentialsDtoResponse; | ||
| custom_provider?: CustomProviderDefinitionResponse; | ||
| } |
22 changes: 22 additions & 0 deletions
22
src/pipes/interfaces/create-user-connected-account-options.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| import type { ConnectedAccountState } from './connected-account-state.interface'; | ||
|
|
||
| export interface CreateUserConnectedAccountOptions { | ||
| /** A [User](https://workos.com/docs/reference/authkit/user) identifier. */ | ||
| userId: string; | ||
| /** The slug identifier of the provider (e.g., `github`, `slack`, `notion`). */ | ||
| slug: string; | ||
| /** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. */ | ||
| organizationId?: string; | ||
| /** The OAuth access token for the connected account. */ | ||
| accessToken?: string; | ||
| /** The OAuth refresh token for the connected account. */ | ||
| refreshToken?: string; | ||
| /** The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire. */ | ||
| expiresAt?: Date; | ||
| /** The OAuth scopes granted for this connection. */ | ||
| scopes?: string[]; | ||
| /** Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. */ | ||
| state?: ConnectedAccountState; | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/pipes/interfaces/custom-provider-definition-authenticate-via.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| export const CustomProviderDefinitionAuthenticateVia = { | ||
| RequestBody: 'request_body', | ||
| BasicAuthHeader: 'basic_auth_header', | ||
| } as const; | ||
|
|
||
| export type CustomProviderDefinitionAuthenticateVia = | ||
| (typeof CustomProviderDefinitionAuthenticateVia)[keyof typeof CustomProviderDefinitionAuthenticateVia]; |
42 changes: 42 additions & 0 deletions
42
src/pipes/interfaces/custom-provider-definition.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| import type { CustomProviderDefinitionAuthenticateVia } from './custom-provider-definition-authenticate-via.interface'; | ||
|
|
||
| export interface CustomProviderDefinition { | ||
| /** A descriptive name for the custom provider. */ | ||
| name: string; | ||
| /** The provider's OAuth authorization endpoint. */ | ||
| authorizationUrl: string; | ||
| /** The provider's OAuth token endpoint. */ | ||
| tokenUrl: string; | ||
| /** The endpoint used to refresh tokens, if different from the token endpoint. */ | ||
| refreshTokenUrl?: string | null; | ||
| /** Whether PKCE is used during the authorization code flow. Defaults to `true`. */ | ||
| pkceEnabled?: boolean; | ||
| /** The separator used to join requested scopes. Defaults to a space. */ | ||
| requestScopeSeparator?: string; | ||
| /** Whether at least one scope must be selected when connecting an account. Defaults to `false`. */ | ||
| scopesRequired?: boolean; | ||
| /** Whether a client secret is required for this provider. Defaults to `true`. */ | ||
| clientSecretRequired?: boolean; | ||
| /** Additional static query parameters appended to the authorization request. */ | ||
| additionalAuthorizationParameters?: Record<string, string>; | ||
| /** The Content-Type used when exchanging the token request. */ | ||
| tokenBodyContentType?: string; | ||
| /** How client credentials are sent when exchanging authorization codes and refreshing tokens. */ | ||
| authenticateVia?: CustomProviderDefinitionAuthenticateVia; | ||
| } | ||
|
|
||
| export interface CustomProviderDefinitionResponse { | ||
| name: string; | ||
| authorization_url: string; | ||
| token_url: string; | ||
| refresh_token_url?: string | null; | ||
| pkce_enabled?: boolean; | ||
| request_scope_separator?: string; | ||
| scopes_required?: boolean; | ||
| client_secret_required?: boolean; | ||
| additional_authorization_parameters?: Record<string, string>; | ||
| token_body_content_type?: string; | ||
| authenticate_via?: CustomProviderDefinitionAuthenticateVia; | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/pipes/interfaces/data-integration-credential-type.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| export const DataIntegrationCredentialType = { | ||
| Custom: 'custom', | ||
| Organization: 'organization', | ||
| } as const; | ||
|
|
||
| export type DataIntegrationCredentialType = | ||
| (typeof DataIntegrationCredentialType)[keyof typeof DataIntegrationCredentialType]; |
19 changes: 19 additions & 0 deletions
19
src/pipes/interfaces/data-integration-credential.interface.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // This file is auto-generated by oagen. Do not edit. | ||
|
|
||
| import type { DataIntegrationCredentialType } from './data-integration-credential-type.interface'; | ||
|
|
||
| /** The credentials configured for the Data Integration. */ | ||
| export interface DataIntegrationCredential { | ||
| /** The credentials type. `custom` uses your own OAuth app credentials; `organization` has each organization supply its own credentials (so `client_id`/`redacted_client_secret` are null on the integration itself). */ | ||
| type: DataIntegrationCredentialType; | ||
| /** The OAuth client ID configured for the provider app. Null for `organization` credentials. */ | ||
| clientId: string | null; | ||
| /** The last four characters of the OAuth client secret. The full secret is never returned. Null for `organization` credentials. */ | ||
| redactedClientSecret: string | null; | ||
| } | ||
|
|
||
| export interface DataIntegrationCredentialResponse { | ||
| type: DataIntegrationCredentialType; | ||
| client_id: string | null; | ||
| redacted_client_secret: string | null; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConnectedAccountstill documentsdisconnectedas a possible API state, and the existing connected-account serializers typeresponse.stateasConnectedAccountState. RemovingDisconnectedfrom this exported const makes valid disconnected responses unrepresentable in TypeScript and breaks callers usingConnectedAccountState.Disconnectedfor delete/list states.Artifacts
Repro: TypeScript source that imports ConnectedAccountState.Disconnected from the real SDK interface
Repro: tsc output showing ConnectedAccountState.Disconnected is not exported
Repro: runtime serializer source showing disconnected payload pass-through
Repro: runtime output showing serializer preserves disconnected state
Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
disconnectedshould 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 (
ConnectedAccountDtoand the create/update-connected-account options) only defineconnected/needs_reauthorization.disconnectedonly ever lived in theConnectedAccountresponse schema (added in https://github.com/workos/workos/pull/50448), but it was never wired through the backend:z.enum(['connected', 'needs_reauthorization'])state: 'disconnected'.Thepipes.connected_account.disconnected webhookis the event; there's no lingering object carrying that stateSo 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.There was a problem hiding this comment.
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, thenDisconnectedwas never a valid SDK value to expose. The removal is correct.Happy to dismiss this comment. No rule needed here.