ibm_tools-people 1.1.0 → 1.1.1

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: 4c524e17db9198566e6ae5884cd64653a62b05325b560c05e4e8f57b9ac3526a
4
- data.tar.gz: 8156b94d0aab35e6cd98078e40160bed249a945453dc4149e014093fd970d465
3
+ metadata.gz: 51f4d6a531af302ea58c562547649c271bb6c7d516aae5499850c75cd10d9dc0
4
+ data.tar.gz: 923ef485df6bfa6edfa82fdc385f3d8213a26e80a2739b17073c42f3bde0c318
5
5
  SHA512:
6
- metadata.gz: db572c5d69b6b71c783aa7c878f0f1bc4fa00f0290505883c080815302682a58fa9ad7ab509870ac95774e3d7cc2427415c423656d37116d677749cd688d8af8
7
- data.tar.gz: 3dff16c40a3da2133a0233db918afd09ea3569c5b7c375f53db08f2a5e390eb8b33dd374cbc7745dd870b74e9991ccf74e1ce2c0951f15c8c6c314e903b0a138
6
+ metadata.gz: 4a2493f5506e630bc8f187640ecab57f892fce875d4c4230c0445530d03f7a7e8f9b04ecdb0e53c7931387b0ee7415fce40774c04aaff96d350e535ce537b773
7
+ data.tar.gz: 4386b1dac3ecd4e44681ba76a4ec30f863a25f6038586a56298733eea3ab345ba6cff48cc7849b58895f604176aa6cb83ab365561df5e9dd428baf349ceead06
data/README.md CHANGED
@@ -115,7 +115,7 @@ Since there are different kind of ways to search the user and to ensure readabil
115
115
  | query | String | `IbmTools::People.info(query: 'John Doe')`
116
116
  | token | String | `token: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf`*
117
117
 
118
- > Token can be used as a argument of the module, but it will also look for the envrionment variable `IBM_PEOPLE_API_KEY`
118
+ > Token can be used as a argument of the module, but it will also look for the environment variable `IBM_PEOPLE_API_KEY`
119
119
 
120
120
  #### Options (`optional`)
121
121
 
@@ -217,7 +217,7 @@ Since there are different kind of ways to search the user and to ensure readabil
217
217
  | email | String | `IbmTools::People.info(email: 'johndoe@ibm.com')`
218
218
  | token | String | `token: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf`*
219
219
 
220
- > Token can be used as a argument of the module, but it will also look for the envrionment variable `IBM_PEOPLE_API_KEY`
220
+ > Token can be used as a argument of the module, but it will also look for the environment variable `IBM_PEOPLE_API_KEY`
221
221
 
222
222
  #### Schemas
223
223
 
@@ -245,7 +245,7 @@ Since there are different kind of ways to search the user and to ensure readabil
245
245
  | email | String | `IbmTools::People.info(email: 'johndoe@ibm.com')`
246
246
  | token | String | `token: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf`*
247
247
 
248
- > Token can be used as a argument of the module, but it will also look for the envrionment variable `IBM_PEOPLE_API_KEY`
248
+ > Token can be used as a argument of the module, but it will also look for the environment variable `IBM_PEOPLE_API_KEY`
249
249
 
250
250
 
251
251
  #### Schemas
@@ -274,7 +274,7 @@ Since there are different kind of ways to search the user and to ensure readabil
274
274
  | email | String | `IbmTools::People.info(email: 'johndoe@ibm.com')`
275
275
  | token | String | `token: nbvcsw23456yhbvfrt6789olkmnhyu8i9olkmnhgtrdf`*
276
276
 
277
- > Token can be used as a argument of the module, but it will also look for the envrionment variable `IBM_PEOPLE_API_KEY`
277
+ > Token can be used as a argument of the module, but it will also look for the environment variable `IBM_PEOPLE_API_KEY`
278
278
 
279
279
  #### Schemas
280
280
 
@@ -5,7 +5,8 @@ module IbmTools
5
5
  module People
6
6
  module Profile
7
7
  class Skills < Search
8
- def initialize(query)
8
+ def initialize(query, token = nil)
9
+ @token = token
9
10
  @response = HTTParty.get(uri(query: query), header: headers)
10
11
  end
11
12
 
@@ -21,6 +22,7 @@ module IbmTools
21
22
 
22
23
  def headers
23
24
  {
25
+ 'X-UP-API-KEY': @token,
24
26
  'Content-Type': 'application/json',
25
27
  accept: 'application/json'
26
28
  }
@@ -5,7 +5,8 @@ module IbmTools
5
5
  module People
6
6
  module Profile
7
7
  class Teams < Search
8
- def initialize(query)
8
+ def initialize(query, token = nil)
9
+ @token = token
9
10
  @response = HTTParty.get(uri(query: query), header: headers)
10
11
  end
11
12
 
@@ -21,6 +22,7 @@ module IbmTools
21
22
 
22
23
  def headers
23
24
  {
25
+ 'X-UP-API-KEY': @token,
24
26
  'Content-Type': 'application/json',
25
27
  accept: 'application/json'
26
28
  }
@@ -6,8 +6,9 @@ module IbmTools
6
6
  module People
7
7
  module Profile
8
8
  class Typeahead < Search
9
- def initialize(query, serial: '000000', limit: 10, start: 0)
9
+ def initialize(query, token = nil, serial: '000000', limit: 10, start: 0)
10
10
  uri = "#{IbmTools::People::BLUEPAGES_V1_URI}?userId=#{serial}&rows=#{limit}&start=#{start}&query=#{query}&searchConfig=typeahead_search"
11
+ @token = token
11
12
  @response = HTTParty.get(uri, header: headers, format: :plain)
12
13
  end
13
14
 
@@ -19,6 +20,7 @@ module IbmTools
19
20
 
20
21
  def headers
21
22
  {
23
+ 'X-UP-API-KEY': @token,
22
24
  'Content-Type': 'application/json',
23
25
  accept: 'application/json'
24
26
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  module IbmTools
4
4
  module People
5
- VERSION = "1.1.0"
5
+ VERSION = "1.1.1"
6
6
  BLUEPAGES_V3_URI = "https://w3-unifiedprofile-api.dal1a.cirrus.ibm.com/v3/profiles"
7
7
  BLUEPAGES_V1_URI = "https://w3-unifiedprofile-search.dal1a.cirrus.ibm.com/search"
8
8
  EMAIL_REGEX = %r{\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z}i
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibm_tools-people
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-24 00:00:00.000000000 Z
11
+ date: 2024-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty