workos 7.1.1 → 8.0.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/.github/workflows/docs.yml +46 -0
- data/.gitignore +2 -0
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +61 -40
- data/.release-please-manifest.json +1 -1
- data/.yardopts +6 -0
- data/CHANGELOG.md +38 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +33 -2
- data/lib/workos/api_keys/api_key.rb +1 -1
- data/lib/workos/api_keys/api_key_created_data.rb +1 -1
- data/lib/workos/api_keys/organization_api_key.rb +43 -0
- data/lib/workos/{types/events_order.rb → api_keys/organization_api_key_owner.rb} +1 -3
- data/lib/workos/api_keys/organization_api_key_with_value.rb +46 -0
- data/lib/workos/{types/audit_logs_order.rb → api_keys/organization_api_key_with_value_owner.rb} +1 -3
- data/lib/workos/api_keys.rb +46 -46
- data/lib/workos/audit_logs.rb +6 -6
- data/lib/workos/authorization/user_organization_membership_base_list_data.rb +5 -2
- data/lib/workos/authorization/{role_assignment.rb → user_role_assignment.rb} +5 -2
- data/lib/workos/authorization/{role_assignment_resource.rb → user_role_assignment_resource.rb} +1 -1
- data/lib/workos/authorization.rb +250 -138
- data/lib/workos/base_client.rb +6 -1
- data/lib/workos/client.rb +4 -4
- data/lib/workos/connect.rb +2 -2
- data/lib/workos/directory_sync/directory_user.rb +3 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +4 -1
- data/lib/workos/directory_sync/dsync_user_updated_data.rb +3 -0
- data/lib/workos/directory_sync.rb +6 -6
- data/lib/workos/encryptors/aes_gcm.rb +35 -3
- data/lib/workos/events.rb +2 -2
- data/lib/workos/feature_flags.rb +6 -6
- data/lib/workos/groups.rb +5 -5
- data/lib/workos/multi_factor_auth.rb +3 -3
- data/lib/workos/organization_domains.rb +1 -1
- data/lib/workos/organizations.rb +2 -2
- data/lib/workos/radar.rb +2 -2
- data/lib/workos/sso/profile.rb +3 -0
- data/lib/workos/sso.rb +4 -4
- data/lib/workos/types/event_context_actor_source.rb +2 -1
- data/lib/workos/types/{applications_order.rb → pagination_order.rb} +1 -1
- data/lib/workos/types/{vault_byok_key_verification_completed_data_key_provider.rb → vault_byok_key_provider.rb} +1 -1
- data/lib/workos/user_management/create_user_api_key.rb +25 -0
- data/lib/workos/user_management/organization_membership.rb +5 -2
- data/lib/workos/user_management/user_api_key.rb +43 -0
- data/lib/workos/user_management/user_api_key_created_data_owner.rb +25 -0
- data/lib/workos/{api_keys/api_key_with_value_owner.rb → user_management/user_api_key_owner.rb} +1 -1
- data/lib/workos/{types/webhooks_order.rb → user_management/user_api_key_revoked_data_owner.rb} +1 -3
- data/lib/workos/{api_keys/api_key_with_value.rb → user_management/user_api_key_with_value.rb} +2 -2
- data/lib/workos/{types/groups_order.rb → user_management/user_api_key_with_value_owner.rb} +1 -3
- data/lib/workos/user_management/user_organization_membership.rb +5 -2
- data/lib/workos/user_management.rb +181 -75
- data/lib/workos/user_management_organization_membership_groups.rb +2 -2
- data/lib/workos/vault/vault_byok_key_deleted.rb +34 -0
- data/lib/workos/vault/vault_byok_key_deleted_data.rb +22 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos/webhooks.rb +3 -3
- data/rbi/workos/api_key.rbi +2 -2
- data/rbi/workos/api_key_created_data.rbi +2 -2
- data/rbi/workos/api_key_revoked_data.rbi +2 -2
- data/rbi/workos/api_keys.rbi +17 -17
- data/rbi/workos/authorization.rbi +127 -27
- data/rbi/workos/client.rbi +3 -3
- data/rbi/workos/create_user_api_key.rbi +36 -0
- data/rbi/workos/directory_user.rbi +6 -0
- data/rbi/workos/directory_user_with_groups.rbi +6 -0
- data/rbi/workos/dsync_user_updated_data.rbi +6 -0
- data/rbi/workos/organization_api_key.rbi +72 -0
- data/rbi/workos/{api_key_with_value_owner.rbi → organization_api_key_owner.rbi} +1 -1
- data/rbi/workos/organization_api_key_with_value.rbi +78 -0
- data/rbi/workos/organization_api_key_with_value_owner.rbi +30 -0
- data/rbi/workos/organization_membership.rbi +6 -0
- data/rbi/workos/profile.rbi +6 -0
- data/rbi/workos/user_api_key.rbi +72 -0
- data/rbi/workos/user_api_key_created_data_owner.rbi +36 -0
- data/rbi/workos/user_api_key_owner.rbi +36 -0
- data/rbi/workos/user_api_key_revoked_data_owner.rbi +36 -0
- data/rbi/workos/{api_key_with_value.rbi → user_api_key_with_value.rbi} +3 -3
- data/rbi/workos/user_api_key_with_value_owner.rbi +36 -0
- data/rbi/workos/user_management.rbi +91 -14
- data/rbi/workos/user_organization_membership.rbi +6 -0
- data/rbi/workos/user_organization_membership_base_list_data.rbi +6 -0
- data/rbi/workos/{role_assignment.rbi → user_role_assignment.rbi} +9 -3
- data/rbi/workos/{role_assignment_resource.rbi → user_role_assignment_resource.rbi} +1 -1
- data/rbi/workos/vault_byok_key_deleted.rbi +54 -0
- data/rbi/workos/vault_byok_key_deleted_data.rbi +30 -0
- data/script/docs +16 -0
- data/script/docs-serve +12 -0
- data/script/llms-txt +37 -0
- data/test/workos/test_api_keys.rb +17 -17
- data/test/workos/test_audit_logs.rb +2 -2
- data/test/workos/test_authorization.rb +102 -20
- data/test/workos/test_encryptors_aes_gcm.rb +21 -0
- data/test/workos/test_model_round_trip.rb +278 -83
- data/test/workos/test_session.rb +68 -0
- data/test/workos/test_user_management.rb +69 -9
- data/test/workos/test_webhooks.rb +2 -2
- metadata +39 -33
- data/lib/workos/types/authorization_order.rb +0 -9
- data/lib/workos/types/connections_order.rb +0 -9
- data/lib/workos/types/directories_order.rb +0 -9
- data/lib/workos/types/directory_groups_order.rb +0 -9
- data/lib/workos/types/directory_users_order.rb +0 -9
- data/lib/workos/types/feature_flags_order.rb +0 -9
- data/lib/workos/types/organizations_api_keys_order.rb +0 -9
- data/lib/workos/types/organizations_feature_flags_order.rb +0 -9
- data/lib/workos/types/organizations_order.rb +0 -9
- data/lib/workos/types/permissions_order.rb +0 -9
- data/lib/workos/types/user_management_invitations_order.rb +0 -9
- data/lib/workos/types/user_management_multi_factor_authentication_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +0 -9
- data/lib/workos/types/user_management_organization_membership_order.rb +0 -9
- data/lib/workos/types/user_management_users_authorized_applications_order.rb +0 -9
- data/lib/workos/types/user_management_users_feature_flags_order.rb +0 -9
- data/lib/workos/types/user_management_users_order.rb +0 -9
|
@@ -0,0 +1,72 @@
|
|
|
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 UserApiKey
|
|
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 object; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def object=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def id; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def id=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(WorkOS::UserApiKeyOwner) }
|
|
25
|
+
def owner; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: WorkOS::UserApiKeyOwner).returns(WorkOS::UserApiKeyOwner) }
|
|
28
|
+
def owner=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(String) }
|
|
31
|
+
def name; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: String).returns(String) }
|
|
34
|
+
def name=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(String) }
|
|
37
|
+
def obfuscated_value; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: String).returns(String) }
|
|
40
|
+
def obfuscated_value=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
def last_used_at; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
46
|
+
def last_used_at=(value); end
|
|
47
|
+
|
|
48
|
+
sig { returns(T::Array[String]) }
|
|
49
|
+
def permissions; end
|
|
50
|
+
|
|
51
|
+
sig { params(value: T::Array[String]).returns(T::Array[String]) }
|
|
52
|
+
def permissions=(value); end
|
|
53
|
+
|
|
54
|
+
sig { returns(String) }
|
|
55
|
+
def created_at; end
|
|
56
|
+
|
|
57
|
+
sig { params(value: String).returns(String) }
|
|
58
|
+
def created_at=(value); end
|
|
59
|
+
|
|
60
|
+
sig { returns(String) }
|
|
61
|
+
def updated_at; end
|
|
62
|
+
|
|
63
|
+
sig { params(value: String).returns(String) }
|
|
64
|
+
def updated_at=(value); end
|
|
65
|
+
|
|
66
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
67
|
+
def to_h; end
|
|
68
|
+
|
|
69
|
+
sig { params(args: T.untyped).returns(String) }
|
|
70
|
+
def to_json(*args); end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 UserApiKeyCreatedDataOwner
|
|
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(String) }
|
|
19
|
+
def id; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def id=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def organization_id; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def organization_id=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 UserApiKeyOwner
|
|
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(String) }
|
|
19
|
+
def id; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def id=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def organization_id; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def organization_id=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
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 UserApiKeyRevokedDataOwner
|
|
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(String) }
|
|
19
|
+
def id; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def id=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def organization_id; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def organization_id=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
class
|
|
8
|
+
class UserApiKeyWithValue
|
|
9
9
|
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
10
|
def initialize(json); end
|
|
11
11
|
|
|
@@ -21,10 +21,10 @@ module WorkOS
|
|
|
21
21
|
sig { params(value: String).returns(String) }
|
|
22
22
|
def id=(value); end
|
|
23
23
|
|
|
24
|
-
sig { returns(WorkOS::
|
|
24
|
+
sig { returns(WorkOS::UserApiKeyWithValueOwner) }
|
|
25
25
|
def owner; end
|
|
26
26
|
|
|
27
|
-
sig { params(value: WorkOS::
|
|
27
|
+
sig { params(value: WorkOS::UserApiKeyWithValueOwner).returns(WorkOS::UserApiKeyWithValueOwner) }
|
|
28
28
|
def owner=(value); end
|
|
29
29
|
|
|
30
30
|
sig { returns(String) }
|
|
@@ -0,0 +1,36 @@
|
|
|
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 UserApiKeyWithValueOwner
|
|
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(String) }
|
|
19
|
+
def id; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def id=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def organization_id; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def organization_id=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
31
|
+
def to_h; end
|
|
32
|
+
|
|
33
|
+
sig { params(args: T.untyped).returns(String) }
|
|
34
|
+
def to_json(*args); end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -6,6 +6,58 @@
|
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
8
|
class UserManagement
|
|
9
|
+
class PasswordPlaintext
|
|
10
|
+
sig { returns(String) }
|
|
11
|
+
def password; end
|
|
12
|
+
|
|
13
|
+
sig do
|
|
14
|
+
params(
|
|
15
|
+
password: String
|
|
16
|
+
).returns(WorkOS::UserManagement::PasswordPlaintext)
|
|
17
|
+
end
|
|
18
|
+
def self.new(password:); end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class PasswordHashed
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
def password_hash; end
|
|
24
|
+
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
def password_hash_type; end
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
password_hash: String,
|
|
31
|
+
password_hash_type: String
|
|
32
|
+
).returns(WorkOS::UserManagement::PasswordHashed)
|
|
33
|
+
end
|
|
34
|
+
def self.new(password_hash:, password_hash_type:); end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class RoleSingle
|
|
38
|
+
sig { returns(String) }
|
|
39
|
+
def role_slug; end
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
params(
|
|
43
|
+
role_slug: String
|
|
44
|
+
).returns(WorkOS::UserManagement::RoleSingle)
|
|
45
|
+
end
|
|
46
|
+
def self.new(role_slug:); end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class RoleMultiple
|
|
50
|
+
sig { returns(T::Array[String]) }
|
|
51
|
+
def role_slugs; end
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
params(
|
|
55
|
+
role_slugs: T::Array[String]
|
|
56
|
+
).returns(WorkOS::UserManagement::RoleMultiple)
|
|
57
|
+
end
|
|
58
|
+
def self.new(role_slugs:); end
|
|
59
|
+
end
|
|
60
|
+
|
|
9
61
|
sig { params(client: WorkOS::BaseClient).void }
|
|
10
62
|
def initialize(client); end
|
|
11
63
|
|
|
@@ -113,13 +165,11 @@ module WorkOS
|
|
|
113
165
|
email_verified: T.nilable(T::Boolean),
|
|
114
166
|
metadata: T.nilable(T::Hash[String, String]),
|
|
115
167
|
external_id: T.nilable(String),
|
|
116
|
-
password: T.nilable(
|
|
117
|
-
password_hash: T.nilable(String),
|
|
118
|
-
password_hash_type: T.nilable(String),
|
|
168
|
+
password: T.nilable(T.any(WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed)),
|
|
119
169
|
request_options: T::Hash[Symbol, T.untyped]
|
|
120
170
|
).returns(WorkOS::User)
|
|
121
171
|
end
|
|
122
|
-
def create_user(email:, first_name:, last_name:, email_verified:, metadata:, external_id:, password:,
|
|
172
|
+
def create_user(email:, first_name:, last_name:, email_verified:, metadata:, external_id:, password:, request_options:); end
|
|
123
173
|
|
|
124
174
|
sig do
|
|
125
175
|
params(
|
|
@@ -147,13 +197,11 @@ module WorkOS
|
|
|
147
197
|
metadata: T.nilable(T::Hash[String, String]),
|
|
148
198
|
external_id: T.nilable(String),
|
|
149
199
|
locale: T.nilable(String),
|
|
150
|
-
password: T.nilable(
|
|
151
|
-
password_hash: T.nilable(String),
|
|
152
|
-
password_hash_type: T.nilable(String),
|
|
200
|
+
password: T.nilable(T.any(WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed)),
|
|
153
201
|
request_options: T::Hash[Symbol, T.untyped]
|
|
154
202
|
).returns(WorkOS::User)
|
|
155
203
|
end
|
|
156
|
-
def update_user(id:, email:, first_name:, last_name:, email_verified:, metadata:, external_id:, locale:, password:,
|
|
204
|
+
def update_user(id:, email:, first_name:, last_name:, email_verified:, metadata:, external_id:, locale:, password:, request_options:); end
|
|
157
205
|
|
|
158
206
|
sig do
|
|
159
207
|
params(
|
|
@@ -285,6 +333,13 @@ module WorkOS
|
|
|
285
333
|
end
|
|
286
334
|
def revoke_invitation(id:, request_options:); end
|
|
287
335
|
|
|
336
|
+
sig do
|
|
337
|
+
params(
|
|
338
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
339
|
+
).returns(WorkOS::JWTTemplateResponse)
|
|
340
|
+
end
|
|
341
|
+
def list_jwt_template(request_options:); end
|
|
342
|
+
|
|
288
343
|
sig do
|
|
289
344
|
params(
|
|
290
345
|
content: String,
|
|
@@ -328,12 +383,11 @@ module WorkOS
|
|
|
328
383
|
params(
|
|
329
384
|
user_id: String,
|
|
330
385
|
organization_id: String,
|
|
331
|
-
|
|
332
|
-
role_slugs: T.nilable(T::Array[String]),
|
|
386
|
+
role: T.nilable(T.any(WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple)),
|
|
333
387
|
request_options: T::Hash[Symbol, T.untyped]
|
|
334
388
|
).returns(WorkOS::OrganizationMembership)
|
|
335
389
|
end
|
|
336
|
-
def create_organization_membership(user_id:, organization_id:,
|
|
390
|
+
def create_organization_membership(user_id:, organization_id:, role:, request_options:); end
|
|
337
391
|
|
|
338
392
|
sig do
|
|
339
393
|
params(
|
|
@@ -346,12 +400,11 @@ module WorkOS
|
|
|
346
400
|
sig do
|
|
347
401
|
params(
|
|
348
402
|
id: String,
|
|
349
|
-
|
|
350
|
-
role_slugs: T.nilable(T::Array[String]),
|
|
403
|
+
role: T.nilable(T.any(WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple)),
|
|
351
404
|
request_options: T::Hash[Symbol, T.untyped]
|
|
352
405
|
).returns(WorkOS::UserOrganizationMembership)
|
|
353
406
|
end
|
|
354
|
-
def update_organization_membership(id:,
|
|
407
|
+
def update_organization_membership(id:, role:, request_options:); end
|
|
355
408
|
|
|
356
409
|
sig do
|
|
357
410
|
params(
|
|
@@ -406,5 +459,29 @@ module WorkOS
|
|
|
406
459
|
end
|
|
407
460
|
def delete_user_authorized_application(application_id:, user_id:, request_options:); end
|
|
408
461
|
|
|
462
|
+
sig do
|
|
463
|
+
params(
|
|
464
|
+
user_id: String,
|
|
465
|
+
before: T.nilable(String),
|
|
466
|
+
after: T.nilable(String),
|
|
467
|
+
limit: T.nilable(Integer),
|
|
468
|
+
order: T.nilable(String),
|
|
469
|
+
organization_id: T.nilable(String),
|
|
470
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
471
|
+
).returns(WorkOS::Types::ListStruct)
|
|
472
|
+
end
|
|
473
|
+
def list_user_api_keys(user_id:, before:, after:, limit:, order:, organization_id:, request_options:); end
|
|
474
|
+
|
|
475
|
+
sig do
|
|
476
|
+
params(
|
|
477
|
+
user_id: String,
|
|
478
|
+
name: String,
|
|
479
|
+
organization_id: String,
|
|
480
|
+
permissions: T.nilable(T::Array[String]),
|
|
481
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
482
|
+
).returns(WorkOS::UserApiKeyWithValue)
|
|
483
|
+
end
|
|
484
|
+
def create_user_api_key(user_id:, name:, organization_id:, permissions:, request_options:); end
|
|
485
|
+
|
|
409
486
|
end
|
|
410
487
|
end
|
|
@@ -75,6 +75,12 @@ module WorkOS
|
|
|
75
75
|
sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) }
|
|
76
76
|
def role=(value); end
|
|
77
77
|
|
|
78
|
+
sig { returns(WorkOS::User) }
|
|
79
|
+
def user; end
|
|
80
|
+
|
|
81
|
+
sig { params(value: WorkOS::User).returns(WorkOS::User) }
|
|
82
|
+
def user=(value); end
|
|
83
|
+
|
|
78
84
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
79
85
|
def to_h; end
|
|
80
86
|
|
|
@@ -69,6 +69,12 @@ module WorkOS
|
|
|
69
69
|
sig { params(value: String).returns(String) }
|
|
70
70
|
def updated_at=(value); end
|
|
71
71
|
|
|
72
|
+
sig { returns(WorkOS::User) }
|
|
73
|
+
def user; end
|
|
74
|
+
|
|
75
|
+
sig { params(value: WorkOS::User).returns(WorkOS::User) }
|
|
76
|
+
def user=(value); end
|
|
77
|
+
|
|
72
78
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
73
79
|
def to_h; end
|
|
74
80
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# typed: strong
|
|
6
6
|
|
|
7
7
|
module WorkOS
|
|
8
|
-
class
|
|
8
|
+
class UserRoleAssignment
|
|
9
9
|
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
10
|
def initialize(json); end
|
|
11
11
|
|
|
@@ -21,16 +21,22 @@ module WorkOS
|
|
|
21
21
|
sig { params(value: String).returns(String) }
|
|
22
22
|
def id=(value); end
|
|
23
23
|
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def organization_membership_id; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def organization_membership_id=(value); end
|
|
29
|
+
|
|
24
30
|
sig { returns(WorkOS::SlimRole) }
|
|
25
31
|
def role; end
|
|
26
32
|
|
|
27
33
|
sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) }
|
|
28
34
|
def role=(value); end
|
|
29
35
|
|
|
30
|
-
sig { returns(WorkOS::
|
|
36
|
+
sig { returns(WorkOS::UserRoleAssignmentResource) }
|
|
31
37
|
def resource; end
|
|
32
38
|
|
|
33
|
-
sig { params(value: WorkOS::
|
|
39
|
+
sig { params(value: WorkOS::UserRoleAssignmentResource).returns(WorkOS::UserRoleAssignmentResource) }
|
|
34
40
|
def resource=(value); end
|
|
35
41
|
|
|
36
42
|
sig { returns(String) }
|
|
@@ -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 VaultByokKeyDeleted
|
|
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 id; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def id=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def event; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def event=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(WorkOS::VaultByokKeyDeletedData) }
|
|
25
|
+
def data; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: WorkOS::VaultByokKeyDeletedData).returns(WorkOS::VaultByokKeyDeletedData) }
|
|
28
|
+
def data=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(String) }
|
|
31
|
+
def created_at; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: String).returns(String) }
|
|
34
|
+
def created_at=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(WorkOS::EventContext)) }
|
|
37
|
+
def context; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) }
|
|
40
|
+
def context=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(String) }
|
|
43
|
+
def object; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: String).returns(String) }
|
|
46
|
+
def object=(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
|
|
@@ -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 VaultByokKeyDeletedData
|
|
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 organization_id; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def organization_id=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def key_provider; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def key_provider=(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
|
data/script/docs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
cd "$(dirname "$0")/.."
|
|
4
|
+
bundle config set --local with 'docs'
|
|
5
|
+
bundle install
|
|
6
|
+
rm -rf docs/_site
|
|
7
|
+
# 1. Generate HTML docs (default YARD format).
|
|
8
|
+
bundle exec yard doc
|
|
9
|
+
# 2. Generate Markdown docs alongside the HTML, using the yard-markdown plugin.
|
|
10
|
+
# We point output at the same docs/_site directory so .md files land next to .html.
|
|
11
|
+
# --no-cache forces a re-parse so the markdown formatter sees fresh registry data.
|
|
12
|
+
# --plugin yard-markdown ensures the plugin is loaded without relying on ~/.yard/config.
|
|
13
|
+
bundle exec yard doc --plugin yard-markdown --format markdown --no-cache --output-dir docs/_site
|
|
14
|
+
# 3. Generate llms.txt (index) from the markdown output, so the published site
|
|
15
|
+
# is consumable by LLM tooling.
|
|
16
|
+
bundle exec ./script/llms-txt
|
data/script/docs-serve
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
cd "$(dirname "$0")/.."
|
|
4
|
+
bundle config set --local with 'docs'
|
|
5
|
+
bundle install --quiet
|
|
6
|
+
if [ "${1:-}" = "--static" ]; then
|
|
7
|
+
if [ ! -d docs/_site ]; then
|
|
8
|
+
./script/docs
|
|
9
|
+
fi
|
|
10
|
+
exec bundle exec ruby -run -e httpd -- docs/_site -p 4000
|
|
11
|
+
fi
|
|
12
|
+
exec bundle exec yard server --reload --port 4000
|
data/script/llms-txt
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# Generates llms.txt (curated index) from the Markdown docs produced by
|
|
5
|
+
# `yard --format markdown` in docs/_site. See https://llmstxt.org for the format.
|
|
6
|
+
|
|
7
|
+
require "pathname"
|
|
8
|
+
|
|
9
|
+
ROOT = Pathname.new(__dir__).join("..").expand_path
|
|
10
|
+
SITE = ROOT.join("docs/_site")
|
|
11
|
+
require ROOT.join("lib/workos/version").to_s
|
|
12
|
+
|
|
13
|
+
abort "docs/_site is missing — run script/docs first" unless SITE.directory?
|
|
14
|
+
|
|
15
|
+
md_files = Pathname.glob(SITE.join("**/*.md")).sort_by { |p| p.relative_path_from(SITE).to_s }
|
|
16
|
+
|
|
17
|
+
title_for = lambda do |path|
|
|
18
|
+
first_heading = path.each_line.lazy.map(&:strip).find { |l| l.start_with?("# ") }
|
|
19
|
+
first_heading ? first_heading.sub(/^#\s+/, "").sub(/\s*<a id=.*?<\/a>\s*$/, "").strip : path.basename(".md").to_s
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
index_lines = []
|
|
23
|
+
index_lines << "# WorkOS Ruby SDK v#{WorkOS::VERSION}"
|
|
24
|
+
index_lines << ""
|
|
25
|
+
index_lines << "> API client for WorkOS. This file indexes the auto-generated YARD documentation for the `workos` gem so language models can locate per-class references."
|
|
26
|
+
index_lines << ""
|
|
27
|
+
index_lines << "## API Reference"
|
|
28
|
+
index_lines << ""
|
|
29
|
+
md_files.each do |path|
|
|
30
|
+
rel = path.relative_path_from(SITE).to_s
|
|
31
|
+
index_lines << "- [#{title_for.call(path)}](#{rel})"
|
|
32
|
+
end
|
|
33
|
+
index_lines << ""
|
|
34
|
+
|
|
35
|
+
SITE.join("llms.txt").write(index_lines.join("\n"))
|
|
36
|
+
|
|
37
|
+
puts "Wrote #{SITE.join("llms.txt")} (#{md_files.size} entries)"
|
|
@@ -11,20 +11,6 @@ class ApiKeysTest < Minitest::Test
|
|
|
11
11
|
@client = WorkOS::Client.new(api_key: "sk_test_123")
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def test_create_validation_returns_expected_result
|
|
15
|
-
stub_request(:post, %r{\Ahttps://api\.workos\.com/api_keys/validations(\?|\z)})
|
|
16
|
-
.to_return(body: "{}", status: 200)
|
|
17
|
-
result = @client.api_keys.create_validation(value: "stub")
|
|
18
|
-
refute_nil result
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def test_delete_api_key_returns_expected_result
|
|
22
|
-
stub_request(:delete, %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)})
|
|
23
|
-
.to_return(body: "{}", status: 200)
|
|
24
|
-
result = @client.api_keys.delete_api_key(id: "stub")
|
|
25
|
-
assert_nil result
|
|
26
|
-
end
|
|
27
|
-
|
|
28
14
|
def test_list_organization_api_keys_returns_expected_result
|
|
29
15
|
stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)})
|
|
30
16
|
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
@@ -39,12 +25,26 @@ class ApiKeysTest < Minitest::Test
|
|
|
39
25
|
refute_nil result
|
|
40
26
|
end
|
|
41
27
|
|
|
28
|
+
def test_create_validation_returns_expected_result
|
|
29
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/api_keys/validations(\?|\z)})
|
|
30
|
+
.to_return(body: "{}", status: 200)
|
|
31
|
+
result = @client.api_keys.create_validation(value: "stub")
|
|
32
|
+
refute_nil result
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_delete_api_key_returns_expected_result
|
|
36
|
+
stub_request(:delete, %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)})
|
|
37
|
+
.to_return(body: "{}", status: 200)
|
|
38
|
+
result = @client.api_keys.delete_api_key(id: "stub")
|
|
39
|
+
assert_nil result
|
|
40
|
+
end
|
|
41
|
+
|
|
42
42
|
# Parameterized authentication error tests (one per endpoint).
|
|
43
43
|
[
|
|
44
|
-
{name: :create_validation, verb: :post, url: %r{\Ahttps://api\.workos\.com/api_keys/validations(\?|\z)}, args: {value: "stub"}},
|
|
45
|
-
{name: :delete_api_key, verb: :delete, url: %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)}, args: {id: "stub"}},
|
|
46
44
|
{name: :list_organization_api_keys, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}, args: {organization_id: "stub"}},
|
|
47
|
-
{name: :create_organization_api_key, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}, args: {organization_id: "stub", name: "stub"}}
|
|
45
|
+
{name: :create_organization_api_key, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}, args: {organization_id: "stub", name: "stub"}},
|
|
46
|
+
{name: :create_validation, verb: :post, url: %r{\Ahttps://api\.workos\.com/api_keys/validations(\?|\z)}, args: {value: "stub"}},
|
|
47
|
+
{name: :delete_api_key, verb: :delete, url: %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)}, args: {id: "stub"}}
|
|
48
48
|
].each do |spec|
|
|
49
49
|
define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do
|
|
50
50
|
stub_request(spec[:verb], spec[:url])
|