cts-mpx 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -27
- data/Rakefile +1 -1
- data/config/root_registry_sea1.json +92 -92
- data/cts-mpx.gemspec +2 -1
- data/lib/cts/mpx/driver/assemblers.rb +5 -5
- data/lib/cts/mpx/driver/exceptions.rb +4 -6
- data/lib/cts/mpx/driver/page.rb +11 -1
- data/lib/cts/mpx/driver/request.rb +1 -1
- data/lib/cts/mpx/driver/response.rb +1 -1
- data/lib/cts/mpx/entries.rb +15 -7
- data/lib/cts/mpx/entry.rb +21 -13
- data/lib/cts/mpx/field.rb +1 -1
- data/lib/cts/mpx/fields.rb +2 -1
- data/lib/cts/mpx/query.rb +6 -9
- data/lib/cts/mpx/registry.rb +5 -2
- data/lib/cts/mpx/service.rb +1 -0
- data/lib/cts/mpx/services.rb +16 -2
- data/lib/cts/mpx/services/data.rb +14 -15
- data/lib/cts/mpx/services/web.rb +4 -4
- data/lib/cts/mpx/user.rb +8 -7
- data/lib/cts/mpx/version.rb +1 -1
- metadata +20 -7
- data/COPYRIGHT +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '093703b1860e83e394cabc1a41265df8f68aaae1'
|
4
|
+
data.tar.gz: 7015a35fe53ed1ee309e3091ab25dcdd4da757c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25e01f7ffa9ec6df19006c2a387dc80186f53556595939ef04fe609feddd6d5d193508e242cb8e96537bf8d4c7d438a817dc861f8bc3fd03620517d21a7b7534
|
7
|
+
data.tar.gz: 5738666bc5198383797fcc9db6bc6a116a2e7a5c8bf8310e749bbe0f7cef2b2b6e15ceea96546711009d6f59a9f56f28d388f679f19f96b1dd659c75ec032b80
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cts-mpx (1.0.
|
5
|
-
creatable
|
4
|
+
cts-mpx (1.0.2)
|
5
|
+
creatable
|
6
6
|
excon
|
7
7
|
oj (= 3.5.0)
|
8
8
|
|
@@ -13,26 +13,17 @@ GEM
|
|
13
13
|
ast (2.4.0)
|
14
14
|
binding_of_caller (0.8.0)
|
15
15
|
debug_inspector (>= 0.0.1)
|
16
|
-
builder (3.2.3)
|
17
16
|
bump (0.6.1)
|
18
17
|
coderay (1.1.2)
|
19
|
-
creatable (1.
|
18
|
+
creatable (2.1.1)
|
20
19
|
debug_inspector (0.0.3)
|
21
20
|
diff-lcs (1.3)
|
22
21
|
docile (1.3.1)
|
23
22
|
erubis (2.7.0)
|
23
|
+
eventmachine (1.2.7)
|
24
24
|
excon (0.62.0)
|
25
|
-
faraday (0.15.2)
|
26
|
-
multipart-post (>= 1.2, < 3)
|
27
25
|
ffi (1.9.25)
|
28
26
|
formatador (0.2.5)
|
29
|
-
geminabox (1.1.0)
|
30
|
-
builder
|
31
|
-
faraday
|
32
|
-
httpclient (>= 2.2.7)
|
33
|
-
nesty
|
34
|
-
reentrant_flock
|
35
|
-
sinatra (>= 1.2.7)
|
36
27
|
gli (2.17.2)
|
37
28
|
guard (2.14.2)
|
38
29
|
formatador (>= 0.2.4)
|
@@ -59,19 +50,20 @@ GEM
|
|
59
50
|
guard (>= 1.1.0)
|
60
51
|
yard (>= 0.7.0)
|
61
52
|
hirb (0.7.3)
|
62
|
-
|
53
|
+
htmlentities (4.3.4)
|
63
54
|
interception (0.5)
|
64
55
|
json (2.1.0)
|
56
|
+
kramdown (1.17.0)
|
65
57
|
listen (3.1.5)
|
66
58
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
67
59
|
rb-inotify (~> 0.9, >= 0.9.7)
|
68
60
|
ruby_dep (~> 1.2)
|
69
61
|
lumberjack (1.0.13)
|
70
62
|
method_source (0.9.0)
|
71
|
-
|
72
|
-
mustermann (1.0.3)
|
63
|
+
mini_portile2 (2.3.0)
|
73
64
|
nenv (0.3.0)
|
74
|
-
|
65
|
+
nokogiri (1.8.5)
|
66
|
+
mini_portile2 (~> 2.3.0)
|
75
67
|
notiffany (0.1.1)
|
76
68
|
nenv (~> 0.1)
|
77
69
|
shellany (~> 0.0)
|
@@ -89,15 +81,13 @@ GEM
|
|
89
81
|
pry-stack_explorer (0.4.9.2)
|
90
82
|
binding_of_caller (>= 0.7)
|
91
83
|
pry (>= 0.9.11)
|
92
|
-
rack (2.0.5)
|
93
|
-
rack-protection (2.0.3)
|
94
|
-
rack
|
95
84
|
rainbow (3.0.0)
|
96
85
|
rake (12.3.1)
|
97
86
|
rb-fsevent (0.10.3)
|
98
87
|
rb-inotify (0.9.10)
|
99
88
|
ffi (>= 0.5.0, < 2)
|
100
|
-
|
89
|
+
reverse_markdown (1.1.0)
|
90
|
+
nokogiri
|
101
91
|
rspec (3.8.0)
|
102
92
|
rspec-core (~> 3.8.0)
|
103
93
|
rspec-expectations (~> 3.8.0)
|
@@ -132,11 +122,17 @@ GEM
|
|
132
122
|
hirb
|
133
123
|
simplecov
|
134
124
|
simplecov-html (0.10.2)
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
125
|
+
solargraph (0.28.2)
|
126
|
+
coderay (~> 1.1)
|
127
|
+
eventmachine (~> 1.2, >= 1.2.5)
|
128
|
+
htmlentities (~> 4.3, >= 4.3.4)
|
129
|
+
kramdown (~> 1.16)
|
130
|
+
parser (~> 2.4)
|
131
|
+
reverse_markdown (~> 1.0, >= 1.0.5)
|
132
|
+
rubocop (~> 0.52)
|
133
|
+
thor (~> 0.19, >= 0.19.4)
|
139
134
|
tilt (~> 2.0)
|
135
|
+
yard (~> 0.9)
|
140
136
|
thor (0.20.0)
|
141
137
|
tilt (2.0.8)
|
142
138
|
unicode-display_width (1.4.0)
|
@@ -150,7 +146,6 @@ DEPENDENCIES
|
|
150
146
|
bundler
|
151
147
|
cts-mpx!
|
152
148
|
erubis
|
153
|
-
geminabox
|
154
149
|
gli
|
155
150
|
guard
|
156
151
|
guard-bundler
|
@@ -166,7 +161,8 @@ DEPENDENCIES
|
|
166
161
|
rubocop-rspec
|
167
162
|
simplecov
|
168
163
|
simplecov-console
|
164
|
+
solargraph
|
169
165
|
yard
|
170
166
|
|
171
167
|
BUNDLED WITH
|
172
|
-
1.16.
|
168
|
+
1.16.5
|
data/Rakefile
CHANGED
@@ -1,118 +1,118 @@
|
|
1
1
|
{
|
2
2
|
"resolveDomainResponse": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
3
|
+
"ACS Data Service": "http://data.acs.euid.theplatform.com/acsdata",
|
4
|
+
"ACS Data Service read-only": "http://data.acs.euid.theplatform.com/acsdata",
|
5
|
+
"Access Data Service": "http://access.auth.theplatform.com",
|
6
|
+
"Access Data Service audience": "http://enduser.access.auth.theplatform.com",
|
7
|
+
"Access Data Service audience read-only": "http://enduser.access.auth.theplatform.com",
|
8
|
+
"Access Data Service master": "http://access.auth.theplatform.com",
|
9
|
+
"Access Data Service read-only": "http://access.auth.theplatform.com",
|
10
|
+
"Account Data Service": "http://mps.theplatform.com",
|
11
|
+
"Account Data Service read-only": "http://mps.theplatform.com",
|
12
|
+
"Address Service": "https://address.commerce.theplatform.com/address",
|
13
|
+
"Address Service read-only": "https://address.commerce.theplatform.com/address",
|
14
|
+
"Admin Storefront Service": "https://admin.storefront.commerce.theplatform.com/storefront",
|
15
|
+
"Alternate Content Data Service": "https://data.altcontent.tv.theplatform.com/altcontent",
|
16
|
+
"Checkout Service": "https://checkout.commerce.theplatform.com/checkout",
|
17
|
+
"Commerce Configuration Data Service": "https://data.configuration.commerce.theplatform.com/configuration",
|
18
|
+
"Commerce Configuration Data Service read-only": "https://read.data.configuration.commerce.theplatform.com/configuration",
|
6
19
|
"Commerce End User Notification Service": "https://euns.commerce.theplatform.com/euns",
|
20
|
+
"Commerce Event Data Service": "https://data.event.commerce.theplatform.com/event",
|
21
|
+
"Commerce Event Data Service read-only": "https://data.event.commerce.theplatform.com/event",
|
22
|
+
"Concurrency Service": "https://concurrency.delivery.theplatform.com/concurrency",
|
7
23
|
"Console Data Service": "http://data.mpx.theplatform.com/cds",
|
8
|
-
"
|
9
|
-
"Ingest Data Service": "http://adapter.ingest.theplatform.com/adapter",
|
10
|
-
"FeedReader Data Service read-only": "https://feedreader.ingest.theplatform.com/feedreader",
|
24
|
+
"Console Data Service read-only": "http://data.mpx.theplatform.com/cds",
|
11
25
|
"Conviva Insights": "https://viewerinsights.theplatform.com/sso/thePlatform?url={account}&endpoint=Basic&token={token}",
|
12
|
-
"
|
13
|
-
"ACS Data Service read-only": "http://data.acs.euid.theplatform.com/acsdata",
|
14
|
-
"Storefront Service": "https://storefront.commerce.theplatform.com/storefront",
|
15
|
-
"FeedReader Data Service": "https://feedreader.ingest.theplatform.com/feedreader",
|
16
|
-
"Sharing Data Service": "http://data.share.theplatform.com/sharing",
|
17
|
-
"TV Listing Data Service read-only": "http://read.data.listing.tv.theplatform.com/listing",
|
18
|
-
"Static Web Files": "http://web.theplatform.com",
|
19
|
-
"Publish Service": "http://publish.theplatform.com",
|
20
|
-
"Selector Reporting Service": "http://release.theplatform.com",
|
21
|
-
"Entertainment Feeds Service": "http://feed.entertainment.tv.theplatform.com/f",
|
22
|
-
"User Profile Metadata Service": "http://userprofiles.community.theplatform.com/userprofile",
|
23
|
-
"WatchFolder Data Service": "https://watchfolder.ingest.theplatform.com/wf",
|
24
|
-
"Task Service": "http://data.task.theplatform.com/task",
|
26
|
+
"Cue Point Data Service": "http://data.cuepoint.theplatform.com/cuepoint",
|
25
27
|
"Cue Point Data Service read-only": "http://data.cuepoint.theplatform.com/cuepoint",
|
26
|
-
"
|
27
|
-
"
|
28
|
+
"Decision Manager Service": "https://decide.altcontent.tv.theplatform.com/d",
|
29
|
+
"Delivery Data Service": "http://data.delivery.theplatform.com/delivery",
|
30
|
+
"Delivery Data Service read-only": "http://data.delivery.theplatform.com/delivery",
|
31
|
+
"End User Data Service": "https://euid.theplatform.com/idm",
|
32
|
+
"End User Data Service read-only": "https://euid.theplatform.com/idm",
|
33
|
+
"Entertainment Data Service": "http://data.entertainment.tv.theplatform.com/entertainment",
|
34
|
+
"Entertainment Data Service read-only": "http://read.data.entertainment.tv.theplatform.com/entertainment",
|
35
|
+
"Entertainment Feeds Service": "http://feed.entertainment.tv.theplatform.com/f",
|
28
36
|
"Entertainment Ingest Data Service": "http://data.ingest.tv.theplatform.com/ingest",
|
29
|
-
"
|
37
|
+
"Entertainment Ingest Data Service read-only": "http://data.ingest.tv.theplatform.com/ingest",
|
38
|
+
"Entitlement Data Service": "http://data.entitlement.theplatform.com/eds",
|
39
|
+
"Entitlement Data Service read-only": "http://data.entitlement.theplatform.com/eds",
|
30
40
|
"Entitlement License Service": "http://entitlement.theplatform.com/license",
|
31
41
|
"Entitlement Web Service": "http://entitlement.theplatform.com/ent",
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"User Data Service master": "https://identity.auth.theplatform.com/idm",
|
36
|
-
"Alternate Content Data Service": "https://data.altcontent.tv.theplatform.com/altcontent",
|
37
|
-
"Validation Service": "http://validation.theplatform.com/validation",
|
38
|
-
"Selector Web Service": "http://link.theplatform.com",
|
39
|
-
"Promotion Service": "https://promotion.commerce.theplatform.com/promotion",
|
42
|
+
"FeedReader Data Service": "https://feedreader.ingest.theplatform.com/feedreader",
|
43
|
+
"FeedReader Data Service read-only": "https://feedreader.ingest.theplatform.com/feedreader",
|
44
|
+
"Feeds Data Service": "http://data.feed.theplatform.com/feed",
|
40
45
|
"Feeds Data Service read-only": "http://read.data.feed.theplatform.com/feed",
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
46
|
+
"Feeds Service": "http://feed.theplatform.com/f",
|
47
|
+
"File Management Service": "http://fms.theplatform.com",
|
48
|
+
"Flash Access Service": "http://flashaccess.entitlement.theplatform.com",
|
49
|
+
"Fulfillment Service": "https://fulfillment.commerce.theplatform.com/fulfillment",
|
50
|
+
"Ingest Data Service": "http://adapter.ingest.theplatform.com/adapter",
|
51
|
+
"Ingest Data Service read-only": "http://adapter.ingest.theplatform.com/adapter",
|
52
|
+
"Ingest Service": "http://ingest.theplatform.com",
|
53
|
+
"Key Data Service": "https://data.key.entitlement.theplatform.com/key",
|
44
54
|
"Key Data Service read-only": "https://data.key.entitlement.theplatform.com/key",
|
45
|
-
"
|
46
|
-
"Address Service": "https://address.commerce.theplatform.com/address",
|
47
|
-
"Commerce Event Data Service": "https://data.event.commerce.theplatform.com/event",
|
48
|
-
"End User Data Service read-only": "https://euid.theplatform.com/idm",
|
49
|
-
"Access Data Service": "http://access.auth.theplatform.com",
|
55
|
+
"Ledger Data Service": "https://ledger.commerce.theplatform.com/ledger",
|
50
56
|
"Ledger Data Service read-only": "https://ledger.commerce.theplatform.com/ledger",
|
51
|
-
"Product Feeds Service": "http://feed.product.theplatform.com/f",
|
52
|
-
"Message Data Service read-only": "http://data.message.theplatform.com/message",
|
53
57
|
"Live Event Data Service": "http://data.liveevent.theplatform.com/liveevent",
|
58
|
+
"Live Event Data Service read-only": "http://data.liveevent.theplatform.com/liveevent",
|
59
|
+
"Live Event Service": "http://liveevent.theplatform.com",
|
60
|
+
"Manifest Redirect Service": "http://redirect.manifest.theplatform.com/r",
|
61
|
+
"Media Data Service": "http://data.media.theplatform.com/media",
|
54
62
|
"Media Data Service read-only": "http://read.data.media.theplatform.com/media",
|
55
|
-
"
|
56
|
-
"
|
63
|
+
"Message Data Service": "http://data.message.theplatform.com/message",
|
64
|
+
"Message Data Service read-only": "http://data.message.theplatform.com/message",
|
65
|
+
"Order Data Service": "https://order.commerce.theplatform.com/order",
|
66
|
+
"Order Data Service read-only": "https://read.order.commerce.theplatform.com/order",
|
67
|
+
"Order Item Data Service": "http://order.commerce.theplatform.com/order",
|
68
|
+
"Order Item Data Service read-only": "http://order.commerce.theplatform.com/order",
|
69
|
+
"PDK": "https://pdk.theplatform.com",
|
70
|
+
"PDK 6": "https://pdk.theplatform.com/pdk6",
|
71
|
+
"Payment Data Service": "https://payment.commerce.theplatform.com/payment",
|
57
72
|
"Payment Data Service read-only": "https://payment.commerce.theplatform.com/payment",
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"Console Data Service read-only": "http://data.mpx.theplatform.com/cds",
|
61
|
-
"Ingest Data Service read-only": "http://adapter.ingest.theplatform.com/adapter",
|
73
|
+
"Payment Service": "https://payment.commerce.theplatform.com/payment",
|
74
|
+
"Player Data Service": "http://data.player.theplatform.com/player",
|
62
75
|
"Player Data Service read-only": "http://read.data.player.theplatform.com/player",
|
76
|
+
"Player Service": "http://player.theplatform.com",
|
77
|
+
"Product Data Service": "http://data.product.theplatform.com/product",
|
78
|
+
"Product Data Service read-only": "http://read.data.product.theplatform.com/product",
|
79
|
+
"Product Feeds Service": "http://feed.product.theplatform.com/f",
|
63
80
|
"Promotion Data Service": "https://promotion.commerce.theplatform.com/promotion",
|
64
|
-
"
|
81
|
+
"Promotion Data Service read-only": "https://promotion.commerce.theplatform.com/promotion",
|
82
|
+
"Promotion Service": "https://promotion.commerce.theplatform.com/promotion",
|
83
|
+
"Publish Data Service": "http://data.publish.theplatform.com/publish",
|
84
|
+
"Publish Data Service read-only": "http://data.publish.theplatform.com/publish",
|
85
|
+
"Publish Service": "http://publish.theplatform.com",
|
86
|
+
"Sales Tax Service": "https://tax.commerce.theplatform.com/tax",
|
87
|
+
"Selector Reporting Service": "http://release.theplatform.com",
|
88
|
+
"Selector Reporting Service read-only": "http://mps.theplatform.com",
|
89
|
+
"Selector Service": "http://link.theplatform.com/s",
|
90
|
+
"Selector Web Service": "http://link.theplatform.com",
|
91
|
+
"Sharing Data Service": "http://data.share.theplatform.com/sharing",
|
65
92
|
"Sharing Data Service read-only": "http://data.share.theplatform.com/sharing",
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"Commerce Configuration Data Service read-only": "https://read.data.configuration.commerce.theplatform.com/configuration",
|
70
|
-
"PDK 6": "https://pdk.theplatform.com/pdk6",
|
93
|
+
"Shopping Cart Service": "https://shoppingcart.commerce.theplatform.com/cart",
|
94
|
+
"Static Web Files": "http://web.theplatform.com",
|
95
|
+
"Storefront Service": "https://storefront.commerce.theplatform.com/storefront",
|
71
96
|
"Stub Ingest Service": "http://ingest-stub.ingest.theplatform.com/service/ingest/mps",
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"User Profile Data Service read-only": "http://data.userprofile.community.theplatform.com/userprofile",
|
76
|
-
"Order Item Data Service": "http://order.commerce.theplatform.com/order",
|
77
|
-
"Concurrency Service": "https://concurrency.delivery.theplatform.com/concurrency",
|
78
|
-
"Delivery Data Service read-only": "http://data.delivery.theplatform.com/delivery",
|
97
|
+
"TV Listing Data Service": "http://data.listing.tv.theplatform.com/listing",
|
98
|
+
"TV Listing Data Service read-only": "http://read.data.listing.tv.theplatform.com/listing",
|
99
|
+
"Task Service": "http://data.task.theplatform.com/task",
|
79
100
|
"Task Service read-only": "http://data.task.theplatform.com/task",
|
80
|
-
"
|
81
|
-
"
|
82
|
-
"Payment Service": "https://payment.commerce.theplatform.com/payment",
|
83
|
-
"Sales Tax Service": "https://tax.commerce.theplatform.com/tax",
|
84
|
-
"Access Data Service audience": "http://enduser.access.auth.theplatform.com",
|
85
|
-
"Promotion Data Service read-only": "https://promotion.commerce.theplatform.com/promotion",
|
86
|
-
"Account Data Service read-only": "http://mps.theplatform.com",
|
87
|
-
"End User Data Service": "https://euid.theplatform.com/idm",
|
88
|
-
"Feeds Data Service": "http://data.feed.theplatform.com/feed",
|
89
|
-
"Product Data Service": "http://data.product.theplatform.com/product",
|
90
|
-
"PDK": "https://pdk.theplatform.com",
|
101
|
+
"User Data Service": "https://identity.auth.theplatform.com/idm",
|
102
|
+
"User Data Service master": "https://identity.auth.theplatform.com/idm",
|
91
103
|
"User Data Service read-only": "https://identity.auth.theplatform.com/idm",
|
92
104
|
"User Profile Data Service": "http://data.userprofile.community.theplatform.com/userprofile",
|
93
|
-
"
|
94
|
-
"
|
95
|
-
"
|
96
|
-
"
|
97
|
-
"
|
98
|
-
"
|
105
|
+
"User Profile Data Service read-only": "http://data.userprofile.community.theplatform.com/userprofile",
|
106
|
+
"User Profile Metadata Service": "http://userprofiles.community.theplatform.com/userprofile",
|
107
|
+
"Validation Data Service": "http://data.validation.theplatform.com/validation",
|
108
|
+
"Validation Data Service read-only": "http://data.validation.theplatform.com/validation",
|
109
|
+
"Validation Service": "http://validation.theplatform.com/validation",
|
110
|
+
"WatchFolder Data Service": "https://watchfolder.ingest.theplatform.com/wf",
|
111
|
+
"WatchFolder Data Service read-only": "https://watchfolder.ingest.theplatform.com/wf",
|
112
|
+
"Windows Media License Generator Service": "http://208.79.64.254/LicenseServer",
|
99
113
|
"Windows Media License Service": "https://wm.entitlement.theplatform.com/wmlicense",
|
100
|
-
"
|
101
|
-
"Flash Access Service": "http://flashaccess.entitlement.theplatform.com",
|
102
|
-
"Ledger Data Service": "https://ledger.commerce.theplatform.com/ledger",
|
103
|
-
"Entertainment Data Service": "http://data.entertainment.tv.theplatform.com/entertainment",
|
104
|
-
"Access Data Service master": "http://access.auth.theplatform.com",
|
105
|
-
"Cue Point Data Service": "http://data.cuepoint.theplatform.com/cuepoint",
|
114
|
+
"Workflow Data Service": "http://data.workflow.theplatform.com/workflow",
|
106
115
|
"Workflow Data Service read-only": "http://data.workflow.theplatform.com/workflow",
|
107
|
-
"
|
108
|
-
"Access Data Service audience read-only": "http://enduser.access.auth.theplatform.com",
|
109
|
-
"Product Data Service read-only": "http://read.data.product.theplatform.com/product",
|
110
|
-
"Payment Data Service": "https://payment.commerce.theplatform.com/payment",
|
111
|
-
"File Management Service": "http://fms.theplatform.com",
|
112
|
-
"Windows Media License Generator Service": "http://208.79.64.254/LicenseServer",
|
113
|
-
"Order Data Service": "https://order.commerce.theplatform.com/order",
|
114
|
-
"Live Event Service": "http://liveevent.theplatform.com",
|
115
|
-
"Account Data Service": "http://mps.theplatform.com",
|
116
|
-
"Entitlement Data Service": "http://data.entitlement.theplatform.com/eds"
|
116
|
+
"comScore Digital Analytix": "http://comscore.theplatform.com?token={token}&account={account}&display=account"
|
117
117
|
}
|
118
118
|
}
|
data/cts-mpx.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
spec.required_ruby_version = '>= 2.4.0'
|
19
19
|
|
20
|
-
spec.add_runtime_dependency "creatable"
|
20
|
+
spec.add_runtime_dependency "creatable"
|
21
21
|
spec.add_runtime_dependency "excon"
|
22
22
|
spec.add_runtime_dependency "oj", "3.5.0"
|
23
23
|
|
@@ -39,5 +39,6 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_development_dependency "rubocop-rspec"
|
40
40
|
spec.add_development_dependency "simplecov"
|
41
41
|
spec.add_development_dependency "simplecov-console"
|
42
|
+
spec.add_development_dependency "solargraph"
|
42
43
|
spec.add_development_dependency "yard"
|
43
44
|
end
|
@@ -19,7 +19,7 @@ module Cts
|
|
19
19
|
user.token!
|
20
20
|
|
21
21
|
service = Services[service]
|
22
|
-
u = URI.parse service.url
|
22
|
+
u = URI.parse service.url(account_id)
|
23
23
|
|
24
24
|
[u.scheme, u.host].join('://')
|
25
25
|
end
|
@@ -34,7 +34,7 @@ module Cts
|
|
34
34
|
# @return [String] assembled path for a data call
|
35
35
|
def path(service: nil, endpoint: nil, extra_path: nil, ids: nil, account_id: 'urn:theplatform:auth:root')
|
36
36
|
Helpers.required_arguments %i[service endpoint], binding
|
37
|
-
service = Services[service
|
37
|
+
service = Services[].find { |s| s.name == service && s.endpoints.include?(endpoint) }
|
38
38
|
|
39
39
|
path = "#{URI.parse(service.url(account_id)).path}/#{service.path}/#{endpoint}"
|
40
40
|
path += "/#{extra_path}" if extra_path
|
@@ -56,11 +56,11 @@ module Cts
|
|
56
56
|
# @raise [ArgumentError] if user, service or endpoint is not supplied
|
57
57
|
# @raise [RuntimeError] if the user token is not set
|
58
58
|
# @return [Hash] assembled query for a data call
|
59
|
-
def query(user: nil,
|
59
|
+
def query(user: nil, account_id: nil, service: nil, endpoint: nil, query: {}, range: nil, count: nil, entries: nil, sort: nil)
|
60
60
|
Helpers.required_arguments %i[user service endpoint], binding
|
61
61
|
user.token!
|
62
62
|
|
63
|
-
service = Services[service
|
63
|
+
service = Services[].find { |s| s.name == service && s.endpoints.include?(endpoint) }
|
64
64
|
|
65
65
|
h = {}
|
66
66
|
if service.type == 'data'
|
@@ -70,7 +70,7 @@ module Cts
|
|
70
70
|
h.merge!(token: user.token, schema: service.endpoints[endpoint]['schema'], form: service.form)
|
71
71
|
end
|
72
72
|
|
73
|
-
h[:account] =
|
73
|
+
h[:account] = account_id if account_id
|
74
74
|
h.delete :token if user.token == 'sign_in_token'
|
75
75
|
h.merge! query
|
76
76
|
h
|
@@ -10,6 +10,7 @@ module Cts
|
|
10
10
|
# @return [nil]
|
11
11
|
def raise_unless_account_id(argument)
|
12
12
|
raise ArgumentError, "#{argument} is not a valid account_id" unless Validators.account_id? argument
|
13
|
+
|
13
14
|
nil
|
14
15
|
end
|
15
16
|
|
@@ -19,12 +20,8 @@ module Cts
|
|
19
20
|
# @raise [ArgumentError] if the argument is not of the correct type
|
20
21
|
# @return [nil]
|
21
22
|
def raise_unless_argument_error?(data, type = nil, &block)
|
22
|
-
|
23
|
-
|
24
|
-
raise ArgumentError, msg unless Validators.argument_error?(data, type, &block)
|
25
|
-
elsif Validators.argument_error?(data, type, &block)
|
26
|
-
raise ArgumentError, msg
|
27
|
-
end
|
23
|
+
raise(ArgumentError, "#{data} is not a valid #{type}") if Validators.argument_error?(data, type, &block)
|
24
|
+
|
28
25
|
nil
|
29
26
|
end
|
30
27
|
|
@@ -34,6 +31,7 @@ module Cts
|
|
34
31
|
# @return [nil]
|
35
32
|
def raise_unless_reference?(argument)
|
36
33
|
raise ArgumentError, "#{argument} is not a valid reference" unless Validators.reference? argument
|
34
|
+
|
37
35
|
nil
|
38
36
|
end
|
39
37
|
|
data/lib/cts/mpx/driver/page.rb
CHANGED
@@ -7,7 +7,7 @@ module Cts
|
|
7
7
|
# @attribute xmlns
|
8
8
|
# @return [Hash] active namespace received for this page
|
9
9
|
class Page
|
10
|
-
|
10
|
+
include Creatable
|
11
11
|
include Enumerable
|
12
12
|
|
13
13
|
attribute name: 'entries', kind_of: Array
|
@@ -18,6 +18,16 @@ module Cts
|
|
18
18
|
@xmlns = {}
|
19
19
|
end
|
20
20
|
|
21
|
+
def to_mpx_entries
|
22
|
+
c = @entries.map do |e|
|
23
|
+
r = Entry.new
|
24
|
+
r.fields = Fields.create_from_data(data: e, xmlns: xmlns)
|
25
|
+
end
|
26
|
+
|
27
|
+
e = Entries.create collection: c
|
28
|
+
e
|
29
|
+
end
|
30
|
+
|
21
31
|
# return a json copy of the object, useful for later interpreation
|
22
32
|
# @param [Object] indent_depth sets indent depth to 2 if not nil
|
23
33
|
# @return [String] json serialized copy of the page
|
@@ -17,7 +17,7 @@ module Cts
|
|
17
17
|
# @attribute headers
|
18
18
|
# @return [Hash] headers to transmit to the services along with the request
|
19
19
|
class Request
|
20
|
-
|
20
|
+
include Creatable
|
21
21
|
|
22
22
|
attribute name: 'method', kind_of: Symbol
|
23
23
|
attribute name: 'url', kind_of: String
|
@@ -5,7 +5,7 @@ module Cts
|
|
5
5
|
# Class to contain a response from the services, has a few helper methods to make reading the data easier.
|
6
6
|
#
|
7
7
|
class Response
|
8
|
-
|
8
|
+
include Creatable
|
9
9
|
|
10
10
|
# @!attribute original
|
11
11
|
# @return [Excon::Response] copy of the original excon response.
|
data/lib/cts/mpx/entries.rb
CHANGED
@@ -6,7 +6,8 @@ module Cts
|
|
6
6
|
class Entries
|
7
7
|
include Enumerable
|
8
8
|
include Driver
|
9
|
-
|
9
|
+
include Creatable
|
10
|
+
extend Forwardable
|
10
11
|
|
11
12
|
attribute name: 'collection', kind_of: Array
|
12
13
|
|
@@ -16,14 +17,11 @@ module Cts
|
|
16
17
|
# @return [Entries] a new entries collection
|
17
18
|
def self.create_from_page(page)
|
18
19
|
Exceptions.raise_unless_argument_error? page, Page
|
19
|
-
entries =
|
20
|
-
|
21
|
-
entry = Entry.new
|
22
|
-
entry.fields = Fields.create_from_data(data: e, xmlns: page.xmlns)
|
20
|
+
entries = page.entries.each do |e|
|
21
|
+
entry = Entry.create(fields: Fields.create_from_data(data: e, xmlns: page.xmlns))
|
23
22
|
entry.id = entry.fields['id'] if entry.fields['id']
|
24
|
-
entries.add entry
|
25
23
|
end
|
26
|
-
entries
|
24
|
+
Entries.create(collection: entries)
|
27
25
|
end
|
28
26
|
|
29
27
|
# Addressable method, indexed by entry object
|
@@ -31,15 +29,25 @@ module Cts
|
|
31
29
|
# @return [Self.collection,Entry,nil] Can return the collection, a single entry, or nil if nothing found
|
32
30
|
def [](key = nil)
|
33
31
|
return @collection unless key
|
32
|
+
|
34
33
|
@collection.find { |e| e.id == key }
|
35
34
|
end
|
36
35
|
|
36
|
+
def +(other)
|
37
|
+
Entries.create collection: @collection += other.collection
|
38
|
+
end
|
39
|
+
|
40
|
+
def -(other)
|
41
|
+
Entries.create collection: @collection += other.collection
|
42
|
+
end
|
43
|
+
|
37
44
|
# Add an entry object to the collection
|
38
45
|
# @param [Entry] entry instantiated Entry to include
|
39
46
|
# @raise [ArgumentError] if entry is not an Entry
|
40
47
|
# @return [Self]
|
41
48
|
def add(entry)
|
42
49
|
return self if @collection.include? entry
|
50
|
+
|
43
51
|
Exceptions.raise_unless_argument_error? entry, Entry
|
44
52
|
@collection.push entry
|
45
53
|
self
|
data/lib/cts/mpx/entry.rb
CHANGED
@@ -2,7 +2,7 @@ module Cts
|
|
2
2
|
module Mpx
|
3
3
|
# ORM style class to contain any entry from the data services.
|
4
4
|
class Entry
|
5
|
-
|
5
|
+
include Creatable
|
6
6
|
|
7
7
|
attribute name: 'endpoint', kind_of: String
|
8
8
|
attribute name: 'fields', kind_of: Fields
|
@@ -14,7 +14,7 @@ module Cts
|
|
14
14
|
# @param [String] id long form id to look up
|
15
15
|
# @param [String] fields comma delimited list of fields to collect
|
16
16
|
# @return [Entry] the resulting entry
|
17
|
-
def self.load_by_id(user: nil, id: nil, fields: nil)
|
17
|
+
def self.load_by_id(user: nil, id: nil, fields: nil, account_id: nil)
|
18
18
|
Driver::Helpers.required_arguments %i[user id], binding
|
19
19
|
|
20
20
|
Driver::Exceptions.raise_unless_argument_error? user, User
|
@@ -22,7 +22,7 @@ module Cts
|
|
22
22
|
|
23
23
|
e = new
|
24
24
|
e.id = id
|
25
|
-
e.load user: user, fields:
|
25
|
+
e.load user: user, fields: fields, account_id: account_id
|
26
26
|
e
|
27
27
|
end
|
28
28
|
|
@@ -35,13 +35,17 @@ module Cts
|
|
35
35
|
# Set the id of the entry, will check if it's a valid reference.
|
36
36
|
# @param [String] account_id account_id to set the entry to
|
37
37
|
# @return [Entry] the resulting entry
|
38
|
-
def id=(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
def id=(id)
|
39
|
+
if id.nil?
|
40
|
+
fields.remove 'id'
|
41
|
+
@id, @service, @endpoint = nil
|
42
|
+
else
|
43
|
+
Driver::Exceptions.raise_unless_reference? id
|
44
|
+
result = Services.from_url id
|
45
|
+
fields['id'] = id
|
46
|
+
@service = result[:service]
|
47
|
+
@endpoint = result[:endpoint]
|
48
|
+
end
|
45
49
|
end
|
46
50
|
|
47
51
|
# Initialize an entry.
|
@@ -63,16 +67,20 @@ module Cts
|
|
63
67
|
# @param [User] user user to make calls with
|
64
68
|
# @param [String] fields comma delimited list of fields to collect
|
65
69
|
# @return [Driver::Response] Response of the call.
|
66
|
-
def load(user: nil, fields: nil)
|
70
|
+
def load(user: nil, fields: nil, account_id: 'urn:theplatform:auth:root')
|
67
71
|
Driver::Helpers.required_arguments %i[user], binding
|
68
72
|
|
69
73
|
Driver::Exceptions.raise_unless_argument_error? user, User
|
70
74
|
Driver::Exceptions.raise_unless_argument_error? fields, String if fields
|
71
75
|
Driver::Exceptions.raise_unless_reference? id
|
72
76
|
|
73
|
-
|
77
|
+
Registry.fetch_and_store_domain user: user, account_id: account_id
|
78
|
+
response = Services::Data.get account_id: account_id, user: user, service: service, endpoint: endpoint, fields: fields, ids: id.split("/").last
|
79
|
+
|
80
|
+
raise 'could not load ' + id unless response.data['entries'].count.positive?
|
81
|
+
|
74
82
|
self.fields.parse data: response.data['entries'].first, xmlns: response.data['xmlns']
|
75
|
-
|
83
|
+
self
|
76
84
|
end
|
77
85
|
|
78
86
|
# Save the entry to the remote services.
|
data/lib/cts/mpx/field.rb
CHANGED
data/lib/cts/mpx/fields.rb
CHANGED
@@ -5,7 +5,7 @@ module Cts
|
|
5
5
|
# @return [Field[]]
|
6
6
|
class Fields
|
7
7
|
include Enumerable
|
8
|
-
|
8
|
+
include Creatable
|
9
9
|
|
10
10
|
attribute name: 'collection', kind_of: Array
|
11
11
|
|
@@ -79,6 +79,7 @@ module Cts
|
|
79
79
|
# @return [Field[]] returns a collection of fields
|
80
80
|
def parse(xmlns: nil, data: nil)
|
81
81
|
Driver::Exceptions.raise_unless_argument_error? data, Hash
|
82
|
+
|
82
83
|
data.delete :service
|
83
84
|
data.delete :endpoint
|
84
85
|
reset
|
data/lib/cts/mpx/query.rb
CHANGED
@@ -26,10 +26,9 @@ module Cts
|
|
26
26
|
# @attribute sort
|
27
27
|
# @return [String] string to sort in the service shell style
|
28
28
|
class Query
|
29
|
-
|
30
|
-
attr_accessor :sort
|
29
|
+
include Creatable
|
31
30
|
|
32
|
-
attribute name: '
|
31
|
+
attribute name: 'account_id', kind_of: String
|
33
32
|
attribute name: 'endpoint', kind_of: String
|
34
33
|
attribute name: 'extra_path', kind_of: String
|
35
34
|
attribute name: 'fields', kind_of: String
|
@@ -37,15 +36,15 @@ module Cts
|
|
37
36
|
attribute name: 'page', kind_of: Driver::Page
|
38
37
|
attribute name: 'query', kind_of: Hash
|
39
38
|
attribute name: 'range', kind_of: String
|
40
|
-
attribute name: 'return_count'
|
41
|
-
attribute name: 'return_entries'
|
39
|
+
attribute name: 'return_count'
|
40
|
+
attribute name: 'return_entries'
|
42
41
|
attribute name: 'service', kind_of: String
|
43
42
|
attribute name: 'sort', kind_of: String
|
44
43
|
|
45
44
|
# List of attributes availble
|
46
45
|
# @return [Symbol[]]
|
47
46
|
def attributes
|
48
|
-
%i[
|
47
|
+
%i[account_id endpoint extra_path fields ids query range return_count return_entries service sort]
|
49
48
|
end
|
50
49
|
|
51
50
|
# Instiatiate a page and query, set return's to false.
|
@@ -82,9 +81,7 @@ module Cts
|
|
82
81
|
# @param [Boolean] include_entries include the entries array or not
|
83
82
|
# @return [Hash]
|
84
83
|
def to_h(include_entries: true)
|
85
|
-
h = {
|
86
|
-
params: params
|
87
|
-
}
|
84
|
+
h = { params: params }
|
88
85
|
h[:entries] = entries.to_h if include_entries
|
89
86
|
h
|
90
87
|
end
|
data/lib/cts/mpx/registry.rb
CHANGED
@@ -16,6 +16,7 @@ module Cts
|
|
16
16
|
# @raise (see #fetch_domain)
|
17
17
|
# @return [Hash] hash of the newly fetched domain
|
18
18
|
def fetch_and_store_domain(user, account_id = 'urn:theplatform:auth:root')
|
19
|
+
account_id ||= 'urn:theplatform:auth:root'
|
19
20
|
result = fetch_domain user, account_id
|
20
21
|
store_domain result, account_id
|
21
22
|
domains[account_id]
|
@@ -29,8 +30,9 @@ module Cts
|
|
29
30
|
# @return [Hash] hash of the newly fetched domain
|
30
31
|
def fetch_domain(user, account_id = 'urn:theplatform:auth:root')
|
31
32
|
return domains['urn:theplatform:auth:root'] if account_id == 'urn:theplatform:auth:root'
|
32
|
-
|
33
|
-
Driver::Exceptions.raise_unless_argument_error?(
|
33
|
+
|
34
|
+
Driver::Exceptions.raise_unless_argument_error?(user, 'User') { !user.is_a? User }
|
35
|
+
Driver::Exceptions.raise_unless_argument_error?(account_id, 'account_id') { !Validators.account_id? account_id }
|
34
36
|
user.token!
|
35
37
|
|
36
38
|
response = Services::Web.post user: user, service: 'Access Data Service', endpoint: 'Registry', method: 'resolveDomain', arguments: { 'accountId' => account_id }
|
@@ -46,6 +48,7 @@ module Cts
|
|
46
48
|
def store_domain(data, account_id = 'urn:theplatform:auth:root')
|
47
49
|
raise ArgumentError, "#{account_id} is not a valid account_id" unless Validators.account_id? account_id
|
48
50
|
raise ArgumentError, "#{data} is not a valid Hash" unless data.is_a? Hash
|
51
|
+
|
49
52
|
@domains.store account_id, data
|
50
53
|
nil
|
51
54
|
end
|
data/lib/cts/mpx/service.rb
CHANGED
@@ -49,6 +49,7 @@ module Cts
|
|
49
49
|
# @param [String] account_id long form account id (ownerId)
|
50
50
|
# @return [String] the url string or nil if none available
|
51
51
|
def url(account_id = 'urn:theplatform:auth:root')
|
52
|
+
account_id ||= 'urn:theplatform:auth:root'
|
52
53
|
Exceptions.raise_unless_account_id account_id
|
53
54
|
reg = Registry.domains[account_id]
|
54
55
|
return reg[name] if reg
|
data/lib/cts/mpx/services.rb
CHANGED
@@ -13,8 +13,10 @@ module Cts
|
|
13
13
|
def [](key = nil)
|
14
14
|
return @services unless key
|
15
15
|
raise 'key must be a string' unless key.is_a? String
|
16
|
+
|
16
17
|
service = @services.find { |e| e.name == key }
|
17
18
|
raise "#{key} must be a service name." unless service
|
19
|
+
|
18
20
|
service
|
19
21
|
end
|
20
22
|
|
@@ -22,15 +24,25 @@ module Cts
|
|
22
24
|
# @param [String] url url to parse
|
23
25
|
# @return [Hash] including service and endpoint as string.
|
24
26
|
def from_url(url)
|
25
|
-
|
27
|
+
type = 'data' if url.include? 'data'
|
28
|
+
uri = URI.parse url
|
29
|
+
|
30
|
+
service = Services[].find { |s| uri.host.include?(s.uri_hint) if s.uri_hint && s.type == type }
|
26
31
|
return nil unless service
|
27
32
|
|
28
33
|
{
|
29
34
|
service: service.name,
|
30
|
-
endpoint:
|
35
|
+
endpoint: endpoint_regex(url)
|
31
36
|
}
|
32
37
|
end
|
33
38
|
|
39
|
+
# check url structure for correct endpoint
|
40
|
+
# @param [String] url to parse for a match
|
41
|
+
# @return [String] results of regex matching
|
42
|
+
def endpoint_regex(url)
|
43
|
+
/data\/([a-zA-Z]*\/Field)|data\/([a-zA-Z]*)\//.match(url)&.[](1, 2)&.select { |e| e unless e.nil? }[0]
|
44
|
+
end
|
45
|
+
|
34
46
|
# Load references and services from disk.
|
35
47
|
def initialize
|
36
48
|
load_references
|
@@ -44,6 +56,7 @@ module Cts
|
|
44
56
|
def load_reference_file(file: nil, type: nil)
|
45
57
|
raise ArgumentError, 'type must be supplied' unless type
|
46
58
|
raise ArgumentError, 'file must be supplied' unless file
|
59
|
+
|
47
60
|
@raw_reference.store(type, Driver.load_json_file(file))
|
48
61
|
true
|
49
62
|
end
|
@@ -100,6 +113,7 @@ module Cts
|
|
100
113
|
return @raw_reference unless key
|
101
114
|
raise 'key must be a string' unless key.is_a? String
|
102
115
|
raise "#{key} is not in the reference library." unless @raw_reference.include? key
|
116
|
+
|
103
117
|
@raw_reference[key]
|
104
118
|
end
|
105
119
|
|
@@ -26,8 +26,8 @@ module Cts
|
|
26
26
|
# @raise (see #get)
|
27
27
|
# @param (see #get)
|
28
28
|
# @return (see #get)
|
29
|
-
def delete(user: nil,
|
30
|
-
get(user: user,
|
29
|
+
def delete(user: nil, account_id: nil, service: nil, endpoint: nil, sort: nil, extra_path: nil, range: nil, ids: nil, query: {}, headers: {}, count: nil, entries: nil)
|
30
|
+
get(user: user, account_id: account_id, service: service, endpoint: endpoint, sort: sort, extra_path: extra_path, range: range, ids: ids, query: query, headers: headers, count: count, entries: entries, method: :delete)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Procedural method to GET data from the data services
|
@@ -46,12 +46,12 @@ module Cts
|
|
46
46
|
# @param [String] sort set the sort field
|
47
47
|
# @raise (see #prep_call)
|
48
48
|
# @return [Response] Response of the call
|
49
|
-
def get(user: nil,
|
50
|
-
prep_call(user: user,
|
49
|
+
def get(user: nil, account_id: nil, service: nil, fields: nil, endpoint: nil, sort: nil, extra_path: nil, range: nil, ids: nil, query: {}, headers: {}, count: nil, entries: nil, method: :get)
|
50
|
+
prep_call(user: user, account_id: account_id, service: service, query: query, headers: headers, required_arguments: ['user', 'service', 'endpoint'], binding: binding)
|
51
51
|
|
52
|
-
host = Driver::Assemblers.host user: user, service: service
|
52
|
+
host = Driver::Assemblers.host user: user, service: service, account_id: account_id
|
53
53
|
path = Driver::Assemblers.path service: service, endpoint: endpoint, extra_path: extra_path, ids: ids
|
54
|
-
query = Driver::Assemblers.query user: user,
|
54
|
+
query = Driver::Assemblers.query user: user, account_id: account_id, service: service, endpoint: endpoint, query: query
|
55
55
|
|
56
56
|
if Services[service].type == 'data'
|
57
57
|
query.merge! Driver::Assemblers.query_data range: range, count: count, entries: entries, sort: sort
|
@@ -72,12 +72,12 @@ module Cts
|
|
72
72
|
# @param [String] service title of a service
|
73
73
|
# @raise (see #prep_call)
|
74
74
|
# @return [Response] Response of the call
|
75
|
-
def post(user: nil,
|
76
|
-
prep_call(user: user,
|
75
|
+
def post(user: nil, account_id: nil, service: nil, endpoint: nil, extra_path: nil, query: {}, page: nil, headers: {}, method: :post)
|
76
|
+
prep_call(user: user, account_id: account_id, service: service, query: query, headers: headers, required_arguments: ['user', 'service', 'endpoint', 'page'], page: page, binding: binding)
|
77
77
|
|
78
78
|
host = Driver::Assemblers.host user: user, service: service
|
79
79
|
path = Driver::Assemblers.path service: service, endpoint: endpoint, extra_path: extra_path
|
80
|
-
query = Driver::Assemblers.query user: user,
|
80
|
+
query = Driver::Assemblers.query user: user, account_id: account_id, service: service, endpoint: endpoint, query: query
|
81
81
|
|
82
82
|
request = Driver::Request.create(method: method, url: [host, path].join, query: query, headers: headers, payload: page.to_s)
|
83
83
|
request.call
|
@@ -87,8 +87,8 @@ module Cts
|
|
87
87
|
# @param (see #post)
|
88
88
|
# @raise (see #post)
|
89
89
|
# @return (see #post)
|
90
|
-
def put(user: nil,
|
91
|
-
post(user: user,
|
90
|
+
def put(user: nil, account_id: nil, service: nil, endpoint: nil, extra_path: nil, query: {}, page: nil, headers: {})
|
91
|
+
post(user: user, account_id: account_id, service: service, endpoint: endpoint, extra_path: extra_path, query: query, page: page, headers: headers, method: :put)
|
92
92
|
end
|
93
93
|
|
94
94
|
# Helper method to assure that everything is is ok to call the methods above
|
@@ -111,12 +111,11 @@ module Cts
|
|
111
111
|
# @private
|
112
112
|
def prep_call(args = {})
|
113
113
|
Driver::Helpers.required_arguments args[:required_arguments], args[:binding]
|
114
|
-
args[:user]
|
114
|
+
Driver::Helpers.raise_if_not_a([args[:user]], User) if args[:user]
|
115
115
|
Driver::Helpers.raise_if_not_a_hash [args[:query], args[:headers]]
|
116
|
-
|
117
116
|
Driver::Helpers.raise_if_not_a([args[:page]], Driver::Page) if args[:page]
|
118
|
-
|
119
|
-
Registry.fetch_and_store_domain(args[:user], args[:
|
117
|
+
args[:user].token!
|
118
|
+
Registry.fetch_and_store_domain(args[:user], args[:account_id])
|
120
119
|
end
|
121
120
|
end
|
122
121
|
end
|
data/lib/cts/mpx/services/web.rb
CHANGED
@@ -15,8 +15,8 @@ module Cts
|
|
15
15
|
# @return [Service] a service
|
16
16
|
def [](key = nil)
|
17
17
|
return services unless key
|
18
|
-
Driver::Exceptions.raise_unless_argument_error?(key, String)
|
19
18
|
|
19
|
+
Driver::Exceptions.raise_unless_argument_error?(key, String)
|
20
20
|
service = services.find { |e| e.name == key }
|
21
21
|
Driver::Exceptions.raise_unless_argument_error?(service, Driver::Service)
|
22
22
|
|
@@ -40,9 +40,9 @@ module Cts
|
|
40
40
|
service = Services[service]
|
41
41
|
method_list = service.endpoints[endpoint]['methods']
|
42
42
|
Driver::Exceptions.raise_unless_argument_error?(arguments, Hash)
|
43
|
-
Driver::Exceptions.raise_unless_argument_error?(method, 'method') { method_list.key?(method) }
|
43
|
+
Driver::Exceptions.raise_unless_argument_error?(method, 'method') { !method_list.key?(method) }
|
44
44
|
|
45
|
-
arguments.each_key { |k| Driver::Exceptions.raise_unless_argument_error?(arguments, 'argument') { method_list[method].include? k.to_s } }
|
45
|
+
arguments.each_key { |k| Driver::Exceptions.raise_unless_argument_error?(arguments, 'argument') { !method_list[method].include? k.to_s } }
|
46
46
|
|
47
47
|
h = {}
|
48
48
|
h[method] = arguments
|
@@ -78,7 +78,7 @@ module Cts
|
|
78
78
|
host = Driver::Assemblers.host user: user, service: service
|
79
79
|
path = Driver::Assemblers.path service: service, endpoint: endpoint, extra_path: extra_path
|
80
80
|
payload = assemble_payload service: service, endpoint: endpoint, method: method, arguments: arguments
|
81
|
-
query = Driver::Assemblers.query user: user,
|
81
|
+
query = Driver::Assemblers.query user: user, account_id: account, service: service, endpoint: endpoint, query: query
|
82
82
|
|
83
83
|
### Request
|
84
84
|
request = Driver::Request.create(method: :post, url: [host, path].join, query: query, payload: Oj.dump(payload), headers: headers)
|
data/lib/cts/mpx/user.rb
CHANGED
@@ -12,13 +12,13 @@ module Cts
|
|
12
12
|
# @attribute token
|
13
13
|
# @return [String] the retrieved token
|
14
14
|
class User
|
15
|
-
|
15
|
+
include Creatable
|
16
16
|
|
17
|
-
attribute name: 'username',
|
18
|
-
attribute name: 'password',
|
19
|
-
attribute name: 'idle_timeout',
|
20
|
-
attribute name: 'duration',
|
21
|
-
attribute name: 'token',
|
17
|
+
attribute name: 'username', kind_of: String
|
18
|
+
attribute name: 'password', kind_of: String
|
19
|
+
attribute name: 'idle_timeout', kind_of: Integer
|
20
|
+
attribute name: 'duration', kind_of: Integer
|
21
|
+
attribute name: 'token', kind_of: String
|
22
22
|
|
23
23
|
# Attempt to sign the user in with the provided credentials
|
24
24
|
# @param [Numeric] idle_timeout how long the token will stay alive without communicating with the services
|
@@ -26,6 +26,7 @@ module Cts
|
|
26
26
|
# @return [Self]
|
27
27
|
def sign_in(idle_timeout: nil, duration: nil)
|
28
28
|
raise 'token is already set, use sign_out first.' if token
|
29
|
+
|
29
30
|
arguments = {}
|
30
31
|
|
31
32
|
arguments['idleTimeout'] if idle_timeout
|
@@ -45,7 +46,7 @@ module Cts
|
|
45
46
|
def sign_out
|
46
47
|
arguments = { "token" => token }
|
47
48
|
response = Services::Web.post user: self, service: 'User Data Service', endpoint: 'Authentication', method: 'signOut', arguments: arguments
|
48
|
-
|
49
|
+
@token = nil if response.status == 200
|
49
50
|
nil
|
50
51
|
end
|
51
52
|
|
data/lib/cts/mpx/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cts-mpx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernie Brodeur
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: creatable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: excon
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -304,6 +304,20 @@ dependencies:
|
|
304
304
|
- - ">="
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '0'
|
307
|
+
- !ruby/object:Gem::Dependency
|
308
|
+
name: solargraph
|
309
|
+
requirement: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - ">="
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: '0'
|
314
|
+
type: :development
|
315
|
+
prerelease: false
|
316
|
+
version_requirements: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - ">="
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: '0'
|
307
321
|
- !ruby/object:Gem::Dependency
|
308
322
|
name: yard
|
309
323
|
requirement: !ruby/object:Gem::Requirement
|
@@ -329,7 +343,6 @@ files:
|
|
329
343
|
- ".rspec"
|
330
344
|
- ".rubocop.yml"
|
331
345
|
- CONTRIBUTING
|
332
|
-
- COPYRIGHT
|
333
346
|
- EXAMPLES.md
|
334
347
|
- Gemfile
|
335
348
|
- Gemfile.lock
|
data/COPYRIGHT
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
Copyright 2018 Comcast Cable Communications Management, LLC
|
2
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
-
you may not use this file except in compliance with the License.
|
4
|
-
You may obtain a copy of the License at
|
5
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
6
|
-
Unless required by applicable law or agreed to in writing, software
|
7
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
8
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
9
|
-
See the License for the specific language governing permissions and
|
10
|
-
limitations under the License.
|