usps-imis-api 0.11.29 → 0.11.31

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: ff08376f763d16ba1615aea1d4d072f25c31faf5586a255cbf500d920d5d0de0
4
- data.tar.gz: fdb80613eaf2d4448e9e7731001b276f3513a86de9c9e2b85718cd99df4aa738
3
+ metadata.gz: 89c0e9fe29de0f31798abeccd536e5baf2cc453cc230a8b895cbbe75dbe2e8ee
4
+ data.tar.gz: 6757e0a1dce8914c5721cc35adee3e7e84ae8cfb9fcfb3e2ccd1645a9b396a9c
5
5
  SHA512:
6
- metadata.gz: 9ea444e537b5f978c3017045faf126474f8f53d885c6a8c802d5f81051b738f5474a43fe4de2baad28a68b5365b5e929e73717ba08cb2183cbe8e020c88873aa
7
- data.tar.gz: ac58fcaef0547ae18db0170ca5ffb1370df2965b6f8563104d9d20ff986c892ad41fffd0bcf6764a80d8ebbf96ec8bbd33bb8354acadf6227384a8e4fcbe08bd
6
+ metadata.gz: b655813057769181c8d4fb0f7d3780dc6b74bc5c4c24be99e6301994933771cfacfbac0d77bfdea7b449986ce87f025addd06c8c132c5201f813c198a4f0b951
7
+ data.tar.gz: edf1815b9d585f27e2f15d450efd0708905b847bc24f5ef5fc34dae9162b652cd4f38a4924303175bb8d649d792f1c3714301d94d1981050b3225e32a9b53a2b
data/lib/usps/imis/api.rb CHANGED
@@ -62,6 +62,8 @@ module Usps
62
62
 
63
63
  # Manually set the current ID, if you already have it for a given member
64
64
  #
65
+ # Supports integer ID and UUID string
66
+ #
65
67
  # @param id [Integer, String] iMIS ID to select for future requests
66
68
  #
67
69
  # @return [Integer] iMIS ID
@@ -69,7 +71,14 @@ module Usps
69
71
  def imis_id=(id)
70
72
  raise Errors::LockedIdError if lock_imis_id
71
73
 
72
- @imis_id = id&.to_i
74
+ hex = '[0-9a-fA-F]'
75
+ uuid_pattern = /^#{hex}{8}-#{hex}{4}-#{hex}{4}-#{hex}{4}-#{hex}{12}$/
76
+ @imis_id =
77
+ if id.to_s.match?(uuid_pattern)
78
+ id
79
+ elsif id.to_i.to_s == id.to_s
80
+ id.to_i
81
+ end
73
82
  end
74
83
 
75
84
  # Manually set the current record ID
@@ -89,6 +89,7 @@ module Usps
89
89
  case options
90
90
  in certificate: then api.imis_id_for(certificate)
91
91
  in id: then api.imis_id = id
92
+ in uuid: then api.imis_id = uuid
92
93
  else
93
94
  # Query
94
95
  end
@@ -11,6 +11,7 @@ module Usps
11
11
  certificate: ['Member certificate number', { type: :string }],
12
12
  id: ['Member iMIS ID', { type: :integer }],
13
13
  record_id: ['Specific Record ID', { type: :integer, short: :I }],
14
+ uuid: ['Record UUID', { type: :string }],
14
15
 
15
16
  # Primary interactions
16
17
  on: ['Business Object name', { type: :string }],
@@ -44,7 +45,8 @@ module Usps
44
45
  }.freeze
45
46
 
46
47
  CONFLICTING_OPTION_GROUPS = [
47
- %i[certificate id],
48
+ %i[certificate id uuid],
49
+ %i[record_id uuid],
48
50
  %i[on panel query mapper map business_objects auth_token],
49
51
  %i[field fields map query],
50
52
  %i[raw include_ids],
@@ -20,6 +20,11 @@ module Usps
20
20
  def imis_id = self['Id'].to_i
21
21
  alias id imis_id
22
22
 
23
+ # Access the Uniform ID (uuid) property
24
+ #
25
+ def uniform_id = self['UniformId']
26
+ alias uuid uniform_id
27
+
23
28
  # Access the certificate number
24
29
  #
25
30
  def certificate = self['AlternateIds'].find { it['IdType'] == 'MajorKey' }['Id']
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.11.29'
5
+ VERSION = '0.11.31'
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.29
4
+ version: 0.11.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander