distributed-press-api-client 0.3.0 → 0.3.1

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: 6731553fbdfb80318a3ffedd78b9805594fc9817a8554516c8ac3c8982df3345
4
- data.tar.gz: 3e5fb1bf9ac4526acec284834505c19a0811bc5c51fccc177a712073794e4ab8
3
+ metadata.gz: 1f9ade4eb6d66abaf9b33a5781a0a3ec1ced7849c59d2c5e23b871b59cd206f2
4
+ data.tar.gz: 57c7f2e5e72e49fa7418e850800a4ad420b29e6be1d62cf4bfb25272234c3424
5
5
  SHA512:
6
- metadata.gz: 2dc6826aaa09cccc207933c3fd9c60de6e5fed15f2c2e7617090079ee74f666ba3ae95c3a51d7543279dae1bc0be64564855ca883abe251b7df6fc1eb01d9f65
7
- data.tar.gz: 31835fadab543760c181269ab9284e0c52c91784f0c46f7f9e1ca7389926e0108bea25bf053ff2c3657acb5724ddc51bfff0249e74b2f3b97f21b2a4537fc72e
6
+ metadata.gz: 5e6d5be220822e44d1397aa1bf034be6141892a847b99cb1dedb8830d56d0064e955f15b95aba51c1f4aba460d0c04195c1d8b45a651f2c328de5571a75f6215
7
+ data.tar.gz: b16c1082df61f87468e54ddf0cfd6336f995b45b7c05f6b30e94cff127daa4ea904fbf6188c519efc98c8116a90e9bef424d2985f5641989f2f42ee8b342e387
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry-schema'
4
+
5
+ class DistributedPress
6
+ module V1
7
+ module Schemas
8
+ # Bittorrent protocol
9
+ class BittorrentProtocol < Dry::Schema::JSON
10
+ define do
11
+ required(:enabled).value(:bool)
12
+ # TODO: Validate URL
13
+ required(:link).filled(:string)
14
+ required(:gateway).filled(:string)
15
+ required(:dnslink).filled(:string)
16
+ required(:infoHash).filled(:string)
17
+ required(:pubKey).filled(:string)
18
+ required(:magnet).filled(:string)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -11,6 +11,7 @@ class DistributedPress
11
11
  define do
12
12
  # TODO: Validate domain name
13
13
  required(:domain).filled(:string)
14
+ optional(:public).filled(:bool)
14
15
 
15
16
  optional(:protocols).hash do
16
17
  optional(:http).filled(:bool)
@@ -4,6 +4,7 @@ require 'dry-schema'
4
4
  require_relative 'http_protocol'
5
5
  require_relative 'hyper_protocol'
6
6
  require_relative 'ipfs_protocol'
7
+ require_relative 'bittorrent_protocol'
7
8
 
8
9
  class DistributedPress
9
10
  module V1
@@ -15,18 +16,20 @@ class DistributedPress
15
16
 
16
17
  # TODO: Validate domain name
17
18
  required(:domain).filled(:string)
18
- required(:public).filled(:bool)
19
+ optional(:public).filled(:bool)
19
20
 
20
21
  required(:protocols).hash do
21
22
  required(:http).filled(:bool)
22
23
  required(:ipfs).filled(:bool)
23
24
  required(:hyper).filled(:bool)
25
+ optional(:bittorrent).filled(:bool)
24
26
  end
25
27
 
26
28
  required(:links).hash do
27
29
  optional(:http).hash(HttpProtocol.new)
28
30
  optional(:hyper).hash(HyperProtocol.new)
29
31
  optional(:ipfs).hash(IpfsProtocol.new)
32
+ optional(:bittorrent).hash(BittorrentProtocol.new)
30
33
  end
31
34
  end
32
35
  end
@@ -10,7 +10,7 @@ class DistributedPress
10
10
  class UpdateSite < Dry::Schema::JSON
11
11
  define do
12
12
  required(:id).filled(:string)
13
- required(:public).filled(:bool)
13
+ optional(:public).filled(:bool)
14
14
 
15
15
  required(:protocols).hash do
16
16
  optional(:http).filled(:bool)
@@ -4,6 +4,7 @@ require_relative 'schemas/admin'
4
4
  require_relative 'schemas/http_protocol'
5
5
  require_relative 'schemas/hyper_protocol'
6
6
  require_relative 'schemas/ipfs_protocol'
7
+ require_relative 'schemas/bittorrent_protocol'
7
8
  require_relative 'schemas/new_admin'
8
9
  require_relative 'schemas/new_publisher'
9
10
  require_relative 'schemas/new_site'
@@ -3,5 +3,5 @@
3
3
  # API client
4
4
  class DistributedPress
5
5
  # Version
6
- VERSION = '0.3.0'
6
+ VERSION = '0.3.1'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distributed-press-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
@@ -264,6 +264,7 @@ files:
264
264
  - lib/distributed_press/v1/errors.rb
265
265
  - lib/distributed_press/v1/schemas.rb
266
266
  - lib/distributed_press/v1/schemas/admin.rb
267
+ - lib/distributed_press/v1/schemas/bittorrent_protocol.rb
267
268
  - lib/distributed_press/v1/schemas/http_protocol.rb
268
269
  - lib/distributed_press/v1/schemas/hyper_protocol.rb
269
270
  - lib/distributed_press/v1/schemas/ipfs_protocol.rb