workos 2.14.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc295cd8c46339a6d6ecf851da0afc2209f1c69de9b0b9f97f880047fff0213a
4
- data.tar.gz: e730de6baf7200c817fa85893939448d541e3740800a892800ec7eee2aad939f
3
+ metadata.gz: 2b01746fa31764bb3e0a381ca2e3dd0bef08a39a9e80db8d5079997e2e392d36
4
+ data.tar.gz: 79ec855c5da2d642a911b7896d353628e837c020a471d70824b39bb510e60d71
5
5
  SHA512:
6
- metadata.gz: 8fa02446a42a473799a85091e142dec2b3b9ec8828017638fdba5625160df7e56f01fddd3aca5b86350106d7226c8979f9e556b775aa24086954ce3b2651948c
7
- data.tar.gz: 4510685f43bbc1877f2f49e840da87ccb40240a3f6360d0832fb5714228a30d08c17c36d3d499bc3d6ccaffda72c4766d02ccacb8b6808b90231a2ece996a74b
6
+ metadata.gz: 6aaee86d818a23e40de43f9f5eececdb109fe1fdbba6c4c7a50916e814976ec7a140628415c40aca4d170eb4fd3105125eb8bc4c68ea8ff695f6bb8f91baeea9
7
+ data.tar.gz: c805ad7bf051ebaeb1b5ac485f710d951d5890cd9219adbf32daa3edf653d2baa8e0fb740c550d4e0be9433d7fe6fb355d4130148a66ef9e80f7f73d76bebc66
data/.rubocop.yml CHANGED
@@ -11,7 +11,7 @@ Layout/LineLength:
11
11
  Metrics/BlockLength:
12
12
  ExcludedMethods: ['describe', 'context', 'before']
13
13
  Metrics/MethodLength:
14
- Max: 15
14
+ Max: 30
15
15
  Metrics/ModuleLength:
16
16
  Max: 200
17
17
  Metrics/ParameterLists:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (2.14.0)
4
+ workos (2.15.0)
5
5
  sorbet-runtime (~> 0.5)
6
6
 
7
7
  GEM
@@ -46,7 +46,9 @@ module WorkOS
46
46
  # @param [String] range_start ISO-8601 datetime
47
47
  # @param [String] range_end ISO-8601 datetime
48
48
  # @param [Array<String>] actions A list of actions to filter by
49
- # @param [Array<String>] actors A list of actor names to filter by
49
+ # @param [Array<String>] @deprecated use `actor_names` instead
50
+ # @param [Array<String>] actor_names A list of actor names to filter by
51
+ # @param [Array<String>] actor_ids A list of actor ids to filter by
50
52
  # @param [Array<String>] targets A list of target types to filter by
51
53
  #
52
54
  # @return [WorkOS::AuditLogExport]
@@ -58,9 +60,12 @@ module WorkOS
58
60
  actions: T.nilable(T::Array[String]),
59
61
  actors: T.nilable(T::Array[String]),
60
62
  targets: T.nilable(T::Array[String]),
63
+ actor_names: T.nilable(T::Array[String]),
64
+ actor_ids: T.nilable(T::Array[String]),
61
65
  ).returns(WorkOS::AuditLogExport)
62
66
  end
63
- def create_export(organization:, range_start:, range_end:, actions: nil, actors: nil, targets: nil)
67
+ def create_export(organization:, range_start:, range_end:, actions: nil, # rubocop:disable Metrics/ParameterLists
68
+ actors: nil, targets: nil, actor_names: nil, actor_ids: nil)
64
69
  body = {
65
70
  organization_id: organization,
66
71
  range_start: range_start,
@@ -69,6 +74,8 @@ module WorkOS
69
74
 
70
75
  body['actions'] = actions unless actions.nil?
71
76
  body['actors'] = actors unless actors.nil?
77
+ body['actor_names'] = actor_names unless actor_names.nil?
78
+ body['actor_ids'] = actor_ids unless actor_ids.nil?
72
79
  body['targets'] = targets unless targets.nil?
73
80
 
74
81
  request = post_request(
@@ -13,7 +13,7 @@ module WorkOS
13
13
  :groups, :custom_attributes, :raw_attributes, :directory_id, :organization_id,
14
14
  :created_at, :updated_at
15
15
 
16
- # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
16
+ # rubocop:disable Metrics/AbcSize
17
17
  sig { params(json: String).void }
18
18
  def initialize(json)
19
19
  raw = parse_json(json)
@@ -36,9 +36,8 @@ module WorkOS
36
36
 
37
37
  replace_without_warning(to_json)
38
38
  end
39
- # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
39
+ # rubocop:enable Metrics/AbcSize
40
40
 
41
- # rubocop:disable Metrics/MethodLength
42
41
  def to_json(*)
43
42
  {
44
43
  id: id,
@@ -58,7 +57,6 @@ module WorkOS
58
57
  updated_at: updated_at,
59
58
  }
60
59
  end
61
- # rubocop:enable Metrics/MethodLength
62
60
 
63
61
  def primary_email
64
62
  primary_email = (emails || []).find { |email| email[:primary] }
@@ -67,7 +65,7 @@ module WorkOS
67
65
 
68
66
  private
69
67
 
70
- # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
68
+ # rubocop:disable Metrics/AbcSize
71
69
  sig do
72
70
  params(
73
71
  json_string: String,
@@ -94,6 +92,6 @@ module WorkOS
94
92
  raw_attributes: hash[:raw_attributes],
95
93
  )
96
94
  end
97
- # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
95
+ # rubocop:enable Metrics/AbcSize
98
96
  end
99
97
  end
data/lib/workos/mfa.rb CHANGED
@@ -76,7 +76,6 @@ module WorkOS
76
76
  phone_number: T.nilable(String),
77
77
  ).returns(WorkOS::Factor)
78
78
  end
79
- # rubocop:disable Metrics/MethodLength
80
79
  def enroll_factor(
81
80
  type:,
82
81
  totp_issuer: nil,
@@ -101,7 +100,6 @@ module WorkOS
101
100
  ))
