usps-imis-api 0.11.2 → 0.11.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: 3ae172a9c55f4af8298e49c3eda45769f427ef373f0f136acf605e916e20ce0d
4
- data.tar.gz: 01d8ca97541785761ee2713ebf06705ba70703cf2c3435f67195ffe07b1ccc0c
3
+ metadata.gz: e8eb337744ecc5e0a04d0bcb6d7b0dc6f0a71652dcb419d2ad401fac4d2ebd62
4
+ data.tar.gz: 94cd6355d822afb03d72d17c038b4be0a4afd163ffe0c686654be3617fec355a
5
5
  SHA512:
6
- metadata.gz: 061415c29f6e9ea552de17e8b589bb1b2a842727b07b704a2eaeb48177efb8211f6f29ef013db6bdb7382df985d4e36f981f70403aa8841e4fec5c41e569cccd
7
- data.tar.gz: 53c68f5487b0b7adef9489b2507baa11b033ad3e4c316cd814d254cf4d9db649d1a421b7370e83e4b30f5e56d78631f8f9ebb4cb8076de60cf58bbfe923b0ea0
6
+ metadata.gz: 6d9c4765758a516a7119dd43dc7d2681b09eef01d00ade3967cb0495c88b1b7b09579df78e8cb35e7bf035bcb487ed03c3aeff8cf3915f890451a560cb75d003
7
+ data.tar.gz: fb012df3006fddd40566eca42371452c98908e88dd869c2733fe90ee858b1cffe44f087639787433534a9e1dc9a37cb8bd5c773e78441d5a6ea6d4ff9019c41b
@@ -65,6 +65,7 @@ module Usps
65
65
  # rubocop:disable Metrics
66
66
  def perform!
67
67
  case options
68
+ in mapper: true, data: then api.mapper.update(data)
68
69
  in map:, data: then api.mapper[map.to_sym] = data
69
70
  in map: then api.mapper[map.to_sym]
70
71
 
@@ -18,6 +18,7 @@ module Usps
18
18
  field: ['Specific field to return or update', { type: :string }],
19
19
  fields: ['Specific field(s) to return', { type: :strings, short: :F }],
20
20
  map: ['Mapped field name to return or update', { type: :string }],
21
+ mapper: ['Multiple mapped fields to update together', { short: :M }],
21
22
  data: ['JSON string input', { type: :string }],
22
23
  config: ['Path to the JSON config file to use', { type: :string, short: :C }],
23
24
  raw: ['Return raw JSON output, rather than simplified data', { short: :R }],
@@ -37,24 +38,46 @@ module Usps
37
38
 
38
39
  def self.banner_contents
39
40
  <<~BANNER
40
- Usage:
41
- imis.rb #{'[options]'.gray}
41
+ #{'Usage'.underline}
42
+
43
+ #{'imis.rb'.bold} #{'[options]'.gray}
44
+
45
+
46
+ #{'HTTP Verbs'.underline}
42
47
 
43
48
  The default HTTP verb is #{'GET'.cyan}.
49
+
44
50
  If #{'--data'.green}/#{'-d'.green} is provided, the default HTTP verb is #{'PUT'.cyan}.
45
51
 
46
52
  #{'--data'.green}/#{'-d'.green} is used to provide field(s) data for #{'PUT'.cyan}
47
53
  requests and mapper updates, object data for #{'POST'.cyan},
48
54
  and to provide any query params.
49
55
 
50
- Configuration can be specified with #{'--config'.green}/#{'-C'.green}, or by setting
51
- the following environment variables:
52
- #{'IMIS_ENVIRONMENT'.yellow}
53
- #{'IMIS_USERNAME'.yellow}
54
- #{'IMIS_PASSWORD'.yellow}
55
- #{'IMIS_ID_QUERY_NAME'.yellow}
56
56
 
57
- Options:
57
+ #{'Configuration'.underline}
58
+
59
+ API configuration can be specified in two ways:
60
+
61
+
62
+ With #{'--config'.green}/#{'-C'.green} given the path to a JSON file, e.g.:
63
+
64
+ {
65
+ "imis_id_query_name": "#{'$/IQA_QUERY_NAME'.yellow}",
66
+ "environment": "#{'development'.yellow}",
67
+ "username": "#{'USERNAME'.yellow}",
68
+ "password": "#{'PASSWORD'.yellow}"
69
+ }
70
+
71
+
72
+ By setting the following environment variables:
73
+
74
+ #{'IMIS_ID_QUERY_NAME'.yellow}
75
+ #{'IMIS_ENVIRONMENT'.yellow}
76
+ #{'IMIS_USERNAME'.yellow}
77
+ #{'IMIS_PASSWORD'.yellow}
78
+
79
+
80
+ #{'Options'.underline}
58
81
  BANNER
59
82
  end
60
83
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.11.2'
5
+ VERSION = '0.11.4'
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.2
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander