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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e67e44f47792ce4b3d6f16e5f89e154300961e9
4
- data.tar.gz: 681ce55323cd2ac96e92242c938fdd4f53ee9107
3
+ metadata.gz: b84bf4180cc4eded508c0c0106be1bf6313b5541
4
+ data.tar.gz: f24aca69426b02b052606ba5d82982438e450a71
5
5
  SHA512:
6
- metadata.gz: 1ad5b5e2ab0daeeba411e3d4ea02aafe28252821315958e8dc07e6b88c0ece2ce594d662651a1989dbbc1a4190a4720d5274e1abb89682259fc84db82b209a5d
7
- data.tar.gz: 1ba4fa735ef999155710fb509ce6b72777484acacdbba3d52f48ab74fc9366d06521fed1c70203bb949c15bcf8375a310f0150096ec3bdad0b560764cc4c81fa
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
- unless look_up
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mio-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.17.0
4
+ version: 2.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jspc