cts-mpx 1.0.1
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 +7 -0
- data/.gitignore +50 -0
- data/.rspec +2 -0
- data/.rubocop.yml +88 -0
- data/CONTRIBUTING +8 -0
- data/COPYRIGHT +10 -0
- data/EXAMPLES.md +81 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +172 -0
- data/Guardfile +41 -0
- data/LICENSE +201 -0
- data/NOTICE +9 -0
- data/README.md +60 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/config/data_services.json +423 -0
- data/config/ingest_services.json +14 -0
- data/config/root_registry_sea1.json +118 -0
- data/config/web_services.json +544 -0
- data/cts-mpx.gemspec +43 -0
- data/examples/basic_query.rb +23 -0
- data/examples/login.rb +7 -0
- data/examples/update_media.rb +16 -0
- data/examples/update_procedurally.rb +20 -0
- data/lib/cts/mpx.rb +42 -0
- data/lib/cts/mpx/driver.rb +47 -0
- data/lib/cts/mpx/driver/assemblers.rb +96 -0
- data/lib/cts/mpx/driver/connections.rb +41 -0
- data/lib/cts/mpx/driver/exceptions.rb +50 -0
- data/lib/cts/mpx/driver/helpers.rb +67 -0
- data/lib/cts/mpx/driver/page.rb +38 -0
- data/lib/cts/mpx/driver/request.rb +60 -0
- data/lib/cts/mpx/driver/response.rb +72 -0
- data/lib/cts/mpx/entries.rb +80 -0
- data/lib/cts/mpx/entry.rb +100 -0
- data/lib/cts/mpx/field.rb +38 -0
- data/lib/cts/mpx/fields.rb +120 -0
- data/lib/cts/mpx/query.rb +115 -0
- data/lib/cts/mpx/registry.rb +60 -0
- data/lib/cts/mpx/service.rb +70 -0
- data/lib/cts/mpx/services.rb +113 -0
- data/lib/cts/mpx/services/data.rb +124 -0
- data/lib/cts/mpx/services/ingest.rb +60 -0
- data/lib/cts/mpx/services/web.rb +90 -0
- data/lib/cts/mpx/user.rb +74 -0
- data/lib/cts/mpx/validators.rb +51 -0
- data/lib/cts/mpx/version.rb +6 -0
- data/sdk-ring-diagram.png +0 -0
- data/sdk-uml.png +0 -0
- data/uml.nomnoml +242 -0
- metadata +401 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 65e447aa1b9c22663d6f59d10a51598047822603
|
4
|
+
data.tar.gz: e783c916b10517ca47ecbde40749eedd2f5fefc6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b8924578fbb7ed2f6fcc71ef7489123613b7394b6f46702b7374086cc3f44a50acd8742c0247260f8d92630bd750778e4552c08451cc4386af8df91c79c30ff1
|
7
|
+
data.tar.gz: f14cb79c5e448985b7df72bb280795022e7180234c2fde3649be7c269284090ca40eb9cb2bb9fe24f3766deb597128e01b2327dbb74cc1c060dbbd547c960b20
|
data/.gitignore
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
|
13
|
+
# Used by dotenv library to load environment variables.
|
14
|
+
# .env
|
15
|
+
|
16
|
+
## Specific to RubyMotion:
|
17
|
+
.dat*
|
18
|
+
.repl_history
|
19
|
+
build/
|
20
|
+
*.bridgesupport
|
21
|
+
build-iPhoneOS/
|
22
|
+
build-iPhoneSimulator/
|
23
|
+
|
24
|
+
## Specific to RubyMotion (use of CocoaPods):
|
25
|
+
#
|
26
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
27
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
28
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
29
|
+
#
|
30
|
+
# vendor/Pods/
|
31
|
+
|
32
|
+
## Documentation cache and generated files:
|
33
|
+
/.yardoc/
|
34
|
+
/_yardoc/
|
35
|
+
/doc/
|
36
|
+
/rdoc/
|
37
|
+
|
38
|
+
## Environment normalization:
|
39
|
+
/.bundle/
|
40
|
+
/vendor/bundle
|
41
|
+
/lib/bundler/man/
|
42
|
+
|
43
|
+
# for a library or gem, you might want to ignore these files since the code is
|
44
|
+
# intended to run in multiple environments; otherwise, check them in:
|
45
|
+
# Gemfile.lock
|
46
|
+
# .ruby-version
|
47
|
+
# .ruby-gemset
|
48
|
+
|
49
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
50
|
+
.rvmrc
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.4.0
|
5
|
+
Exclude:
|
6
|
+
- 'vendor/**/*'
|
7
|
+
- 'tmp/**/*'
|
8
|
+
- 'spec/spec_helper.rb'
|
9
|
+
|
10
|
+
|
11
|
+
# The defaults for these seem to be based on a rails env, this is not rails.
|
12
|
+
# TODO tune this down and recode.
|
13
|
+
Metrics/ModuleLength:
|
14
|
+
CountComments: false
|
15
|
+
Max: 250
|
16
|
+
|
17
|
+
Metrics/ClassLength:
|
18
|
+
Max: 250
|
19
|
+
|
20
|
+
Metrics/MethodLength:
|
21
|
+
Max: 20
|
22
|
+
|
23
|
+
Metrics/AbcSize:
|
24
|
+
Max: 25
|
25
|
+
|
26
|
+
Metrics/CyclomaticComplexity:
|
27
|
+
Max: 8
|
28
|
+
|
29
|
+
Metrics/PerceivedComplexity:
|
30
|
+
Max: 10
|
31
|
+
|
32
|
+
# it's 2016, people have wide monitors.
|
33
|
+
Metrics/LineLength:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
# we exclude these two files since they are generated, the rest of our projects
|
37
|
+
# should use // style regexps.
|
38
|
+
Style/RegexpLiteral:
|
39
|
+
EnforcedStyle: slashes
|
40
|
+
AllowInnerSlashes: true
|
41
|
+
Exclude:
|
42
|
+
- 'Guardfile'
|
43
|
+
- '*.gemspec'
|
44
|
+
|
45
|
+
# Prefer single-quoted strings when you don't need string interpolation or special symbols
|
46
|
+
Style/StringLiterals:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Style/WordArray:
|
50
|
+
EnforcedStyle: brackets
|
51
|
+
|
52
|
+
Style/FrozenStringLiteralComment:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
Style/MixinUsage:
|
56
|
+
Exclude:
|
57
|
+
- 'bin/*'
|
58
|
+
|
59
|
+
# Purty hashes.
|
60
|
+
Layout/AlignHash:
|
61
|
+
EnforcedHashRocketStyle: table
|
62
|
+
EnforcedColonStyle: table
|
63
|
+
|
64
|
+
# Specs don't need inline documentation.
|
65
|
+
# TODO at some point, re-enable this.
|
66
|
+
Style/Documentation:
|
67
|
+
Enabled: false
|
68
|
+
Exclude:
|
69
|
+
- 'spec/**/*'
|
70
|
+
|
71
|
+
Metrics/BlockLength:
|
72
|
+
Exclude:
|
73
|
+
- 'spec/**/*'
|
74
|
+
- '*.gemspec'
|
75
|
+
- 'Rakefile'
|
76
|
+
|
77
|
+
Metrics/ParameterLists:
|
78
|
+
Exclude:
|
79
|
+
- 'lib/cts/mpx/services/data.rb'
|
80
|
+
- 'lib/cts/mpx/driver/assemblers.rb'
|
81
|
+
- 'lib/cts/mpx/services/ingest.rb'
|
82
|
+
- 'lib/cts/mpx/services/web.rb'
|
83
|
+
|
84
|
+
RSpec/NamedSubject:
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
Lint/Debugger:
|
88
|
+
Enabled: false
|
data/CONTRIBUTING
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
If you would like to contribute code to this project you can do so through
|
2
|
+
GitHub by forking the repository and sending a pull request. Before Comcast
|
3
|
+
merges your code into the project you must sign the
|
4
|
+
[Comcast Contributor License Agreement (CLA)](https://gist.github.com/ComcastOSS/a7b8933dd8e368535378cda25c92d19a).
|
5
|
+
If you haven't previously signed a Comcast CLA, you'll automatically be asked
|
6
|
+
to when you open a pull request.
|
7
|
+
|
8
|
+
Alternatively, we can send you a PDF that you can sign and scan back to us. Please create a new GitHub issue to request a PDF version of the CLA.
|
data/COPYRIGHT
ADDED
@@ -0,0 +1,10 @@
|
|
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.
|
data/EXAMPLES.md
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# Examples
|
2
|
+
|
3
|
+
## Preamble
|
4
|
+
|
5
|
+
``` ruby
|
6
|
+
username = 'a_user@somewhere.com'
|
7
|
+
password = 'jghajg84j1mca'
|
8
|
+
account = 'http://access.auth.theplatform.com/data/Account/1'
|
9
|
+
```
|
10
|
+
|
11
|
+
## User Class
|
12
|
+
|
13
|
+
### Login
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
user = Cts::Mpx::User.create username: username, password: password
|
17
|
+
user.sign_in
|
18
|
+
```
|
19
|
+
|
20
|
+
### Logout
|
21
|
+
|
22
|
+
``` ruby
|
23
|
+
user.sign_out
|
24
|
+
```
|
25
|
+
|
26
|
+
## Web.post
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
response = Services::Web.post user: user, service: 'File Management Service', endpoint: 'FileManagement', method: 'resetTask', arguments: {"taskId": "http://..."}
|
30
|
+
puts response.status
|
31
|
+
```
|
32
|
+
|
33
|
+
## Ingest.post
|
34
|
+
|
35
|
+
## Rest Methods (Data endpoint)
|
36
|
+
|
37
|
+
### GET
|
38
|
+
|
39
|
+
``` ruby
|
40
|
+
response = Cts::Mpx::Services::Data.get user: user, service: 'Media Data Service', endpoint: 'Media', account: account, fields: 'id,guid'
|
41
|
+
puts response.page
|
42
|
+
```
|
43
|
+
|
44
|
+
### POST
|
45
|
+
|
46
|
+
``` ruby
|
47
|
+
Cts::Mpx::Services::Data.post user: user, service: 'Media Data Service', endpoint: 'Media', account: account, page: Page.create(entries:[{"id": "http://data.media.theplatform.com/data/media/1"}])
|
48
|
+
```
|
49
|
+
|
50
|
+
### PUT
|
51
|
+
|
52
|
+
``` ruby
|
53
|
+
Cts::Mpx::Services::Data.put user: user, service: 'Media Data Service', endpoint: 'Media', account: account, page: Page.create(entries:[{}])
|
54
|
+
```
|
55
|
+
|
56
|
+
### DELETE
|
57
|
+
|
58
|
+
``` ruby
|
59
|
+
response = Cts::Mpx::Services::Data.delete user: user, service: 'Media Data Service', endpoint: 'Media', account: account, fields: 'id,guid', ids: "1,2,3,4"
|
60
|
+
puts response.page
|
61
|
+
```
|
62
|
+
|
63
|
+
## Page class
|
64
|
+
|
65
|
+
### Create
|
66
|
+
|
67
|
+
``` ruby
|
68
|
+
page = Page.create(xmlns: {namespace: 'http://...'}, entries: [{}])
|
69
|
+
```
|
70
|
+
|
71
|
+
### output
|
72
|
+
|
73
|
+
``` ruby
|
74
|
+
puts page.to_s
|
75
|
+
```
|
76
|
+
|
77
|
+
### Indented Output
|
78
|
+
|
79
|
+
``` ruby
|
80
|
+
puts page.to_s(true)
|
81
|
+
```
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cts-mpx (1.0.1)
|
5
|
+
creatable (= 1.0.1)
|
6
|
+
excon
|
7
|
+
oj (= 3.5.0)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
ansi (1.5.0)
|
13
|
+
ast (2.4.0)
|
14
|
+
binding_of_caller (0.8.0)
|
15
|
+
debug_inspector (>= 0.0.1)
|
16
|
+
builder (3.2.3)
|
17
|
+
bump (0.6.1)
|
18
|
+
coderay (1.1.2)
|
19
|
+
creatable (1.0.1)
|
20
|
+
debug_inspector (0.0.3)
|
21
|
+
diff-lcs (1.3)
|
22
|
+
docile (1.3.1)
|
23
|
+
erubis (2.7.0)
|
24
|
+
excon (0.62.0)
|
25
|
+
faraday (0.15.2)
|
26
|
+
multipart-post (>= 1.2, < 3)
|
27
|
+
ffi (1.9.25)
|
28
|
+
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
|
+
gli (2.17.2)
|
37
|
+
guard (2.14.2)
|
38
|
+
formatador (>= 0.2.4)
|
39
|
+
listen (>= 2.7, < 4.0)
|
40
|
+
lumberjack (>= 1.0.12, < 2.0)
|
41
|
+
nenv (~> 0.1)
|
42
|
+
notiffany (~> 0.0)
|
43
|
+
pry (>= 0.9.12)
|
44
|
+
shellany (~> 0.0)
|
45
|
+
thor (>= 0.18.1)
|
46
|
+
guard-bundler (2.1.0)
|
47
|
+
bundler (~> 1.0)
|
48
|
+
guard (~> 2.2)
|
49
|
+
guard-compat (~> 1.1)
|
50
|
+
guard-compat (1.2.1)
|
51
|
+
guard-rspec (4.7.3)
|
52
|
+
guard (~> 2.1)
|
53
|
+
guard-compat (~> 1.1)
|
54
|
+
rspec (>= 2.99.0, < 4.0)
|
55
|
+
guard-rubocop (1.3.0)
|
56
|
+
guard (~> 2.0)
|
57
|
+
rubocop (~> 0.20)
|
58
|
+
guard-yard (2.2.1)
|
59
|
+
guard (>= 1.1.0)
|
60
|
+
yard (>= 0.7.0)
|
61
|
+
hirb (0.7.3)
|
62
|
+
httpclient (2.8.3)
|
63
|
+
interception (0.5)
|
64
|
+
json (2.1.0)
|
65
|
+
listen (3.1.5)
|
66
|
+
rb-fsevent (~> 0.9, >= 0.9.4)
|
67
|
+
rb-inotify (~> 0.9, >= 0.9.7)
|
68
|
+
ruby_dep (~> 1.2)
|
69
|
+
lumberjack (1.0.13)
|
70
|
+
method_source (0.9.0)
|
71
|
+
multipart-post (2.0.0)
|
72
|
+
mustermann (1.0.3)
|
73
|
+
nenv (0.3.0)
|
74
|
+
nesty (1.0.2)
|
75
|
+
notiffany (0.1.1)
|
76
|
+
nenv (~> 0.1)
|
77
|
+
shellany (~> 0.0)
|
78
|
+
oj (3.5.0)
|
79
|
+
parallel (1.12.1)
|
80
|
+
parser (2.5.1.2)
|
81
|
+
ast (~> 2.4.0)
|
82
|
+
powerpack (0.1.2)
|
83
|
+
pry (0.11.3)
|
84
|
+
coderay (~> 1.1.0)
|
85
|
+
method_source (~> 0.9.0)
|
86
|
+
pry-rescue (1.4.5)
|
87
|
+
interception (>= 0.5)
|
88
|
+
pry
|
89
|
+
pry-stack_explorer (0.4.9.2)
|
90
|
+
binding_of_caller (>= 0.7)
|
91
|
+
pry (>= 0.9.11)
|
92
|
+
rack (2.0.5)
|
93
|
+
rack-protection (2.0.3)
|
94
|
+
rack
|
95
|
+
rainbow (3.0.0)
|
96
|
+
rake (12.3.1)
|
97
|
+
rb-fsevent (0.10.3)
|
98
|
+
rb-inotify (0.9.10)
|
99
|
+
ffi (>= 0.5.0, < 2)
|
100
|
+
reentrant_flock (0.1.1)
|
101
|
+
rspec (3.8.0)
|
102
|
+
rspec-core (~> 3.8.0)
|
103
|
+
rspec-expectations (~> 3.8.0)
|
104
|
+
rspec-mocks (~> 3.8.0)
|
105
|
+
rspec-core (3.8.0)
|
106
|
+
rspec-support (~> 3.8.0)
|
107
|
+
rspec-expectations (3.8.1)
|
108
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
109
|
+
rspec-support (~> 3.8.0)
|
110
|
+
rspec-mocks (3.8.0)
|
111
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
112
|
+
rspec-support (~> 3.8.0)
|
113
|
+
rspec-support (3.8.0)
|
114
|
+
rubocop (0.52.1)
|
115
|
+
parallel (~> 1.10)
|
116
|
+
parser (>= 2.4.0.2, < 3.0)
|
117
|
+
powerpack (~> 0.1)
|
118
|
+
rainbow (>= 2.2.2, < 4.0)
|
119
|
+
ruby-progressbar (~> 1.7)
|
120
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
121
|
+
rubocop-rspec (1.23.0)
|
122
|
+
rubocop (>= 0.52.1)
|
123
|
+
ruby-progressbar (1.10.0)
|
124
|
+
ruby_dep (1.5.0)
|
125
|
+
shellany (0.0.1)
|
126
|
+
simplecov (0.16.1)
|
127
|
+
docile (~> 1.1)
|
128
|
+
json (>= 1.8, < 3)
|
129
|
+
simplecov-html (~> 0.10.0)
|
130
|
+
simplecov-console (0.4.2)
|
131
|
+
ansi
|
132
|
+
hirb
|
133
|
+
simplecov
|
134
|
+
simplecov-html (0.10.2)
|
135
|
+
sinatra (2.0.3)
|
136
|
+
mustermann (~> 1.0)
|
137
|
+
rack (~> 2.0)
|
138
|
+
rack-protection (= 2.0.3)
|
139
|
+
tilt (~> 2.0)
|
140
|
+
thor (0.20.0)
|
141
|
+
tilt (2.0.8)
|
142
|
+
unicode-display_width (1.4.0)
|
143
|
+
yard (0.9.16)
|
144
|
+
|
145
|
+
PLATFORMS
|
146
|
+
ruby
|
147
|
+
|
148
|
+
DEPENDENCIES
|
149
|
+
bump
|
150
|
+
bundler
|
151
|
+
cts-mpx!
|
152
|
+
erubis
|
153
|
+
geminabox
|
154
|
+
gli
|
155
|
+
guard
|
156
|
+
guard-bundler
|
157
|
+
guard-rspec
|
158
|
+
guard-rubocop
|
159
|
+
guard-yard
|
160
|
+
pry
|
161
|
+
pry-rescue
|
162
|
+
pry-stack_explorer
|
163
|
+
rake
|
164
|
+
rspec
|
165
|
+
rubocop (~> 0.52.1)
|
166
|
+
rubocop-rspec
|
167
|
+
simplecov
|
168
|
+
simplecov-console
|
169
|
+
yard
|
170
|
+
|
171
|
+
BUNDLED WITH
|
172
|
+
1.16.1
|
data/Guardfile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
clearing :on
|
2
|
+
|
3
|
+
# guard :bundler do
|
4
|
+
# require 'guard/bundler'
|
5
|
+
# require 'guard/bundler/verify'
|
6
|
+
# helper = Guard::Bundler::Verify.new
|
7
|
+
|
8
|
+
# files = ['Gemfile']
|
9
|
+
# files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
10
|
+
|
11
|
+
# # Assume files are symlinked from somewhere
|
12
|
+
# files.each { |file| watch(helper.real_path(file)) }
|
13
|
+
# end
|
14
|
+
|
15
|
+
# guard :rubocop, cli: '-fs --color -S -a' do
|
16
|
+
# watch(%r{.+\.rb$}) { |m| File.dirname(m[0]) }
|
17
|
+
# watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
18
|
+
# end
|
19
|
+
|
20
|
+
# guard 'yard', server: false do
|
21
|
+
# watch(%r{app\/.+\.rb})
|
22
|
+
# watch(%r{lib\/.+\.rb})
|
23
|
+
# watch(%r{ext\/.+\.c})
|
24
|
+
# end
|
25
|
+
|
26
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
27
|
+
require "guard/rspec/dsl"
|
28
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
29
|
+
|
30
|
+
# Feel free to open issues for suggestions and improvements
|
31
|
+
|
32
|
+
# RSpec files
|
33
|
+
rspec = dsl.rspec
|
34
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
35
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
36
|
+
watch(rspec.spec_files)
|
37
|
+
|
38
|
+
# Ruby files
|
39
|
+
ruby = dsl.ruby
|
40
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
41
|
+
end
|