mio-config 2.36.0 → 2.37.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: 184a84a8ca4d07568de20768113a2685d2a1e305
4
- data.tar.gz: 004e9040b61a788ab6adde0937f47275642f2d60
3
+ metadata.gz: 6448c20b0e2ab0c9594fac09c5ac25cf2da65c2e
4
+ data.tar.gz: 2e59c59a6af72953f24e7f54ad50edb375680cfc
5
5
  SHA512:
6
- metadata.gz: 7316ef5c7e7310a1729aaf19628ad68c8e07e165f9f2bfc3d8967f9b536b9d5c7cf60fc5e0618437cb398917811df18b13227d7a3fb7fccf2af2ec7bcbcee8fa
7
- data.tar.gz: 09df5d018062bd0388680be66697d80f01c4f1d370be53bdeb8495f5dd96c2b6c652cd6ebffde0772edc7f8b81a6df517b2ad75d778b651d454c66fdfa99b71c
6
+ metadata.gz: 8794e0f6077ea5e50e9b0ab86b595670992299671b16de4ac969cac775fa63591c38ec891cba3d8f54905bda6b3cce8437fd658a11b0a1af0c220cd33d8d0eec
7
+ data.tar.gz: b6fee1727e463fa48bc22fddc27cb495113614bbc20c91cbbaca91b285fd4ad9018b257e498ffa334bdb53d1b0a175f78645cd826d34fed717f795f58a575268
@@ -9,6 +9,7 @@ class Mio
9
9
  field :script, String, 'The groovy script (inline) ', '"File.read(/path/to/script.groovy)"'
10
10
  field :jars, Array, 'JARs to load on remote, empty for none', []
11
11
  field :imports, Array, 'Imports to reference within groovy script, empty for none', []
12
+ field :requiresLock, String, 'Requires asset Lock', 'EXCLUSIVE', /^(NONE|EXCLUSIVE|SHARED)$/
12
13
 
13
14
  field :enable, Symbol, ':true or :false', :true
14
15
  field :start, Symbol, ':true or :false', :true
@@ -30,7 +31,8 @@ class Mio
30
31
  imports: {
31
32
  'jar-url': @args.jars.map{|jar| {value: jar, isExpression: false}},
32
33
  import: @args.imports.map{|import| {value: import, isExpression: false}}
33
- }
34
+ },
35
+ 'requires-lock': @args.requiresLock
34
36
  }
35
37
  end
36
38
  end
@@ -11,6 +11,7 @@ class Mio
11
11
  field :imports, Array, 'Imports to reference within groovy script, empty for none', []
12
12
  field :timeout, Fixnum, 'Time to give up waiting', 0
13
13
  field :polling_time, Fixnum, 'Time to wait between script invocation', 100000
14
+ field :requiresLock, String, 'Requires asset Lock', 'EXCLUSIVE', /^(NONE|EXCLUSIVE|SHARED)$/
14
15
 
15
16
  field :enable, Symbol, ':true or :false', :true
16
17
  field :start, Symbol, ':true or :false', :true
@@ -34,7 +35,8 @@ class Mio
34
35
  import: @args.imports.map{|i| {value: i, isExpression: false}}
35
36
  },
36
37
  "timeout": @args.timeout,
37
- "polling-time-period": @args.polling_time
38
+ "polling-time-period": @args.polling_time,
39
+ "requires-lock": @args.requiresLock
38
40
  }
39
41
  end
40
42
  end
@@ -16,8 +16,6 @@ class Mio
16
16
  field :visibility, Array, 'Ids of the accounts which may see the import action', [4]
17
17
  field :sourceJsonVariable, String, 'Json Variable to grab metadata from'
18
18
  field :runRuleExpression, String, 'Job run rule expression', ''
19
- field :memberAssetId, String, 'Variable or id of group to which this asset should belong', ''
20
- field :memberAssetRelationName, String, 'Name of group relationship', ''
21
19
 
22
20
  field :enable, Symbol, ':true or :false', :true
23
21
  field :start, Symbol, ':true or :false', :true
@@ -33,6 +31,11 @@ class Mio
33
31
  end
34
32
 
35
33
  def config_hash
34
+ metadata_definition = @search.find_metadataDefinitions_by_name(@args.metadataDefinition).first
35
+ if metadata_definition.nil?
36
+ raise Mio::Model::NoSuchResource, 'No such metadata definition [' + @args.metadataDefinition + ']'
37
+ end
38
+
36
39
  h = {
37
40
  "source-file": {
38
41
  "source": {
@@ -72,23 +75,23 @@ class Mio
72
75
  "value": @args.creationContext,
73
76
  "isExpression": false
74
77
  }
78
+ },
79
+ "variant-and-metadata-definition": {
80
+ "variant": {
81
+ "value": @args.variant,
82
+ "isExpression": false
83
+ },
84
+ "metadata": {
85
+ "metadata-definition": {
86
+ "id": metadata_definition['id']
87
+ },
88
+ "source-json-variable": {
89
+ "value": @args.sourceJsonVariable,
90
+ "isExpression": false
91
+ }
92
+ }
75
93
  }
76
94
  }
77
-
78
- unless @args.variant.to_s == ''
79
- h[:"variant-and-metadata-definition"] = { "variant": { "value": @args.variant, "isExpression": false } }
80
-
81
- unless @args.metadataDefinition.to_s == ''
82
- metadata_definition = @search.find_metadataDefinitions_by_name(@args.metadataDefinition).first
83
- if metadata_definition.nil?
84
- raise Mio::Model::NoSuchResource, 'No such metadata definition [' + @args.metadataDefinition + ']'
85
- end
86
- h[:"variant-and-metadata-definition"]["metadata"] = { "metadata-definition": { "id": metadata_definition['id']},
87
- "source-json-variable": {"value": @args.sourceJsonVariable, "isExpression": false}
88
- }
89
- end
90
- end
91
-
92
95
  unless @args.parentAssetId.to_s == ''
