workos 5.14.0 → 5.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6183009c18af059a5674bf77c72ec94126a2bafb5f8e4dda14aeaf892f3f8718
4
- data.tar.gz: 268cc5ee7e878a4b85100c0e546db98d8a55dbffeb21f993c67265c029c99a4b
3
+ metadata.gz: 69f06ffb6d48f24c256d4a75f1f4e42a84386e512ac5db2a4aa8772b2a56ab2f
4
+ data.tar.gz: d1ea70f2447b40577d396e4ecd8354d3bf91dd7de1e5627abccf4ff698095011
5
5
  SHA512:
6
- metadata.gz: dfe47d29f7d33d94ef521e773706e50defed072831386333c10f32b81d60687ffe67519e09c208be7e9c3d5f04cc56e74ef100cc340ea5f653241e636cd32e7e
7
- data.tar.gz: '0036088e5ccee84780ce0e223ca64f8da917024322da5969771eaf5c103f2c5a3a3aab4da805f9111041c803bdd7351280edd39bfeb60ac3f2540b29d8eb4696'
6
+ metadata.gz: f03a281918fb01a2044322b153e6ca8967dae8ed9aa77bf5c0026440fc1d973868500180d06063ed10946bd9227878aab9103dfb3dd4d65b73d92424925d4f65
7
+ data.tar.gz: 7024ecbd59776f8a66a44d991b692da2e2d9c798d305359880adeed14633ab4477740b6f1179a77208efe59bb0b5a52cfa57aa9263ce0ea9fc051007e992f07b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workos (5.14.0)
4
+ workos (5.16.0)
5
5
  encryptor (~> 3.0)
6
6
  jwt (~> 2.8)
7
7
 
@@ -7,7 +7,7 @@ module WorkOS
7
7
  class DirectoryUser < DeprecatedHashWrapper
8
8
  include HashProvider
9
9
 
10
- attr_accessor :id, :idp_id, :emails, :first_name, :last_name, :job_title, :username, :state,
10
+ attr_accessor :id, :idp_id, :email, :emails, :first_name, :last_name, :job_title, :username, :state,
11
11
  :groups, :role, :custom_attributes, :raw_attributes, :directory_id, :organization_id,
12
12
  :created_at, :updated_at
13
13
 
@@ -19,10 +19,20 @@ module WorkOS
19
19
  @directory_id = hash[:directory_id]
20
20
  @organization_id = hash[:organization_id]
21
21
  @idp_id = hash[:idp_id]
22
+ @email = hash[:email]
23
+ # @deprecated Will be removed in a future major version.
24
+ # Enable the `emails` custom attribute in dashboard and pull from customAttributes instead.
25
+ # See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
22
26
  @emails = hash[:emails]
23
27
  @first_name = hash[:first_name]
24
28
  @last_name = hash[:last_name]
29
+ # @deprecated Will be removed in a future major version.
30
+ # Enable the `job_title` custom attribute in dashboard and pull from customAttributes instead.
31
+ # See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
25
32
  @job_title = hash[:job_title]
33
+ # @deprecated Will be removed in a future major version.
34
+ # Enable the `username` custom attribute in dashboard and pull from customAttributes instead.
35
+ # See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
26
36
  @username = hash[:username]
27
37
  @state = hash[:state]
28
38
  @groups = hash[:groups]
@@ -42,6 +52,7 @@ module WorkOS
42
52
  directory_id: directory_id,
43
53
  organization_id: organization_id,
44
54
  idp_id: idp_id,
55
+ email: email,
45
56
  emails: emails,
46
57
  first_name: first_name,
47
58
  last_name: last_name,
@@ -57,6 +68,7 @@ module WorkOS
57
68
  }
58
69
  end
59
70
 
71
+ # @deprecated Will be removed in a future major version. Use {#email} instead.
60
72
  def primary_email
61
73
  primary_email = (emails || []).find { |email| email[:primary] }
62
74
  return primary_email[:value] if primary_email
data/lib/workos/user.rb CHANGED
@@ -8,7 +8,7 @@ module WorkOS
8
8
  include HashProvider
9
9
 
10
10
  attr_accessor :id, :email, :first_name, :last_name, :email_verified,
11
- :profile_picture_url, :created_at, :updated_at
11
+ :profile_picture_url, :last_sign_in_at, :created_at, :updated_at
12
12
 
13
13
  def initialize(json)
14
14
  hash = JSON.parse(json, symbolize_names: true)
@@ -19,6 +19,7 @@ module WorkOS
19
19
  @last_name = hash[:last_name]
20
20
  @email_verified = hash[:email_verified]
21
21
  @profile_picture_url = hash[:profile_picture_url]
22
+ @last_sign_in_at = hash[:last_sign_in_at]
22
23
  @created_at = hash[:created_at]
23
24
  @updated_at = hash[:updated_at]
24
25
  end
@@ -31,6 +32,7 @@ module WorkOS
31
32
  last_name: last_name,
32
33
  email_verified: email_verified,
33
34
  profile_picture_url: profile_picture_url,
35
+ last_sign_in_at: last_sign_in_at,
34
36
  created_at: created_at,
35
37
  updated_at: updated_at,
36
38
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WorkOS
4
- VERSION = '5.14.0'
4
+ VERSION = '5.16.0'
5
5
  end
@@ -229,6 +229,12 @@ describe WorkOS::UserManagement do
229
229
 
230
230
  expect(user.id.instance_of?(String))
231
231
  expect(user.instance_of?(WorkOS::User))
232
+ expect(user.first_name).to eq('Bob')
233
+ expect(user.last_name).to eq('Loblaw')
234
+ expect(user.email).to eq('bob@example.com')
235
+ expect(user.email_verified).to eq(false)
236
+ expect(user.profile_picture_url).to eq(nil)
237
+ expect(user.last_sign_in_at).to eq('2024-02-06T23:13:18.137Z')
232
238
  end
233
239
  end
234
240
  end
@@ -76,7 +76,7 @@ http_interactions:
76
76
  - cloudflare
77
77
  body:
78
78
  encoding: ASCII-8BIT
79
- string: '{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"}'
79
+ string: '{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"last_sign_in_at":"2024-02-06T23:13:18.137Z","created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"}'
80
80
  http_version:
81
81
  recorded_at: Tue, 06 Feb 2024 23:16:59 GMT
82
82
  recorded_with: VCR 5.0.0
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: 5.14.0
4
+ version: 5.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WorkOS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-13 00:00:00.000000000 Z
11
+ date: 2025-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: encryptor