@pod-os/core 0.14.0 → 0.14.1-01c71c6.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.14.0",
3
+ "version": "0.14.1-01c71c6.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./types/index.d.ts",
6
6
  "files": [
package/types/Store.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Fetcher, IndexedFormula, UpdateManager } from "rdflib";
2
2
  import { PodOsSession } from "./authentication";
3
3
  import { Thing } from "./thing";
4
- import { LabelIndex } from "./search";
4
+ import { UpdateOperation } from "@solid-data-modules/rdflib-utils";
5
5
  /**
6
6
  * The store contains all data that is known locally.
7
7
  * It can be used to fetch additional data from the web and also update data and sync it back to editable resources.
@@ -34,5 +34,5 @@ export declare class Store {
34
34
  */
35
35
  addPropertyValue(thing: Thing, property: string, value: string): Promise<void>;
36
36
  addNewThing(uri: string, name: string, type: string): Promise<void>;
37
- addToLabelIndex(thing: Thing, labelIndex: LabelIndex): Promise<void>;
37
+ executeUpdate(operation: UpdateOperation): Promise<void>;
38
38
  }
package/types/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { BehaviorSubject } from "rxjs";
3
3
  import { SessionInfo } from "./authentication";
4
4
  import { SolidFile } from "./files";
5
5
  import { WebIdProfile } from "./profile";
6
- import { LabelIndex, SearchIndex } from "./search";
6
+ import { LabelIndex } from "./search";
7
7
  import { Store } from "./Store";
8
8
  import { Term } from "./terms";
9
9
  import { Thing } from "./thing";
@@ -20,6 +20,7 @@ export declare class PodOS {
20
20
  readonly store: Store;
21
21
  readonly uriService: UriService;
22
22
  private fileFetcher;
23
+ private searchGateway;
23
24
  constructor();
24
25
  private flagAuthorizationMetaDataOnSessionChange;
25
26
  handleIncomingRedirect(restorePreviousSession?: boolean): void;
@@ -53,7 +54,7 @@ export declare class PodOS {
53
54
  * Fetch the private label index for the given profile and build a search index from it
54
55
  * @param webId
55
56
  */
56
- buildSearchIndex(profile: WebIdProfile): Promise<SearchIndex>;
57
+ buildSearchIndex(profile: WebIdProfile): Promise<import("./search").SearchIndex>;
57
58
  logout(): Promise<void>;
58
59
  login(oidcIssuer?: string): Promise<void>;
59
60
  loadContactsModule(): Promise<ContactsModule>;
@@ -63,4 +64,11 @@ export declare class PodOS {
63
64
  * @param labelIndex - The index to update
64
65
  */
65
66
  addToLabelIndex(thing: Thing, labelIndex: LabelIndex): Promise<void>;
67
+ /**
68
+ * Creates a new label index document at a default location and links it to the user's profile or preferences document
69
+ *
70
+ * @param profile - The profile for that to create the index
71
+ * @returns the newly created label index
72
+ */
73
+ createDefaultLabelIndex(profile: WebIdProfile): Promise<LabelIndex>;
66
74
  }
@@ -1 +1,2 @@
1
1
  export declare const rdfs: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
2
+ export declare const pim: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
@@ -0,0 +1,16 @@
1
+ import { WebIdProfile } from "../profile";
2
+ import { Store } from "../Store";
3
+ import { LabelIndex } from "./LabelIndex";
4
+ import { Thing } from "../thing";
5
+ import { SearchIndex } from "./SearchIndex";
6
+ export declare class SearchGateway {
7
+ private store;
8
+ constructor(store: Store);
9
+ /**
10
+ * Fetch the private label index for the given profile and build a search index from it
11
+ * @param webId
12
+ */
13
+ buildSearchIndex(profile: WebIdProfile): Promise<SearchIndex>;
14
+ addToLabelIndex(thing: Thing, labelIndex: LabelIndex): Promise<void>;
15
+ createDefaultLabelIndex(profile: WebIdProfile): Promise<LabelIndex>;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -4,8 +4,13 @@ import { Index } from "lunr";
4
4
  * A fast, in-memory search index based on data from label indexes. Both labels and URIs are indexed.
5
5
  */
6
6
  export declare class SearchIndex {
7
+ private labelIndexes;
7
8
  private index;
8
- constructor(indexes: LabelIndex[]);
9
+ constructor(labelIndexes: LabelIndex[]);
10
+ /**
11
+ * Recreates the search index with the current data from all label indexes
12
+ */
13
+ rebuild(): this;
9
14
  /**
10
15
  * Search the index for a given term. It finds partial matches, but will rank exact matches higher.
11
16
  *
@@ -0,0 +1,5 @@
1
+ import { UpdateOperation } from "@solid-data-modules/rdflib-utils";
2
+ import { WebIdProfile } from "../profile";
3
+ export declare function createDefaultLabelIndex(profile: WebIdProfile): {
4
+ uri: string;
5
+ } & UpdateOperation;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from "./SearchIndex";
2
2
  export * from "./LabelIndex";
3
+ export * from "./SearchGateway";