mason_hub_api 0.1.3 → 0.1.5

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: 89d45f831b2941b944dac6522cbad039fca9cbd7ba8d1b528bae7b098c3e40b3
4
- data.tar.gz: c44b069a37e75e7d520cf1909b6de134ef69f81d15a49b2d8af3a9db6331e437
3
+ metadata.gz: 81c2db4ff9fd57f3159002058ac0405fedf74b74e33cc5997f045275dcb93679
4
+ data.tar.gz: 579e6412100571043c201b2c289097a2f18637a9cdca72161ab16163e76eb950
5
5
  SHA512:
6
- metadata.gz: 32416fa9bd471ffcda821a150d791d8588d63af68a9000240333852db9b647d6c8b4531431c2dd87e5f326dbd561bb0c518b9442bf3ee56277b4efb1be30420a
7
- data.tar.gz: 8698cab1e8f1680610d4ecbd30e7961f10ee3f487c91f123fb8edb253a2f5dfb0624a2f0bafe1b95714d35959a598f31d4adf63cd7c0470362204949b2c14c51
6
+ metadata.gz: 5e6b4f05b7fb73e644f925adf3de589f5da1342eeb527a5187dabfcdb3adc947e0f4b795559d638d1193c5d191fcd72061fda40e617c1d38cfee29c3a3f4752a
7
+ data.tar.gz: ec9a0673bc6d5d9c6083dc7a370a0b8638d7a47a4c383cfe38bf09ef3166243bff9eb08b3b88165d6409daba07efea9b6dd0efb43ccd3c02a9ddca0db746c8f7
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mason_hub_api (0.1.2)
4
+ mason_hub_api (0.1.3)
5
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.1.2)
11
+ activesupport (7.1.3.2)
12
12
  base64
13
13
  bigdecimal
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -20,25 +20,24 @@ GEM
20
20
  tzinfo (~> 2.0)
21
21
  ast (2.4.2)
22
22
  base64 (0.2.0)
23
- bigdecimal (3.1.4)
23
+ bigdecimal (3.1.6)
24
24
  coderay (1.1.3)
25
- concurrent-ruby (1.2.2)
25
+ concurrent-ruby (1.2.3)
26
26
  connection_pool (2.4.1)
27
27
  diff-lcs (1.5.0)
28
28
  dotenv (2.8.1)
29
- drb (2.2.0)
30
- ruby2_keywords
31
- faraday (2.7.11)
29
+ drb (2.2.1)
30
+ faraday (2.7.12)
32
31
  base64
33
32
  faraday-net_http (>= 2.0, < 3.1)
34
33
  ruby2_keywords (>= 0.0.4)
35
34
  faraday-net_http (3.0.2)
36
- i18n (1.14.1)
35
+ i18n (1.14.4)
37
36
  concurrent-ruby (~> 1.0)
38
37
  json (2.6.3)
39
38
  language_server-protocol (3.17.0.3)
40
39
  method_source (1.0.0)
41
- minitest (5.20.0)
40
+ minitest (5.22.2)
42
41
  mutex_m (0.2.0)
43
42
  parallel (1.23.0)
44
43
  parser (3.2.2.4)
@@ -64,6 +64,8 @@ module MasonHubAPI
64
64
  params.map { |value| parse_body(value) }
65
65
  elsif params.is_a?(Hash)
66
66
  params.deep_transform_keys { |key| key.to_s.underscore }
67
+ else
68
+ params
67
69
  end
68
70
  end
69
71
 
@@ -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.3"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mason_hub_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
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-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -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