usps-imis-api 0.12.10 → 0.12.11
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 +4 -4
- data/lib/usps/imis/business_object.rb +6 -1
- data/lib/usps/imis/command_line/formatters.rb +2 -0
- data/lib/usps/imis/command_line/options.yml.erb +3 -0
- data/lib/usps/imis/command_line/performers.rb +2 -0
- data/lib/usps/imis/panels/base_panel.rb +11 -0
- data/lib/usps/imis/query.rb +3 -1
- data/lib/usps/imis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ec2297be1e5f52e2fc6e790a8a8cf2aba7ff67a430f5bef76337f42fc298289
|
|
4
|
+
data.tar.gz: 4e919e980577e95daa39fbf84d5bb0326e5fbb22d51188a7eaa7cf19434197b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 01b5bfe414810fd40b892b37d83bfd8c5bc70380c8e3b4c824bb0bc211cfc1a6152452f531403b6ae108fdb72fca8529604d571aa26aa832778590f3f0b6febe
|
|
7
|
+
data.tar.gz: bb1e46ce5c63bfbcbd0b078e9f842b9acff81a0c256d5d3209e55ca0dbc0b6240dd774379f0264987f5b0dfb3741bf743b4085945ba277435247dd55e6578546
|
|
@@ -44,7 +44,12 @@ module Usps
|
|
|
44
44
|
#
|
|
45
45
|
# @return [Usps::Imis::Query] Query wrapper
|
|
46
46
|
#
|
|
47
|
-
def query = api.query(business_object_name)
|
|
47
|
+
def query(**) = api.query(business_object_name, **)
|
|
48
|
+
|
|
49
|
+
# Get all records from the business object for the current member
|
|
50
|
+
#
|
|
51
|
+
def get_all(**) = query(**, id: api.imis_id).to_a
|
|
52
|
+
alias list get_all
|
|
48
53
|
|
|
49
54
|
# Support passthrough for Api#with
|
|
50
55
|
#
|
|
@@ -54,6 +54,7 @@ module Usps
|
|
|
54
54
|
case options
|
|
55
55
|
in delete: true then on.delete
|
|
56
56
|
in create: true, data: then on.post(data)
|
|
57
|
+
in all: true then on.list
|
|
57
58
|
in data:, field: then on.put_field(field, data)
|
|
58
59
|
in data: then on.put_fields(data)
|
|
59
60
|
in fields: then on.get_fields(*fields)
|
|
@@ -66,6 +67,7 @@ module Usps
|
|
|
66
67
|
case options
|
|
67
68
|
in delete: true, ordinal: then panel.delete(ordinal)
|
|
68
69
|
in create: true, data: then panel.post(data)
|
|
70
|
+
in all: true then panel.list
|
|
69
71
|
in ordinal:, data:, field: then panel.put_field(ordinal, field, data)
|
|
70
72
|
in ordinal:, data: then panel.put_fields(ordinal, data)
|
|
71
73
|
in ordinal:, fields: then panel.get_fields(ordinal, *fields)
|
|
@@ -21,6 +21,17 @@ module Usps
|
|
|
21
21
|
@logger = Imis.logger('Panel')
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
# Run a query on the entire business object
|
|
25
|
+
#
|
|
26
|
+
# @return [Usps::Imis::Query] Query wrapper
|
|
27
|
+
#
|
|
28
|
+
def query(**) = api.query(business_object_name, **)
|
|
29
|
+
|
|
30
|
+
# Get all records from the Panel for the current member
|
|
31
|
+
#
|
|
32
|
+
def get_all(**) = query(**, id: api.imis_id).to_a
|
|
33
|
+
alias list get_all
|
|
34
|
+
|
|
24
35
|
# Get a specific object from the Panel
|
|
25
36
|
#
|
|
26
37
|
# If +fields+ is provided, will return only those field values
|
data/lib/usps/imis/query.rb
CHANGED
|
@@ -88,7 +88,7 @@ module Usps
|
|
|
88
88
|
|
|
89
89
|
# Fetch a filtered query page, and update the current offset
|
|
90
90
|
#
|
|
91
|
-
def page = fetch_next['Items']['$values'].map { iqa? ? it.except('$type') :
|
|
91
|
+
def page = fetch_next['Items']['$values'].map { iqa? ? it.except('$type') : wrap(it) }
|
|
92
92
|
|
|
93
93
|
# Fetch the next raw query page, and update the current offset
|
|
94
94
|
#
|
|
@@ -148,6 +148,8 @@ module Usps
|
|
|
148
148
|
"#{Imis::BusinessObject::API_PATH}/#{query_name}?#{path_params.to_query}"
|
|
149
149
|
end
|
|
150
150
|
end
|
|
151
|
+
|
|
152
|
+
def wrap(data) = query_name == 'Party' ? Imis::PartyData[data] : Imis::Data[data]
|
|
151
153
|
end
|
|
152
154
|
end
|
|
153
155
|
end
|
data/lib/usps/imis/version.rb
CHANGED