93
96
  h["asset-relationships"] = {
94
97
  "child": {
@@ -106,13 +109,6 @@ class Mio
106
109
  }
107
110
  end
108
111
 
109
- unless @args.memberAssetId.to_s == ''
110
- h["asset-relationships"] = {
111
- "member": { "group": { "group-asset-id": { "value": @args.memberAssetId, "isExpression": false } },
112
- "membership-name": {"value": @args.memberAssetRelationName, "isExpression": false} }
113
- }
114
- end
115
-
116
112
  h
117
113
  end
118
114
  end
@@ -4,7 +4,7 @@ class Mio
4
4
  set_resource :variants
5
5
 
6
6
  field :name, String, 'Name of the Object Variant'
7
- field :objectType, String,'The Object which this varies', /^(group-asset|media-asset|text-asset)$/
7
+ field :objectType, String,'The Object which this varies'
8
8
  field :defaultVariant, Symbol, 'AWS API Key with access to bucket', :false
9
9
  field :metadataDefinitions, Array, 'Array of metadata definition names'
10
10
  field :defaultMetadataDefinition, String, 'Default metadata definition name'
@@ -50,20 +50,15 @@ class Mio
50
50
  raise Mio::Model::NoSuchResource, 'No such object type [' + @args.objectType + ']'
51
51
  end
52
52
 
53
- h = {name: @args.name,
53
+ {name: @args.name,
54
54
  objectTypeId: object_type['id'],
55
- defaultVariant: @args.defaultVariant}
56
-
57
- unless @args.metadataDefinitions.empty?
58
- h[:metadataDefinitionIds] = metadata_definition_ids(metadata_definitions, @args.metadataDefinitions)
59
- h[:defaultMetadataDefinition] = metadata_definition_id(metadata_definitions, @args.defaultMetadataDefinition)
60
- end
61
-
62
- h
55
+ defaultVariant: @args.defaultVariant,
56
+ metadataDefinitionIds: metadata_definition_ids(metadata_definitions, @args.metadataDefinitions),
57
+ defaultMetadataDefinition: metadata_definition_id(metadata_definitions, @args.defaultMetadataDefinition)}
63
58
  end
64
59
 
65
60
  def go
66
- if (@args.metadataDefinitions.empty? && (@args.objectType != 'text-asset'))
61
+ if @args.metadataDefinitions.empty?
67
62
  raise Mio::Model::EmptyField, 'Field metadataDefinitions to Mio::Model::Variant contain at least one metadata definition name'
68
63
  end
69
64
 
@@ -14,6 +14,7 @@ class Mio
14
14
  field :imports, Array, 'Imports to reference within groovy script, empty for none', []
15
15
  field :timeout, Fixnum, 'Wait time out', 1000 * 60 * 60
16
16
  field :pollingTimePeriodMs, Fixnum, 'Time between script runs (polling time)', 1000 * 60
17
+ field :requiresLock, String, 'Requires asset Lock', 'EXCLUSIVE', /^(NONE|EXCLUSIVE|SHARED)$/
17
18
 
18
19
  field :enable, Symbol, ':true or :false', :true
19
20
  field :start, Symbol, ':true or :false', :true
@@ -37,7 +38,8 @@ class Mio
37
38
  import: @args.imports.map{|import| {value: import, isExpression: false}}
38
39
  },
39
40
  'timeout': @args.timeout,
40
- 'polling-time-period': @args.pollingTimePeriodMs
41
+ 'polling-time-period': @args.pollingTimePeriodMs,
42
+ "requires-lock": @args.requiresLock
41
43
  }
42
44
  end
43
45
 
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.36.0
4
+ version: 2.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jspc
@@ -127,7 +127,6 @@ files:
127
127
  - "./lib/mio/model/metadatadefinition/definition.rb"
128
128
  - "./lib/mio/model/metadatadefinition/option.rb"
129
129
  - "./lib/mio/model/place_holder_group_asset_action.rb"
130
- - "./lib/mio/model/rename.rb"
131
130
  - "./lib/mio/model/s3.rb"
132
131
  - "./lib/mio/model/variant.rb"
133
132
  - "./lib/mio/model/wait_groovy_script.rb"
@@ -1,36 +0,0 @@
1
- class Mio
2
- class Model
3
- class Rename < Model
4
- set_resource :actions
5
- field :name, String, 'Name of the Import Action'
6
- field :visibility, Array, 'Ids of the accounts which may see the import action', [4]
7
- field :runRuleExpression, String, 'Job run rule expression', ''
8
- field :preserveFileExtension, Symbol, 'preserve file extention of the file path', false
9
- field :filePath, String, 'File path', ''
10
-
11
- field :enable, Symbol, ':true or :false', :true
12
- field :start, Symbol, ':true or :false', :true
13
-
14
- def create_hash
15
- plugin = 'tv.nativ.mio.enterprise.execution.action.file.impl.rename.AssetRenameCommand'
16
- {name: @args.name,
17
- pluginClass: plugin,
18
- visibilityIds: @args.visibility,
19
- 'type': 'rename',
20
- 'runRuleExpression': @args.runRuleExpression
21
- }
22
- end
23
-
24
- def config_hash
25
- {
26
- "file": { "file-name": { "value": @args.filePath,
27
- "isExpression": false
28
- },
29
- "preserve-file-extension": @args.preserveFileExtension
30
- }
31
- }
32
- end
33
-
34
- end
35
- end
36
- end