@pod-os/core 0.22.1-rc.77c38a0.0 → 0.23.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/dist/index.js +945 -111
- package/lib/index.js +1021 -183
- package/package.json +2 -1
- package/types/Store.d.ts +13 -1
- package/types/Store.findMembers.spec.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/namespaces/index.d.ts +1 -0
- package/types/profile/ProfileGateway.d.ts +7 -0
- package/types/profile/ProfileGateway.spec.d.ts +1 -0
- package/types/profile/WebIdProfile.d.ts +12 -3
- package/types/profile/index.d.ts +1 -0
- package/types/type-index/TypeIndex.d.ts +13 -0
- package/types/type-index/TypeIndex.spec.d.ts +1 -0
- package/types/type-index/TypeRegistration.d.ts +26 -0
- package/types/type-index/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pod-os/core",
|
|
3
3
|
"description": "Core module of PodOS",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.23.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"build:types:watch": "rimraf types && tsc --emitDeclarationOnly --outDir types --watch",
|
|
31
31
|
"build:watch": "node esbuild/watch-esm.mjs",
|
|
32
32
|
"build:doc": "typedoc",
|
|
33
|
+
"postbuild:doc": "./scripts/postprocess-typedoc.sh",
|
|
33
34
|
"dev": "run-p build:types:watch build:watch",
|
|
34
35
|
"build": " npm run build:bundle && npm run build:types && npm run build:esm"
|
|
35
36
|
},
|
package/types/Store.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { PodOsSession } from "./authentication";
|
|
|
3
3
|
import { Thing } from "./thing";
|
|
4
4
|
import { ModuleConfig, UpdateOperation } from "@solid-data-modules/rdflib-utils";
|
|
5
5
|
import { OfflineCache, OnlineStatus } from "./offline-cache";
|
|
6
|
-
import { Subject } from "rxjs";
|
|
6
|
+
import { Observable, Subject } from "rxjs";
|
|
7
7
|
import { Quad } from "rdflib/lib/tf-types";
|
|
8
8
|
/**
|
|
9
9
|
* The Store contains all data that is known locally.
|
|
@@ -42,6 +42,18 @@ export declare class Store {
|
|
|
42
42
|
executeUpdate(operation: UpdateOperation): Promise<void>;
|
|
43
43
|
flagAuthorizationMetadata(): void;
|
|
44
44
|
loadModule<T>(module: PodOsModule<T>): T;
|
|
45
|
+
/**
|
|
46
|
+
* Finds instances of the given class or its sub-classes
|
|
47
|
+
* @param {string} classUri
|
|
48
|
+
* @returns {string[]} An array of URIs
|
|
49
|
+
*/
|
|
50
|
+
findMembers(classUri: string): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Get an Observable that will push new results from {@link findMembers} when it changes
|
|
53
|
+
* @param {string} classUri
|
|
54
|
+
* @returns {Observable<string[]>} Observable that pushes an array of URIs of instances of the given class or its sub-classes
|
|
55
|
+
*/
|
|
56
|
+
observeFindMembers(classUri: string): Observable<string[]>;
|
|
45
57
|
}
|
|
46
58
|
export interface PodOsModule<T> {
|
|
47
59
|
readonly default: new (config: ModuleConfig) => T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare class PodOS {
|
|
|
40
40
|
private readonly searchGateway;
|
|
41
41
|
private readonly pictureGateway;
|
|
42
42
|
private readonly offlineCache;
|
|
43
|
+
private readonly profileGateway;
|
|
43
44
|
constructor({ session, offlineCache, onlineStatus, internalStore, }?: PodOsConfiguration);
|
|
44
45
|
private flagAuthorizationMetaDataOnSessionChange;
|
|
45
46
|
fetch(uri: string): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { IndexedFormula } from "rdflib";
|
|
2
2
|
import { Thing } from "../thing";
|
|
3
3
|
/**
|
|
4
|
-
* Allows
|
|
4
|
+
* Allows finding things related to the WebID and their profile document
|
|
5
5
|
*/
|
|
6
6
|
export declare class WebIdProfile extends Thing {
|
|
7
7
|
readonly webId: string;
|
|
8
8
|
readonly store: IndexedFormula;
|
|
9
9
|
readonly editable: boolean;
|
|
10
|
+
private profileQuery;
|
|
10
11
|
constructor(webId: string, store: IndexedFormula, editable?: boolean);
|
|
11
12
|
/**
|
|
12
|
-
* Returns
|
|
13
|
+
* Returns the URI of the preferences document
|
|
13
14
|
*/
|
|
14
|
-
getPreferencesFile(): string |
|
|
15
|
+
getPreferencesFile(): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the URI of the public type index document
|
|
18
|
+
*/
|
|
19
|
+
getPublicTypeIndex(): string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the URI of the private type index document
|
|
22
|
+
*/
|
|
23
|
+
getPrivateTypeIndex(): string | undefined;
|
|
15
24
|
/**
|
|
16
25
|
* Returns the URIs of the private label indexes
|
|
17
26
|
*/
|
package/types/profile/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Thing } from "../thing";
|
|
2
|
+
import { IndexedFormula } from "rdflib";
|
|
3
|
+
import { TypeRegistration } from "./TypeRegistration";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a private or public type index document
|
|
6
|
+
*/
|
|
7
|
+
export declare class TypeIndex extends Thing {
|
|
8
|
+
readonly uri: string;
|
|
9
|
+
readonly store: IndexedFormula;
|
|
10
|
+
readonly editable: boolean;
|
|
11
|
+
constructor(uri: string, store: IndexedFormula, editable?: boolean);
|
|
12
|
+
listAll(): TypeRegistration[];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registration of a type in the type index
|
|
3
|
+
*/
|
|
4
|
+
export interface TypeRegistration {
|
|
5
|
+
/**
|
|
6
|
+
* RDF class of the indexed item(s) (resembling terms:forClass)
|
|
7
|
+
*/
|
|
8
|
+
forClass: string;
|
|
9
|
+
/**
|
|
10
|
+
* The containers or things this registration points to
|
|
11
|
+
*/
|
|
12
|
+
targets: RegistrationTarget[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Target of a type registration
|
|
16
|
+
*/
|
|
17
|
+
export interface RegistrationTarget {
|
|
18
|
+
/**
|
|
19
|
+
* container containing instances or direct reference to a single instance
|
|
20
|
+
*/
|
|
21
|
+
type: "container" | "instance";
|
|
22
|
+
/**
|
|
23
|
+
* URI the index points to (resembling terms:instance or terms:instanceContainer)
|
|
24
|
+
*/
|
|
25
|
+
uri: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TypeIndex } from "./TypeIndex";
|