distributed-press-api-client 0.5.0rc6 → 0.5.0rc8
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/distributed_press/v1/social/client.rb +1 -1
- data/lib/distributed_press/v1/social/dereferencer.rb +3 -3
- data/lib/distributed_press/v1/social/hook.rb +1 -1
- data/lib/distributed_press/v1/social/reference.rb +1 -1
- data/lib/distributed_press/v1/social/referenced_object.rb +1 -1
- data/lib/distributed_press/v1/social/replies.rb +2 -2
- data/lib/distributed_press/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03507acb74efe4f9acac94ec797a4e9e2c763e0bea35a64442c2cc5be9a433bd
|
4
|
+
data.tar.gz: d291bf8e88761714b282fb54273dc220615f53ea0d2647a95447c13ff0d3b7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 639668b2192c1e7c256de2d294582e96a1f9c3ddb701ca6102805e7a887265df6a7d73579b97fc5d4dcbe6564b5dbab852e798b22182824cefdf805312dcc17c
|
7
|
+
data.tar.gz: 9d54c9a9567c1af53340d9d412a67cf43513c80c2af3642dc843949af0120165cf5a6e7eef8fcef106880e077273157fa84953a25842a735e32e229a617e7c42
|
@@ -231,7 +231,7 @@ class DistributedPress
|
|
231
231
|
# after the request is instantiated. No need to process
|
232
232
|
# cookies for now. Uses the public key URL as a caching key so
|
233
233
|
# we revalidate access on shared caches.
|
234
|
-
options = { body: body, headers: headers, base_uri: url, parser: parser, stream_body: true }
|
234
|
+
options = { body: body, headers: headers, base_uri: url, parser: parser, stream_body: true, timeout: 5 }
|
235
235
|
options = HTTParty::ModuleInheritableAttributes.hash_deep_dup(self.class.default_options).merge(options)
|
236
236
|
response_body = ''.dup
|
237
237
|
|
@@ -29,14 +29,14 @@ class DistributedPress
|
|
29
29
|
# @todo Replace with a class
|
30
30
|
@parser =
|
31
31
|
proc do |body, format|
|
32
|
-
next HTTParty::Parser.call(body, :html) if body&.
|
33
|
-
next HTTParty::Parser.call(body, format || :plain) unless body&.
|
32
|
+
next HTTParty::Parser.call(body, :html) if body&.start_with? '<'
|
33
|
+
next HTTParty::Parser.call(body, format || :plain) unless body&.start_with? '{'
|
34
34
|
|
35
35
|
object = HTTParty::Parser.call(body, :json)
|
36
36
|
|
37
37
|
# @todo Actually validate objects
|
38
38
|
case object['type']
|
39
|
-
when 'Collection', 'OrderedCollection', 'CollectionPage'
|
39
|
+
when 'Collection', 'OrderedCollection', 'CollectionPage', 'OrderedCollectionPage'
|
40
40
|
Collection.new(object: object, dereferencer: self)
|
41
41
|
else
|
42
42
|
ReferencedObject.new(object: object, dereferencer: self)
|
@@ -43,7 +43,7 @@ class DistributedPress
|
|
43
43
|
|
44
44
|
# XXX: format is nil but should be :json
|
45
45
|
@parser = proc do |body, format|
|
46
|
-
next HTTParty::Parser.call(body, format || :plain) unless body.
|
46
|
+
next HTTParty::Parser.call(body, format || :plain) unless body.start_with? '{'
|
47
47
|
|
48
48
|
json = HTTParty::Parser.call(body, :json)
|
49
49
|
|
@@ -44,7 +44,7 @@ class DistributedPress
|
|
44
44
|
attr_reader :dereferencer
|
45
45
|
attr_reader :referenced
|
46
46
|
|
47
|
-
def_delegators :referenced, :[], :dig, :to_h, :to_json
|
47
|
+
def_delegators :referenced, :[], :dig, :to_h, :to_json, :keys, :key?
|
48
48
|
|
49
49
|
def initialize(object:, dereferencer:)
|
50
50
|
@object = object
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'base64'
|
4
4
|
require_relative 'client'
|
5
5
|
|
6
6
|
class DistributedPress
|
@@ -38,7 +38,7 @@ class DistributedPress
|
|
38
38
|
#
|
39
39
|
# @return [String]
|
40
40
|
def endpoint
|
41
|
-
@endpoint ||= "/v1/#{actor}/inbox/replies/#{
|
41
|
+
@endpoint ||= "/v1/#{actor}/inbox/replies/#{Base64.encode64(activity).delete("\n")}"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: distributed-press-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.0rc8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|