mio-config 2.17.0 → 2.18.0
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/mio/client.rb +14 -0
- data/lib/mio/model/account_property.rb +13 -8
- data/lib/mio/model/metadatadefinition/definition.rb +5 -2
- data/lib/mio/model/workflow/node.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b84bf4180cc4eded508c0c0106be1bf6313b5541
|
|
4
|
+
data.tar.gz: f24aca69426b02b052606ba5d82982438e450a71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53eb020f81578d6eeebd657fe1d60e35b63b295ad75bed08710efe853a8220764498add201e90e3f668ccfe70c36369f949ac4155d58ea38e5362bd057e72fbb
|
|
7
|
+
data.tar.gz: 3a9e84568dbecb923b275756be220ee812724a881f9a181d76a4a8a48de7823925447dab77bb7003de3afe59f2fb51a93c246280d40220bc12b05b98f07948e1
|
data/lib/mio/client.rb
CHANGED
|
@@ -61,6 +61,16 @@ class Mio
|
|
|
61
61
|
make_object response.body
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
def remove resource, id, opts={}
|
|
65
|
+
url = path resource, id
|
|
66
|
+
response = delete url, opts
|
|
67
|
+
unless response.success?
|
|
68
|
+
raise Mio::Client::LoadOfBollocks, "DELETE on #{url} returned #{response.status}"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
response.status
|
|
72
|
+
end
|
|
73
|
+
|
|
64
74
|
def configure resource, id, payload, opts={}
|
|
65
75
|
url = path(resource, id, :configuration)
|
|
66
76
|
response = put url, payload, opts
|
|
@@ -122,6 +132,10 @@ class Mio
|
|
|
122
132
|
Mio::Requests.make_request :put, @agent, url, opts, payload, content_type, accept
|
|
123
133
|
end
|
|
124
134
|
|
|
135
|
+
def delete url, opts
|
|
136
|
+
Mio::Requests.make_request :delete, @agent, url, opts
|
|
137
|
+
end
|
|
138
|
+
|
|
125
139
|
def make_object response
|
|
126
140
|
JSON.parse(response)
|
|
127
141
|
end
|
|
@@ -12,18 +12,23 @@ class Mio
|
|
|
12
12
|
value: @args.value}
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
def look_up
|
|
16
|
+
r = self.class.resource_name
|
|
17
|
+
all_resources = @client.find_all r
|
|
18
|
+
return nil if all_resources['totalCount'] == 0
|
|
19
|
+
|
|
20
|
+
all_resources[r].find{|o| o['key'] == @args.key}
|
|
21
|
+
end
|
|
22
|
+
|
|
15
23
|
def go
|
|
16
|
-
|
|
24
|
+
@object = look_up
|
|
25
|
+
if @object.nil?
|
|
26
|
+
@object = create
|
|
27
|
+
elsif ((@object != nil) && (@object['value'] != @args.value))
|
|
28
|
+
@client.remove self.class.resource_name, @object['id']
|
|
17
29
|
@object = create
|
|
18
|
-
#else
|
|
19
|
-
# @object = look_up
|
|
20
30
|
end
|
|
21
31
|
|
|
22
|
-
# @TODO Update the account property??
|
|
23
|
-
# Does not appear to support PUT ?
|
|
24
|
-
# Will need raise feature with oooooyyyyyaaaallllllaaaa
|
|
25
|
-
# No configure endpoint as no configuration
|
|
26
|
-
|
|
27
32
|
@object['name'] = @args.name
|
|
28
33
|
@object['id'] = @object['href'].scan( /\d+$/).last
|
|
29
34
|
|
|
@@ -6,7 +6,7 @@ class Mio
|
|
|
6
6
|
|
|
7
7
|
field :name, String, 'Metadata Definition Name'
|
|
8
8
|
field :displayName, String, 'Display name'
|
|
9
|
-
field :type, String, 'Metdata type tsingle-option|text|url|boolean|image', 'text', /^(single-option|text|url|boolean|image)$/
|
|
9
|
+
field :type, String, 'Metdata type tsingle-option|text|url|boolean|image', 'text', /^(single-option|text|url|boolean|image|string)$/
|
|
10
10
|
field :description, String, 'Metadata Definition Description'
|
|
11
11
|
field :searchable, Symbol, 'Indexed and searchable', :true
|
|
12
12
|
field :editable, Symbol, 'Editable field', :true
|
|
@@ -30,7 +30,8 @@ class Mio
|
|
|
30
30
|
formType: @args.formType,
|
|
31
31
|
maxLength: @args.maxLength,
|
|
32
32
|
validationHandler: @args.validationHandler,
|
|
33
|
-
options: @args.options
|
|
33
|
+
options: @args.options,
|
|
34
|
+
strings: @args.strings
|
|
34
35
|
}
|
|
35
36
|
end
|
|
36
37
|
|
|
@@ -44,6 +45,8 @@ class Mio
|
|
|
44
45
|
'tv.nativ.mio.metadata.variable.def.validation.MaxLengthValidationHandler'
|
|
45
46
|
when 'url'
|
|
46
47
|
'tv.nativ.mio.metadata.resource.def.MioURLVariable$URLValidationHandler'
|
|
48
|
+
when 'string'
|
|
49
|
+
'tv.nativ.mio.metadata.variable.def.validation.MaxLengthValidationHandler'
|
|
47
50
|
else
|
|
48
51
|
''
|
|
49
52
|
end
|
|
@@ -6,7 +6,7 @@ class Mio
|
|
|
6
6
|
|
|
7
7
|
field :name, String, 'Nodal Name'
|
|
8
8
|
field :action, String, 'Name of the action, empty for none', 'Load S3'
|
|
9
|
-
field :type, String, 'Action Type', 'ACTION'
|
|
9
|
+
field :type, String, 'Action Type', 'ACTION', /^(START|ACTION|FORK|END)$/
|
|
10
10
|
field :assetContext, String, 'Asset context', ''
|
|
11
11
|
|
|
12
12
|
nested true
|