cb-api 22.5.0 → 22.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/cb/clients/saved_search.rb +10 -9
- data/lib/cb/config.rb +2 -2
- data/lib/cb/models/implementations/saved_search.rb +13 -12
- data/lib/cb/responses/saved_search/{singular.rb → create.rb} +6 -23
- data/lib/cb/utils/api.rb +4 -3
- data/lib/cb/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aff53c7029fb4b770eada75260ed3f2be84885b
|
4
|
+
data.tar.gz: 45f0d477bcc9d13a91288531159cf44eb3399c26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588dfc9549c04997f52d7b0e53f7712e3253a58c5d8e14efa1c013f923fcde847ad2c936811301ac2c16a4b3904643462fb32df0d6068c4bbe56f0a1c9d25dcb
|
7
|
+
data.tar.gz: a534fcb3d754f1d6c8009a3acbcca59065949b8656f6db7dbab89a991bcf2b456e22630d95942a76dd2539513a1813eb13b5b6a5851c22839f764e808837b6df
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,9 @@ Version History
|
|
2
2
|
====
|
3
3
|
* All Version bumps are required to update this file as well!!
|
4
4
|
----
|
5
|
+
* 22.6.2 Updating just to test rubygems publishing from travis
|
6
|
+
* 22.6.1 Minor fixes on saved search tests.
|
7
|
+
* 22.6.0 Move saved search create to new API. Request changes from XML to JSON.
|
5
8
|
* 22.5.0 Add clients side-by-side existing requests.
|
6
9
|
* 22.4.0 Add optional resume POST param: entry_path
|
7
10
|
* 22.3.2 Add is_dynamic_screener to application form API
|
@@ -13,9 +13,9 @@ module Cb
|
|
13
13
|
module Clients
|
14
14
|
class SavedSearch < Base
|
15
15
|
def self.create(saved_search)
|
16
|
-
body = saved_search.
|
17
|
-
json = cb_client.cb_post(Cb.configuration.uri_saved_search_create, body: body)
|
18
|
-
|
16
|
+
body = saved_search.create_to_json
|
17
|
+
json = cb_client.cb_post(Cb.configuration.uri_saved_search_create, body: body, headers: create_headers)
|
18
|
+
Responses::SavedSearch::Create.new(json)
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.update(saved_search)
|
@@ -56,6 +56,13 @@ module Cb
|
|
56
56
|
'HostSite' => (host_site.blank? ? Cb.configuration.host_site : host_site)
|
57
57
|
}
|
58
58
|
end
|
59
|
+
|
60
|
+
def self.create_headers
|
61
|
+
{
|
62
|
+
'developerkey' => Cb.configuration.dev_key,
|
63
|
+
'Content-Type' => 'application/json'
|
64
|
+
}
|
65
|
+
end
|
59
66
|
|
60
67
|
def self.retrieve_query(oauth_token)
|
61
68
|
{
|
@@ -72,12 +79,6 @@ module Cb
|
|
72
79
|
}
|
73
80
|
end
|
74
81
|
|
75
|
-
def self.singular_model_response(json_hash, external_user_id = nil, external_id = nil)
|
76
|
-
json_hash['ExternalUserID'] = external_user_id unless external_user_id.nil?
|
77
|
-
json_hash['ExternalID'] = external_id unless external_id.nil?
|
78
|
-
Responses::SavedSearch::Singular.new(json_hash)
|
79
|
-
end
|
80
|
-
|
81
82
|
def self.replace_uri_field(uri_string, field, replacement)
|
82
83
|
uri_string.gsub(field, replacement)
|
83
84
|
end
|
data/lib/cb/config.rb
CHANGED
@@ -80,8 +80,8 @@ module Cb
|
|
80
80
|
@uri_resume_post ||= '/consumer/resumedocuments'
|
81
81
|
@uri_resumes ||= '/consumer/resumes'
|
82
82
|
@uri_saved_search_retrieve ||= '/cbapi/savedsearches/:did'
|
83
|
-
@uri_saved_search_create ||= '/
|
84
|
-
@uri_saved_search_update ||= '/cbapi/
|
83
|
+
@uri_saved_search_create ||= '/cbapi/savedsearches'
|
84
|
+
@uri_saved_search_update ||= '/cbapi/savedsearches'
|
85
85
|
@uri_saved_search_delete ||= '/cbapi/savedsearches/:did'
|
86
86
|
@uri_saved_search_list ||= '/cbapi/savedsearches'
|
87
87
|
@uri_subscription_retrieve ||= '/v2/user/subscription/retrieve'
|
@@ -36,18 +36,18 @@ module Cb
|
|
36
36
|
@search_parameters = SearchParameters.new(args['SavedSearchParameters'] || {})
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
39
|
+
def create_to_json
|
40
|
+
hash = {
|
41
|
+
'SiteID' => site_id,
|
42
|
+
'Cobrand' => cobrand,
|
43
|
+
'EmailDeliveryDay' => email_delivery_day,
|
44
|
+
'IsDailyEmail' => is_daily_email,
|
45
|
+
'userOAuthToken' => user_oauth_token,
|
46
|
+
'HostSite' => host_site,
|
47
|
+
'SearchName' => search_name,
|
48
|
+
'SavedSearchParameters' => search_parameters.to_hash
|
49
|
+
}
|
50
|
+
hash.to_json
|
51
51
|
end
|
52
52
|
|
53
53
|
def create_anon_to_xml
|
@@ -74,6 +74,7 @@ module Cb
|
|
74
74
|
'HostSite' => host_site,
|
75
75
|
'SiteID' => site_id,
|
76
76
|
'Cobrand' => cobrand,
|
77
|
+
'EmailDeliveryDay' => email_delivery_day,
|
77
78
|
'IsDailyEmail' => is_daily_email,
|
78
79
|
'userOAuthToken' => user_oauth_token,
|
79
80
|
'SavedSearchParameters' => search_parameters.to_hash
|
@@ -11,46 +11,29 @@
|
|
11
11
|
module Cb
|
12
12
|
module Responses
|
13
13
|
module SavedSearch
|
14
|
-
class
|
14
|
+
class Create < ApiResponse
|
15
15
|
protected
|
16
16
|
|
17
17
|
def validate_api_hash
|
18
|
-
required_response_field(
|
19
|
-
required_response_field(model_node, response[root_node])
|
18
|
+
required_response_field(collection_node, response)
|
20
19
|
end
|
21
20
|
|
22
21
|
def hash_containing_metadata
|
23
|
-
response
|
22
|
+
response
|
24
23
|
end
|
25
24
|
|
26
25
|
def extract_models
|
27
|
-
# these IDs comes back in weird places in the response hash,
|
28
|
-
# we need to move them around a little bit so things work correctly.
|
29
|
-
model_hash[user_id_node] = response[user_id_node]
|
30
|
-
model_hash[search_id_node] = response[search_id_node]
|
31
26
|
Models::SavedSearch.new(model_hash)
|
32
27
|
end
|
33
28
|
|
34
29
|
private
|
35
30
|
|
36
|
-
def
|
37
|
-
'
|
38
|
-
end
|
39
|
-
|
40
|
-
def model_node
|
41
|
-
'SavedSearch'
|
42
|
-
end
|
43
|
-
|
44
|
-
def user_id_node
|
45
|
-
'ExternalUserID'
|
46
|
-
end
|
47
|
-
|
48
|
-
def search_id_node
|
49
|
-
'ExternalID'
|
31
|
+
def collection_node
|
32
|
+
'Results'
|
50
33
|
end
|
51
34
|
|
52
35
|
def model_hash
|
53
|
-
response[
|
36
|
+
response[collection_node][0]
|
54
37
|
end
|
55
38
|
end
|
56
39
|
end
|
data/lib/cb/utils/api.rb
CHANGED
@@ -34,9 +34,10 @@ module Cb
|
|
34
34
|
outputjson: Cb.configuration.use_json.to_s
|
35
35
|
|
36
36
|
self.class.default_timeout Cb.configuration.time_out
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
h = { 'developerkey' => Cb.configuration.dev_key }
|
38
|
+
h.merge! ({ 'accept-encoding' => 'deflate, gzip' }) unless Cb.configuration.debug_api
|
39
|
+
h.merge! headers
|
40
|
+
self.class.headers(h)
|
40
41
|
end
|
41
42
|
|
42
43
|
def cb_get(path, options = {}, &block)
|
data/lib/cb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 22.
|
4
|
+
version: 22.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The CareerBuilder.com Niche and Consumer Development teams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -328,10 +328,10 @@ files:
|
|
328
328
|
- lib/cb/responses/nil_model.rb
|
329
329
|
- lib/cb/responses/resumes/resume.rb
|
330
330
|
- lib/cb/responses/resumes/resume_document.rb
|
331
|
+
- lib/cb/responses/saved_search/create.rb
|
331
332
|
- lib/cb/responses/saved_search/delete.rb
|
332
333
|
- lib/cb/responses/saved_search/list.rb
|
333
334
|
- lib/cb/responses/saved_search/retrieve.rb
|
334
|
-
- lib/cb/responses/saved_search/singular.rb
|
335
335
|
- lib/cb/responses/saved_search/update.rb
|
336
336
|
- lib/cb/responses/timing.rb
|
337
337
|
- lib/cb/responses/user/change_password.rb
|
@@ -371,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
371
371
|
version: '0'
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
|
-
rubygems_version: 2.5
|
374
|
+
rubygems_version: 2.4.5
|
375
375
|
signing_key:
|
376
376
|
specification_version: 4
|
377
377
|
summary: Ruby wrapper around Careerbuilder Public API.
|