postmen 0.1.0 → 1.0.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/postmen/collection_proxy.rb +22 -0
- data/lib/postmen/connection.rb +44 -0
- data/lib/postmen/label.rb +15 -0
- data/lib/postmen/label_collection.rb +19 -0
- data/lib/postmen/manifest.rb +38 -0
- data/lib/postmen/manifest_collection.rb +39 -0
- data/lib/postmen/parcel.rb +12 -0
- data/lib/postmen/query/create_label_query.rb +6 -1
- data/lib/postmen/query/create_manifest_query.rb +23 -0
- data/lib/postmen/query/create_rate_query.rb +27 -0
- data/lib/postmen/query/create_shipper_account_query.rb +22 -0
- data/lib/postmen/query/label_query.rb +7 -1
- data/lib/postmen/query/manifest_query.rb +50 -0
- data/lib/postmen/query/rate_query.rb +41 -0
- data/lib/postmen/query/shipper_account_query.rb +29 -0
- data/lib/postmen/query/shipper_account_update_credentials_query.rb +20 -0
- data/lib/postmen/query/shipper_account_update_query.rb +30 -0
- data/lib/postmen/rate.rb +35 -0
- data/lib/postmen/rate_collection.rb +39 -0
- data/lib/postmen/rate_object.rb +19 -0
- data/lib/postmen/response.rb +20 -0
- data/lib/postmen/shipment.rb +18 -0
- data/lib/postmen/shipper_account.rb +68 -0
- data/lib/postmen/shipper_account_collection.rb +39 -0
- data/lib/postmen/types/address.rb +31 -0
- data/lib/postmen/types/aes.rb +11 -0
- data/lib/postmen/types/billing.rb +9 -0
- data/lib/postmen/types/brief_shipper_account.rb +12 -0
- data/lib/postmen/types/customs.rb +16 -0
- data/lib/postmen/types/customs_billing.rb +13 -0
- data/lib/postmen/types/detailed_charges.rb +10 -0
- data/lib/postmen/types/dimension.rb +12 -0
- data/lib/postmen/types/invoice.rb +9 -0
- data/lib/postmen/types/item.rb +24 -0
- data/lib/postmen/types/money.rb +10 -0
- data/lib/postmen/types/no_eei.rb +11 -0
- data/lib/postmen/types/passport.rb +21 -0
- data/lib/postmen/types/payment_method.rb +13 -0
- data/lib/postmen/types/reference.rb +9 -0
- data/lib/postmen/types/uuid.rb +10 -0
- data/lib/postmen/types/weight.rb +10 -0
- data/lib/postmen/types.rb +113 -8
- data/lib/postmen/version.rb +2 -1
- data/lib/postmen.rb +36 -1
- metadata +71 -9
data/lib/postmen.rb
CHANGED
@@ -9,29 +9,64 @@ require 'postmen/version'
|
|
9
9
|
require 'postmen/types'
|
10
10
|
require 'postmen/connection'
|
11
11
|
require 'postmen/collection_proxy'
|
12
|
+
require 'postmen/parcel'
|
13
|
+
require 'postmen/shipment'
|
12
14
|
require 'postmen/label'
|
13
15
|
require 'postmen/label_collection'
|
14
16
|
require 'postmen/response'
|
15
17
|
require 'postmen/query/label_query'
|
16
18
|
require 'postmen/query/create_label_query'
|
17
|
-
|
19
|
+
require 'postmen/query/rate_query'
|
20
|
+
require 'postmen/query/create_rate_query'
|
21
|
+
require 'postmen/rate_object'
|
22
|
+
require 'postmen/rate'
|
23
|
+
require 'postmen/rate_collection'
|
24
|
+
require 'postmen/shipper_account'
|
25
|
+
require 'postmen/shipper_account_collection'
|
26
|
+
require 'postmen/query/shipper_account_query'
|
27
|
+
require 'postmen/query/create_shipper_account_query'
|
28
|
+
require 'postmen/query/shipper_account_query'
|
29
|
+
require 'postmen/query/shipper_account_update_query'
|
30
|
+
require 'postmen/query/shipper_account_update_credentials_query'
|
31
|
+
require 'postmen/query/manifest_query'
|
32
|
+
require 'postmen/query/create_manifest_query'
|
33
|
+
require 'postmen/manifest'
|
34
|
+
require 'postmen/manifest_collection'
|
35
|
+
# This is the main class, it's being used as a namespace for all
|
36
|
+
# related classes and modules as well.
|
18
37
|
class Postmen
|
19
38
|
extend Dry::Configurable
|
20
39
|
|
40
|
+
# Generic Exception class, all other exceptions should inherit from this class
|
21
41
|
Error = Class.new(StandardError)
|
42
|
+
# Exception raised if rate limit was exceeded
|
22
43
|
RateLimitExceeded = Class.new(Error)
|
44
|
+
# Exception raised in case of any connection error
|
23
45
|
ConnectionError = Class.new(Error)
|
46
|
+
# Generic exception raised if the API returns an error
|
24
47
|
RequestError = Class.new(Error)
|
48
|
+
# Expcetion raised if resource was not found.
|
25
49
|
ResourceNotFound = Class.new(RequestError)
|
26
50
|
|
51
|
+
# @#!attribute [rw] api_key [String] API key taken from the application.
|
27
52
|
setting :api_key
|
53
|
+
|
54
|
+
# @#!attribute [rw] region [String] Region - typically either 'sandbox' or 'production'
|
28
55
|
setting :region
|
56
|
+
|
57
|
+
# @#!attribute endpoint [String] Endoint name - specify if you'd like to use custom endpoint
|
29
58
|
setting :endpoint
|
30
59
|
|
60
|
+
# Returns the endpoint used in all queries
|
61
|
+
#
|
62
|
+
# @return [String] endpoint url
|
31
63
|
def self.endpoint
|
32
64
|
config.endpoint || "https://#{config.region}-api.postmen.com/v3"
|
33
65
|
end
|
34
66
|
|
67
|
+
# Returns path where gem is installed
|
68
|
+
#
|
69
|
+
# @return [Pathname] path
|
35
70
|
def self.root
|
36
71
|
Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '../')))
|
37
72
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 1.0.0.pre.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- postmen.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.1
|
20
20
|
type: :runtime
|
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:
|
26
|
+
version: 2.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dry-configurable
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '2.3'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.9'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.9'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rake
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +136,20 @@ dependencies:
|
|
122
136
|
- - ">"
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: '10.0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: coveralls
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.8'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.8'
|
125
153
|
description: Developed for easy integration with Postmen
|
126
154
|
email:
|
127
155
|
- support@postmen.com
|
@@ -135,10 +163,44 @@ files:
|
|
135
163
|
- lib/postmen/connection.rb
|
136
164
|
- lib/postmen/label.rb
|
137
165
|
- lib/postmen/label_collection.rb
|
166
|
+
- lib/postmen/manifest.rb
|
167
|
+
- lib/postmen/manifest_collection.rb
|
168
|
+
- lib/postmen/parcel.rb
|
138
169
|
- lib/postmen/query/create_label_query.rb
|
170
|
+
- lib/postmen/query/create_manifest_query.rb
|
171
|
+
- lib/postmen/query/create_rate_query.rb
|
172
|
+
- lib/postmen/query/create_shipper_account_query.rb
|
139
173
|
- lib/postmen/query/label_query.rb
|
174
|
+
- lib/postmen/query/manifest_query.rb
|
175
|
+
- lib/postmen/query/rate_query.rb
|
176
|
+
- lib/postmen/query/shipper_account_query.rb
|
177
|
+
- lib/postmen/query/shipper_account_update_credentials_query.rb
|
178
|
+
- lib/postmen/query/shipper_account_update_query.rb
|
179
|
+
- lib/postmen/rate.rb
|
180
|
+
- lib/postmen/rate_collection.rb
|
181
|
+
- lib/postmen/rate_object.rb
|
140
182
|
- lib/postmen/response.rb
|
183
|
+
- lib/postmen/shipment.rb
|
184
|
+
- lib/postmen/shipper_account.rb
|
185
|
+
- lib/postmen/shipper_account_collection.rb
|
141
186
|
- lib/postmen/types.rb
|
187
|
+
- lib/postmen/types/address.rb
|
188
|
+
- lib/postmen/types/aes.rb
|
189
|
+
- lib/postmen/types/billing.rb
|
190
|
+
- lib/postmen/types/brief_shipper_account.rb
|
191
|
+
- lib/postmen/types/customs.rb
|
192
|
+
- lib/postmen/types/customs_billing.rb
|
193
|
+
- lib/postmen/types/detailed_charges.rb
|
194
|
+
- lib/postmen/types/dimension.rb
|
195
|
+
- lib/postmen/types/invoice.rb
|
196
|
+
- lib/postmen/types/item.rb
|
197
|
+
- lib/postmen/types/money.rb
|
198
|
+
- lib/postmen/types/no_eei.rb
|
199
|
+
- lib/postmen/types/passport.rb
|
200
|
+
- lib/postmen/types/payment_method.rb
|
201
|
+
- lib/postmen/types/reference.rb
|
202
|
+
- lib/postmen/types/uuid.rb
|
203
|
+
- lib/postmen/types/weight.rb
|
142
204
|
- lib/postmen/version.rb
|
143
205
|
homepage: https://www.postmen.com
|
144
206
|
licenses:
|
@@ -155,12 +217,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
217
|
version: 2.2.0
|
156
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
219
|
requirements:
|
158
|
-
- - "
|
220
|
+
- - ">"
|
159
221
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
222
|
+
version: 1.3.1
|
161
223
|
requirements: []
|
162
224
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.
|
225
|
+
rubygems_version: 2.6.10
|
164
226
|
signing_key:
|
165
227
|
specification_version: 4
|
166
228
|
summary: Postmen
|