sourcescrub 0.0.7 → 0.0.8

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: c425f778c050e471a59f52d8101bc7d5b2bd926e333292525ebe9ad67d4dce65
4
- data.tar.gz: b98238083a2c65ec56cf6d45e82141c2b2f70a9ffde7eaa6be46a989f0c30a01
3
+ metadata.gz: 3f41dea3cdbae246c59a9d375d31d5eff2f1897b09140415efc832a25efe52c2
4
+ data.tar.gz: 3ac121521449233ecca410aed6a1a6f3d8071f60162c2d9edc727a39284d9855
5
5
  SHA512:
6
- metadata.gz: b5b33a6b315e789588f09039cd5b62d1e038833019f2ada2b31b9eff4f99e967745db6a65698a5f4226e6bdaa3d47a62492d916e990f6ba3815a926da5526418
7
- data.tar.gz: 17be5421cb1d3008de1248befc059f9e481424b966106a80afc4622f375e594ca65e98b071522b970955b2692d9634efd4f53e4d14db028bc6827b5aa3b042ec
6
+ metadata.gz: 5a08fc46e8376a96db5e1d32d5697f9a3b34f8190e7be90d84d5f3fb196f45ccf063953a56efd73b087608a4d19477a907ce7e8f69a2f4ec52ddc4a8314bd1ac
7
+ data.tar.gz: 759e47f3afd856181b36d79f7cb37e9894c35eca866087ef0d1266b9616c262b86764ac64f1084e5f1dee61ece13a14f617d00fd0c2350843ee936986c65c00b
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+
4
+ ## [0.0.8] - 2020-08-13
5
+
6
+ - Implement API to request all compnies - `client.companies`
7
+
8
+ ## [0.0.7] - 2020-08-04
9
+
10
+ - Get source data and source compaines - `client.source_companies(source_id)`
11
+ - Get company's employeerange data by domain - `client.company_cards('monday.com', { card_id: 'employeerange' })`
12
+ - Get company's employees data by domain - `client.company_cards('monday.com', { card_id: 'employees' })`
13
+
3
14
  ## [0.0.3] - 2020-06-20
4
15
 
5
16
  - Implement API to request token by user certificate
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sourcescrub (0.0.7)
4
+ sourcescrub (0.0.8)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -26,6 +26,13 @@ module Sourcescrub
26
26
  @card_id
27
27
  ].compact.join('/')
28
28
  end
29
+
30
+ def search_url
31
+ [
32
+ 'search',
33
+ Models::Company::ENDPOINT
34
+ ].compact.join('/')
35
+ end
29
36
  end
30
37
  end
31
38
  end
@@ -18,14 +18,24 @@ module Sourcescrub
18
18
  { 'Authorization' => "Bearer #{@token}" }
19
19
  end
20
20
 
21
+ def companies(args = { limit: 100, offset: 0 })
22
+ api = companies_api(args)
23
+
24
+ Models::CompanyItems.new.parse_response_items(
25
+ nil,
26
+ api.kclass_name,
27
+ get(api.search_url, api.args)
28
+ )
29
+ end
30
+
21
31
  def company(domain, args = {})
22
- api = companies_api(domain, args)
32
+ api = company_api(domain, args)
23
33
 
24
34
  api.sobject.parse_response get(api.request_url, api.args)
25
35
  end
26
36
 
27
37
  def company_cards(domain, args = {})
28
- api = companies_api(domain, args.merge(model_type: company_card_mappings[args[:card_id]]))
38
+ api = company_api(domain, args.merge(model_type: company_card_mappings[args[:card_id]]))
29
39
 
30
40
  Models::CompanyItems.new.parse_response_items(
31
41
  domain,
@@ -62,8 +72,15 @@ module Sourcescrub
62
72
 
63
73
  private
64
74
 
65
- def companies_api(domain, args)
75
+ def companies_api(args)
66
76
  @companies_api ||= Apis::Companies.new(
77
+ nil,
78
+ { model_type: 'company' }.merge(args)
79
+ )
80
+ end
81
+
82
+ def company_api(domain, args)
83
+ @company_api ||= Apis::Companies.new(
67
84
  domain,
68
85
  { model_type: 'company' }.merge(args)
69
86
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sourcescrub
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sourcescrub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Encore Shao
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-12 00:00:00.000000000 Z
11
+ date: 2020-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday