usps-imis-api 0.11.13 → 0.11.14
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 44450f01517549462f9d3aa96be347bd194af2ae1b5783f6b850490e00996c1b
|
|
4
|
+
data.tar.gz: 4f0e3a76e46b7b18c1f2fb6456d49630df2bf61a123f672ac892926db3504abb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e3c7adbd2000547146095a15a375e330a9a14ec4fd63fdac085d08b36fc3932bd99f3c3c165de8321ad8b55dc7022496e5ab6c672333296fc88d180997e0acc
|
|
7
|
+
data.tar.gz: 4157ad2c639306c47026fe1a14846515a07a2933cd6f039e5d44887aef7b3e5167d2c0bd5c6bc7f5510e7d25167bbb04a986b42ea5088aa09fbcc114404c5382
|
|
@@ -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],
|
data/lib/usps/imis/version.rb
CHANGED