mason_hub_api 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d16dd76e038a33d543a22e356b487981453ea48dff32a83c8f6486976423bae
4
- data.tar.gz: 3e83b712294c7085d9bf70e0e177aaa5a676f583fa6341d6f3015f54d3dd4fbc
3
+ metadata.gz: 5d9a5d474e64378e0e777212eb6fe486898e6d1de987a2c326d6e6faeba5dce7
4
+ data.tar.gz: e0090930f22093f4cc19caad4856f6aa79344a317024c845ff6faecc26a98456
5
5
  SHA512:
6
- metadata.gz: 80d0f7239751e39448fb4fc0e85186aabba1f3f0b4dd7fefad611fa91f86fb74c0f9bfa04288aa47d7f9af6676f8e3258f5c7a154c12ceee5b47935184cc2e4c
7
- data.tar.gz: 1fd5a86fb4ff90a123b2bd39714c159e483393bc023b8a711433f321a358c54b3f854efe3aa0bb57405f4898a2a58e2bc2d334c2868c41e43a63b592dd477c74
6
+ metadata.gz: fc1f8a76f9f01088aa84be8d8f5432ff92e202b7717afa7f3146de83e22b573b777836608326e1b5413e19260ebb460f0b68c9f815bac00edaa243eafcebf9ec
7
+ data.tar.gz: 291c9355e537012a8d2f621cb088547587dffe90795591dca1f3a1d860135636a3b83535a506f7e5d1fc49cd0f41fdb48ae6df2ed62a127fd363aba2bc2a2c45
data/Gemfile.lock CHANGED
@@ -1,35 +1,44 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mason_hub_api (0.1.0)
5
- activesupport (~> 7.0.8)
4
+ mason_hub_api (0.1.3)
5
+ activesupport
6
6
  faraday (~> 2.7.10)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.8)
11
+ activesupport (7.1.3.2)
12
+ base64
13
+ bigdecimal
12
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ connection_pool (>= 2.2.5)
16
+ drb
13
17
  i18n (>= 1.6, < 2)
14
18
  minitest (>= 5.1)
19
+ mutex_m
15
20
  tzinfo (~> 2.0)
16
21
  ast (2.4.2)
17
22
  base64 (0.2.0)
23
+ bigdecimal (3.1.6)
18
24
  coderay (1.1.3)
19
- concurrent-ruby (1.2.2)
25
+ concurrent-ruby (1.2.3)
26
+ connection_pool (2.4.1)
20
27
  diff-lcs (1.5.0)
21
28
  dotenv (2.8.1)
22
- faraday (2.7.11)
29
+ drb (2.2.1)
30
+ faraday (2.7.12)
23
31
  base64
24
32
  faraday-net_http (>= 2.0, < 3.1)
25
33
  ruby2_keywords (>= 0.0.4)
26
34
  faraday-net_http (3.0.2)
27
- i18n (1.14.1)
35
+ i18n (1.14.4)
28
36
  concurrent-ruby (~> 1.0)
29
37
  json (2.6.3)
30
38
  language_server-protocol (3.17.0.3)
31
39
  method_source (1.0.0)
32
- minitest (5.20.0)
40
+ minitest (5.22.2)
41
+ mutex_m (0.2.0)
33
42
  parallel (1.23.0)
34
43
  parser (3.2.2.4)
35
44
  ast (~> 2.4.1)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support"
3
4
  require "active_support/core_ext/string"
4
5
  require "ostruct"
5
6
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support"
3
4
  require "active_support/core_ext/string"
4
5
 
5
6
  module MasonHubAPI
@@ -2,6 +2,12 @@
2
2
 
3
3
  module MasonHubAPI
4
4
  class CallbackResource < Resource
5
+ def all(message_type: "all")
6
+ response = get_request("callbacks", params: { message_type: message_type })
7
+
8
+ response.body.map { |attributes| Callback.new(attributes) }
9
+ end
10
+
5
11
  def create(attributes)
6
12
  # accept either a single hash or an array of hashes
7
13
  attributes = [attributes] if attributes.is_a?(Hash)
@@ -11,10 +17,19 @@ module MasonHubAPI
11
17
  response
12
18
  end
13
19
 
14
- def all(message_type: "all")
15
- response = get_request("callbacks", params: { message_type: message_type })
20
+ #
21
+ # Delete the registered callbacks
22
+ #
23
+ # @param [Array] message_types An array of message types to delete.
24
+ # Available type: "skuInventoryChange", "orderEvent", "orderCancelResolution", "orderUpdateResolution", "rmaEvent", "inboundShipmentEvent", "snapshotReady"
25
+ #
26
+ # @return [Response] An array of deleted callbacks
27
+ #
28
+ def delete(message_types)
29
+ message_types = [message_types] if message_types.is_a?(String)
30
+ raise ArgumentError, "message_types must be an array or string" unless message_types.is_a?(Array)
16
31
 
17
- response.body.map { |attributes| Callback.new(attributes) }
32
+ delete_request("callbacks", body: message_types).body
18
33
  end
19
34
  end
20
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MasonHubAPI
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mason_hub_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickfarm27
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.8
19
+ version: '0'
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: 7.0.8
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faraday
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubygems_version: 3.3.18
133
+ rubygems_version: 3.2.33
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: MasonHub API Wrapper