shipstation 0.16.7 → 0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +0 -0
  3. data/Rakefile +0 -0
  4. data/lib/shipstation.rb +1 -7
  5. data/lib/shipstation/api_operations/create.rb +1 -1
  6. data/lib/shipstation/api_operations/delete.rb +1 -1
  7. data/lib/shipstation/api_operations/list.rb +1 -1
  8. data/lib/shipstation/api_operations/retrieve.rb +1 -1
  9. data/lib/shipstation/api_operations/shipment.rb +10 -0
  10. data/lib/shipstation/api_operations/update.rb +1 -1
  11. data/lib/shipstation/api_resource.rb +0 -0
  12. data/lib/shipstation/carrier.rb +3 -2
  13. data/lib/shipstation/customer.rb +0 -0
  14. data/lib/shipstation/order.rb +7 -0
  15. data/lib/shipstation/product.rb +0 -0
  16. data/lib/shipstation/shipment.rb +5 -5
  17. data/lib/shipstation/store.rb +3 -2
  18. data/lib/shipstation/tag.rb +2 -2
  19. data/lib/shipstation/version.rb +1 -1
  20. data/lib/shipstation/warehouse.rb +2 -2
  21. data/lib/shipstation/webhook.rb +18 -0
  22. data/lib/tasks/shipstation_tasks.rake +0 -0
  23. data/test/dummy/Gemfile +0 -0
  24. data/test/dummy/Gemfile.lock +3 -3
  25. data/test/dummy/README.rdoc +0 -0
  26. data/test/dummy/Rakefile +0 -0
  27. data/test/dummy/app/assets/javascripts/application.js +0 -0
  28. data/test/dummy/app/assets/stylesheets/application.css +0 -0
  29. data/test/dummy/app/controllers/application_controller.rb +0 -0
  30. data/test/dummy/app/helpers/application_helper.rb +0 -0
  31. data/test/dummy/app/views/layouts/application.html.erb +0 -0
  32. data/test/dummy/config.ru +0 -0
  33. data/test/dummy/config/application.rb +0 -0
  34. data/test/dummy/config/boot.rb +0 -0
  35. data/test/dummy/config/database.yml +0 -0
  36. data/test/dummy/config/environment.rb +0 -0
  37. data/test/dummy/config/environments/development.rb +0 -0
  38. data/test/dummy/config/environments/production.rb +0 -0
  39. data/test/dummy/config/environments/test.rb +0 -0
  40. data/test/dummy/config/initializers/assets.rb +0 -0
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -0
  42. data/test/dummy/config/initializers/cookies_serializer.rb +0 -0
  43. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -0
  44. data/test/dummy/config/initializers/inflections.rb +0 -0
  45. data/test/dummy/config/initializers/mime_types.rb +0 -0
  46. data/test/dummy/config/initializers/session_store.rb +0 -0
  47. data/test/dummy/config/initializers/shipstation.rb +0 -0
  48. data/test/dummy/config/initializers/wrap_parameters.rb +0 -0
  49. data/test/dummy/config/locales/en.yml +0 -0
  50. data/test/dummy/config/routes.rb +0 -0
  51. data/test/dummy/config/secrets.yml +0 -0
  52. data/test/dummy/db/seeds.rb +0 -0
  53. data/test/dummy/public/404.html +0 -0
  54. data/test/dummy/public/422.html +0 -0
  55. data/test/dummy/public/500.html +0 -0
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/dummy/public/robots.txt +0 -0
  58. data/test/dummy/test/test_helper.rb +0 -0
  59. data/test/shipstation_test.rb +0 -0
  60. data/test/test_helper.rb +0 -0
  61. metadata +29 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: eccb33dc316e12fb82e4aa03b0a782eea29ab2f9
4
- data.tar.gz: ab0daa9e81f345e8c48ae6e306d14dba27953ce4
2
+ SHA256:
3
+ metadata.gz: c507a735a529c23156fe6ab42982b440f257d3f4bc8ca8c924abda2e54ca1c20
4
+ data.tar.gz: 0ebec015d22d4aa233dca50aad78bd6f0ef2b22f5f4514a2e6db29f1be720b67
5
5
  SHA512:
