distributed-press-api-client 0.4.1 → 0.5.0rc0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e19e26b40b8e66a49cd2ac91d688ffc0757fc83c7d19d6d3e7c59917d7cab652
|
4
|
+
data.tar.gz: bea92fa0f42403e3c6eeffa5484f8224bbfc08236089be41aed7dd6900124f77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df7cae6980256471a341c25d9ec34f60d38df59eded802959e210167157960376ef19e00d09be9b943cbf9f165046b7949de7824ea1dffbb7dd8824718c8f7b
|
7
|
+
data.tar.gz: 846042442ce3c6720b5af695332d6140edacbe523e4fc7ad3f930938179672faffbd4a587e66ff45a44b1c8e796133188cc1e867770f4b9e4859d8f07e0c2fca
|
@@ -24,11 +24,13 @@ class DistributedPress
|
|
24
24
|
# Creates a Social Inbox by uploading the keypair to it.
|
25
25
|
#
|
26
26
|
# @param actor_url [String] The URL where the Actor profile is hosted
|
27
|
+
# @param announce [Boolean] Automatically announce new accounts
|
27
28
|
# @return [HTTParty::Response]
|
28
|
-
def create(actor_url)
|
29
|
+
def create(actor_url, announce = false)
|
29
30
|
inbox_body = {
|
30
31
|
'actorUrl' => actor_url,
|
31
32
|
'publicKeyId' => "#{actor_url}#main-key",
|
33
|
+
'announce' => announce,
|
32
34
|
'keypair' => {
|
33
35
|
'publicKeyPem' => client.public_key.public_to_pem,
|
34
36
|
'privateKeyPem' => client.private_key.export
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uri'
|
4
|
+
require_relative 'client'
|
5
|
+
|
6
|
+
class DistributedPress
|
7
|
+
module V1
|
8
|
+
module Social
|
9
|
+
# Manages the activity's replies
|
10
|
+
class Replies
|
11
|
+
# @return [DistributedPress::V1::Social::Client]
|
12
|
+
attr_reader :client
|
13
|
+
|
14
|
+
# @return [String]
|
15
|
+
attr_reader :actor
|
16
|
+
|
17
|
+
# @return [String] Activity ID (URL)
|
18
|
+
attr_reader :activity
|
19
|
+
|
20
|
+
# @param :client [DistributedPress::V1::Social::Client]
|
21
|
+
# @param :actor [String]
|
22
|
+
# @param :activity [String]
|
23
|
+
def initialize(client:, actor:, activity:)
|
24
|
+
@client = client
|
25
|
+
@actor = actor
|
26
|
+
@activity = activity
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get the activities replies collection. Authenticated requests
|
30
|
+
# contain the list of replies.
|
31
|
+
#
|
32
|
+
# @return [HTTParty::Response]
|
33
|
+
def get
|
34
|
+
client.get(endpoint: endpoint)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Replies
|
38
|
+
#
|
39
|
+
# @return [String]
|
40
|
+
def endpoint
|
41
|
+
@endpoint ||= "/v1/#{actor}/inbox/replies/#{URI.encode_uri_component(activity)}"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
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.
|
4
|
+
version: 0.5.0rc0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -317,6 +317,7 @@ files:
|
|
317
317
|
- lib/distributed_press/v1/social/outbox.rb
|
318
318
|
- lib/distributed_press/v1/social/reference.rb
|
319
319
|
- lib/distributed_press/v1/social/referenced_object.rb
|
320
|
+
- lib/distributed_press/v1/social/replies.rb
|
320
321
|
- lib/distributed_press/v1/social/schemas/webhook.rb
|
321
322
|
- lib/distributed_press/v1/social/signed_headers.rb
|
322
323
|
- lib/distributed_press/v1/token.rb
|
@@ -351,9 +352,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
351
352
|
version: '2.7'
|
352
353
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
353
354
|
requirements:
|
354
|
-
- - "
|
355
|
+
- - ">"
|
355
356
|
- !ruby/object:Gem::Version
|
356
|
-
version:
|
357
|
+
version: 1.3.1
|
357
358
|
requirements: []
|
358
359
|
rubygems_version: 3.3.26
|
359
360
|
signing_key:
|