diff --git a/.changelog-pending/2026-07-28T19-17-40-72f2c0b2792fb452e4b7e1a0555c2fe14b857631.md b/.changelog-pending/2026-07-28T19-17-40-72f2c0b2792fb452e4b7e1a0555c2fe14b857631.md new file mode 100644 index 00000000..455cf492 --- /dev/null +++ b/.changelog-pending/2026-07-28T19-17-40-72f2c0b2792fb452e4b7e1a0555c2fe14b857631.md @@ -0,0 +1,18 @@ +* [#531](https://github.com/workos/workos-ruby/pull/531) fix(generated): regenerate from spec + + **Features** + * **[pipes](https://workos.com/docs/reference/pipes)**: + * Added `config` to `DataIntegrationsGetDataIntegrationAuthorizeUrlRequest` + * Added `client_credentials` to `DataIntegrationAuthMethods` + * Added `client_credentials` to `DataIntegrationsListResponseDataAuthMethods` + * Added `client_credentials` to `DataIntegrationsListResponseDataConnectedAccountAuthMethod` + * Added `config` to Pipes models + * **[connect](https://workos.com/docs/reference/workos-connect/standalone)**: + * Added `client_credentials` to `ConnectedAccountAuthMethod` + + **Fixes** + * **[user_management](https://workos.com/docs/reference/authkit/user)**: + * Changed errors for endpoint `POST /user_management/invitations` + * Changed errors for endpoint `POST /user_management/invitations/{id}/resend` + * Changed errors for endpoint `POST /user_management/magic_auth` + * Changed errors for endpoint `POST /user_management/authenticate` diff --git a/.last-synced-sha b/.last-synced-sha index 5d1fd6d4..dd187756 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -f40851a620a1ba0badec95e80faac475382c8dd0 +904c5bccd2c6d0511ad2d0760e57d139143f1773 diff --git a/lib/workos/pipes.rb b/lib/workos/pipes.rb index c32eb296..6271146f 100644 --- a/lib/workos/pipes.rb +++ b/lib/workos/pipes.rb @@ -60,6 +60,7 @@ def list_data_integrations( # @param enabled [Boolean, nil] Whether the Data Integration is enabled. Defaults to `false`. # @param scopes [Array, nil] The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted. # @param auth_methods [Array, nil] How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request). + # @param config [Hash{String => String}, nil] Provider-specific config values (e.g. a Snowflake `account_identifier`), keyed by the config field. Only fields the built-in provider declares are accepted. # @param credentials [WorkOS::DataIntegrationCredentialsInput, nil] The OAuth credentials to configure for the Data Integration. Required for OAuth integrations; omit when `auth_methods` is `["api_key"]`. # @param api_key [WorkOS::ApiKeyInstallation, nil] An optional API key to install for the first tenant on an `api_key` integration. Omit to declare a keyless integration; tenants can be added later via the per-installation API key path. # @param custom_provider [WorkOS::CustomProviderDefinition, nil] 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. @@ -71,6 +72,7 @@ def create_data_integration( enabled: nil, scopes: WorkOS::OMIT, auth_methods: nil, + config: nil, credentials: nil, api_key: nil, custom_provider: nil, @@ -80,6 +82,7 @@ def create_data_integration( "provider" => provider, "enabled" => enabled, "auth_methods" => auth_methods, + "config" => config, "credentials" => credentials, "api_key" => api_key, "custom_provider" => custom_provider @@ -210,6 +213,7 @@ def update_data_integration_api_key( # @param user_id [String] The ID of the user to authorize. # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization. # @param return_to [String, nil] The URL to redirect the user to after authorization. + # @param config [Hash{String => String}, nil] Connect-time config values for the provider-declared `installation`-scope fields (e.g. a Zendesk `subdomain`), keyed by the config field. Only fields the provider declares may be supplied, and required fields must be provided unless already pinned on the integration. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::DataIntegrationAuthorizeUrlResponse] def authorize_data_integration( @@ -217,12 +221,14 @@ def authorize_data_integration( user_id:, organization_id: nil, return_to: nil, + config: nil, request_options: {} ) body = { "user_id" => user_id, "organization_id" => organization_id, - "return_to" => return_to + "return_to" => return_to, + "config" => config }.compact response = @client.request( method: :post, diff --git a/lib/workos/pipes/create_data_integration.rb b/lib/workos/pipes/create_data_integration.rb index 9a1e6fbb..12f4ae2c 100644 --- a/lib/workos/pipes/create_data_integration.rb +++ b/lib/workos/pipes/create_data_integration.rb @@ -10,6 +10,7 @@ class CreateDataIntegration < WorkOS::Types::BaseModel enabled: :enabled, scopes: :scopes, auth_methods: :auth_methods, + config: :config, credentials: :credentials, api_key: :api_key, custom_provider: :custom_provider @@ -21,6 +22,7 @@ class CreateDataIntegration < WorkOS::Types::BaseModel :enabled, :scopes, :auth_methods, + :config, :credentials, :api_key, :custom_provider @@ -32,6 +34,7 @@ def initialize(json) @enabled = hash[:enabled] @scopes = hash[:scopes] || [] @auth_methods = hash[:auth_methods] || [] + @config = hash[:config] || {} @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsInput.new(hash[:credentials]) : nil @api_key = hash[:api_key] ? WorkOS::ApiKeyInstallation.new(hash[:api_key]) : nil @custom_provider = hash[:custom_provider] ? WorkOS::CustomProviderDefinition.new(hash[:custom_provider]) : nil diff --git a/lib/workos/pipes/data_integration.rb b/lib/workos/pipes/data_integration.rb index dd08ea01..ec91dd91 100644 --- a/lib/workos/pipes/data_integration.rb +++ b/lib/workos/pipes/data_integration.rb @@ -17,6 +17,7 @@ class DataIntegration < WorkOS::Types::BaseModel auth_methods: :auth_methods, credentials: :credentials, installation: :installation, + config: :config, custom_provider: :custom_provider, created_at: :created_at, updated_at: :updated_at @@ -35,6 +36,7 @@ class DataIntegration < WorkOS::Types::BaseModel :auth_methods, :credentials, :installation, + :config, :custom_provider, :created_at, :updated_at @@ -53,6 +55,7 @@ def initialize(json) @auth_methods = hash[:auth_methods] || [] @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredential.new(hash[:credentials]) : nil @installation = hash[:installation] ? WorkOS::DataIntegrationInstallation.new(hash[:installation]) : nil + @config = hash[:config] || {} @custom_provider = hash[:custom_provider] ? WorkOS::DataIntegrationCustomProvider.new(hash[:custom_provider]) : nil @created_at = hash[:created_at] @updated_at = hash[:updated_at] diff --git a/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb b/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb index 495c04c5..3fb576f5 100644 --- a/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +++ b/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb @@ -7,19 +7,22 @@ class DataIntegrationsGetDataIntegrationAuthorizeUrlRequest < WorkOS::Types::Bas HASH_ATTRS = { user_id: :user_id, organization_id: :organization_id, - return_to: :return_to + return_to: :return_to, + config: :config }.freeze attr_accessor \ :user_id, :organization_id, - :return_to + :return_to, + :config def initialize(json) hash = self.class.normalize(json) @user_id = hash[:user_id] @organization_id = hash[:organization_id] @return_to = hash[:return_to] + @config = hash[:config] || {} end end end diff --git a/lib/workos/pipes_provider.rb b/lib/workos/pipes_provider.rb index edecdfec..f5df45c2 100644 --- a/lib/workos/pipes_provider.rb +++ b/lib/workos/pipes_provider.rb @@ -36,6 +36,7 @@ def list_organization_data_integration_configurations( # @param scopes [Array, nil] The OAuth scopes to request for the organization. Pass `null` to inherit the provider scopes. # @param client_id [String, nil] The OAuth client ID of the organization's own application. Must be provided together with `client_secret`, and only for providers whose credentials are supplied by the organization. # @param client_secret [String, nil] The OAuth client secret of the organization's own application. Must be provided together with `client_id`. + # @param config [Hash{String => String}, nil] Provider-specific config values to set for the organization, keyed by config field. Only fields the provider declares are accepted, and each value must match that field's pattern. Accepted only for providers whose credentials are organization-managed; for shared or custom credential providers, config belongs on the integration itself (via the data-integrations API) and supplying it here is rejected. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::DataIntegrationConfigurationResponse] def update_organization_data_integration_configuration( @@ -45,12 +46,14 @@ def update_organization_data_integration_configuration( scopes: WorkOS::OMIT, client_id: nil, client_secret: nil, + config: nil, request_options: {} ) body = { "enabled" => enabled, "client_id" => client_id, - "client_secret" => client_secret + "client_secret" => client_secret, + "config" => config }.compact body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT) response = @client.request( diff --git a/lib/workos/pipes_provider/configure_data_integration_body.rb b/lib/workos/pipes_provider/configure_data_integration_body.rb index 3a59cfc2..348cb7af 100644 --- a/lib/workos/pipes_provider/configure_data_integration_body.rb +++ b/lib/workos/pipes_provider/configure_data_integration_body.rb @@ -8,14 +8,16 @@ class ConfigureDataIntegrationBody < WorkOS::Types::BaseModel enabled: :enabled, scopes: :scopes, client_id: :client_id, - client_secret: :client_secret + client_secret: :client_secret, + config: :config }.freeze attr_accessor \ :enabled, :scopes, :client_id, - :client_secret + :client_secret, + :config def initialize(json) hash = self.class.normalize(json) @@ -23,6 +25,7 @@ def initialize(json) @scopes = hash[:scopes] || [] @client_id = hash[:client_id] @client_secret = hash[:client_secret] + @config = hash[:config] || {} end end end diff --git a/lib/workos/pipes_provider/data_integration_configuration_response.rb b/lib/workos/pipes_provider/data_integration_configuration_response.rb index bf33bd3c..eb67e839 100644 --- a/lib/workos/pipes_provider/data_integration_configuration_response.rb +++ b/lib/workos/pipes_provider/data_integration_configuration_response.rb @@ -12,6 +12,7 @@ class DataIntegrationConfigurationResponse < WorkOS::Types::BaseModel name: :name, enabled: :enabled, scopes: :scopes, + config: :config, created_at: :created_at, updated_at: :updated_at, credentials: :credentials @@ -25,6 +26,7 @@ class DataIntegrationConfigurationResponse < WorkOS::Types::BaseModel :name, :enabled, :scopes, + :config, :created_at, :updated_at, :credentials @@ -38,6 +40,7 @@ def initialize(json) @name = hash[:name] @enabled = hash[:enabled] @scopes = hash[:scopes] || [] + @config = hash[:config] || {} @created_at = hash[:created_at] @updated_at = hash[:updated_at] @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentials.new(hash[:credentials]) : nil diff --git a/lib/workos/types/connected_account_auth_method.rb b/lib/workos/types/connected_account_auth_method.rb index 54706946..51fadecc 100644 --- a/lib/workos/types/connected_account_auth_method.rb +++ b/lib/workos/types/connected_account_auth_method.rb @@ -7,7 +7,8 @@ module Types class ConnectedAccountAuthMethod OAUTH = "oauth" API_KEY = "api_key" - ALL = [OAUTH, API_KEY].freeze + CLIENT_CREDENTIALS = "client_credentials" + ALL = [OAUTH, API_KEY, CLIENT_CREDENTIALS].freeze end end end diff --git a/lib/workos/types/create_data_integration_auth_methods.rb b/lib/workos/types/create_data_integration_auth_methods.rb index 94d082ce..a6f17c5a 100644 --- a/lib/workos/types/create_data_integration_auth_methods.rb +++ b/lib/workos/types/create_data_integration_auth_methods.rb @@ -4,6 +4,10 @@ module WorkOS module Types - CreateDataIntegrationAuthMethods = ConnectedAccountAuthMethod + class CreateDataIntegrationAuthMethods + OAUTH = "oauth" + API_KEY = "api_key" + ALL = [OAUTH, API_KEY].freeze + end end end diff --git a/rbi/workos/configure_data_integration_body.rbi b/rbi/workos/configure_data_integration_body.rbi index 011bb13d..af8f41f3 100644 --- a/rbi/workos/configure_data_integration_body.rbi +++ b/rbi/workos/configure_data_integration_body.rbi @@ -33,6 +33,12 @@ module WorkOS sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def client_secret=(value); end + sig { returns(T.nilable(T::Hash[String, String])) } + def config; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def config=(value); end + sig { returns(T::Hash[Symbol, T.untyped]) } def to_h; end diff --git a/rbi/workos/create_data_integration.rbi b/rbi/workos/create_data_integration.rbi index b90c9cca..8b6e2bef 100644 --- a/rbi/workos/create_data_integration.rbi +++ b/rbi/workos/create_data_integration.rbi @@ -39,6 +39,12 @@ module WorkOS sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } def auth_methods=(value); end + sig { returns(T.nilable(T::Hash[String, String])) } + def config; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def config=(value); end + sig { returns(T.nilable(WorkOS::DataIntegrationCredentialsInput)) } def credentials; end diff --git a/rbi/workos/data_integration.rbi b/rbi/workos/data_integration.rbi index c7ee1313..bf1bb40c 100644 --- a/rbi/workos/data_integration.rbi +++ b/rbi/workos/data_integration.rbi @@ -81,6 +81,12 @@ module WorkOS sig { params(value: T.nilable(WorkOS::DataIntegrationInstallation)).returns(T.nilable(WorkOS::DataIntegrationInstallation)) } def installation=(value); end + sig { returns(T::Hash[String, String]) } + def config; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def config=(value); end + sig { returns(T.nilable(WorkOS::DataIntegrationCustomProvider)) } def custom_provider; end diff --git a/rbi/workos/data_integration_configuration_response.rbi b/rbi/workos/data_integration_configuration_response.rbi index 567b5ff5..3ccec7b7 100644 --- a/rbi/workos/data_integration_configuration_response.rbi +++ b/rbi/workos/data_integration_configuration_response.rbi @@ -51,6 +51,12 @@ module WorkOS sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } def scopes=(value); end + sig { returns(T::Hash[String, String]) } + def config; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def config=(value); end + sig { returns(String) } def created_at; end diff --git a/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi b/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi index 5b1ab5b9..fda7994c 100644 --- a/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +++ b/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi @@ -27,6 +27,12 @@ module WorkOS sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def return_to=(value); end + sig { returns(T.nilable(T::Hash[String, String])) } + def config; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def config=(value); end + sig { returns(T::Hash[Symbol, T.untyped]) } def to_h; end diff --git a/rbi/workos/pipes.rbi b/rbi/workos/pipes.rbi index 35ca9d63..e6a0366c 100644 --- a/rbi/workos/pipes.rbi +++ b/rbi/workos/pipes.rbi @@ -27,13 +27,14 @@ module WorkOS enabled: T.nilable(T::Boolean), scopes: T.nilable(T::Array[String]), auth_methods: T.nilable(T::Array[String]), + config: T.nilable(T::Hash[String, String]), credentials: T.nilable(WorkOS::DataIntegrationCredentialsInput), api_key: T.nilable(WorkOS::ApiKeyInstallation), custom_provider: T.nilable(WorkOS::CustomProviderDefinition), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegration) end - def create_data_integration(provider:, description:, enabled:, scopes:, auth_methods:, credentials:, api_key:, custom_provider:, request_options:); end + def create_data_integration(provider:, description:, enabled:, scopes:, auth_methods:, config:, credentials:, api_key:, custom_provider:, request_options:); end sig do params( @@ -82,10 +83,11 @@ module WorkOS user_id: String, organization_id: T.nilable(String), return_to: T.nilable(String), + config: T.nilable(T::Hash[String, String]), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegrationAuthorizeUrlResponse) end - def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, request_options:); end + def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, config:, request_options:); end sig do params( diff --git a/rbi/workos/pipes_provider.rbi b/rbi/workos/pipes_provider.rbi index a6dd69d8..e7873666 100644 --- a/rbi/workos/pipes_provider.rbi +++ b/rbi/workos/pipes_provider.rbi @@ -25,10 +25,11 @@ module WorkOS scopes: T.nilable(T::Array[String]), client_id: T.nilable(String), client_secret: T.nilable(String), + config: T.nilable(T::Hash[String, String]), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegrationConfigurationResponse) end - def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, request_options:); end + def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, config:, request_options:); end end end diff --git a/test/workos/test_pipes_model_round_trip.rb b/test/workos/test_pipes_model_round_trip.rb index 02fc5524..958380bf 100644 --- a/test/workos/test_pipes_model_round_trip.rb +++ b/test/workos/test_pipes_model_round_trip.rb @@ -61,6 +61,7 @@ def test_create_data_integration_round_trip "enabled" => true, "scopes" => nil, "auth_methods" => [], + "config" => {}, "credentials" => {}, "api_key" => {}, "custom_provider" => {} @@ -135,6 +136,7 @@ def test_data_integration_round_trip "auth_methods" => [], "credentials" => {}, "installation" => nil, + "config" => {}, "custom_provider" => nil, "created_at" => "stub", "updated_at" => "stub" @@ -364,7 +366,8 @@ def test_data_integrations_get_data_integration_authorize_url_request_round_trip fixture = { "user_id" => "stub", "organization_id" => "stub", - "return_to" => "stub" + "return_to" => "stub", + "config" => {} } model = WorkOS::DataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json) json = model.to_h diff --git a/test/workos/test_pipes_provider_model_round_trip.rb b/test/workos/test_pipes_provider_model_round_trip.rb index fb725719..7b98fb77 100644 --- a/test/workos/test_pipes_provider_model_round_trip.rb +++ b/test/workos/test_pipes_provider_model_round_trip.rb @@ -32,6 +32,7 @@ def test_data_integration_configuration_response_round_trip "name" => "stub", "enabled" => true, "scopes" => nil, + "config" => {}, "created_at" => "stub", "updated_at" => "stub", "credentials" => {} @@ -65,7 +66,8 @@ def test_configure_data_integration_body_round_trip "enabled" => true, "scopes" => nil, "client_id" => "stub", - "client_secret" => "stub" + "client_secret" => "stub", + "config" => {} } model = WorkOS::ConfigureDataIntegrationBody.new(fixture.to_json) json = model.to_h diff --git a/test/workos/test_shared_model_round_trip.rb b/test/workos/test_shared_model_round_trip.rb index 4587e613..131f85b9 100644 --- a/test/workos/test_shared_model_round_trip.rb +++ b/test/workos/test_shared_model_round_trip.rb @@ -16,39 +16,6 @@ def test_error_response_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_object_summary_round_trip - fixture = { - "id" => "stub", - "name" => "stub", - "updated_at" => nil - } - model = WorkOS::ObjectSummary.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["name"], json[:name] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - - def test_object_version_round_trip - fixture = { - "created_at" => "stub", - "current_version" => true, - "etag" => "stub", - "id" => "stub", - "size" => 1 - } - model = WorkOS::ObjectVersion.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["created_at"], json[:created_at] - assert_equal fixture["current_version"], json[:current_version] - assert_equal fixture["etag"], json[:etag] - assert_equal fixture["id"], json[:id] - assert_equal fixture["size"], json[:size] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_connect_application_oauth_round_trip fixture = { "object" => "connect_application", @@ -195,24 +162,6 @@ def test_waitlist_user_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_schema_round_trip - fixture = { - "object" => "event", - "id" => "stub", - "event" => "stub", - "data" => {}, - "created_at" => "stub", - "context" => {} - } - model = WorkOS::EventSchema.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["id"], json[:id] - assert_equal fixture["event"], json[:event] - assert_equal fixture["created_at"], json[:created_at] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_agent_registration_claim_attempt_created_round_trip fixture = { "object" => "event", @@ -838,17 +787,6 @@ def test_auth_method_mismatch_error_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_event_list_list_metadata_round_trip - fixture = { - "after" => nil - } - model = WorkOS::EventListListMetadata.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_nil json[:after] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_event_context_google_analytics_session_round_trip fixture = { "containerId" => "stub",