trailer_vote-media_types 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec23eaa48d5c021225b57e4d7421e3a2d4fae49846affb8e978d0945bb67efce
4
- data.tar.gz: 4ea417c8eb93ab2772671acade25444230760c3dc8a7446c494e6d2271ed77f0
3
+ metadata.gz: 2182d33752e07b5878ddd13b2ef671f9ace5b6a64a68dc7259d2ab7a36f9d521
4
+ data.tar.gz: be855c8d7daf6c6254a770e96054f11cdd377f152e288e94bdb00f0631ae0c6b
5
5
  SHA512:
6
- metadata.gz: 696f2e870bccf9bf30cdf26c5e0e13275ddf4e9d335624f5afcb39889267203807cf4c56474b670eabf4bf500efdc818be92c43de545afdd5f422a9b4587c0fb
7
- data.tar.gz: dd5ada82b6968986d47324699d9f640d1f93db21672f19db22a7fd7a81c2df318d05a6102778fcc1c9df6683311ccb30a66b4be90e5b427ce84fb6f3ece42124
6
+ metadata.gz: 596a1c7beb838ecb06fcbdacd3719b1f3c5c62d320e689a559b7aff486e3b7bf8d01e24fa59a444a2c818a56e0734466e1afaf9367151dfcca31a8f16ca549f8
7
+ data.tar.gz: 252563017b7da78d34e7183638ae9f009aa5dd636e95770d8449469bfaeaff2092eabdf5d5b8ebbd9762055a313c6ba6c4b93d42d1cc7f5c15279e1fbb65a549
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trailer_vote-media_types (1.2.1)
4
+ trailer_vote-media_types (1.2.2)
5
5
  media_types (>= 0.6.0, < 1)
6
6
 
7
7
  GEM
@@ -13,7 +13,7 @@ GEM
13
13
  docile (1.3.2)
14
14
  json (2.2.0)
15
15
  media_types (0.6.2)
16
- minitest (5.12.0)
16
+ minitest (5.12.2)
17
17
  minitest-ci (3.4.0)
18
18
  minitest (>= 5.0.6)
19
19
  minitest-reporters (1.3.8)
@@ -21,7 +21,7 @@ GEM
21
21
  builder
22
22
  minitest (>= 5.0)
23
23
  ruby-progressbar
24
- oj (3.9.1)
24
+ oj (3.9.2)
25
25
  rake (12.3.3)
26
26
  ruby-progressbar (1.10.1)
27
27
  simplecov (0.17.1)
@@ -29,7 +29,7 @@ GEM
29
29
  json (>= 1.8, < 3)
30
30
  simplecov-html (~> 0.10.0)
31
31
  simplecov-html (0.10.2)
32
- trailer_vote-fixtures (1.6.1)
32
+ trailer_vote-fixtures (1.6.2)
33
33
 
34
34
  PLATFORMS
35
35
  ruby
@@ -44,7 +44,7 @@ DEPENDENCIES
44
44
  oj (~> 3.6)
45
45
  rake (~> 12.3)
46
46
  simplecov (~> 0.16)
47
- trailer_vote-fixtures (~> 1.6.1)
47
+ trailer_vote-fixtures (~> 1.6.2)
48
48
  trailer_vote-media_types!
49
49
 
50
50
  BUNDLED WITH
@@ -12,9 +12,20 @@ module TrailerVote
12
12
  # The push manifest is a list of active push campaigns
13
13
  #
14
14
  class PushManifest < BaseText
15
- media_type 'push_manifest', defaults: { suffix: :json, version: 1 }
15
+ media_type 'push_manifest', defaults: { suffix: :json, version: 2 }
16
16
 
17
17
  validations do
18
+
19
+ version 2 do
20
+ attribute :push_manifest do
21
+ collection :campaigns, allow_empty: true do
22
+ link :audio_fragment, optional: true
23
+ link :product, optional: true
24
+ link :campaign
25
+ end
26
+ end
27
+ end
28
+
18
29
  version 1 do
19
30
  attribute :push_manifest do
20
31
  collection :campaigns, allow_empty: true do
@@ -14,7 +14,7 @@ module TrailerVote
14
14
  # The trivial push campaign is used to schedule a local push notification at a specified time.
15
15
  #
16
16
  class PushTrivialCampaign < BaseText
17
- media_type 'push_campaign_trivial', defaults: { suffix: :json, version: 3 }
17
+ media_type 'push_campaign_trivial', defaults: { suffix: :json, version: 4 }
18
18
 
19
19
  filters = ::MediaTypes::Scheme.new do
20
20
  attribute :filter do
@@ -45,19 +45,41 @@ module TrailerVote
45
45
  end
46
46
 
47
47
  push_creation_base = ::MediaTypes::Scheme.new do
48
- attribute :_links do
49
- attribute :product_asset do
50
- attribute :href, Types::HttpUrl
51
- end
52
- attribute :action do
53
- attribute :href, Types::HttpUrl
54
- end
55
- end
48
+ link :product_asset
49
+ link :action
50
+ attribute :schedule_at, Types::Iso8601
51
+ attribute :translations, ::Hash
52
+ end
53
+
54
+ push_creation_base_v4 = ::MediaTypes::Scheme.new do
55
+ link :product, optional: true
56
+ link :product_asset, optional: true
57
+ link :action
58
+ link :rich_media, optional: true
56
59
  attribute :schedule_at, Types::Iso8601
57
60
  attribute :translations, ::Hash
58
61
  end
59
62
 
60
63
  validations do
64
+
65
+ version 4 do
66
+ attribute :push_campaign_trivial do
67
+ link :action
68
+ link :self
69
+ link :rich_media, optional: true
70
+ attribute :message, String
71
+ attribute :schedule_at, Types::Iso8601
72
+ merge filters
73
+ end
74
+
75
+ view 'create' do
76
+ attribute :push_campaign_trivial do
77
+ merge push_creation_base_v4
78
+ merge filters_creation
79
+ end
80
+ end
81
+ end
82
+
61
83
  version 3 do
62
84
  attribute :push_campaign_trivial do
63
85
  link :action
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TrailerVote
4
4
  module MediaTypes
5
- VERSION = '1.2.1'
5
+ VERSION = '1.2.2'
6
6
  end
7
7
  end
@@ -39,5 +39,5 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency 'oj', '~> 3.6'
40
40
  spec.add_development_dependency 'rake', '~> 12.3'
41
41
  spec.add_development_dependency 'simplecov', '~> 0.16'
42
- spec.add_development_dependency 'trailer_vote-fixtures', '~> 1.6.1'
42
+ spec.add_development_dependency 'trailer_vote-fixtures', '~> 1.6.2'
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailer_vote-media_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derk-Jan Karrenbeld
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-25 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: media_types
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 1.6.1
151
+ version: 1.6.2
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 1.6.1
158
+ version: 1.6.2
159
159
  description:
160
160
  email:
161
161
  - dj@trailervote.com