6
- metadata.gz: d7b9fc224fb1821cc280e8d6e234cb83cf991387c8b7951a0112e5c61eba17e62644e1817966671542111995ad4938472920f29699799aee3ab43ac652ebe804
7
- data.tar.gz: 51962716b01875da48bb8c0ec46a68282985db01e826a23327f19fefc2bae5ce0b08692cc2e193b6283868192d8e847a22e55c6b0f47ec7f193331009b1a249e
6
+ metadata.gz: 96777ce36c6379b11e60b9ae3b5d7adef3c9573cb93fce1ef3e17aab32da8dd233691dc888537645b02708df96510d11b04dba38be402f66122a8072cc86c548
7
+ data.tar.gz: ab617ef8b63b9d67242ad963299e92924713e01ecc18fec445119acdbfc23654a22e880b36024cd28b3584279200e0e81289d5b1e3cf009b96f02cabdfee3133
data/MIT-LICENSE CHANGED
File without changes
data/Rakefile CHANGED
File without changes
data/lib/shipstation.rb CHANGED
@@ -17,6 +17,7 @@ require 'shipstation/store'
17
17
  require 'shipstation/warehouse'
18
18
  require 'shipstation/product'
19
19
  require 'shipstation/tag'
20
+ require 'shipstation/webhook'
20
21
 
21
22
  module Shipstation
22
23
 
@@ -83,13 +84,6 @@ module Shipstation
83
84
  payload: payload ? payload.to_json : nil,
84
85
  headers: headers
85
86
  }).execute do |response, request, result|
86
- if response.code != 200
87
- raise ApiRequestError.new(
88
- response_code: response.code,
89
- response_headers: response.headers,
90
- response_body: response.to_str
91
- )
92
- end
93
87
  str_response = response.to_str
94
88
  str_response.blank? ? '' : JSON.parse(str_response)
95
89
  end
@@ -2,7 +2,7 @@ module Shipstation
2
2
  module APIOperations
3
3
  module Create
4
4
 
5
- def create params = {}
5
+ def create(params = {})
6
6
  response = Shipstation.request(:post, "#{class_name.downcase.pluralize}/create#{class_name.downcase}", params)
7
7
  return response
8
8
  end
@@ -2,7 +2,7 @@ module Shipstation
2
2
  module APIOperations
3
3
  module Delete
4
4
 
5
- def delete object_id, params = {}
5
+ def delete(object_id, params = {})
6
6
  Shipstation.request(:delete, "#{class_name.downcase.pluralize}/#{object_id}", params)
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module Shipstation
2
2
  module APIOperations
3
3
  module List
4
4
 
5
- def list params = {}
5
+ def list(params = {})
6
6
  response = Shipstation.request(:get, class_name.downcase.pluralize, params)
7
7
 
8
8
  return response
@@ -2,7 +2,7 @@ module Shipstation
2
2
  module APIOperations
3
3
  module Retrieve
4
4
 
5
- def retrieve object_id, params = {}
5
+ def retrieve(object_id, params = {})
6
6
  response = Shipstation.request(:get, "#{class_name.downcase.pluralize}/#{object_id}", params)
7
7
  return response
8
8
  end
@@ -0,0 +1,10 @@
1
+ module Shipstation
2
+ module APIOperations
3
+ module Shipment
4
+
5
+ def mark_as_shipped(params = {})
6
+ Shipstation.request(:post, 'orders/markasshipped', params)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -2,7 +2,7 @@ module Shipstation
2
2
  module APIOperations
3
3
  module Update
4
4
 
5
- def update object_id, params = {}
5
+ def update(object_id, params = {})
6
6
  Shipstation.request(:put, "#{class_name.downcase.pluralize}/#{object_id}", params)
7
7
  end
8
8
 
File without changes
@@ -1,9 +1,10 @@
1
1
  module Shipstation
2
2
  class Carrier < ApiResource
3
+ extend Shipstation::APIOperations::List
3
4
 
4
5
  class << self
5
- def list
6
- response = Shipstation.request(:get, 'carriers')
6
+ def list_services(params = {})
7
+ response = Shipstation.request(:get, 'carriers/listservices', params)
7
8
  return response
8
9
  end
9
10
  end
File without changes
@@ -6,6 +6,7 @@ module Shipstation
6
6
  extend Shipstation::APIOperations::Create
7
7
  extend Shipstation::APIOperations::Retrieve
8
8
  extend Shipstation::APIOperations::Delete
9
+ extend Shipstation::APIOperations::Shipment
9
10
 
10
11
  class << self
11
12
  def create_label(params = {})
