workos 9.3.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.last-synced-sha +1 -1
  3. data/.oagen-manifest.json +117 -1
  4. data/.release-please-manifest.json +1 -1
  5. data/CHANGELOG.md +139 -0
  6. data/Gemfile.lock +2 -2
  7. data/lib/workos/admin_portal/generate_link.rb +0 -3
  8. data/lib/workos/admin_portal.rb +0 -3
  9. data/lib/workos/authorization/user_role_assignment.rb +3 -0
  10. data/lib/workos/authorization/user_role_assignment_source.rb +22 -0
  11. data/lib/workos/pipes/connected_account_dto.rb +31 -0
  12. data/lib/workos/pipes/create_data_integration.rb +34 -0
  13. data/lib/workos/pipes/custom_provider_definition.rb +49 -0
  14. data/lib/workos/pipes/data_integration.rb +55 -0
  15. data/lib/workos/pipes/data_integration_credential.rb +25 -0
  16. data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
  17. data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
  18. data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
  19. data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
  20. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
  21. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
  22. data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
  23. data/lib/workos/pipes/update_data_integration.rb +31 -0
  24. data/lib/workos/pipes.rb +304 -0
  25. data/lib/workos/radar/radar_standalone_assess_request.rb +5 -2
  26. data/lib/workos/radar.rb +5 -2
  27. data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
  28. data/lib/workos/types/audit_log_export_state.rb +2 -1
  29. data/lib/workos/types/connected_account_state.rb +1 -2
  30. data/lib/workos/types/create_webhook_endpoint_events.rb +8 -1
  31. data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
  32. data/lib/workos/types/data_integration_credential_type.rb +13 -0
  33. data/lib/workos/types/data_integration_credentials_response_error.rb +9 -0
  34. data/lib/workos/types/data_integration_credentials_type.rb +9 -0
  35. data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
  36. data/lib/workos/types/data_integration_state.rb +14 -0
  37. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
  38. data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
  39. data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
  40. data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
  41. data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
  42. data/lib/workos/user_management/create_user.rb +9 -0
  43. data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
  44. data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +43 -0
  45. data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
  46. data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
  47. data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
  48. data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
  49. data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
  50. data/lib/workos/user_management/user_create_response.rb +61 -0
  51. data/lib/workos/user_management.rb +261 -9
  52. data/lib/workos/version.rb +1 -1
  53. data/rbi/workos/admin_portal.rbi +1 -2
  54. data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
  55. data/rbi/workos/authorization_code_session_authenticate_request.rbi +6 -0
  56. data/rbi/workos/connected_account_dto.rbi +48 -0
  57. data/rbi/workos/create_data_integration.rbi +54 -0
  58. data/rbi/workos/create_magic_code_and_return.rbi +24 -0
  59. data/rbi/workos/create_user.rbi +18 -0
  60. data/rbi/workos/custom_provider_definition.rbi +84 -0
  61. data/rbi/workos/data_integration.rbi +96 -0
  62. data/rbi/workos/data_integration_credential.rbi +36 -0
  63. data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
  64. data/rbi/workos/data_integration_credentials_response.rbi +36 -0
  65. data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
  66. data/rbi/workos/data_integration_custom_provider.rbi +84 -0
  67. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
  68. data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
  69. data/rbi/workos/generate_link.rbi +0 -6
  70. data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
  71. data/rbi/workos/magic_auth_send_magic_auth_code_and_return_response.rbi +72 -0
  72. data/rbi/workos/password_session_authenticate_request.rbi +12 -0
  73. data/rbi/workos/pipes.rbi +104 -0
  74. data/rbi/workos/radar.rbi +2 -1
  75. data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
  76. data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
  77. data/rbi/workos/radar_standalone_assess_request.rbi +6 -0
  78. data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
  79. data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
  80. data/rbi/workos/update_custom_provider_definition.rbi +84 -0
  81. data/rbi/workos/update_data_integration.rbi +48 -0
  82. data/rbi/workos/user_create_response.rbi +108 -0
  83. data/rbi/workos/user_management.rbi +47 -5
  84. data/rbi/workos/user_role_assignment.rbi +6 -0
  85. data/rbi/workos/user_role_assignment_source.rbi +30 -0
  86. data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
  87. data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
  88. data/test/workos/test_authorization_model_round_trip.rb +456 -0
  89. data/test/workos/test_connect_model_round_trip.rb +30 -0
  90. data/test/workos/test_groups_model_round_trip.rb +33 -0
  91. data/test/workos/test_model_round_trip.rb +2 -7857
  92. data/test/workos/test_organizations_model_round_trip.rb +29 -0
  93. data/test/workos/test_pipes.rb +72 -0
  94. data/test/workos/test_pipes_model_round_trip.rb +389 -0
  95. data/test/workos/test_radar_model_round_trip.rb +85 -0
  96. data/test/workos/test_shared_model_round_trip.rb +92 -0
  97. data/test/workos/test_user_management.rb +54 -0
  98. data/test/workos/test_user_management_model_round_trip.rb +1087 -0
  99. data/test/workos/test_webhooks_model_round_trip.rb +53 -0
  100. metadata +62 -1
