Skip to content

Commit

Permalink
Merge pull request #1 from joachimvh/fix
Browse files Browse the repository at this point in the history
Fix various issues
  • Loading branch information
joepio committed Mar 25, 2022
2 parents 25863bc + 7c54078 commit 4e612dd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
11 changes: 11 additions & 0 deletions config/search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.0/components/context.jsonld",
"@graph": [
{
"@type": "SearchListener",
"source": { "@id": "urn:solid-server:default:ResourceStore" },
"store": { "@id": "urn:solid-server:default:ResourceStore" },
"searchEndpoint": "http://example.org/my-search-endpoint"
}
]
}
18 changes: 8 additions & 10 deletions file-search.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/components/context.jsonld",
"@context": [
"https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/components/context.jsonld",
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.0/components/context.jsonld"
],
"import": [
"files-scs:config/app/main/default.json",
"files-scs:config/app/init/default.json",
Expand Down Expand Up @@ -30,18 +33,13 @@
"files-scs:config/util/logging/winston.json",
"files-scs:config/util/representation-conversion/default.json",
"files-scs:config/util/resource-locker/memory.json",
"files-scs-search:config/search.json",
"files-scs:config/util/variables/default.json"
"files-scs:config/util/variables/default.json",

"files-solid-search:config/search.json"
],
"@graph": [
{
"comment": "A single-pod server that stores its resources on disk."
},
{
"@type": "SearchListener",
"eventEmitter": { "@id": "urn:solid-server:default:ResourceStore" },
"store": { "@id": "urn:solid-server:default:ResourceStore" },
"searchEndpoint": "string"
"comment": "A single-pod server that stores its resources on disk and supports solid search."
}
]
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"start": "community-solid-server -c file-search.json",
"build": "npm run build:ts && npm run build:components",
"build:components": "componentsjs-generator -s src -c dist/components -r knows-scs",
"build:components": "componentsjs-generator -s src -c dist/components -i .componentsignore -r solid-search --typeScopedContexts",
"build:ts": "tsc"
},
"keywords": [
Expand All @@ -35,12 +36,12 @@
"lsd:module": "https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server",
"lsd:components": "dist/components/components.jsonld",
"lsd:contexts": {
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.1/components/context.jsonld": "dist/components/context.jsonld"
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.0/components/context.jsonld": "dist/components/context.jsonld"
},
"lsd:importPaths": {
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.1/components/": "dist/components/",
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.1/config/": "config/",
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.1/dist/": "dist/"
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.0/components/": "dist/components/",
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.0/config/": "config/",
"https://linkedsoftwaredependencies.org/bundles/npm/solid-search-community-server/^0.0.0/dist/": "dist/"
},
"author": "Joep Meindertsma",
"license": "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {getLoggerFor, ResourceStore, ResourceIdentifier} from '@solid/community-server';
import type { EventEmitter } from 'events';
import fetch from 'node-fetch';

/**
Expand All @@ -7,8 +8,7 @@ import fetch from 'node-fetch';
export class SearchListener {
private readonly logger = getLoggerFor(this);

public constructor(source: NodeJS.EventEmitter, store: ResourceStore, searchEndpoint: string) {
// super();
public constructor(source: EventEmitter, store: ResourceStore, searchEndpoint: string) {
// Every time a resource is changed, post to the Solid-Search instance
source.on('changed', async(changed: ResourceIdentifier): Promise<void> => {
const turtleStream = (await store.getRepresentation(changed, { type: { 'text/turtle': 1 } })).data;
Expand Down

0 comments on commit 4e612dd

Please sign in to comment.