@pod-os/core 0.9.1-451938f.0 → 0.9.1-49d87ed.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pod-os/core",
3
- "version": "0.9.1-451938f.0",
3
+ "version": "0.9.1-49d87ed.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./types/index.d.ts",
6
6
  "files": [
@@ -24,26 +24,28 @@
24
24
  "author": "Angelo Veltens",
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@babel/preset-env": "^7.22.9",
27
+ "@babel/preset-env": "^7.22.10",
28
28
  "@babel/preset-typescript": "^7.22.5",
29
29
  "@types/jest": "^29.5.3",
30
30
  "@types/jest-when": "^3.5.2",
31
31
  "@types/sparqljs": "^3.1.4",
32
- "@typescript-eslint/eslint-plugin": "^6.1.0",
33
- "@typescript-eslint/parser": "^6.1.0",
34
- "esbuild": "^0.18.14",
35
- "eslint": "^8.45.0",
36
- "jest": "^29.6.1",
37
- "jest-when": "^3.5.2",
38
- "prettier": "^3.0.0",
32
+ "@typescript-eslint/eslint-plugin": "^6.4.0",
33
+ "@typescript-eslint/parser": "^6.4.0",
34
+ "esbuild": "^0.19.2",
35
+ "eslint": "^8.47.0",
36
+ "jest": "^29.6.2",
37
+ "jest-when": "^3.6.0",
38
+ "prettier": "^3.0.2",
39
39
  "rdf-namespaces": "^1.11.0",
40
40
  "rimraf": "^5.0.1",
41
41
  "sparqljs": "^3.7.1",
42
42
  "typescript": "^5.1.6"
43
43
  },
44
44
  "dependencies": {
45
- "@inrupt/solid-client-authn-browser": "^1.13.4",
45
+ "@inrupt/solid-client-authn-browser": "^1.17.1",
46
+ "@types/lunr": "^2.3.4",
46
47
  "buffer": "^6.0.3",
48
+ "lunr": "^2.3.9",
47
49
  "rdflib": "^2.2.32",
48
50
  "slugify": "^1.6.6",
49
51
  "url": "^0.11.1"
package/types/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { ISessionInfo } from "@inrupt/solid-client-authn-browser";
2
2
  import { SolidFile } from "./files";
3
+ import { WebIdProfile } from "./profile";
4
+ import { SearchIndex } from "./search/SearchIndex";
3
5
  import { Store } from "./Store";
4
6
  import { Term } from "./terms";
5
7
  import { Thing } from "./thing";
@@ -9,6 +11,8 @@ export * from "./files";
9
11
  export * from "./thing";
10
12
  export * from "./rdf-document";
11
13
  export * from "./ldp-container";
14
+ export * from "./profile";
15
+ export * from "./search";
12
16
  export declare class PodOS {
13
17
  private readonly session;
14
18
  readonly store: Store;
@@ -23,6 +27,16 @@ export declare class PodOS {
23
27
  addNewThing(uri: string, name: string, type: string): Promise<void>;
24
28
  proposeUriForNewThing(referenceUri: string, name: string): string;
25
29
  trackSession(callback: (session: ISessionInfo) => unknown): void;
30
+ /**
31
+ * Fetch the WebId profile and preferences file for the given WebID
32
+ * @param webId
33
+ */
34
+ fetchProfile(webId: string): Promise<WebIdProfile>;
35
+ /**
36
+ * Fetch the private label index for the given profile and build a search index from it
37
+ * @param webId
38
+ */
39
+ buildSearchIndex(profile: WebIdProfile): Promise<SearchIndex>;
26
40
  logout(): Promise<void>;
27
41
  login(oidcIssuer?: string): Promise<void>;
28
42
  }
@@ -0,0 +1,10 @@
1
+ import { IndexedFormula } from "rdflib";
2
+ import { Thing } from "../thing";
3
+ export declare class WebIdProfile extends Thing {
4
+ readonly webId: string;
5
+ readonly store: IndexedFormula;
6
+ readonly editable: boolean;
7
+ constructor(webId: string, store: IndexedFormula, editable?: boolean);
8
+ getPreferencesFile(): string | void;
9
+ getPrivateLabelIndex(): string | void;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { WebIdProfile } from "./WebIdProfile";
@@ -1 +1 @@
1
- export * from './RdfDocument';
1
+ export * from "./RdfDocument";
@@ -0,0 +1,12 @@
1
+ import { IndexedFormula } from "rdflib";
2
+ import { RdfDocument } from "../rdf-document";
3
+ export declare class LabelIndex extends RdfDocument {
4
+ readonly uri: string;
5
+ readonly store: IndexedFormula;
6
+ readonly editable: boolean;
7
+ constructor(uri: string, store: IndexedFormula, editable?: boolean);
8
+ getIndexedItems(): {
9
+ uri: string;
10
+ label: string;
11
+ }[];
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { LabelIndex } from "./LabelIndex";
2
+ import { Index } from "lunr";
3
+ export declare class SearchIndex {
4
+ private index;
5
+ constructor(indexes: LabelIndex[]);
6
+ search(term: string, maxResults?: number): Index.Result[];
7
+ clear(): void;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./SearchIndex";
2
+ export * from "./LabelIndex";