workos 9.3.0 → 9.4.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.
- checksums.yaml +4 -4
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +110 -1
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +123 -0
- data/Gemfile.lock +2 -2
- data/lib/workos/admin_portal/generate_link.rb +0 -3
- data/lib/workos/admin_portal.rb +0 -3
- data/lib/workos/authorization/user_role_assignment.rb +3 -0
- data/lib/workos/authorization/user_role_assignment_source.rb +22 -0
- data/lib/workos/pipes/connected_account_dto.rb +31 -0
- data/lib/workos/pipes/create_data_integration.rb +34 -0
- data/lib/workos/pipes/custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/data_integration.rb +55 -0
- data/lib/workos/pipes/data_integration_credential.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_dto.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response.rb +25 -0
- data/lib/workos/pipes/data_integration_credentials_response_credential.rb +34 -0
- data/lib/workos/pipes/data_integration_custom_provider.rb +49 -0
- data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -0
- data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +22 -0
- data/lib/workos/pipes/update_custom_provider_definition.rb +49 -0
- data/lib/workos/pipes/update_data_integration.rb +31 -0
- data/lib/workos/pipes.rb +304 -0
- data/lib/workos/radar/radar_standalone_assess_request.rb +5 -2
- data/lib/workos/radar.rb +5 -2
- data/lib/workos/shared/auth_method_mismatch_error.rb +22 -0
- data/lib/workos/types/audit_log_export_state.rb +2 -1
- data/lib/workos/types/connected_account_state.rb +1 -2
- data/lib/workos/types/create_webhook_endpoint_events.rb +8 -1
- data/lib/workos/types/custom_provider_definition_authenticate_via.rb +13 -0
- data/lib/workos/types/data_integration_credential_type.rb +13 -0
- data/lib/workos/types/data_integration_credentials_response_error.rb +9 -0
- data/lib/workos/types/data_integration_credentials_type.rb +9 -0
- data/lib/workos/types/data_integration_custom_provider_authenticate_via.rb +9 -0
- data/lib/workos/types/data_integration_state.rb +14 -0
- data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +6 -1
- data/lib/workos/types/update_custom_provider_definition_authenticate_via.rb +9 -0
- data/lib/workos/types/user_role_assignment_source_type.rb +13 -0
- data/lib/workos/user_management/authorization_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/create_magic_code_and_return.rb +14 -2
- data/lib/workos/user_management/create_user.rb +9 -0
- data/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb +5 -2
- data/lib/workos/user_management/magic_auth_send_magic_auth_code_and_return_response.rb +18 -0
- data/lib/workos/user_management/password_session_authenticate_request.rb +8 -2
- data/lib/workos/user_management/radar_email_challenge_code_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/radar_sms_challenge_code_session_authenticate_request.rb +46 -0
- data/lib/workos/user_management/send_radar_sms_challenge.rb +31 -0
- data/lib/workos/user_management/send_radar_sms_challenge_response.rb +22 -0
- data/lib/workos/user_management/user_create_response.rb +7 -0
- data/lib/workos/user_management.rb +165 -6
- data/lib/workos/version.rb +1 -1
- data/rbi/workos/admin_portal.rbi +1 -2
- data/rbi/workos/auth_method_mismatch_error.rbi +30 -0
- data/rbi/workos/authorization_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/connected_account_dto.rbi +48 -0
- data/rbi/workos/create_data_integration.rbi +54 -0
- data/rbi/workos/create_magic_code_and_return.rbi +24 -0
- data/rbi/workos/create_user.rbi +18 -0
- data/rbi/workos/custom_provider_definition.rbi +84 -0
- data/rbi/workos/data_integration.rbi +96 -0
- data/rbi/workos/data_integration_credential.rbi +36 -0
- data/rbi/workos/data_integration_credentials_dto.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response.rbi +36 -0
- data/rbi/workos/data_integration_credentials_response_credential.rbi +54 -0
- data/rbi/workos/data_integration_custom_provider.rbi +84 -0
- data/rbi/workos/data_integrations_upsert_api_key_request.rbi +36 -0
- data/rbi/workos/data_integrations_vend_credentials_request.rbi +30 -0
- data/rbi/workos/generate_link.rbi +0 -6
- data/rbi/workos/magic_auth_code_session_authenticate_request.rbi +6 -0
- data/rbi/workos/magic_auth_send_magic_auth_code_and_return_response.rbi +24 -0
- data/rbi/workos/password_session_authenticate_request.rbi +12 -0
- data/rbi/workos/pipes.rbi +104 -0
- data/rbi/workos/radar.rbi +2 -1
- data/rbi/workos/radar_email_challenge_code_session_authenticate_request.rbi +72 -0
- data/rbi/workos/radar_sms_challenge_code_session_authenticate_request.rbi +78 -0
- data/rbi/workos/radar_standalone_assess_request.rbi +6 -0
- data/rbi/workos/send_radar_sms_challenge.rbi +48 -0
- data/rbi/workos/send_radar_sms_challenge_response.rbi +30 -0
- data/rbi/workos/update_custom_provider_definition.rbi +84 -0
- data/rbi/workos/update_data_integration.rbi +48 -0
- data/rbi/workos/user_create_response.rbi +24 -0
- data/rbi/workos/user_management.rbi +47 -5
- data/rbi/workos/user_role_assignment.rbi +6 -0
- data/rbi/workos/user_role_assignment_source.rbi +30 -0
- data/test/workos/test_admin_portal_model_round_trip.rb +33 -0
- data/test/workos/test_audit_logs_model_round_trip.rb +218 -0
- data/test/workos/test_authorization_model_round_trip.rb +456 -0
- data/test/workos/test_connect_model_round_trip.rb +30 -0
- data/test/workos/test_groups_model_round_trip.rb +33 -0
- data/test/workos/test_model_round_trip.rb +2 -7857
- data/test/workos/test_organizations_model_round_trip.rb +29 -0
- data/test/workos/test_pipes.rb +72 -0
- data/test/workos/test_pipes_model_round_trip.rb +389 -0
- data/test/workos/test_radar_model_round_trip.rb +85 -0
- data/test/workos/test_shared_model_round_trip.rb +92 -0
- data/test/workos/test_user_management.rb +24 -0
- data/test/workos/test_user_management_model_round_trip.rb +1048 -0
- data/test/workos/test_webhooks_model_round_trip.rb +53 -0
- metadata +62 -1
|
@@ -13,7 +13,8 @@ module WorkOS
|
|
|
13
13
|
invitation_token: :invitation_token,
|
|
14
14
|
ip_address: :ip_address,
|
|
15
15
|
device_id: :device_id,
|
|
16
|
-
user_agent: :user_agent
|
|
16
|
+
user_agent: :user_agent,
|
|
17
|
+
radar_auth_attempt_id: :radar_auth_attempt_id
|
|
17
18
|
}.freeze
|
|
18
19
|
|
|
19
20
|
attr_accessor \
|
|
@@ -25,7 +26,8 @@ module WorkOS
|
|
|
25
26
|
:invitation_token,
|
|
26
27
|
:ip_address,
|
|
27
28
|
:device_id,
|
|
28
|
-
:user_agent
|
|
29
|
+
:user_agent,
|
|
30
|
+
:radar_auth_attempt_id
|
|
29
31
|
|
|
30
32
|
def initialize(json)
|
|
31
33
|
hash = self.class.normalize(json)
|
|
@@ -38,6 +40,7 @@ module WorkOS
|
|
|
38
40
|
@ip_address = hash[:ip_address]
|
|
39
41
|
@device_id = hash[:device_id]
|
|
40
42
|
@user_agent = hash[:user_agent]
|
|
43
|
+
@radar_auth_attempt_id = hash[:radar_auth_attempt_id]
|
|
41
44
|
end
|
|
42
45
|
end
|
|
43
46
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class MagicAuthSendMagicAuthCodeAndReturnResponse < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
radar_auth_attempt_id: :radar_auth_attempt_id
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
attr_accessor :radar_auth_attempt_id
|
|
12
|
+
|
|
13
|
+
def initialize(json)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
15
|
+
@radar_auth_attempt_id = hash[:radar_auth_attempt_id]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -13,7 +13,9 @@ module WorkOS
|
|
|
13
13
|
invitation_token: :invitation_token,
|
|
14
14
|
ip_address: :ip_address,
|
|
15
15
|
device_id: :device_id,
|
|
16
|
-
user_agent: :user_agent
|
|
16
|
+
user_agent: :user_agent,
|
|
17
|
+
signals_id: :signals_id,
|
|
18
|
+
radar_auth_attempt_id: :radar_auth_attempt_id
|
|
17
19
|
}.freeze
|
|
18
20
|
|
|
19
21
|
attr_accessor \
|
|
@@ -25,7 +27,9 @@ module WorkOS
|
|
|
25
27
|
:invitation_token,
|
|
26
28
|
:ip_address,
|
|
27
29
|
:device_id,
|
|
28
|
-
:user_agent
|
|
30
|
+
:user_agent,
|
|
31
|
+
:signals_id,
|
|
32
|
+
:radar_auth_attempt_id
|
|
29
33
|
|
|
30
34
|
def initialize(json)
|
|
31
35
|
hash = self.class.normalize(json)
|
|
@@ -38,6 +42,8 @@ module WorkOS
|
|
|
38
42
|
@ip_address = hash[:ip_address]
|
|
39
43
|
@device_id = hash[:device_id]
|
|
40
44
|
@user_agent = hash[:user_agent]
|
|
45
|
+
@signals_id = hash[:signals_id]
|
|
46
|
+
@radar_auth_attempt_id = hash[:radar_auth_attempt_id]
|
|
41
47
|
end
|
|
42
48
|
end
|
|
43
49
|
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class RadarEmailChallengeCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
client_id: :client_id,
|
|
9
|
+
client_secret: :client_secret,
|
|
10
|
+
grant_type: :grant_type,
|
|
11
|
+
code: :code,
|
|
12
|
+
radar_challenge_id: :radar_challenge_id,
|
|
13
|
+
pending_authentication_token: :pending_authentication_token,
|
|
14
|
+
ip_address: :ip_address,
|
|
15
|
+
device_id: :device_id,
|
|
16
|
+
user_agent: :user_agent
|
|
17
|
+
}.freeze
|
|
18
|
+
|
|
19
|
+
attr_accessor \
|
|
20
|
+
:client_id,
|
|
21
|
+
:client_secret,
|
|
22
|
+
:grant_type,
|
|
23
|
+
:code,
|
|
24
|
+
:radar_challenge_id,
|
|
25
|
+
:pending_authentication_token,
|
|
26
|
+
:ip_address,
|
|
27
|
+
:device_id,
|
|
28
|
+
:user_agent
|
|
29
|
+
|
|
30
|
+
def initialize(json)
|
|
31
|
+
hash = self.class.normalize(json)
|
|
32
|
+
@client_id = hash[:client_id]
|
|
33
|
+
@client_secret = hash[:client_secret]
|
|
34
|
+
@grant_type = hash[:grant_type]
|
|
35
|
+
@code = hash[:code]
|
|
36
|
+
@radar_challenge_id = hash[:radar_challenge_id]
|
|
37
|
+
@pending_authentication_token = hash[:pending_authentication_token]
|
|
38
|
+
@ip_address = hash[:ip_address]
|
|
39
|
+
@device_id = hash[:device_id]
|
|
40
|
+
@user_agent = hash[:user_agent]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class RadarSmsChallengeCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
client_id: :client_id,
|
|
9
|
+
client_secret: :client_secret,
|
|
10
|
+
grant_type: :grant_type,
|
|
11
|
+
code: :code,
|
|
12
|
+
verification_id: :verification_id,
|
|
13
|
+
phone_number: :phone_number,
|
|
14
|
+
pending_authentication_token: :pending_authentication_token,
|
|
15
|
+
ip_address: :ip_address,
|
|
16
|
+
device_id: :device_id,
|
|
17
|
+
user_agent: :user_agent
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
attr_accessor \
|
|
21
|
+
:client_id,
|
|
22
|
+
:client_secret,
|
|
23
|
+
:grant_type,
|
|
24
|
+
:code,
|
|
25
|
+
:verification_id,
|
|
26
|
+
:phone_number,
|
|
27
|
+
:pending_authentication_token,
|
|
28
|
+
:ip_address,
|
|
29
|
+
:device_id,
|
|
30
|
+
:user_agent
|
|
31
|
+
|
|
32
|
+
def initialize(json)
|
|
33
|
+
hash = self.class.normalize(json)
|
|
34
|
+
@client_id = hash[:client_id]
|
|
35
|
+
@client_secret = hash[:client_secret]
|
|
36
|
+
@grant_type = hash[:grant_type]
|
|
37
|
+
@code = hash[:code]
|
|
38
|
+
@verification_id = hash[:verification_id]
|
|
39
|
+
@phone_number = hash[:phone_number]
|
|
40
|
+
@pending_authentication_token = hash[:pending_authentication_token]
|
|
41
|
+
@ip_address = hash[:ip_address]
|
|
42
|
+
@device_id = hash[:device_id]
|
|
43
|
+
@user_agent = hash[:user_agent]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class SendRadarSmsChallenge < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
user_id: :user_id,
|
|
9
|
+
pending_authentication_token: :pending_authentication_token,
|
|
10
|
+
phone_number: :phone_number,
|
|
11
|
+
ip_address: :ip_address,
|
|
12
|
+
user_agent: :user_agent
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
15
|
+
attr_accessor \
|
|
16
|
+
:user_id,
|
|
17
|
+
:pending_authentication_token,
|
|
18
|
+
:phone_number,
|
|
19
|
+
:ip_address,
|
|
20
|
+
:user_agent
|
|
21
|
+
|
|
22
|
+
def initialize(json)
|
|
23
|
+
hash = self.class.normalize(json)
|
|
24
|
+
@user_id = hash[:user_id]
|
|
25
|
+
@pending_authentication_token = hash[:pending_authentication_token]
|
|
26
|
+
@phone_number = hash[:phone_number]
|
|
27
|
+
@ip_address = hash[:ip_address]
|
|
28
|
+
@user_agent = hash[:user_agent]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class SendRadarSmsChallengeResponse < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
verification_id: :verification_id,
|
|
9
|
+
phone_number: :phone_number
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor \
|
|
13
|
+
:verification_id,
|
|
14
|
+
:phone_number
|
|
15
|
+
|
|
16
|
+
def initialize(json)
|
|
17
|
+
hash = self.class.normalize(json)
|
|
18
|
+
@verification_id = hash[:verification_id]
|
|
19
|
+
@phone_number = hash[:phone_number]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -53,12 +53,17 @@ module WorkOS
|
|
|
53
53
|
# @param ip_address [String, nil] The IP address of the user's request.
|
|
54
54
|
# @param device_id [String, nil] A unique identifier for the device.
|
|
55
55
|
# @param user_agent [String, nil] The user agent string from the user's browser.
|
|
56
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this authentication attempt.
|
|
56
57
|
# @param email [String, nil] The user's email address.
|
|
57
58
|
# @param password [String, nil] The user's password.
|
|
59
|
+
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this authentication.
|
|
58
60
|
# @param refresh_token [String, nil] The refresh token to exchange for new tokens.
|
|
59
61
|
# @param organization_id [String, nil] The ID of the organization to scope the session to.
|
|
60
62
|
# @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt.
|
|
61
63
|
# @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge.
|
|
64
|
+
# @param radar_challenge_id [String, nil] The ID of the Radar email challenge being verified.
|
|
65
|
+
# @param verification_id [String, nil] The ID of the Radar SMS verification being confirmed.
|
|
66
|
+
# @param phone_number [String, nil] The phone number the Radar SMS challenge was sent to.
|
|
62
67
|
# @param device_code [String, nil] The device verification code.
|
|
63
68
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
64
69
|
# @return [WorkOS::AuthenticateResponse]
|
|
@@ -72,12 +77,17 @@ module WorkOS
|
|
|
72
77
|
ip_address: nil,
|
|
73
78
|
device_id: nil,
|
|
74
79
|
user_agent: nil,
|
|
80
|
+
signals_id: nil,
|
|
75
81
|
email: nil,
|
|
76
82
|
password: nil,
|
|
83
|
+
radar_auth_attempt_id: nil,
|
|
77
84
|
refresh_token: nil,
|
|
78
85
|
organization_id: nil,
|
|
79
86
|
pending_authentication_token: nil,
|
|
80
87
|
authentication_challenge_id: nil,
|
|
88
|
+
radar_challenge_id: nil,
|
|
89
|
+
verification_id: nil,
|
|
90
|
+
phone_number: nil,
|
|
81
91
|
device_code: nil,
|
|
82
92
|
request_options: {}
|
|
83
93
|
)
|
|
@@ -91,12 +101,17 @@ module WorkOS
|
|
|
91
101
|
"ip_address" => ip_address,
|
|
92
102
|
"device_id" => device_id,
|
|
93
103
|
"user_agent" => user_agent,
|
|
104
|
+
"signals_id" => signals_id,
|
|
94
105
|
"email" => email,
|
|
95
106
|
"password" => password,
|
|
107
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id,
|
|
96
108
|
"refresh_token" => refresh_token,
|
|
97
109
|
"organization_id" => organization_id,
|
|
98
110
|
"pending_authentication_token" => pending_authentication_token,
|
|
99
111
|
"authentication_challenge_id" => authentication_challenge_id,
|
|
112
|
+
"radar_challenge_id" => radar_challenge_id,
|
|
113
|
+
"verification_id" => verification_id,
|
|
114
|
+
"phone_number" => phone_number,
|
|
100
115
|
"device_code" => device_code
|
|
101
116
|
}.compact
|
|
102
117
|
response = @client.request(
|
|
@@ -430,6 +445,41 @@ module WorkOS
|
|
|
430
445
|
result
|
|
431
446
|
end
|
|
432
447
|
|
|
448
|
+
# Send a Radar SMS challenge
|
|
449
|
+
# @param user_id [String] The ID of the user to send the SMS challenge to.
|
|
450
|
+
# @param pending_authentication_token [String] The pending authentication token from a previous authentication attempt that triggered the Radar challenge.
|
|
451
|
+
# @param phone_number [String] The phone number to send the SMS verification code to.
|
|
452
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
453
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
454
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
455
|
+
# @return [WorkOS::SendRadarSmsChallengeResponse]
|
|
456
|
+
def create_radar_challenge(
|
|
457
|
+
user_id:,
|
|
458
|
+
pending_authentication_token:,
|
|
459
|
+
phone_number:,
|
|
460
|
+
ip_address: nil,
|
|
461
|
+
user_agent: nil,
|
|
462
|
+
request_options: {}
|
|
463
|
+
)
|
|
464
|
+
body = {
|
|
465
|
+
"user_id" => user_id,
|
|
466
|
+
"pending_authentication_token" => pending_authentication_token,
|
|
467
|
+
"phone_number" => phone_number,
|
|
468
|
+
"ip_address" => ip_address,
|
|
469
|
+
"user_agent" => user_agent
|
|
470
|
+
}.compact
|
|
471
|
+
response = @client.request(
|
|
472
|
+
method: :post,
|
|
473
|
+
path: "/user_management/radar_challenges",
|
|
474
|
+
auth: true,
|
|
475
|
+
body: body,
|
|
476
|
+
request_options: request_options
|
|
477
|
+
)
|
|
478
|
+
result = WorkOS::SendRadarSmsChallengeResponse.new(response.body)
|
|
479
|
+
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
480
|
+
result
|
|
481
|
+
end
|
|
482
|
+
|
|
433
483
|
# Revoke Session
|
|
434
484
|
# @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token.
|
|
435
485
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -451,6 +501,50 @@ module WorkOS
|
|
|
451
501
|
nil
|
|
452
502
|
end
|
|
453
503
|
|
|
504
|
+
# List CORS origins
|
|
505
|
+
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
506
|
+
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
507
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
508
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
509
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
510
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::CORSOriginResponse>]
|
|
511
|
+
def list_cors_origins(
|
|
512
|
+
before: nil,
|
|
513
|
+
after: nil,
|
|
514
|
+
limit: 10,
|
|
515
|
+
order: "desc",
|
|
516
|
+
request_options: {}
|
|
517
|
+
)
|
|
518
|
+
params = {
|
|
519
|
+
"before" => before,
|
|
520
|
+
"after" => after,
|
|
521
|
+
"limit" => limit,
|
|
522
|
+
"order" => order
|
|
523
|
+
}.compact
|
|
524
|
+
response = @client.request(
|
|
525
|
+
method: :get,
|
|
526
|
+
path: "/user_management/cors_origins",
|
|
527
|
+
auth: true,
|
|
528
|
+
params: params,
|
|
529
|
+
request_options: request_options
|
|
530
|
+
)
|
|
531
|
+
fetch_next = ->(cursor) {
|
|
532
|
+
list_cors_origins(
|
|
533
|
+
before: before,
|
|
534
|
+
after: cursor,
|
|
535
|
+
limit: limit,
|
|
536
|
+
order: order,
|
|
537
|
+
request_options: request_options
|
|
538
|
+
)
|
|
539
|
+
}
|
|
540
|
+
WorkOS::Types::ListStruct.from_response(
|
|
541
|
+
response,
|
|
542
|
+
model: WorkOS::CORSOriginResponse,
|
|
543
|
+
filters: {before: before, limit: limit, order: order},
|
|
544
|
+
fetch_next: fetch_next
|
|
545
|
+
)
|
|
546
|
+
end
|
|
547
|
+
|
|
454
548
|
# Create a CORS origin
|
|
455
549
|
# @param origin [String] The origin URL to allow for CORS requests.
|
|
456
550
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
@@ -625,9 +719,12 @@ module WorkOS
|
|
|
625
719
|
# @param email_verified [Boolean, nil] Whether the user's email has been verified.
|
|
626
720
|
# @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user.
|
|
627
721
|
# @param external_id [String, nil] The external ID of the user.
|
|
722
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
723
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
724
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
|
|
628
725
|
# @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password.
|
|
629
726
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
630
|
-
# @return [WorkOS::
|
|
727
|
+
# @return [WorkOS::UserCreateResponse]
|
|
631
728
|
def create_user(
|
|
632
729
|
email:,
|
|
633
730
|
first_name: nil,
|
|
@@ -636,6 +733,9 @@ module WorkOS
|
|
|
636
733
|
email_verified: nil,
|
|
637
734
|
metadata: nil,
|
|
638
735
|
external_id: nil,
|
|
736
|
+
ip_address: nil,
|
|
737
|
+
user_agent: nil,
|
|
738
|
+
signals_id: nil,
|
|
639
739
|
password: nil,
|
|
640
740
|
request_options: {}
|
|
641
741
|
)
|
|
@@ -646,7 +746,10 @@ module WorkOS
|
|
|
646
746
|
"name" => name,
|
|
647
747
|
"email_verified" => email_verified,
|
|
648
748
|
"metadata" => metadata,
|
|
649
|
-
"external_id" => external_id
|
|
749
|
+
"external_id" => external_id,
|
|
750
|
+
"ip_address" => ip_address,
|
|
751
|
+
"user_agent" => user_agent,
|
|
752
|
+
"signals_id" => signals_id
|
|
650
753
|
}.compact
|
|
651
754
|
if password
|
|
652
755
|
case password
|
|
@@ -666,7 +769,7 @@ module WorkOS
|
|
|
666
769
|
body: body,
|
|
667
770
|
request_options: request_options
|
|
668
771
|
)
|
|
669
|
-
result = WorkOS::
|
|
772
|
+
result = WorkOS::UserCreateResponse.new(response.body)
|
|
670
773
|
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
671
774
|
result
|
|
672
775
|
end
|
|
@@ -1176,16 +1279,28 @@ module WorkOS
|
|
|
1176
1279
|
# Create a Magic Auth code
|
|
1177
1280
|
# @param email [String] The email address to send the magic code to.
|
|
1178
1281
|
# @param invitation_token [String, nil] The invitation token to associate with this magic code.
|
|
1282
|
+
# @param ip_address [String, nil] The IP address of the user's request.
|
|
1283
|
+
# @param user_agent [String, nil] The user agent string from the user's request.
|
|
1284
|
+
# @param radar_auth_attempt_id [String, nil] The ID of an existing Radar authentication attempt to associate with this request.
|
|
1285
|
+
# @param signals_id [String, nil] An optional Radar signals ID to correlate client-side signals with this request.
|
|
1179
1286
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1180
|
-
# @return [WorkOS::
|
|
1287
|
+
# @return [WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse]
|
|
1181
1288
|
def create_magic_auth(
|
|
1182
1289
|
email:,
|
|
1183
1290
|
invitation_token: nil,
|
|
1291
|
+
ip_address: nil,
|
|
1292
|
+
user_agent: nil,
|
|
1293
|
+
radar_auth_attempt_id: nil,
|
|
1294
|
+
signals_id: nil,
|
|
1184
1295
|
request_options: {}
|
|
1185
1296
|
)
|
|
1186
1297
|
body = {
|
|
1187
1298
|
"email" => email,
|
|
1188
|
-
"invitation_token" => invitation_token
|
|
1299
|
+
"invitation_token" => invitation_token,
|
|
1300
|
+
"ip_address" => ip_address,
|
|
1301
|
+
"user_agent" => user_agent,
|
|
1302
|
+
"radar_auth_attempt_id" => radar_auth_attempt_id,
|
|
1303
|
+
"signals_id" => signals_id
|
|
1189
1304
|
}.compact
|
|
1190
1305
|
response = @client.request(
|
|
1191
1306
|
method: :post,
|
|
@@ -1194,7 +1309,7 @@ module WorkOS
|
|
|
1194
1309
|
body: body,
|
|
1195
1310
|
request_options: request_options
|
|
1196
1311
|
)
|
|
1197
|
-
result = WorkOS::
|
|
1312
|
+
result = WorkOS::MagicAuthSendMagicAuthCodeAndReturnResponse.new(response.body)
|
|
1198
1313
|
result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
|
|
1199
1314
|
result
|
|
1200
1315
|
end
|
|
@@ -1218,6 +1333,50 @@ module WorkOS
|
|
|
1218
1333
|
result
|
|
1219
1334
|
end
|
|
1220
1335
|
|
|
1336
|
+
# List redirect URIs
|
|
1337
|
+
# @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
|
|
1338
|
+
# @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
|
|
1339
|
+
# @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
|
|
1340
|
+
# @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
|
|
1341
|
+
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
1342
|
+
# @return [WorkOS::Types::ListStruct<WorkOS::RedirectUri>]
|
|
1343
|
+
def list_redirect_uris(
|
|
1344
|
+
before: nil,
|
|
1345
|
+
after: nil,
|
|
1346
|
+
limit: 10,
|
|
1347
|
+
order: "desc",
|
|
1348
|
+
request_options: {}
|
|
1349
|
+
)
|
|
1350
|
+
params = {
|
|
1351
|
+
"before" => before,
|
|
1352
|
+
"after" => after,
|
|
1353
|
+
"limit" => limit,
|
|
1354
|
+
"order" => order
|
|
1355
|
+
}.compact
|
|
1356
|
+
response = @client.request(
|
|
1357
|
+
method: :get,
|
|
1358
|
+
path: "/user_management/redirect_uris",
|
|
1359
|
+
auth: true,
|
|
1360
|
+
params: params,
|
|
1361
|
+
request_options: request_options
|
|
1362
|
+
)
|
|
1363
|
+
fetch_next = ->(cursor) {
|
|
1364
|
+
list_redirect_uris(
|
|
1365
|
+
before: before,
|
|
1366
|
+
after: cursor,
|
|
1367
|
+
limit: limit,
|
|
1368
|
+
order: order,
|
|
1369
|
+
request_options: request_options
|
|
1370
|
+
)
|
|
1371
|
+
}
|
|
1372
|
+
WorkOS::Types::ListStruct.from_response(
|
|
1373
|
+
response,
|
|
1374
|
+
model: WorkOS::RedirectUri,
|
|
1375
|
+
filters: {before: before, limit: limit, order: order},
|
|
1376
|
+
fetch_next: fetch_next
|
|
1377
|
+
)
|
|
1378
|
+
end
|
|
1379
|
+
|
|
1221
1380
|
# Create a redirect URI
|
|
1222
1381
|
# @param uri [String] The redirect URI to create.
|
|
1223
1382
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
data/lib/workos/version.rb
CHANGED
data/rbi/workos/admin_portal.rbi
CHANGED
|
@@ -15,12 +15,11 @@ module WorkOS
|
|
|
15
15
|
return_url: T.nilable(String),
|
|
16
16
|
success_url: T.nilable(String),
|
|
17
17
|
intent: T.nilable(String),
|
|
18
|
-
intent_options: T.nilable(WorkOS::IntentOptions),
|
|
19
18
|
it_contact_emails: T.nilable(T::Array[String]),
|
|
20
19
|
request_options: T::Hash[Symbol, T.untyped]
|
|
21
20
|
).returns(WorkOS::PortalLinkResponse)
|
|
22
21
|
end
|
|
23
|
-
def generate_link(organization:, return_url:, success_url:, intent:,
|
|
22
|
+
def generate_link(organization:, return_url:, success_url:, intent:, it_contact_emails:, request_options:); end
|
|
24
23
|
|
|
25
24
|
end
|
|
26
25
|
end
|
|
@@ -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 AuthMethodMismatchError
|
|
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 code; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def code=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def message; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def message=(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
|
|
@@ -63,6 +63,12 @@ module WorkOS
|
|
|
63
63
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
64
64
|
def user_agent=(value); end
|
|
65
65
|
|
|
66
|
+
sig { returns(T.nilable(String)) }
|
|
67
|
+
def signals_id; end
|
|
68
|
+
|
|
69
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
70
|
+
def signals_id=(value); end
|
|
71
|
+
|
|
66
72
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
67
73
|
def to_h; end
|
|
68
74
|
|
|
@@ -0,0 +1,48 @@
|
|
|
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 ConnectedAccountDto
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
def access_token; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
16
|
+
def access_token=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
def refresh_token; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
+
def refresh_token=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
def expires_at; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
28
|
+
def expires_at=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
31
|
+
def scopes; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
|
34
|
+
def scopes=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
def state; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
40
|
+
def state=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
43
|
+
def to_h; end
|
|
44
|
+
|
|
45
|
+
sig { params(args: T.untyped).returns(String) }
|
|
46
|
+
def to_json(*args); end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
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 CreateDataIntegration
|
|
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 provider; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def provider=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(String)) }
|
|
19
|
+
def description; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
22
|
+
def description=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
25
|
+
def enabled; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
|
|
28
|
+
def enabled=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
31
|
+
def scopes; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) }
|
|
34
|
+
def scopes=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(WorkOS::DataIntegrationCredentialsDto)) }
|
|
37
|
+
def credentials; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(WorkOS::DataIntegrationCredentialsDto)).returns(T.nilable(WorkOS::DataIntegrationCredentialsDto)) }
|
|
40
|
+
def credentials=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(WorkOS::CustomProviderDefinition)) }
|
|
43
|
+
def custom_provider; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(WorkOS::CustomProviderDefinition)).returns(T.nilable(WorkOS::CustomProviderDefinition)) }
|
|
46
|
+
def custom_provider=(value); end
|
|
47
|
+
|
|
48
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
49
|
+
def to_h; end
|
|
50
|
+
|
|
51
|
+
sig { params(args: T.untyped).returns(String) }
|
|
52
|
+
def to_json(*args); end
|
|
53
|
+
end
|
|
54
|
+
end
|