-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: created talos for bootstrapping APIs
- Loading branch information
Showing
48 changed files
with
654 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hydrofoil/talos": minor | ||
--- | ||
|
||
First version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.d.ts | ||
mocha-setup.js | ||
packages/*/bin/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,12 @@ | |
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"init": "node -r ts-node/register ../../packages/knossos init --api https://conduit.knossos.lndo.site --endpoint http://minos:[email protected]/repositories/labyrinth --overwrite" | ||
"resources": "knossos-dev init", | ||
"bootstrap": "talos-dev put --vocabs --acl --resources --api https://conduit.knossos.lndo.site --endpoint http://minos:[email protected]/repositories/labyrinth" | ||
}, | ||
"dependencies": { | ||
"@hydrofoil/knossos": "0.0.0", | ||
"@hydrofoil/talos": "0.0.0", | ||
"@rdfjs/term-set": "^1.0.1", | ||
"@tpluscode/rdf-ns-builders": "^0.4", | ||
"@tpluscode/sparql-builder": "^0.3.11", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix code: <https://code.described.at/> . | ||
@prefix auth: <https://hypermedia.app/auth#> . | ||
@prefix knossos: <https://hypermedia.app/knossos#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#> . | ||
|
||
<> rdfs:subClassOf acl:Authorization ; | ||
a hydra:Class, sh:NodeShape, rdfs:Class ; | ||
knossos:createWithPUT true ; | ||
hydra:apiDocumentation </api> ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "PUT" ; | ||
auth:access acl:Write ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/knossos/resource#PUT> ; | ||
] | ||
] ; | ||
sh:property | ||
[ | ||
sh:path acl:mode ; | ||
sh:minCount 1 ; | ||
sh:in ( | ||
acl:Read acl:Write acl:Control acl:Delete acl:Create | ||
) ; | ||
] ; | ||
sh:or | ||
( | ||
[ | ||
sh:property | ||
[ | ||
sh:path acl:agent ; | ||
sh:minCount 1 ; | ||
sh:nodeKind sh:IRI ; | ||
] | ||
] | ||
[ | ||
sh:property | ||
[ | ||
sh:path acl:agentClass ; | ||
sh:minCount 1 ; | ||
sh:nodeKind sh:IRI ; | ||
] | ||
] | ||
[ | ||
sh:property | ||
[ | ||
sh:path acl:agentGroup ; | ||
sh:minCount 1 ; | ||
sh:class vcard:Group ; | ||
] | ||
] | ||
) ; | ||
sh:or | ||
( | ||
[ | ||
sh:property | ||
[ | ||
sh:path acl:accessTo ; | ||
sh:minCount 1 ; | ||
sh:nodeKind sh:IRI ; | ||
] | ||
] | ||
[ | ||
sh:property | ||
[ | ||
sh:path acl:accessToClass ; | ||
sh:minCount 1 ; | ||
sh:nodeKind sh:IRI ; | ||
] | ||
] | ||
) | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
|
||
<> | ||
a <hydra/Collection> ; | ||
hydra:manages | ||
[ | ||
hydra:property rdf:type ; | ||
hydra:object hydra:Class ; | ||
] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix events: <https://hypermedia.app/events#> . | ||
@prefix code: <https://code.described.at/> . | ||
@prefix auth: <https://hypermedia.app/auth#> . | ||
@prefix knossos: <https://hypermedia.app/knossos#> . | ||
|
||
<> rdfs:subClassOf events:EventHandler ; | ||
a sh:NodeShape, rdfs:Class, hydra:Class ; | ||
hydra:apiDocumentation </api> ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "PUT" ; | ||
auth:access acl:Write ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/knossos/resource#PUT> ; | ||
] | ||
] ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix events: <https://hypermedia.app/events#> . | ||
|
||
events:EventHandler rdfs:subClassOf rdfs:Resource . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix code: <https://code.described.at/> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
@prefix as: <https://www.w3.org/ns/activitystreams#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix events: <https://hypermedia.app/events#> . | ||
|
||
<> a events:EventHandler ; | ||
rdfs:comment "Void ApiDocumentation cache when a hydra:Class is created of updated" ; | ||
events:eventSpec | ||
[ | ||
rdf:predicate rdf:type ; | ||
rdf:object as:Update ; | ||
] , | ||
[ | ||
rdf:predicate rdf:type ; | ||
rdf:object as:Create ; | ||
] ; | ||
events:objectSpec | ||
[ | ||
rdf:predicate rdf:type ; | ||
rdf:object hydra:Class ; | ||
] ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/knossos/lib/api#invalidate> ; | ||
] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@prefix code: <https://code.described.at/> . | ||
@prefix auth: <https://hypermedia.app/auth#> . | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#> . | ||
@prefix knossos: <https://hypermedia.app/knossos#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
|
||
</api/hydra/ApiDocumentation> | ||
rdfs:subClassOf hydra:ApiDocumentation, rdfs:Resource ; | ||
a sh:NodeShape, rdfs:Class, hydra:Class ; | ||
hydra:apiDocumentation </api> ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "DELETE" ; | ||
auth:access acl:Delete ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/knossos/lib/api#DELETE> ; | ||
] | ||
] ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@prefix code: <https://code.described.at/> . | ||
@prefix auth: <https://hypermedia.app/auth#> . | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#> . | ||
@prefix knossos: <https://hypermedia.app/knossos#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
|
||
<> rdfs:subClassOf hydra:Class, </api/hydra/Resource> ; | ||
a sh:NodeShape, rdfs:Class, hydra:Class ; | ||
knossos:createWithPUT true ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "PUT" ; | ||
auth:access acl:Write ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/knossos/resource#PUT> ; | ||
] | ||
] ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "DELETE" ; | ||
auth:access acl:Delete ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/knossos/resource#DELETE> ; | ||
] | ||
] ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix code: <https://code.described.at/> . | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
@prefix auth: <https://hypermedia.app/auth#> . | ||
|
||
<> rdfs:subClassOf hydra:Collection ; | ||
a hydra:Class, rdfs:Class, sh:NodeShape ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "GET" ; | ||
auth:access acl:Read ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/labyrinth/collection#get> ; | ||
] | ||
] ; | ||
sh:property | ||
[ | ||
sh:path hydra:manages ; | ||
sh:minCount 1 ; | ||
] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix code: <https://code.described.at/> . | ||
@prefix acl: <http://www.w3.org/ns/auth/acl#> . | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
@prefix auth: <https://hypermedia.app/auth#> . | ||
|
||
<> rdfs:subClassOf hydra:Resource ; | ||
a hydra:Class ; | ||
hydra:supportedOperation | ||
[ | ||
hydra:method "GET" ; | ||
auth:access acl:Read ; | ||
code:implementedBy | ||
[ | ||
a code:EcmaScript ; | ||
code:link <node:@hydrofoil/labyrinth/resource#get> ; | ||
] | ||
] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@prefix hydra: <http://www.w3.org/ns/hydra/core#> . | ||
|
||
<> | ||
a </api/hydra/ApiDocumentation> ; | ||
hydra:entrypoint <../> ; | ||
. |
Oops, something went wrong.