zuora_api 1.7.81 → 1.8.00

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: e6c33a8033a33f0b2104721db4a09233874c8ee61df45a9d1167ec7301b5f9bf
4
- data.tar.gz: f1fc6c8c62f7c7e054d84775cab9c283cb36bfde243e57cbe3f7f4eed5f80525
3
+ metadata.gz: e79d63055902d66670dad6abed776b5c02ccb422b886bad2e632624e43eb16ba
4
+ data.tar.gz: 8abaee55dad2d4c3636bcbd08159a26dc403a8041aecb7d2ce2f6d84bd9f3917
5
5
  SHA512:
6
- metadata.gz: 2894edcd05d8d4f5a94a725c705050d5ed63d582caebc721e91184adb6853daa036d5c13f942849ef665726c2005dd440212e1dde106cf643ea7fe6c5593b695
7
- data.tar.gz: 4f933ca4535657b0f30feecc70412052cca33c99b1327a919d6c7f9966b16ce9663775c54af18c8665ad83838e8eafd16434253d7190fde8d3a7c6ff0a876758
6
+ metadata.gz: 72165d5892a404b6e25c6f32e83e52065a23837eeb7f4d72a40f13e7c642c460362a3c4ed83b51760e5efac650c5eaffc4d4baa1b97b6c980818273af3fa9af1
7
+ data.tar.gz: 271b546b700d026e9ac12a22418eb90fc45a2a2b1bd66f872586a5552a4dfe703cb95f9f7dd78cb38960d4885a65e20acab0095ab0a2b5c5b3339295b129b995
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .idea
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,63 @@
1
+ image: ruby:2.6
2
+ stages:
3
+ - setup
4
+ - test
5
+ - deploy
6
+
7
+ setup:
8
+ stage: setup
9
+ allow_failure: true
10
+ cache:
11
+ key: gems
12
+ paths:
13
+ - vendor/bundle
14
+ script:
15
+ - apt-get update -qy
16
+ - apt-get install -y nodejs
17
+ - bundle install
18
+
19
+ rubocop-testing:
20
+ stage: test
21
+ allow_failure: true
22
+ script:
23
+ - gem install rubocop
24
+ - rubocop --lint
25
+
26
+ security-testing:
27
+ stage: test
28
+ allow_failure: true
29
+ script:
30
+ - gem install brakeman
31
+ - brakeman
32
+
33
+ rspec-testing:
34
+ stage: test
35
+ script:
36
+ - bundle install
37
+ - rspec
38
+
39
+ rubygems-deploy:
40
+ stage: deploy
41
+ allow_failure: false
42
+ script:
43
+ - echo "deb http://ftp.us.debian.org/debian testing main contrib non-free" >> /etc/apt/sources.list
44
+ - apt-get update
45
+ - apt-get install -y git
46
+ - apt-get clean all
47
+ - gem install dpl
48
+ - if [[ "staging" == $CI_BUILD_REF_SLUG ]];then export VERSION=`git describe --match "[0-9]*\.[0-9]*\.[0-9]*[a-z]" --abbrev=0 --tags HEAD`; fi
49
+ - if [[ "master" == $CI_BUILD_REF_SLUG ]];then export VERSION=`git describe --exclude "[0-9]*\.[0-9]*\.[0-9]*[a-z]" --abbrev=0 --tags HEAD`; fi
50
+ - echo $VERSION
51
+ - sed -i "s/0.0.1/$VERSION/" lib/zuora_api/version.rb
52
+ - git add lib/zuora_api/version.rb
53
+ - git config --global user.email "connect@zuora.com"
54
+ - git config --global user.name "Connect Automation"
55
+ - git commit -m "Automated Version Update $VERSION"
56
+ - bundle install
57
+ - gem install rake
58
+ - version=$(rake install | grep -o 'pkg/zuora_api-.*gem')
59
+ - curl -u $USERNAME:$PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
60
+ - gem push $version
61
+ only:
62
+ - master
63
+ - staging
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ before_install: gem install bundler -v 1.12.5
data/CHANGELOG.md ADDED
@@ -0,0 +1,105 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## [1.7.07] - 2018-9-10
5
+ ### Changed
6
+ - Cookie name for service endpoint integration
7
+
8
+ ## [1.7.06] - 2018-8-25
9
+ ### Added
10
+ - Retry for 502/503
11
+ - Standard exception for 504
12
+
13
+ ## [1.7.05] - 2018-8-25
14
+ ### Added
15
+ - Added support for oauth token forbidden
16
+
17
+ ## [1.7.02] - 2018-8-23
18
+ ### Added
19
+ - Added mulit part support for rest call
20
+
21
+ ## [1.7.01] - 2018-8-06
22
+ ### Changed
23
+ - Changed library used to determine host
24
+ - Added retry for 504 timouts in file download
25
+
26
+ ## [1.7.00] - 2018-8-05
27
+ ### Changed
28
+ - Raise proper exception when oauth client is from deactivated user.
29
+ - Support for rails < 6
30
+
31
+ ## [1.6.53] - 2018-7-29
32
+ ### Changed
33
+ - Don't attempt zsession login if bearer token is bad
34
+
35
+ ## [1.6.51 - 1.6.51] - 2018-7-22
36
+ ### Changed
37
+ - Retry on address not available.
38
+
39
+ ## [1.6.47 - 1.6.48] - 2018-6-26
40
+ ### Changed
41
+ - Changed error raise statements when incorrect credentials are supplied to Basic/Oauth Logins
42
+
43
+ ## [1.6.45] - 2018-5-30
44
+ ### Changed
45
+ - Fix retry so headers are reinstaniated on session failure.
46
+
47
+ ## [1.6.41] - 2018-5-30
48
+ ### Changed
49
+ - Retry added on SSL connection failure
50
+
51
+ ## [1.6.39-1.6.40] - 2018-5-30
52
+ ### Changed
53
+ - Added validation to fix bad urls entered into object initialization
54
+
55
+ ## [1.6.38] - 2018-5-26
56
+ ### Changed
57
+ - HttpParty validation before code extraction
58
+
59
+ ## [1.6.37] - 2018-5-23
60
+ ### Added
61
+ - Added method to determine rest endpoint domain
62
+
63
+ ## [1.6.36] - 2018-5-22
64
+ ### Changed
65
+ - Fixed zuora staging 2 endpoint
66
+
67
+ ## [1.6.33] - 2018-5-15
68
+ ### Changed
69
+ - Added Errno::EHOSTUNREACH to list of retriable error codes
70
+
71
+ ## [1.6.32] - 2018-5-14
72
+ ### Changed
73
+ - Don't log fatal errors, allow application to decide for file download
74
+ - Don't change api url if the user set a high api url
75
+
76
+ ###Removed
77
+ - Force encoding
78
+
79
+ ## [1.6.28] - 2018-3-12
80
+ ### Added
81
+ - Way to avoid force encoding for filedownload
82
+
83
+ ## [1.6.28] - 2018-3-12
84
+ ### Added
85
+ - Way to avoid force encoding for filedownload
86
+
87
+ ## [1.6.22] - 2019-01-03
88
+ ### Changed
89
+ - get_identity method - supports ZSession auth now
90
+ - updated rspecs accordingly
91
+
92
+ ## [1.6.18] - 2018-12-06
93
+ ### Added
94
+ - zconnect_provider attribute accessor for identifying ZConnect cookies
95
+ - Methods for Hallway integration:
96
+ - get_identity
97
+ - get_full_nav
98
+ - set_nav
99
+ - refresh_nav
100
+ - get_oauth_client
101
+
102
+ ### Changed
103
+ - The way environment and region are set
104
+
105
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in zuora.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,117 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ zuora_api (1.8.00)
5
+ httparty
6
+ nokogiri
7
+ railties (>= 4.1.0, < 6)
8
+ rubyzip
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actionpack (5.2.4.4)
14
+ actionview (= 5.2.4.4)
15
+ activesupport (= 5.2.4.4)
16
+ rack (~> 2.0, >= 2.0.8)
17
+ rack-test (>= 0.6.3)
18
+ rails-dom-testing (~> 2.0)
19
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
20
+ actionview (5.2.4.4)
21
+ activesupport (= 5.2.4.4)
22
+ builder (~> 3.1)
23
+ erubi (~> 1.4)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
26
+ activesupport (5.2.4.4)
27
+ concurrent-ruby (~> 1.0, >= 1.0.2)
28
+ i18n (>= 0.7, < 2)
29
+ minitest (~> 5.1)
30
+ tzinfo (~> 1.1)
31
+ addressable (2.5.2)
32
+ public_suffix (>= 2.0.2, < 4.0)
33
+ builder (3.2.4)
34
+ concurrent-ruby (1.1.7)
35
+ crack (0.4.3)
36
+ safe_yaml (~> 1.0.0)
37
+ crass (1.0.6)
38
+ diff-lcs (1.3)
39
+ docile (1.3.1)
40
+ erubi (1.9.0)
41
+ hashdiff (0.3.7)
42
+ httparty (0.18.1)
43
+ mime-types (~> 3.0)
44
+ multi_xml (>= 0.5.2)
45
+ i18n (1.8.5)
46
+ concurrent-ruby (~> 1.0)
47
+ json (2.1.0)
48
+ loofah (2.7.0)
49
+ crass (~> 1.0.2)
50
+ nokogiri (>= 1.5.9)
51
+ method_source (1.0.0)
52
+ mime-types (3.3.1)
53
+ mime-types-data (~> 3.2015)
54
+ mime-types-data (3.2020.0512)
55
+ mini_portile2 (2.4.0)
56
+ minitest (5.14.2)
57
+ multi_xml (0.6.0)
58
+ nokogiri (1.10.10)
59
+ mini_portile2 (~> 2.4.0)
60
+ public_suffix (3.0.3)
61
+ rack (2.2.3)
62
+ rack-test (1.1.0)
63
+ rack (>= 1.0, < 3)
64
+ rails-dom-testing (2.0.3)
65
+ activesupport (>= 4.2.0)
66
+ nokogiri (>= 1.6)
67
+ rails-html-sanitizer (1.3.0)
68
+ loofah (~> 2.3)
69
+ railties (5.2.4.4)
70
+ actionpack (= 5.2.4.4)
71
+ activesupport (= 5.2.4.4)
72
+ method_source
73
+ rake (>= 0.8.7)
74
+ thor (>= 0.19.0, < 2.0)
75
+ rake (10.5.0)
76
+ rspec (3.8.0)
77
+ rspec-core (~> 3.8.0)
78
+ rspec-expectations (~> 3.8.0)
79
+ rspec-mocks (~> 3.8.0)
80
+ rspec-core (3.8.0)
81
+ rspec-support (~> 3.8.0)
82
+ rspec-expectations (3.8.1)
83
+ diff-lcs (>= 1.2.0, < 2.0)
84
+ rspec-support (~> 3.8.0)
85
+ rspec-mocks (3.8.0)
86
+ diff-lcs (>= 1.2.0, < 2.0)
87
+ rspec-support (~> 3.8.0)
88
+ rspec-support (3.8.0)
89
+ rubyzip (2.3.0)
90
+ safe_yaml (1.0.4)
91
+ simplecov (0.16.1)
92
+ docile (~> 1.1)
93
+ json (>= 1.8, < 3)
94
+ simplecov-html (~> 0.10.0)
95
+ simplecov-html (0.10.2)
96
+ thor (1.0.1)
97
+ thread_safe (0.3.6)
98
+ tzinfo (1.2.7)
99
+ thread_safe (~> 0.1)
100
+ webmock (3.4.2)
101
+ addressable (>= 2.3.6)
102
+ crack (>= 0.3.2)
103
+ hashdiff
104
+
105
+ PLATFORMS
106
+ ruby
107
+
108
+ DEPENDENCIES
109
+ bundler (~> 1.12)
110
+ rake (~> 10.0)
111
+ rspec (~> 3.0)
112
+ simplecov
113
+ webmock
114
+ zuora_api!
115
+
116
+ BUNDLED WITH
117
+ 1.17.3
data/README.md CHANGED
@@ -145,13 +145,3 @@ Both do the same thing except one returns a url(data_export_insights) to downloa
145
145
  objectype: "ACCOUNT/USER"
