-
Notifications
You must be signed in to change notification settings - Fork 18
feat(generated): Pipes (batch 8ad8e447) #438
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| * [#438](https://github.com/workos/workos-php/pull/438) fix(generated): regenerate from spec | ||
|
|
||
| **Features** | ||
| * **[pipes](https://workos.com/docs/reference/pipes)**: | ||
| * Added `connected_account_id` to `DataIntegrationsVendCredentialsRequest` | ||
| * Added `connected_account_id` to `DataIntegrationsGetUserTokenRequest` | ||
| * Added parameter `UserManagementDataProviders.getUserDataInstallation.connected_account_id` | ||
| * Changed errors for endpoint `GET /user_management/users/{user_id}/connected_accounts/{slug}` | ||
| * Added parameter `UserManagementDataProviders.updateUserDataInstallation.connected_account_id` | ||
| * Changed errors for endpoint `PUT /user_management/users/{user_id}/connected_accounts/{slug}` | ||
| * Added parameter `UserManagementDataProviders.deleteUserDataInstallation.connected_account_id` | ||
| * Changed errors for endpoint `DELETE /user_management/users/{user_id}/connected_accounts/{slug}` | ||
| * Added `connected_accounts` to `DataIntegrationsListResponseData` | ||
| * Changed errors for endpoint `PUT /data-integrations/{slug}` | ||
| * Changed errors for endpoint `PUT /data-integrations/{slug}/api-key` | ||
| * Changed errors for endpoint `PUT /data-integrations/{slug}/client-credentials` | ||
| * Changed errors for endpoint `POST /data-integrations/{slug}/credentials` | ||
| * Changed errors for endpoint `POST /data-integrations/{provider}/token` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| edb560e2be3f54b668ea8d11fa5a060c87ab5087 | ||
| 6fba233c50a5b651b2df7b859b75bfe715bc825a |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -293,18 +293,21 @@ public function updateDataIntegrationClientCredentials( | |
| * @param string $slug The identifier of the integration. | ||
| * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. | ||
| * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. | ||
| * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. | ||
| * @return \WorkOS\Resource\DataIntegrationCredentialsResponse | ||
| * @throws \WorkOS\Exception\WorkOSException | ||
| */ | ||
| public function createDataIntegrationCredential( | ||
| string $slug, | ||
| string $userId, | ||
| ?string $organizationId = null, | ||
| ?string $connectedAccountId = null, | ||
| ?\WorkOS\RequestOptions $options = null, | ||
| ): \WorkOS\Resource\DataIntegrationCredentialsResponse { | ||
| $body = array_filter([ | ||
| 'user_id' => $userId, | ||
| 'organization_id' => $organizationId, | ||
| 'connected_account_id' => $connectedAccountId, | ||
| ], fn ($v) => $v !== null); | ||
| $response = $this->client->request( | ||
| method: 'POST', | ||
|
|
@@ -322,18 +325,21 @@ public function createDataIntegrationCredential( | |
| * @param string $provider The identifier of the integration. | ||
| * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. | ||
| * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. | ||
| * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. | ||
| * @return \WorkOS\Resource\DataIntegrationAccessTokenResponse | ||
| * @throws \WorkOS\Exception\WorkOSException | ||
| */ | ||
| public function getAccessToken( | ||
| string $provider, | ||
| string $userId, | ||
| ?string $organizationId = null, | ||
| ?string $connectedAccountId = null, | ||
| ?\WorkOS\RequestOptions $options = null, | ||
| ): \WorkOS\Resource\DataIntegrationAccessTokenResponse { | ||
| $body = array_filter([ | ||
| 'user_id' => $userId, | ||
| 'organization_id' => $organizationId, | ||
| 'connected_account_id' => $connectedAccountId, | ||
| ], fn ($v) => $v !== null); | ||
| $response = $this->client->request( | ||
| method: 'POST', | ||
|
|
@@ -351,17 +357,20 @@ public function getAccessToken( | |
| * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. | ||
| * @param string $slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`). | ||
| * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. | ||
| * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select a specific connection when the user has several for this provider. | ||
| * @return \WorkOS\Resource\ConnectedAccount | ||
| * @throws \WorkOS\Exception\WorkOSException | ||
| */ | ||
| public function getUserConnectedAccount( | ||
| string $userId, | ||
| string $slug, | ||
| ?string $organizationId = null, | ||
| ?string $connectedAccountId = null, | ||
| ?\WorkOS\RequestOptions $options = null, | ||
| ): \WorkOS\Resource\ConnectedAccount { | ||
| $query = array_filter([ | ||
| 'organization_id' => $organizationId, | ||
| 'connected_account_id' => $connectedAccountId, | ||
| ], fn ($v) => $v !== null); | ||
| $response = $this->client->request( | ||
| method: 'GET', | ||
|
|
@@ -426,6 +435,7 @@ public function createUserConnectedAccount( | |
| * @param array<string>|null $scopes The OAuth scopes granted for this connection. | ||
| * @param \WorkOS\Resource\PipeConnectedAccountState|null $state Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided. | ||
| * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. | ||
| * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to update. | ||
| * @return \WorkOS\Resource\ConnectedAccount | ||
| * @throws \WorkOS\Exception\WorkOSException | ||
| */ | ||
|
|
@@ -438,6 +448,7 @@ public function updateUserConnectedAccount( | |
| ?array $scopes = null, | ||
| ?\WorkOS\Resource\PipeConnectedAccountState $state = null, | ||
| ?string $organizationId = null, | ||
| ?string $connectedAccountId = null, | ||
|
Comment on lines
448
to
+451
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Knowledge Base Used: Prompt To Fix With AIThis is a comment left during a code review.
Path: lib/Service/Pipes.php
Line: 448-451
Comment:
**Update Drops Account Selector**
`updateUserConnectedAccount` accepts `$connectedAccountId` but sends it in neither the PUT body nor the query, unlike the matching get and delete operations. When a user has multiple accounts for a provider, the API cannot select the requested account and may reject the ambiguous update or modify the legacy/default account instead.
**Knowledge Base Used:**
- [Application and data integrations](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/workos-php/-/docs/integrations.md)
- [Connect and data integrations](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/workos-php/-/docs/connect-and-data-integrations.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
| ?\WorkOS\RequestOptions $options = null, | ||
| ): \WorkOS\Resource\ConnectedAccount { | ||
| $body = array_filter([ | ||
|
|
@@ -463,17 +474,20 @@ public function updateUserConnectedAccount( | |
| * @param string $userId A [User](https://workos.com/docs/reference/authkit/user) identifier. | ||
| * @param string $slug The slug identifier of the provider (e.g., `github`, `slack`, `notion`). | ||
| * @param string|null $organizationId An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. | ||
| * @param string|null $connectedAccountId A [connected account](https://workos.com/docs/reference/pipes/connected-account) identifier. Use this to select the connection to delete. | ||
| * @return void | ||
| * @throws \WorkOS\Exception\WorkOSException | ||
| */ | ||
| public function deleteUserConnectedAccount( | ||
| string $userId, | ||
| string $slug, | ||
| ?string $organizationId = null, | ||
| ?string $connectedAccountId = null, | ||
| ?\WorkOS\RequestOptions $options = null, | ||
| ): void { | ||
| $query = array_filter([ | ||
| 'organization_id' => $organizationId, | ||
| 'connected_account_id' => $connectedAccountId, | ||
| ], fn ($v) => $v !== null); | ||
| $this->client->request( | ||
| method: 'DELETE', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| { | ||
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT" | ||
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "connected_account_id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| { | ||
| "user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT" | ||
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | ||
| "connected_account_id": "data_installation_01EHZNVPK3SFK441A1RGBFSHRT" | ||
| } |
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.
If existing clients pass
RequestOptionspositionally, inserting$connectedAccountIdbefore$optionsbinds that object to a?stringparameter. Because strict types are enabled, calls such asgetAccessToken($provider, $userId, null, $options)now throw aTypeError. The same breaking change affects all five modified public Pipes methods.Knowledge Base Used:
Prompt To Fix With AI