@@ -26,6 +27,12 @@ module Shipstation
26
27
  response
27
28
  end
28
29
 
30
+ def create_bulk(params = {})
31
+ response = Shipstation.request(:post, 'orders/createorders', params)
32
+
33
+ response
34
+ end
35
+
29
36
  # params: { [:username], [:password], input: [ {:order_number, ... }, { :order_number, ... } ] }
30
37
  # todo: complete in future phase
31
38
  # def create_update_orders params
File without changes
@@ -4,15 +4,15 @@ module Shipstation
4
4
 
5
5
  class << self
6
6
  def get_rates(params = {})
7
- response = Shipstation.request(:post, "shipments/getrates", params)
8
-
9
- return response
7
+ Shipstation.request(:post, "shipments/getrates", params)
10
8
  end
11
9
 
12
10
  def create_label(params = {})
13
- response = Shipstation.request(:post, 'shipments/createlabel', params)
11
+ Shipstation.request(:post, 'shipments/createlabel', params)
12
+ end
14
13
 
15
- response
14
+ def void_label(params = {})
15
+ Shipstation.request(:post, 'shipments/voidlabel', params)
16
16
  end
17
17
  end
18
18
  end
@@ -1,11 +1,12 @@
1
1
  module Shipstation
2
2
  class Store < ApiResource
3
+ extend Shipstation::APIOperations::List
3
4
  extend Shipstation::APIOperations::Retrieve
4
5
  extend Shipstation::APIOperations::Update
5
6
 
6
7
  class << self
7
- def list
8
- response = Shipstation.request(:get, 'stores')
8
+ def list(params = {})
9
+ response = Shipstation.request(:get, 'stores', params)
9
10
 
10
11
  return response
11
12
  end
@@ -2,8 +2,8 @@ module Shipstation
2
2
  class Tag < ApiResource
3
3
 
4
4
  class << self
5
- def list
6
- response = Shipstation.request(:get, 'accounts/listtags')
5
+ def list(params = {})
6
+ response = Shipstation.request(:get, 'accounts/listtags', params)
7
7
 
8
8
  return response
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Shipstation
2
- VERSION = "0.16.7"
2
+ VERSION = "0.23"
3
3
  end
@@ -5,8 +5,8 @@ module Shipstation
5
5
  extend Shipstation::APIOperations::Update
6
6
 
7
7
  class << self
8
- def list
9
- response = Shipstation.request(:get, 'warehouses')
8
+ def list(params = {})
9
+ response = Shipstation.request(:get, 'warehouses', params)
10
10
 
11
11
  return response
12
12
  end
@@ -0,0 +1,18 @@
1
+ module Shipstation
2
+ class Webhook < ApiResource
3
+
4
+ class << self
5
+ def subscribe(params={})
6
+ response = Shipstation.request(:post, 'webhooks/subscribe', params)
7
+
8
+ return response
9
+ end
10
+
11
+ def unsubscribe(object_id, params={})
12
+ response = Shipstation.request(:delete, "webhooks/#{object_id}", params)
13
+
14
+ return response
15
+ end
16
+ end
17
+ end
18
+ end
File without changes
data/test/dummy/Gemfile CHANGED
File without changes
@@ -79,12 +79,12 @@ GEM
79
79
  mime-types-data (~> 3.2015)
80
80
  mime-types-data (3.2018.0812)
81
81
  mini_mime (1.0.1)
82
- mini_portile2 (2.3.0)
82
+ mini_portile2 (2.4.0)
83
83
  minitest (5.11.3)
84
84
  multi_json (1.13.1)
85
85
  netrc (0.11.0)
86
- nokogiri (1.8.4)
87
- mini_portile2 (~> 2.3.0)
86
+ nokogiri (1.10.4)
87
+ mini_portile2 (~> 2.4.0)
88
88
  rack (1.6.10)
89
89
  rack-test (0.6.3)
90
90
  rack (>= 1.0)
File without changes
data/test/dummy/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/test/dummy/config.ru CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/test/test_helper.rb CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipstation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.7
4
+ version: '0.23'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Dallimore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-03 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -38,6 +38,7 @@ files:
38
38
  - lib/shipstation/api_operations/delete.rb
39
39
  - lib/shipstation/api_operations/list.rb
40
40
  - lib/shipstation/api_operations/retrieve.rb
41
+ - lib/shipstation/api_operations/shipment.rb
41
42
  - lib/shipstation/api_operations/update.rb