146
146
 
147
147
  segmentuuid: A single or array of string or int of a segment uuid(s) that you get from the describe call. The csv holds a column with a bool that represents if that User or Account belongs to that segment.
148
-
149
- ### License Information
150
- IN THE EVENT YOU ARE AN EXISTING ZUORA CUSTOMER, USE OF THIS SOFTWARE IS GOVERNED
BY THE MIT LICENSE SET FORTH BELOW AND NOT THE MASTER SUBSCRIPTION AGREEMENT OR OTHER COMMERCIAL AGREEMENT ENTERED INTO BETWEEN YOU AND ZUORA (“AGREEMENT”). FOR THE AVOIDANCE OF DOUBT, ZUORA’S OBLIGATIONS WITH RESPECT TO TECHNICAL SUPPORT, UPTIME, INDEMNIFICATION, AND SECURITY SET FORTH IN THE AGREEMENT DO NOT APPLY TO THE USE OF THIS SOFTWARE.
151
-
152
- Copyright 2021 Zuora, Inc.
153
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
154
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
155
-
156
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
157
-
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "zuora"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -40,19 +40,6 @@ module ZuoraAPI
40
40
  def to_s
41
41
  @message || @default_message
42
42
  end
43
-
44
- def parse_message(message)
45
- case message
46
- when /^Invalid Oauth Client Id$/, /^Unable to generate token.$/
47
- @message = "Invalid login, please check client ID and Client Secret or URL endpoint"
48
- when /^Forbidden$/
49
- @message = "The user associated to OAuth credential set has been deactivated."
50
- when /^Invalid login. User name and password do not match.$/
51
- @message = "Invalid login, please check username and password or URL endpoint"
52
- else
53
- @message = message
54
- end
55
- end
56
43
  end
57
44
 
58
45
  class BadEntityError < Error
@@ -190,15 +177,14 @@ module ZuoraAPI
190
177
  end
191
178
 
192
179
  class ZuoraAPITemporaryError < Error
193
- attr_reader :code, :response, :errors
180
+ attr_reader :code, :response
194
181
  attr_writer :default_message
195
182
 
196
- def initialize(message = nil, response = nil, errors = [], successes = [], *args)
183
+ def initialize(message = nil,response=nil, errors = [], successes = [], *args)
197
184
  @code = response.class.to_s == "HTTParty::Response" ? response.code : nil
198
185
  @message = parse_message(message)
199
186
  @response = response
200
187
  @default_message = "There is a temporary error with zuora system."
201
- @errors = errors
202
188
  end
203
189
 
204
190
  def to_s
@@ -238,7 +224,7 @@ module ZuoraAPI
238
224
  end
239
225
  end
240
226
 
241
- class ZuoraAPIReadTimeout < Timeout::Error
227
+ class ZuoraAPIReadTimeout < Net::ReadTimeout
242
228
  attr_reader :code, :response, :request
243
229
  attr_writer :default_message
244
230