102
101
  WorkOS::Factor.new(response.body)
103
102
  end
104
- # rubocop:enable Metrics/MethodLength
105
103
 
106
104
  sig do
107
105
  params(
data/lib/workos/sso.rb CHANGED
@@ -54,7 +54,7 @@ module WorkOS
54
54
  # "response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdocs%22%7D"
55
55
  #
56
56
  # @return [String]
57
- # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists
57
+ # rubocop:disable Metrics/ParameterLists
58
58
  sig do
59
59
  params(
60
60
  redirect_uri: String,
@@ -106,7 +106,7 @@ module WorkOS
106
106
 
107
107
  "https://#{WorkOS::API_HOSTNAME}/sso/authorize?#{query}"
108
108
  end
109
- # rubocop:enable Metrics/MethodLength, Metrics/ParameterLists
109
+ # rubocop:enable Metrics/ParameterLists
110
110
 
111
111
  sig do
112
112
  params(
@@ -271,7 +271,6 @@ module WorkOS
271
271
  end
272
272
 
273
273
  sig { params(response: Net::HTTPResponse).void }
274
- # rubocop:disable Metrics/MethodLength
275
274
  def check_and_raise_profile_and_token_error(response:)
276
275
  begin
277
276
  body = JSON.parse(response.body)
@@ -293,7 +292,6 @@ module WorkOS
293
292
  request_id: request_id,
294
293
  )
295
294
  end
296
- # rubocop:enable Metrics/MethodLength
297
295
  end
298
296
  end
299
297
  end
@@ -2,5 +2,5 @@
2
2
  # typed: strong
3
3
 
4
4
  module WorkOS
5
- VERSION = '2.14.0'
5
+ VERSION = '2.15.0'
6
6
  end
@@ -82,7 +82,7 @@ module WorkOS
82
82
  tolerance: Integer,
83
83
  ).returns(T::Boolean)
84
84
  end
85
- # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
85
+ # rubocop:disable Metrics/AbcSize
86
86
  def verify_header(
87
87
  payload:,
88
88
  sig_header:,
@@ -120,7 +120,7 @@ module WorkOS
120
120
 
121
121
  true
122
122
  end
123
- # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
123
+ # rubocop:enable Metrics/AbcSize
124
124
 
125
125
  # Extracts timestamp and signature hash from WorkOS-Signature header
126
126
  #
@@ -116,6 +116,8 @@ describe WorkOS::AuditLogs do
116
116
  range_end: '2022-08-22T15:04:19.704Z',
117
117
  actions: ['user.signed_in'],
118
118
  actors: ['Jon Smith'],
119
+ actor_names: ['Jon Smith'],
120
+ actor_ids: ['user_123'],
119
121
  targets: %w[user team],
120
122
  )
121
123
 
@@ -62,10 +62,10 @@ describe WorkOS::Events do
62
62
  end
63
63
  end
64
64
 
65
- context 'with the rangeStart and rangeEnd options' do
65
+ context 'with the range_start and range_end options' do
66
66
  it 'forms the proper request to the API' do
67
67
  request_args = [
68
- '/events?rangeStart=2023-01-01T00%3A00%3A00Z&rangeEnd=2023-01-03T00%3A00%3A00Z',
68
+ '/events?range_start=2023-01-01T00%3A00%3A00Z&range_end=2023-01-03T00%3A00%3A00Z',
69
69
  'Content-Type' => 'application/json'
70
70
  ]
71
71
 
@@ -76,8 +76,8 @@ describe WorkOS::Events do
76
76
 
77
77
  VCR.use_cassette 'events/list_events_with_range' do
78
78
  events = described_class.list_events(
79
- rangeStart: '2023-01-01T00:00:00Z',
80
- rangeEnd: '2023-01-03T00:00:00Z',
79
+ range_start: '2023-01-01T00:00:00Z',
80
+ range_end: '2023-01-03T00:00:00Z',
81
81
  )
82
82
 
83
83
  expect(events.data.size).to eq(1)
@@ -6,8 +6,7 @@ http_interactions:
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string:
9
- '{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z","actions":["user.signed_in"],"actors":["Jon
10
- Smith"],"targets":["user","team"]}'
9
+ '{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z","actions":["user.signed_in"],"actors":["Jon Smith"],"actor_names":["Jon Smith"],"actor_ids":["user_123"],"targets":["user","team"]}'
11
10
  headers:
12
11
  Content-Type:
13
12
  - application/json
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.workos.com/events?rangeEnd=2023-01-03T00:00:00Z&rangeStart=2023-01-01T00:00:00Z
5
+ uri: https://api.workos.com/events?range_end=2023-01-03T00:00:00Z&range_start=2023-01-01T00:00:00Z
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workos
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-12 00:00:00.000000000 Z
11
+ date: 2023-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sorbet-runtime