easypost 4.8.1 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +5 -0
- data/.github/workflows/ci.yml +34 -5
- data/.gitignore +27 -20
- data/CHANGELOG.md +56 -0
- data/Makefile +30 -11
- data/README.md +111 -45
- data/UPGRADE_GUIDE.md +119 -0
- data/VERSION +1 -1
- data/easypost.gemspec +14 -10
- data/lib/easypost/client.rb +178 -0
- data/lib/easypost/connection.rb +2 -4
- data/lib/easypost/constants.rb +15 -0
- data/lib/easypost/errors/api/api_error.rb +108 -0
- data/lib/easypost/errors/api/bad_request_error.rb +6 -0
- data/lib/easypost/errors/api/connection_error.rb +6 -0
- data/lib/easypost/errors/api/external_api_error.rb +18 -0
- data/lib/easypost/errors/api/forbidden_error.rb +6 -0
- data/lib/easypost/errors/api/gateway_timeout_error.rb +6 -0
- data/lib/easypost/errors/api/internal_server_error.rb +6 -0
- data/lib/easypost/errors/api/invalid_request_error.rb +6 -0
- data/lib/easypost/errors/api/method_not_allowed_error.rb +6 -0
- data/lib/easypost/errors/api/not_found_error.rb +6 -0
- data/lib/easypost/errors/api/payment_error.rb +6 -0
- data/lib/easypost/errors/api/proxy_error.rb +6 -0
- data/lib/easypost/errors/api/rate_limit_error.rb +6 -0
- data/lib/easypost/errors/api/redirect_error.rb +6 -0
- data/lib/easypost/errors/api/retry_error.rb +6 -0
- data/lib/easypost/errors/api/service_unavailable_error.rb +6 -0
- data/lib/easypost/errors/api/ssl_error.rb +6 -0
- data/lib/easypost/errors/api/timeout_error.rb +6 -0
- data/lib/easypost/errors/api/unauthorized_error.rb +6 -0
- data/lib/easypost/errors/api/unknown_api_error.rb +6 -0
- data/lib/easypost/errors/easy_post_error.rb +7 -0
- data/lib/easypost/errors/end_of_pagination_error.rb +7 -0
- data/lib/easypost/errors/filtering_error.rb +4 -0
- data/lib/easypost/errors/invalid_object_error.rb +4 -0
- data/lib/easypost/errors/invalid_parameter_error.rb +11 -0
- data/lib/easypost/errors/missing_parameter_error.rb +9 -0
- data/lib/easypost/errors/signature_verification_error.rb +4 -0
- data/lib/easypost/errors.rb +32 -0
- data/lib/easypost/hooks/request_context.rb +16 -0
- data/lib/easypost/hooks/response_context.rb +23 -0
- data/lib/easypost/hooks.rb +34 -0
- data/lib/easypost/http_client.rb +117 -0
- data/lib/easypost/internal_utilities.rb +66 -0
- data/lib/easypost/models/address.rb +5 -0
- data/lib/easypost/models/api_key.rb +5 -0
- data/lib/easypost/models/base.rb +58 -0
- data/lib/easypost/models/batch.rb +5 -0
- data/lib/easypost/models/brand.rb +5 -0
- data/lib/easypost/{carbon_offset.rb → models/carbon_offset.rb} +1 -1
- data/lib/easypost/models/carrier_account.rb +5 -0
- data/lib/easypost/models/customs_info.rb +5 -0
- data/lib/easypost/models/customs_item.rb +5 -0
- data/lib/easypost/models/end_shipper.rb +5 -0
- data/lib/easypost/models/error.rb +21 -0
- data/lib/easypost/models/event.rb +5 -0
- data/lib/easypost/{insurance.rb → models/insurance.rb} +1 -1
- data/lib/easypost/models/order.rb +9 -0
- data/lib/easypost/models/parcel.rb +5 -0
- data/lib/easypost/models/payload.rb +5 -0
- data/lib/easypost/models/payment_method.rb +5 -0
- data/lib/easypost/models/pickup.rb +9 -0
- data/lib/easypost/{pickup_rate.rb → models/pickup_rate.rb} +1 -1
- data/lib/easypost/{postage_label.rb → models/postage_label.rb} +1 -1
- data/lib/easypost/models/rate.rb +5 -0
- data/lib/easypost/models/referral.rb +5 -0
- data/lib/easypost/{refund.rb → models/refund.rb} +1 -1
- data/lib/easypost/models/report.rb +5 -0
- data/lib/easypost/models/scan_form.rb +6 -0
- data/lib/easypost/models/shipment.rb +10 -0
- data/lib/easypost/{tax_identifier.rb → models/tax_identifier.rb} +1 -1
- data/lib/easypost/models/tracker.rb +5 -0
- data/lib/easypost/models/user.rb +5 -0
- data/lib/easypost/models/webhook.rb +6 -0
- data/lib/easypost/models.rb +35 -0
- data/lib/easypost/services/address.rb +50 -0
- data/lib/easypost/services/api_key.rb +8 -0
- data/lib/easypost/services/base.rb +27 -0
- data/lib/easypost/services/batch.rb +53 -0
- data/lib/easypost/services/beta_rate.rb +12 -0
- data/lib/easypost/services/beta_referral_customer.rb +40 -0
- data/lib/easypost/services/billing.rb +75 -0
- data/lib/easypost/services/carrier_account.rb +44 -0
- data/lib/easypost/services/carrier_metadata.rb +22 -0
- data/lib/easypost/services/customs_info.rb +17 -0
- data/lib/easypost/services/customs_item.rb +15 -0
- data/lib/easypost/services/end_shipper.rb +31 -0
- data/lib/easypost/services/event.rb +32 -0
- data/lib/easypost/services/insurance.rb +26 -0
- data/lib/easypost/services/order.rb +30 -0
- data/lib/easypost/services/parcel.rb +16 -0
- data/lib/easypost/services/pickup.rb +40 -0
- data/lib/easypost/services/rate.rb +8 -0
- data/lib/easypost/services/referral_customer.rb +103 -0
- data/lib/easypost/services/refund.rb +26 -0
- data/lib/easypost/services/report.rb +42 -0
- data/lib/easypost/services/scan_form.rb +25 -0
- data/lib/easypost/services/shipment.rb +106 -0
- data/lib/easypost/services/tracker.rb +38 -0
- data/lib/easypost/services/user.rb +66 -0
- data/lib/easypost/services/webhook.rb +34 -0
- data/lib/easypost/services.rb +32 -0
- data/lib/easypost/util.rb +116 -161
- data/lib/easypost/utilities/constants.rb +5 -0
- data/lib/easypost/utilities/json.rb +23 -0
- data/lib/easypost/utilities/static_mapper.rb +73 -0
- data/lib/easypost/utilities/system.rb +36 -0
- data/lib/easypost.rb +14 -136
- metadata +177 -65
- data/.rubocop.yml +0 -11
- data/CODE_OF_CONDUCT.md +0 -16
- data/CONTRIBUTING.md +0 -47
- data/SECURITY.md +0 -7
- data/SUPPORT.md +0 -3
- data/easycop.yml +0 -180
- data/lib/easypost/address.rb +0 -40
- data/lib/easypost/api_key.rb +0 -5
- data/lib/easypost/batch.rb +0 -50
- data/lib/easypost/beta/end_shipper.rb +0 -44
- data/lib/easypost/beta/referral.rb +0 -110
- data/lib/easypost/beta.rb +0 -7
- data/lib/easypost/billing.rb +0 -72
- data/lib/easypost/brand.rb +0 -13
- data/lib/easypost/carrier_account.rb +0 -9
- data/lib/easypost/carrier_type.rb +0 -5
- data/lib/easypost/customs_info.rb +0 -9
- data/lib/easypost/customs_item.rb +0 -9
- data/lib/easypost/end_shipper.rb +0 -24
- data/lib/easypost/error.rb +0 -32
- data/lib/easypost/event.rb +0 -11
- data/lib/easypost/object.rb +0 -171
- data/lib/easypost/order.rb +0 -37
- data/lib/easypost/parcel.rb +0 -9
- data/lib/easypost/payment_method.rb +0 -11
- data/lib/easypost/pickup.rb +0 -37
- data/lib/easypost/rate.rb +0 -9
- data/lib/easypost/referral.rb +0 -102
- data/lib/easypost/report.rb +0 -23
- data/lib/easypost/resource.rb +0 -106
- data/lib/easypost/scan_form.rb +0 -11
- data/lib/easypost/shipment.rb +0 -155
- data/lib/easypost/tracker.rb +0 -12
- data/lib/easypost/user.rb +0 -71
- data/lib/easypost/webhook.rb +0 -57
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../models'
|
4
|
+
|
5
|
+
module EasyPost::InternalUtilities::StaticMapper
|
6
|
+
BY_PREFIX = {
|
7
|
+
'adr' => EasyPost::Models::Address,
|
8
|
+
'ak' => EasyPost::Models::ApiKey,
|
9
|
+
'bank' => EasyPost::Models::PaymentMethod,
|
10
|
+
'batch' => EasyPost::Models::Batch,
|
11
|
+
'brd' => EasyPost::Models::Brand,
|
12
|
+
'ca' => EasyPost::Models::CarrierAccount,
|
13
|
+
'card' => EasyPost::Models::PaymentMethod,
|
14
|
+
'cstinfo' => EasyPost::Models::CustomsInfo,
|
15
|
+
'cstitem' => EasyPost::Models::CustomsItem,
|
16
|
+
'es' => EasyPost::Models::EndShipper,
|
17
|
+
'evt' => EasyPost::Models::Event,
|
18
|
+
'hook' => EasyPost::Models::Webhook,
|
19
|
+
'ins' => EasyPost::Models::Insurance,
|
20
|
+
'order' => EasyPost::Models::Order,
|
21
|
+
'payload' => EasyPost::Models::Payload,
|
22
|
+
'pickup' => EasyPost::Models::Pickup,
|
23
|
+
'pickuprate' => EasyPost::Models::PickupRate,
|
24
|
+
'pl' => EasyPost::Models::PostageLabel,
|
25
|
+
'plrep' => EasyPost::Models::Report,
|
26
|
+
'prcl' => EasyPost::Models::Parcel,
|
27
|
+
'rate' => EasyPost::Models::Rate,
|
28
|
+
'refrep' => EasyPost::Models::Report,
|
29
|
+
'rfnd' => EasyPost::Models::Refund,
|
30
|
+
'sf' => EasyPost::Models::ScanForm,
|
31
|
+
'shp' => EasyPost::Models::Shipment,
|
32
|
+
'shpinvrep' => EasyPost::Models::Report,
|
33
|
+
'shprep' => EasyPost::Models::Report,
|
34
|
+
'trk' => EasyPost::Models::Tracker,
|
35
|
+
'trkrep' => EasyPost::Models::Report,
|
36
|
+
'user' => EasyPost::Models::User,
|
37
|
+
}.freeze
|
38
|
+
|
39
|
+
BY_TYPE = {
|
40
|
+
'Address' => EasyPost::Models::Address,
|
41
|
+
'ApiKey' => EasyPost::Models::ApiKey,
|
42
|
+
'BankAccount' => EasyPost::Models::PaymentMethod,
|
43
|
+
'Batch' => EasyPost::Models::Batch,
|
44
|
+
'Brand' => EasyPost::Models::Brand,
|
45
|
+
'CarbonOffset' => EasyPost::Models::CarbonOffset,
|
46
|
+
'CarrierAccount' => EasyPost::Models::CarrierAccount,
|
47
|
+
'CreditCard' => EasyPost::Models::PaymentMethod,
|
48
|
+
'CustomsInfo' => EasyPost::Models::CustomsInfo,
|
49
|
+
'CustomsItem' => EasyPost::Models::CustomsItem,
|
50
|
+
'EndShipper' => EasyPost::Models::EndShipper,
|
51
|
+
'Event' => EasyPost::Models::Event,
|
52
|
+
'Insurance' => EasyPost::Models::Insurance,
|
53
|
+
'Order' => EasyPost::Models::Order,
|
54
|
+
'Parcel' => EasyPost::Models::Parcel,
|
55
|
+
'PaymentLogReport' => EasyPost::Models::Report,
|
56
|
+
'Pickup' => EasyPost::Models::Pickup,
|
57
|
+
'PickupRate' => EasyPost::Models::PickupRate,
|
58
|
+
'PostageLabel' => EasyPost::Models::PostageLabel,
|
59
|
+
'Rate' => EasyPost::Models::Rate,
|
60
|
+
'Refund' => EasyPost::Models::Refund,
|
61
|
+
'RefundReport' => EasyPost::Models::Report,
|
62
|
+
'Report' => EasyPost::Models::Report,
|
63
|
+
'ScanForm' => EasyPost::Models::ScanForm,
|
64
|
+
'Shipment' => EasyPost::Models::Shipment,
|
65
|
+
'ShipmentInvoiceReport' => EasyPost::Models::Report,
|
66
|
+
'ShipmentReport' => EasyPost::Models::Report,
|
67
|
+
'TaxIdentifier' => EasyPost::Models::TaxIdentifier,
|
68
|
+
'Tracker' => EasyPost::Models::Tracker,
|
69
|
+
'TrackerReport' => EasyPost::Models::Report,
|
70
|
+
'User' => EasyPost::Models::User,
|
71
|
+
'Webhook' => EasyPost::Models::Webhook,
|
72
|
+
}.freeze
|
73
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EasyPost::InternalUtilities::System
|
4
|
+
def self.os_name
|
5
|
+
case RUBY_PLATFORM
|
6
|
+
when /linux/i
|
7
|
+
'Linux'
|
8
|
+
when /darwin/i
|
9
|
+
'Darwin'
|
10
|
+
when /cygwin|mswin|mingw|bccwin|wince|emx/i
|
11
|
+
'Windows'
|
12
|
+
else
|
13
|
+
'Unknown'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.os_version
|
18
|
+
Gem::Platform.local.version
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.os_arch
|
22
|
+
Gem::Platform.local.cpu
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.ruby_version
|
26
|
+
RUBY_VERSION
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.ruby_patchlevel
|
30
|
+
RUBY_PATCHLEVEL
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.lib_version
|
34
|
+
File.open(File.expand_path('../../VERSION', __dir__)).read.strip
|
35
|
+
end
|
36
|
+
end
|
data/lib/easypost.rb
CHANGED
@@ -5,149 +5,27 @@ require 'cgi'
|
|
5
5
|
require 'net/http'
|
6
6
|
|
7
7
|
require 'easypost/version'
|
8
|
-
require 'easypost/object'
|
9
|
-
require 'easypost/resource'
|
10
|
-
require 'easypost/error'
|
11
8
|
require 'easypost/connection'
|
12
|
-
|
13
|
-
# Resources
|
14
|
-
require 'easypost/address'
|
15
|
-
require 'easypost/api_key'
|
16
|
-
require 'easypost/batch'
|
17
|
-
require 'easypost/billing'
|
18
|
-
require 'easypost/brand'
|
19
|
-
require 'easypost/carbon_offset'
|
20
|
-
require 'easypost/carrier_account'
|
21
|
-
require 'easypost/carrier_type'
|
22
|
-
require 'easypost/customs_info'
|
23
|
-
require 'easypost/customs_item'
|
24
|
-
require 'easypost/end_shipper'
|
25
|
-
require 'easypost/event'
|
26
|
-
require 'easypost/insurance'
|
27
|
-
require 'easypost/order'
|
28
|
-
require 'easypost/parcel'
|
29
|
-
require 'easypost/payment_method' # deprecated
|
30
|
-
require 'easypost/pickup_rate'
|
31
|
-
require 'easypost/pickup'
|
32
|
-
require 'easypost/postage_label'
|
33
|
-
require 'easypost/rate'
|
34
|
-
require 'easypost/referral'
|
35
|
-
require 'easypost/refund'
|
36
|
-
require 'easypost/report'
|
37
|
-
require 'easypost/scan_form'
|
38
|
-
require 'easypost/shipment'
|
39
|
-
require 'easypost/tax_identifier'
|
40
|
-
require 'easypost/tracker'
|
41
|
-
require 'easypost/user'
|
42
|
-
require 'easypost/webhook'
|
43
|
-
require 'easypost/beta'
|
44
|
-
|
45
9
|
require 'easypost/util'
|
46
10
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
class << self
|
51
|
-
attr_accessor :api_key, :api_base
|
52
|
-
attr_writer :default_connection
|
53
|
-
end
|
54
|
-
|
55
|
-
self.api_base = DEFAULT_API_BASE
|
56
|
-
|
57
|
-
def self.user_agent
|
58
|
-
@user_agent ||=
|
59
|
-
"EasyPost/v2 RubyClient/#{EasyPost::VERSION} Ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} " \
|
60
|
-
"OS/#{EasyPost::Util.os_name} OSVersion/#{EasyPost::Util.os_version} " \
|
61
|
-
"OSArch/#{EasyPost::Util.os_arch}"
|
62
|
-
end
|
63
|
-
|
64
|
-
def self.default_headers
|
65
|
-
@default_headers ||= {
|
66
|
-
'Content-Type' => 'application/json',
|
67
|
-
'User-Agent' => user_agent,
|
68
|
-
}
|
69
|
-
end
|
70
|
-
|
71
|
-
def self.default_connection
|
72
|
-
@default_connection ||= EasyPost::Connection.new(
|
73
|
-
uri: URI(api_base),
|
74
|
-
config: http_config,
|
75
|
-
)
|
76
|
-
end
|
11
|
+
# Client
|
12
|
+
require 'easypost/client'
|
13
|
+
require 'easypost/http_client'
|
77
14
|
|
78
|
-
|
79
|
-
|
80
|
-
end
|
15
|
+
# Services
|
16
|
+
require 'easypost/services'
|
81
17
|
|
82
|
-
|
83
|
-
|
84
|
-
http_config.clear
|
85
|
-
self.default_connection = nil
|
86
|
-
end
|
18
|
+
# Models
|
19
|
+
require 'easypost/models'
|
87
20
|
|
88
|
-
|
89
|
-
|
90
|
-
timeout: 60,
|
91
|
-
open_timeout: 30,
|
92
|
-
verify_ssl: OpenSSL::SSL::VERIFY_PEER,
|
93
|
-
}
|
21
|
+
# Exceptions
|
22
|
+
require 'easypost/errors'
|
94
23
|
|
95
|
-
|
96
|
-
|
97
|
-
http_config[:min_version] = OpenSSL::SSL::TLS1_2_VERSION
|
98
|
-
else
|
99
|
-
http_config[:ssl_version] = :TLSv1_2 # rubocop:disable Naming/VariableNumber
|
100
|
-
end
|
24
|
+
# Internal Utilities
|
25
|
+
require 'easypost/internal_utilities'
|
101
26
|
|
102
|
-
|
103
|
-
|
27
|
+
# Hooks
|
28
|
+
require 'easypost/hooks'
|
104
29
|
|
105
|
-
|
106
|
-
def self.http_config
|
107
|
-
@http_config ||= default_http_config
|
108
|
-
end
|
109
|
-
|
110
|
-
# Set the HTTP config.
|
111
|
-
def self.http_config=(http_config_params)
|
112
|
-
http_config.merge!(http_config_params)
|
113
|
-
|
114
|
-
self.default_connection = nil
|
115
|
-
end
|
116
|
-
|
117
|
-
# Create an EasyPost Client.
|
118
|
-
#
|
119
|
-
# @deprecated
|
120
|
-
def self.make_client(url)
|
121
|
-
EasyPost::Connection.new(uri: URI(url), config: http_config).create
|
122
|
-
end
|
123
|
-
|
124
|
-
# Make an HTTP request against the {default_connection}
|
125
|
-
#
|
126
|
-
# @param method [Symbol] the HTTP Verb (get, method, put, post, etc.)
|
127
|
-
# @param path [String] URI path of the resource
|
128
|
-
# @param requested_api_key [String] ({EasyPost.api_key}) key set Authorization header.
|
129
|
-
# @param body [Object] (nil) object to be dumped to JSON
|
130
|
-
# @raise [EasyPost::Error] if the response has a non-2xx status code
|
131
|
-
# @return [Hash] JSON object parsed from the response body
|
132
|
-
def self.make_request(method, path, api_key = nil, body = nil)
|
133
|
-
default_connection.call(method, path, api_key || EasyPost.api_key, body)
|
134
|
-
end
|
135
|
-
|
136
|
-
def self.parse_response(status:, body:, json:)
|
137
|
-
if status < 200 || status >= 300
|
138
|
-
error = JSON.parse(body)['error']
|
139
|
-
|
140
|
-
raise EasyPost::Error.new(
|
141
|
-
error['message'],
|
142
|
-
status,
|
143
|
-
error['code'],
|
144
|
-
error['errors'],
|
145
|
-
body,
|
146
|
-
)
|
147
|
-
end
|
148
|
-
|
149
|
-
json || !body.nil? && !body.match(/\A\s+\z/) ? JSON.parse(body) : body
|
150
|
-
rescue JSON::ParserError
|
151
|
-
raise "Invalid response object from API, unable to decode.\n#{body}"
|
152
|
-
end
|
30
|
+
module EasyPost
|
153
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easypost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EasyPost Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brakeman
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '5.
|
19
|
+
version: '5.4'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '5.
|
26
|
+
version: '5.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.7.5
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.7.5
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: pry
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +52,20 @@ dependencies:
|
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0.14'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: psych
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.1'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: rake
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,62 +80,76 @@ dependencies:
|
|
52
80
|
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
82
|
version: '13.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rdoc
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '6.5'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '6.5'
|
55
97
|
- !ruby/object:Gem::Dependency
|
56
98
|
name: rspec
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
58
100
|
requirements:
|
59
101
|
- - "~>"
|
60
102
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
103
|
+
version: '3.12'
|
62
104
|
type: :development
|
63
105
|
prerelease: false
|
64
106
|
version_requirements: !ruby/object:Gem::Requirement
|
65
107
|
requirements:
|
66
108
|
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
110
|
+
version: '3.12'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
112
|
name: rubocop
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
|
-
- -
|
115
|
+
- - "~>"
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
117
|
+
version: '1.49'
|
76
118
|
type: :development
|
77
119
|
prerelease: false
|
78
120
|
version_requirements: !ruby/object:Gem::Requirement
|
79
121
|
requirements:
|
80
|
-
- -
|
122
|
+
- - "~>"
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
124
|
+
version: '1.49'
|
83
125
|
- !ruby/object:Gem::Dependency
|
84
126
|
name: rubocop-rspec
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
86
128
|
requirements:
|
87
|
-
- -
|
129
|
+
- - '='
|
88
130
|
- !ruby/object:Gem::Version
|
89
|
-
version: '2.
|
131
|
+
version: '2.19'
|
90
132
|
type: :development
|
91
133
|
prerelease: false
|
92
134
|
version_requirements: !ruby/object:Gem::Requirement
|
93
135
|
requirements:
|
94
|
-
- -
|
136
|
+
- - '='
|
95
137
|
- !ruby/object:Gem::Version
|
96
|
-
version: '2.
|
138
|
+
version: '2.19'
|
97
139
|
- !ruby/object:Gem::Dependency
|
98
140
|
name: simplecov
|
99
141
|
requirement: !ruby/object:Gem::Requirement
|
100
142
|
requirements:
|
101
143
|
- - "~>"
|
102
144
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0.
|
145
|
+
version: '0.22'
|
104
146
|
type: :development
|
105
147
|
prerelease: false
|
106
148
|
version_requirements: !ruby/object:Gem::Requirement
|
107
149
|
requirements:
|
108
150
|
- - "~>"
|
109
151
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0.
|
152
|
+
version: '0.22'
|
111
153
|
- !ruby/object:Gem::Dependency
|
112
154
|
name: simplecov-lcov
|
113
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,34 +164,48 @@ dependencies:
|
|
122
164
|
- - "~>"
|
123
165
|
- !ruby/object:Gem::Version
|
124
166
|
version: '0.8'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: typhoeus
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.4.0
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 1.4.0
|
125
181
|
- !ruby/object:Gem::Dependency
|
126
182
|
name: vcr
|
127
183
|
requirement: !ruby/object:Gem::Requirement
|
128
184
|
requirements:
|
129
|
-
- -
|
185
|
+
- - "~>"
|
130
186
|
- !ruby/object:Gem::Version
|
131
|
-
version: '6.
|
187
|
+
version: '6.1'
|
132
188
|
type: :development
|
133
189
|
prerelease: false
|
134
190
|
version_requirements: !ruby/object:Gem::Requirement
|
135
191
|
requirements:
|
136
|
-
- -
|
192
|
+
- - "~>"
|
137
193
|
- !ruby/object:Gem::Version
|
138
|
-
version: '6.
|
194
|
+
version: '6.1'
|
139
195
|
- !ruby/object:Gem::Dependency
|
140
196
|
name: webmock
|
141
197
|
requirement: !ruby/object:Gem::Requirement
|
142
198
|
requirements:
|
143
199
|
- - "~>"
|
144
200
|
- !ruby/object:Gem::Version
|
145
|
-
version: '3.
|
201
|
+
version: '3.18'
|
146
202
|
type: :development
|
147
203
|
prerelease: false
|
148
204
|
version_requirements: !ruby/object:Gem::Requirement
|
149
205
|
requirements:
|
150
206
|
- - "~>"
|
151
207
|
- !ruby/object:Gem::Version
|
152
|
-
version: '3.
|
208
|
+
version: '3.18'
|
153
209
|
description: Client library for accessing the EasyPost shipping API via Ruby.
|
154
210
|
email: oss@easypost.com
|
155
211
|
executables:
|
@@ -165,61 +221,117 @@ files:
|
|
165
221
|
- ".github/workflows/ci.yml"
|
166
222
|
- ".gitignore"
|
167
223
|
- ".gitmodules"
|
168
|
-
- ".rubocop.yml"
|
169
224
|
- CHANGELOG.md
|
170
|
-
- CODE_OF_CONDUCT.md
|
171
|
-
- CONTRIBUTING.md
|
172
225
|
- Gemfile
|
173
226
|
- LICENSE
|
174
227
|
- Makefile
|
175
228
|
- README.md
|
176
229
|
- Rakefile
|
177
|
-
- SECURITY.md
|
178
|
-
- SUPPORT.md
|
179
230
|
- UPGRADE_GUIDE.md
|
180
231
|
- VERSION
|
181
232
|
- bin/easypost-irb
|
182
|
-
- easycop.yml
|
183
233
|
- easypost.gemspec
|
184
234
|
- lib/easypost.rb
|
185
|
-
- lib/easypost/
|
186
|
-
- lib/easypost/api_key.rb
|
187
|
-
- lib/easypost/batch.rb
|
188
|
-
- lib/easypost/beta.rb
|
189
|
-
- lib/easypost/beta/end_shipper.rb
|
190
|
-
- lib/easypost/beta/referral.rb
|
191
|
-
- lib/easypost/billing.rb
|
192
|
-
- lib/easypost/brand.rb
|
193
|
-
- lib/easypost/carbon_offset.rb
|
194
|
-
- lib/easypost/carrier_account.rb
|
195
|
-
- lib/easypost/carrier_type.rb
|
235
|
+
- lib/easypost/client.rb
|
196
236
|
- lib/easypost/connection.rb
|
197
|
-
- lib/easypost/
|
198
|
-
- lib/easypost/
|
199
|
-
- lib/easypost/
|
200
|
-
- lib/easypost/
|
201
|
-
- lib/easypost/
|
202
|
-
- lib/easypost/
|
203
|
-
- lib/easypost/
|
204
|
-
- lib/easypost/
|
205
|
-
- lib/easypost/
|
206
|
-
- lib/easypost/
|
207
|
-
- lib/easypost/
|
208
|
-
- lib/easypost/
|
209
|
-
- lib/easypost/
|
210
|
-
- lib/easypost/
|
211
|
-
- lib/easypost/
|
212
|
-
- lib/easypost/
|
213
|
-
- lib/easypost/
|
214
|
-
- lib/easypost/
|
215
|
-
- lib/easypost/
|
216
|
-
- lib/easypost/
|
217
|
-
- lib/easypost/
|
218
|
-
- lib/easypost/
|
219
|
-
- lib/easypost/
|
237
|
+
- lib/easypost/constants.rb
|
238
|
+
- lib/easypost/errors.rb
|
239
|
+
- lib/easypost/errors/api/api_error.rb
|
240
|
+
- lib/easypost/errors/api/bad_request_error.rb
|
241
|
+
- lib/easypost/errors/api/connection_error.rb
|
242
|
+
- lib/easypost/errors/api/external_api_error.rb
|
243
|
+
- lib/easypost/errors/api/forbidden_error.rb
|
244
|
+
- lib/easypost/errors/api/gateway_timeout_error.rb
|
245
|
+
- lib/easypost/errors/api/internal_server_error.rb
|
246
|
+
- lib/easypost/errors/api/invalid_request_error.rb
|
247
|
+
- lib/easypost/errors/api/method_not_allowed_error.rb
|
248
|
+
- lib/easypost/errors/api/not_found_error.rb
|
249
|
+
- lib/easypost/errors/api/payment_error.rb
|
250
|
+
- lib/easypost/errors/api/proxy_error.rb
|
251
|
+
- lib/easypost/errors/api/rate_limit_error.rb
|
252
|
+
- lib/easypost/errors/api/redirect_error.rb
|
253
|
+
- lib/easypost/errors/api/retry_error.rb
|
254
|
+
- lib/easypost/errors/api/service_unavailable_error.rb
|
255
|
+
- lib/easypost/errors/api/ssl_error.rb
|
256
|
+
- lib/easypost/errors/api/timeout_error.rb
|
257
|
+
- lib/easypost/errors/api/unauthorized_error.rb
|
258
|
+
- lib/easypost/errors/api/unknown_api_error.rb
|
259
|
+
- lib/easypost/errors/easy_post_error.rb
|
260
|
+
- lib/easypost/errors/end_of_pagination_error.rb
|
261
|
+
- lib/easypost/errors/filtering_error.rb
|
262
|
+
- lib/easypost/errors/invalid_object_error.rb
|
263
|
+
- lib/easypost/errors/invalid_parameter_error.rb
|
264
|
+
- lib/easypost/errors/missing_parameter_error.rb
|
265
|
+
- lib/easypost/errors/signature_verification_error.rb
|
266
|
+
- lib/easypost/hooks.rb
|
267
|
+
- lib/easypost/hooks/request_context.rb
|
268
|
+
- lib/easypost/hooks/response_context.rb
|
269
|
+
- lib/easypost/http_client.rb
|
270
|
+
- lib/easypost/internal_utilities.rb
|
271
|
+
- lib/easypost/models.rb
|
272
|
+
- lib/easypost/models/address.rb
|
273
|
+
- lib/easypost/models/api_key.rb
|
274
|
+
- lib/easypost/models/base.rb
|
275
|
+
- lib/easypost/models/batch.rb
|
276
|
+
- lib/easypost/models/brand.rb
|
277
|
+
- lib/easypost/models/carbon_offset.rb
|
278
|
+
- lib/easypost/models/carrier_account.rb
|
279
|
+
- lib/easypost/models/customs_info.rb
|
280
|
+
- lib/easypost/models/customs_item.rb
|
281
|
+
- lib/easypost/models/end_shipper.rb
|
282
|
+
- lib/easypost/models/error.rb
|
283
|
+
- lib/easypost/models/event.rb
|
284
|
+
- lib/easypost/models/insurance.rb
|
285
|
+
- lib/easypost/models/order.rb
|
286
|
+
- lib/easypost/models/parcel.rb
|
287
|
+
- lib/easypost/models/payload.rb
|
288
|
+
- lib/easypost/models/payment_method.rb
|
289
|
+
- lib/easypost/models/pickup.rb
|
290
|
+
- lib/easypost/models/pickup_rate.rb
|
291
|
+
- lib/easypost/models/postage_label.rb
|
292
|
+
- lib/easypost/models/rate.rb
|
293
|
+
- lib/easypost/models/referral.rb
|
294
|
+
- lib/easypost/models/refund.rb
|
295
|
+
- lib/easypost/models/report.rb
|
296
|
+
- lib/easypost/models/scan_form.rb
|
297
|
+
- lib/easypost/models/shipment.rb
|
298
|
+
- lib/easypost/models/tax_identifier.rb
|
299
|
+
- lib/easypost/models/tracker.rb
|
300
|
+
- lib/easypost/models/user.rb
|
301
|
+
- lib/easypost/models/webhook.rb
|
302
|
+
- lib/easypost/services.rb
|
303
|
+
- lib/easypost/services/address.rb
|
304
|
+
- lib/easypost/services/api_key.rb
|
305
|
+
- lib/easypost/services/base.rb
|
306
|
+
- lib/easypost/services/batch.rb
|
307
|
+
- lib/easypost/services/beta_rate.rb
|
308
|
+
- lib/easypost/services/beta_referral_customer.rb
|
309
|
+
- lib/easypost/services/billing.rb
|
310
|
+
- lib/easypost/services/carrier_account.rb
|
311
|
+
- lib/easypost/services/carrier_metadata.rb
|
312
|
+
- lib/easypost/services/customs_info.rb
|
313
|
+
- lib/easypost/services/customs_item.rb
|
314
|
+
- lib/easypost/services/end_shipper.rb
|
315
|
+
- lib/easypost/services/event.rb
|
316
|
+
- lib/easypost/services/insurance.rb
|
317
|
+
- lib/easypost/services/order.rb
|
318
|
+
- lib/easypost/services/parcel.rb
|
319
|
+
- lib/easypost/services/pickup.rb
|
320
|
+
- lib/easypost/services/rate.rb
|
321
|
+
- lib/easypost/services/referral_customer.rb
|
322
|
+
- lib/easypost/services/refund.rb
|
323
|
+
- lib/easypost/services/report.rb
|
324
|
+
- lib/easypost/services/scan_form.rb
|
325
|
+
- lib/easypost/services/shipment.rb
|
326
|
+
- lib/easypost/services/tracker.rb
|
327
|
+
- lib/easypost/services/user.rb
|
328
|
+
- lib/easypost/services/webhook.rb
|
220
329
|
- lib/easypost/util.rb
|
330
|
+
- lib/easypost/utilities/constants.rb
|
331
|
+
- lib/easypost/utilities/json.rb
|
332
|
+
- lib/easypost/utilities/static_mapper.rb
|
333
|
+
- lib/easypost/utilities/system.rb
|
221
334
|
- lib/easypost/version.rb
|
222
|
-
- lib/easypost/webhook.rb
|
223
335
|
homepage: https://www.easypost.com/docs
|
224
336
|
licenses:
|
225
337
|
- MIT
|
@@ -232,14 +344,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
232
344
|
requirements:
|
233
345
|
- - ">="
|
234
346
|
- !ruby/object:Gem::Version
|
235
|
-
version: '2.
|
347
|
+
version: '2.6'
|
236
348
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
237
349
|
requirements:
|
238
350
|
- - ">="
|
239
351
|
- !ruby/object:Gem::Version
|
240
352
|
version: '0'
|
241
353
|
requirements: []
|
242
|
-
rubygems_version: 3.
|
354
|
+
rubygems_version: 3.4.10
|
243
355
|
signing_key:
|
244
356
|
specification_version: 4
|
245
357
|
summary: EasyPost Ruby Client Library
|
data/.rubocop.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
inherit_from: easycop.yml
|
2
|
-
|
3
|
-
AllCops:
|
4
|
-
SuggestExtensions: false
|
5
|
-
# We are ignoring RSpec/FilePath because Simplecov doesn't play nice with nested spec files
|
6
|
-
RSpec/FilePath:
|
7
|
-
Enabled: false
|
8
|
-
# TODO: Remove this once we start using keyword arguments
|
9
|
-
Style/OptionalBooleanParameter:
|
10
|
-
Exclude:
|
11
|
-
- 'lib/easypost/shipment.rb'
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# Code of Conduct
|
2
|
-
|
3
|
-
> Remember the golden rule? Treat others as you'd like to be treated
|
4
|
-
|
5
|
-
## Standards
|
6
|
-
|
7
|
-
- Create a welcoming and safe community for `everyone`
|
8
|
-
- Demonstrate empathy towards others, realize that everyone has a different `level of experience`
|
9
|
-
- Be respectful of others opinions, viewpoints, and experiences
|
10
|
-
- Give and receive respectful constructive feedback
|
11
|
-
- Accept responsibility and apologize when necessary
|
12
|
-
- Focus on what is best for the overall community
|
13
|
-
|
14
|
-
## Failure to Follow Standards
|
15
|
-
|
16
|
-
If there is a failure to follow the standards laid out above, the user will first be warned. If the offending behavior continues, the user may be blocked entirely.
|