@@ -56,10 +56,11 @@ module WorkOS
56
56
  ip_address: T.nilable(String),
57
57
  device_id: T.nilable(String),
58
58
  user_agent: T.nilable(String),
59
+ signals_id: T.nilable(String),
59
60
  request_options: T::Hash[Symbol, T.untyped]
60
61
  ).returns(WorkOS::AuthenticateResponse)
61
62
  end
62
- def create_authenticate(client_id:, grant_type:, code:, client_secret:, code_verifier:, invitation_token:, ip_address:, device_id:, user_agent:, request_options:); end
63
+ def create_authenticate(client_id:, grant_type:, code:, client_secret:, code_verifier:, invitation_token:, ip_address:, device_id:, user_agent:, signals_id:, request_options:); end
63
64
 
64
65
  sig do
65
66
  params(
@@ -69,6 +70,18 @@ module WorkOS
69
70
  end
70
71
  def create_device(client_id:, request_options:); end
71
72
 
73
+ sig do
74
+ params(
75
+ user_id: String,
76
+ pending_authentication_token: String,
77
+ phone_number: String,
78
+ ip_address: T.nilable(String),
79
+ user_agent: T.nilable(String),
80
+ request_options: T::Hash[Symbol, T.untyped]
81
+ ).returns(WorkOS::SendRadarSmsChallengeResponse)
82
+ end
83
+ def create_radar_challenge(user_id:, pending_authentication_token:, phone_number:, ip_address:, user_agent:, request_options:); end
84
+
72
85
  sig do
73
86
  params(
74
87
  session_id: String,
@@ -77,6 +90,17 @@ module WorkOS
77
90
  end
78
91
  def revoke_session(session_id:, request_options:); end
79
92
 
93
+ sig do
94
+ params(
95
+ before: T.nilable(String),
96
+ after: T.nilable(String),
97
+ limit: T.nilable(Integer),
98
+ order: T.nilable(String),
99
+ request_options: T::Hash[Symbol, T.untyped]
100
+ ).returns(T::Array[WorkOS::CORSOriginResponse])
101
+ end
102
+ def list_cors_origins(before:, after:, limit:, order:, request_options:); end
103
+
80
104
  sig do
81
105
  params(
82
106
  origin: String,
@@ -141,11 +165,14 @@ module WorkOS
141
165
  email_verified: T.nilable(T::Boolean),
142
166
  metadata: T.nilable(T::Hash[String, String]),
143
167
  external_id: T.nilable(String),
168
+ ip_address: T.nilable(String),
169
+ user_agent: T.nilable(String),
170
+ signals_id: T.nilable(String),
144
171
  password: T.nilable(T.any(WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed)),
145
172
  request_options: T::Hash[Symbol, T.untyped]
146
- ).returns(WorkOS::User)
173
+ ).returns(WorkOS::UserCreateResponse)
147
174
  end
148
- def create_user(email:, first_name:, last_name:, name:, email_verified:, metadata:, external_id:, password:, request_options:); end
175
+ def create_user(email:, first_name:, last_name:, name:, email_verified:, metadata:, external_id:, ip_address:, user_agent:, signals_id:, password:, request_options:); end
149
176
 
150
177
  sig do
151
178
  params(
@@ -329,10 +356,14 @@ module WorkOS
329
356
  params(
330
357
  email: String,
331
358
  invitation_token: T.nilable(String),
359
+ ip_address: T.nilable(String),
360
+ user_agent: T.nilable(String),
361
+ radar_auth_attempt_id: T.nilable(String),
362
+ signals_id: T.nilable(String),
332
363
  request_options: T::Hash[Symbol, T.untyped]
333
- ).returns(WorkOS::MagicAuth)
364
+ ).returns(WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse)
334
365
  end
335
- def create_magic_auth(email:, invitation_token:, request_options:); end
366
+ def create_magic_auth(email:, invitation_token:, ip_address:, user_agent:, radar_auth_attempt_id:, signals_id:, request_options:); end
336
367
 
337
368
  sig do
338
369
  params(
@@ -342,6 +373,17 @@ module WorkOS
342
373
  end
343
374
  def get_magic_auth(id:, request_options:); end
344
375
 
376
+ sig do
377
+ params(
378
+ before: T.nilable(String),
379
+ after: T.nilable(String),
380
+ limit: T.nilable(Integer),
381
+ order: T.nilable(String),
382
+ request_options: T::Hash[Symbol, T.untyped]
383
+ ).returns(T::Array[WorkOS::RedirectUri])
384
+ end
385
+ def list_redirect_uris(before:, after:, limit:, order:, request_options:); end
386
+
345
387
  sig do
346
388
  params(
347
389
  uri: String,
@@ -39,6 +39,12 @@ module WorkOS
39
39
  sig { params(value: WorkOS::UserRoleAssignmentResource).returns(WorkOS::UserRoleAssignmentResource) }
40
40
  def resource=(value); end
41
41
 
42
+ sig { returns(WorkOS::UserRoleAssignmentSource) }
43
+ def source; end
44
+
45
+ sig { params(value: WorkOS::UserRoleAssignmentSource).returns(WorkOS::UserRoleAssignmentSource) }
46
+ def source=(value); end
47
+
42
48
  sig { returns(String) }
43
49
  def created_at; end
44
50
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ # typed: strong
6
+
7
+ module WorkOS
8
+ class UserRoleAssignmentSource
9
+ sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
10
+ def initialize(json); end
11
+
12
+ sig { returns(String) }
13
+ def type; end
14
+
15
+ sig { params(value: String).returns(String) }
16
+ def type=(value); end
17
+
18
+ sig { returns(T.nilable(String)) }
19
+ def group_role_assignment_id; end
20
+
21
+ sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
22
+ def group_role_assignment_id=(value); end
23
+
24
+ sig { returns(T::Hash[Symbol, T.untyped]) }
25
+ def to_h; end
26
+
27
+ sig { params(args: T.untyped).returns(String) }
28
+ def to_json(*args); end
29
+ end
30
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "test_helper"
6
+
7
+ class AdminPortalModelRoundTripTest < Minitest::Test
8
+ def test_generate_link_round_trip
9
+ fixture = {
10
+ "return_url" => "stub",
11
+ "success_url" => "stub",
12
+ "organization" => "stub",
13
+ "intent" => "stub",
14
+ "it_contact_emails" => []
15
+ }
16
+ model = WorkOS::GenerateLink.new(fixture.to_json)
17
+ json = model.to_h
18
+ assert_kind_of Hash, json
19
+ assert_equal fixture["organization"], json[:organization]
20
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
21
+ end
22
+
23
+ def test_portal_link_response_round_trip
24
+ fixture = {
25
+ "link" => "stub"
26
+ }
27
+ model = WorkOS::PortalLinkResponse.new(fixture.to_json)
28
+ json = model.to_h
29
+ assert_kind_of Hash, json
30
+ assert_equal fixture["link"], json[:link]
31
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
32
+ end
33
+ end
@@ -0,0 +1,218 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "test_helper"
6
+
7
+ class AuditLogsModelRoundTripTest < Minitest::Test
8
+ def test_audit_log_event_actor_round_trip
9
+ fixture = {
10
+ "id" => "stub",
11
+ "type" => "stub",
12
+ "name" => "stub",
13
+ "metadata" => {}
14
+ }
15
+ model = WorkOS::AuditLogEventActor.new(fixture.to_json)
16
+ json = model.to_h
17
+ assert_kind_of Hash, json
18
+ assert_equal fixture["id"], json[:id]
19
+ assert_equal fixture["type"], json[:type]
20
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
21
+ end
22
+
23
+ def test_audit_log_event_target_round_trip
24
+ fixture = {
25
+ "id" => "stub",
26
+ "type" => "stub",
27
+ "name" => "stub",
28
+ "metadata" => {}
29
+ }
30
+ model = WorkOS::AuditLogEventTarget.new(fixture.to_json)
31
+ json = model.to_h
32
+ assert_kind_of Hash, json
33
+ assert_equal fixture["id"], json[:id]
34
+ assert_equal fixture["type"], json[:type]
35
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
36
+ end
37
+
38
+ def test_audit_log_event_context_round_trip
39
+ fixture = {
40
+ "location" => "stub",
41
+ "user_agent" => "stub"
42
+ }
43
+ model = WorkOS::AuditLogEventContext.new(fixture.to_json)
44
+ json = model.to_h
45
+ assert_kind_of Hash, json
46
+ assert_equal fixture["location"], json[:location]
47
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
48
+ end
49
+
50
+ def test_audit_log_event_round_trip
51
+ fixture = {
52
+ "action" => "stub",
53
+ "occurred_at" => "stub",
54
+ "actor" => {},
55
+ "targets" => [],
56
+ "context" => {},
57
+ "metadata" => {},
58
+ "version" => 1
59
+ }
60
+ model = WorkOS::AuditLogEvent.new(fixture.to_json)
61
+ json = model.to_h
62
+ assert_kind_of Hash, json
63
+ assert_equal fixture["action"], json[:action]
64
+ assert_equal fixture["occurred_at"], json[:occurred_at]
65
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
66
+ end
67
+
68
+ def test_audit_log_event_ingestion_round_trip
69
+ fixture = {
70
+ "organization_id" => "stub",
71
+ "event" => {}
72
+ }
73
+ model = WorkOS::AuditLogEventIngestion.new(fixture.to_json)
74
+ json = model.to_h
75
+ assert_kind_of Hash, json
76
+ assert_equal fixture["organization_id"], json[:organization_id]
77
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
78
+ end
79
+
80
+ def test_audit_log_export_creation_round_trip
81
+ fixture = {
82
+ "organization_id" => "stub",
83
+ "range_start" => "stub",
84
+ "range_end" => "stub",
85
+ "actions" => [],
86
+ "actors" => [],
87
+ "actor_names" => [],
88
+ "actor_ids" => [],
89
+ "targets" => []
90
+ }
91
+ model = WorkOS::AuditLogExportCreation.new(fixture.to_json)
92
+ json = model.to_h
93
+ assert_kind_of Hash, json
94
+ assert_equal fixture["organization_id"], json[:organization_id]
95
+ assert_equal fixture["range_start"], json[:range_start]
96
+ assert_equal fixture["range_end"], json[:range_end]
97
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
98
+ end
99
+
100
+ def test_audit_log_schema_actor_input_round_trip
101
+ fixture = {
102
+ "metadata" => {}
103
+ }
104
+ model = WorkOS::AuditLogSchemaActorInput.new(fixture.to_json)
105
+ json = model.to_h
106
+ assert_kind_of Hash, json
107
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
108
+ end
109
+
110
+ def test_audit_log_schema_target_input_round_trip
111
+ fixture = {
112
+ "type" => "stub",
113
+ "metadata" => {}
114
+ }
115
+ model = WorkOS::AuditLogSchemaTargetInput.new(fixture.to_json)
116
+ json = model.to_h
117
+ assert_kind_of Hash, json
118
+ assert_equal fixture["type"], json[:type]
119
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
120
+ end
121
+
122
+ def test_audit_log_schema_input_round_trip
123
+ fixture = {
124
+ "actor" => {},
125
+ "targets" => [],
126
+ "metadata" => {}
127
+ }
128
+ model = WorkOS::AuditLogSchemaInput.new(fixture.to_json)
129
+ json = model.to_h
130
+ assert_kind_of Hash, json
131
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
132
+ end
133
+
134
+ def test_audit_log_event_create_response_round_trip
135
+ fixture = {
136
+ "success" => true
137
+ }
138
+ model = WorkOS::AuditLogEventCreateResponse.new(fixture.to_json)
139
+ json = model.to_h
140
+ assert_kind_of Hash, json
141
+ assert_equal fixture["success"], json[:success]
142
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
143
+ end
144
+
145
+ def test_audit_log_export_round_trip
146
+ fixture = {
147
+ "object" => "audit_log_export",
148
+ "id" => "stub",
149
+ "state" => "stub",
150
+ "url" => nil,
151
+ "created_at" => "stub",
152
+ "updated_at" => "stub"
153
+ }
154
+ model = WorkOS::AuditLogExport.new(fixture.to_json)
155
+ json = model.to_h
156
+ assert_kind_of Hash, json
157
+ assert_equal fixture["id"], json[:id]
158
+ assert_equal fixture["created_at"], json[:created_at]
159
+ assert_equal fixture["updated_at"], json[:updated_at]
160
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
161
+ end
162
+
163
+ def test_audit_log_schema_round_trip
164
+ fixture = {
165
+ "object" => "audit_log_schema",
166
+ "version" => 1,
167
+ "actor" => {},
168
+ "targets" => [],
169
+ "metadata" => {},
170
+ "created_at" => "stub"
171
+ }
172
+ model = WorkOS::AuditLogSchema.new(fixture.to_json)
173
+ json = model.to_h
174
+ assert_kind_of Hash, json
175
+ assert_equal fixture["version"], json[:version]
176
+ assert_equal fixture["created_at"], json[:created_at]
177
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
178
+ end
179
+
180
+ def test_audit_log_action_round_trip
181
+ fixture = {
182
+ "object" => "audit_log_action",
183
+ "name" => "stub",
184
+ "schema" => {},
185
+ "created_at" => "stub",
186
+ "updated_at" => "stub"
187
+ }
188
+ model = WorkOS::AuditLogAction.new(fixture.to_json)
189
+ json = model.to_h
190
+ assert_kind_of Hash, json
191
+ assert_equal fixture["name"], json[:name]
192
+ assert_equal fixture["created_at"], json[:created_at]
193
+ assert_equal fixture["updated_at"], json[:updated_at]
194
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
195
+ end
196
+
197
+ def test_audit_log_schema_actor_round_trip
198
+ fixture = {
199
+ "metadata" => {}
200
+ }
201
+ model = WorkOS::AuditLogSchemaActor.new(fixture.to_json)
202
+ json = model.to_h
203
+ assert_kind_of Hash, json
204
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
205
+ end
206
+
207
+ def test_audit_log_schema_target_round_trip
208
+ fixture = {
209
+ "type" => "stub",
210
+ "metadata" => {}
211
+ }
212
+ model = WorkOS::AuditLogSchemaTarget.new(fixture.to_json)
213
+ json = model.to_h
214
+ assert_kind_of Hash, json
215
+ assert_equal fixture["type"], json[:type]
216
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
217
+ end
218
+ end