42
43
  - lib/shipstation/api_resource.rb
43
44
  - lib/shipstation/carrier.rb
@@ -49,6 +50,7 @@ files:
49
50
  - lib/shipstation/tag.rb
50
51
  - lib/shipstation/version.rb
51
52
  - lib/shipstation/warehouse.rb
53
+ - lib/shipstation/webhook.rb
52
54
  - lib/tasks/shipstation_tasks.rake
53
55
  - test/dummy/Gemfile
54
56
  - test/dummy/Gemfile.lock
@@ -112,52 +114,51 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
114
  - !ruby/object:Gem::Version
113
115
  version: '0'
114
116
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.5.1
117
+ rubygems_version: 3.2.15
117
118
  signing_key:
118
119
  specification_version: 4
119
120
  summary: A Ruby wrapper for the Shipstation API
120
121
  test_files:
121
- - test/dummy/app/controllers/application_controller.rb
122
- - test/dummy/app/views/layouts/application.html.erb
123
122
  - test/dummy/app/assets/javascripts/application.js
124
123
  - test/dummy/app/assets/stylesheets/application.css
124
+ - test/dummy/app/controllers/application_controller.rb
125
125
  - test/dummy/app/helpers/application_helper.rb
126
- - test/dummy/test/test_helper.rb
126
+ - test/dummy/app/views/layouts/application.html.erb
127
+ - test/dummy/bin/bundle
128
+ - test/dummy/bin/rails
127
129
  - test/dummy/bin/rake
128
130
  - test/dummy/bin/setup
129
- - test/dummy/bin/bundle
130
131
  - test/dummy/bin/spring
131
- - test/dummy/bin/rails
132
- - test/dummy/config/secrets.yml
133
- - test/dummy/config/routes.rb
134
- - test/dummy/config/locales/en.yml
135
- - test/dummy/config/environments/production.rb
136
- - test/dummy/config/environments/development.rb
137
- - test/dummy/config/environments/test.rb
138
- - test/dummy/config/environment.rb
139
132
  - test/dummy/config/application.rb
140
- - test/dummy/config/database.yml
141
133
  - test/dummy/config/boot.rb
134
+ - test/dummy/config/database.yml
135
+ - test/dummy/config/environment.rb
136
+ - test/dummy/config/environments/development.rb
137
+ - test/dummy/config/environments/production.rb
138
+ - test/dummy/config/environments/test.rb
139
+ - test/dummy/config/initializers/assets.rb
142
140
  - test/dummy/config/initializers/backtrace_silencers.rb
143
- - test/dummy/config/initializers/mime_types.rb
141
+ - test/dummy/config/initializers/cookies_serializer.rb
144
142
  - test/dummy/config/initializers/filter_parameter_logging.rb
143
+ - test/dummy/config/initializers/inflections.rb
144
+ - test/dummy/config/initializers/mime_types.rb
145
145
  - test/dummy/config/initializers/session_store.rb
146
- - test/dummy/config/initializers/wrap_parameters.rb
147
- - test/dummy/config/initializers/assets.rb
148
- - test/dummy/config/initializers/cookies_serializer.rb
149
146
  - test/dummy/config/initializers/shipstation.rb
150
- - test/dummy/config/initializers/inflections.rb
147
+ - test/dummy/config/initializers/wrap_parameters.rb
148
+ - test/dummy/config/locales/en.yml
149
+ - test/dummy/config/routes.rb
150
+ - test/dummy/config/secrets.yml
151
151
  - test/dummy/config.ru
152
- - test/dummy/Rakefile
153
- - test/dummy/public/favicon.ico
154
- - test/dummy/public/422.html
155
- - test/dummy/public/500.html
156
- - test/dummy/public/404.html
157
- - test/dummy/public/robots.txt
158
152
  - test/dummy/db/seeds.rb
159
153
  - test/dummy/Gemfile
160
154
  - test/dummy/Gemfile.lock
155
+ - test/dummy/public/404.html
156
+ - test/dummy/public/422.html
157
+ - test/dummy/public/500.html
158
+ - test/dummy/public/favicon.ico
159
+ - test/dummy/public/robots.txt
160
+ - test/dummy/Rakefile
161
161
  - test/dummy/README.rdoc
162
+ - test/dummy/test/test_helper.rb
162
163
  - test/shipstation_test.rb
163
164
  - test/test_helper.rb