usps-imis-api 0.11.13 → 0.11.15

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: f73a43e0e4fd712b2d3dd227800c98cee6811bd9303570e00f4f6d6a3ea361d9
4
- data.tar.gz: dc6d277340cc19195170dff9f163a2b64d4a501f8e84cf3d69c2e7c7223641c8
3
+ metadata.gz: a832672e225e3d314dd72d58089ddb95650e261a6498281a31db365cbadf2c47
4
+ data.tar.gz: edb5fd91281205f91e1b5891e7d6fff16cba99b6851cf53ec89e6c925e502612
5
5
  SHA512:
6
- metadata.gz: 06dde7b0faec7e26f19b73c05326f180f8c65214d9698c9ff22380c7310788e33dc959ffd22cc26f3668e9aba43c72f7b43d279d5220bccc2012e7d55e241e21
7
- data.tar.gz: 0e62f5def3791260add8f67f07e9590f24fdc8e93f4617da1695771224d85856d816547c6d9ad2a9f1c4c7c40019fab3fb002dd5e609fa7e670e76c27ade1d57
6
+ metadata.gz: fb3943d61228582bdef6e516060e816682f48ee6552188d1306f003cee9eb973e1c2c26db1f7a8025e45d60d885512878e4bb5bfbe99a93f59ede12ad0fa4611
7
+ data.tar.gz: ec25020f0a3c138c0f250b5aadfb3e4cdf254172ab430ac587196fe5764a2f8c12a20339dddac2856ad80dade2671aca2eb5f95761461b6fd4b421ca89df8914
@@ -88,6 +88,8 @@ module Usps
88
88
 
89
89
  in query:, data: then api.query(query, data)
90
90
  in query: then api.query(query)
91
+
92
+ in business_objects: true then api.business_objects
91
93
  end
92
94
  rescue NoMatchingPatternError => e
93
95
  raise Errors::CommandLineError, "Unable to match pattern from options: #{e.message}"
@@ -115,7 +117,7 @@ module Usps
115
117
  return data if options[:raw]
116
118
 
117
119
  # Hash includes Usps::Imis::Data
118
- if data.is_a?(Hash)
120
+ if data.is_a?(Hash) && !options[:business_objects]
119
121
  data.properties(include_ids: options[:include_ids])
120
122
  elsif data.is_a?(Array) && data.all? { it.is_a?(Hash) }
121
123
  data.map { it.properties(include_ids: options[:include_ids]) }
@@ -7,19 +7,29 @@ module Usps
7
7
  #
8
8
  class OptionsParser
9
9
  OPTIONS = {
10
+ # IDs
10
11
  certificate: ['Member certificate number', { type: :string }],
11
12
  id: ['Member iMIS ID', { type: :integer }],
13
+
14
+ # Primary interactions
12
15
  on: ['Business Object name', { type: :string }],
13
16
  panel: ['Panel name', { type: :string }],
14
- ordinal: ['Ordinal ID within a Panel', { type: :integer }],
15
17
  query: ['IQA Query or Business Object name to query', { type: :string, short: :Q }],
16
18
  mapper: ['Interact with mapped fields', { short: :M }],
17
19
  map: ["Shorthand for #{'-Mf'.green} to access a single mapped field", { type: :string }],
20
+ business_objects: ['List available Business Objects'],
21
+
22
+ # Alternate verbs
18
23
  create: ["Send a #{'POST'.cyan} request", { short: :P }],
19
24
  delete: ["Send a #{'DELETE'.cyan} request", { short: :D }],
25
+
26
+ # Data
27
+ ordinal: ['Ordinal ID within a Panel', { type: :integer }],
20
28
  field: ['Specific field to return or update', { type: :string }],
21
29
  fields: ['Specific field(s) to return', { type: :strings, short: :F }],
22
30
  data: ['JSON string input', { type: :string }],
31
+
32
+ # General config
23
33
  config: ['Path to the JSON/YAML config file to use', { type: :string, short: :C }],
24
34
  raw: ['Return raw JSON output, rather than simplified data', { short: :R }],
25
35
  include_ids: ["Include any #{'iMIS ID'.yellow} and #{'Ordinal'.yellow} properties in returned data"],
@@ -30,7 +40,7 @@ module Usps
30
40
 
31
41
  CONFLICTING_OPTION_GROUPS = [
32
42
  %i[certificate id],
33
- %i[on panel query map],
43
+ %i[on panel query mapper map business_objects],
34
44
  %i[field fields map query],
35
45
  %i[raw include_ids],
36
46
  %i[quiet log_level],
@@ -71,7 +81,7 @@ module Usps
71
81
  <<~BANNER
72
82
  #{'Usage'.underline}
73
83
 
74
- #{'imis.rb'.bold} #{'[options]'.gray}
84
+ #{'imis'.bold} #{'[options]'.gray}
75
85
 
76
86
 
77
87
  #{'Further Help'.underline}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.11.13'
5
+ VERSION = '0.11.15'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-imis-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.13
4
+ version: 0.11.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander