Compare commits
3 commits
1d6c71f56a
...
d44a30577a
Author | SHA1 | Date | |
---|---|---|---|
d44a30577a | |||
804250ed85 | |||
e0e5bc666f |
3 changed files with 18 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
:resource-paths ["src/main/resources"]
|
||||
:dependencies [[org.clojure/clojure "1.11.1"]
|
||||
[orchestra "2021.01.01-1"]
|
||||
[org.clojure/data.json "2.4.0"]
|
||||
;; Incoming HTTP
|
||||
[ring/ring-core "1.9.6"]
|
||||
[ring/ring-jetty-adapter "1.9.6"]
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
[org.domaindrivenarchitecture.activity-pub-poc.common :as cm]
|
||||
[clojure.spec.alpha :as s]
|
||||
[orchestra.core :refer [defn-spec]]
|
||||
[clojure.data.json :as json]
|
||||
[clojure.inspector :as ins]
|
||||
[hato.client :as hato]
|
||||
[clojure.string :as st]
|
||||
|
@ -49,6 +50,7 @@
|
|||
(s/def to-uri uri-vector?)
|
||||
(s/def actor uri-string?)
|
||||
(s/def object uri-string?)
|
||||
|
||||
(s/def ::to uri-string?)
|
||||
(s/def ::target string?)
|
||||
(s/def ::from uri-string?)
|
||||
|
@ -82,6 +84,13 @@
|
|||
"actor" (:from input-map)
|
||||
"object" (:target input-map)))
|
||||
|
||||
(defn-spec write-json-ld string?
|
||||
[input map?
|
||||
filename string?]
|
||||
(->
|
||||
input
|
||||
(json/write-str)
|
||||
(#(spit filename %))))
|
||||
|
||||
|
||||
|
||||
|
|
8
src/test/resources/like.json
Normal file
8
src/test/resources/like.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"@context": "https:\/\/www.w3.org\/ns\/activitystreams",
|
||||
"type": "Like",
|
||||
"id": "https:\/\/social.bla\/alyssa\/out\/sdfsd44243g324g3455",
|
||||
"to": "https:\/\/chatty.bla\/ben\/",
|
||||
"actor": "https:\/\/social.bla\/alyssa\/",
|
||||
"object": "posts\/234s23-2g34234-2hhj536"
|
||||
}
|
Loading…
Reference in a new issue