@pod-os/core 0.15.1-c576356.0 → 0.15.1-rc.3e90908.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/{chunk-RI2OJWF3.js → chunk-VGZLO2LW.js} +8482 -8479
- package/dist/{dist-SZGBZENE.js → dist-UG2BEWCW.js} +1 -1
- package/dist/index.js +2011 -952
- package/dist/{jsonld-RY2OHZTS.js → jsonld-X74JI4TL.js} +0 -20
- package/lib/index.js +4175 -3132
- package/package.json +13 -13
- package/types/PodOs.spec.d.ts +1 -0
- package/types/Store.d.ts +2 -1
- package/types/index.d.ts +12 -4
- package/types/offline-cache/OfflineCache.d.ts +15 -0
- package/types/offline-cache/OfflineCapableFetcher.d.ts +18 -0
- package/types/offline-cache/OfflineCapableFetcher.spec.d.ts +1 -0
- package/types/offline-cache/OnlineStatus.d.ts +6 -0
- package/types/offline-cache/index.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pod-os/core",
|
|
3
|
-
"version": "0.15.1-
|
|
3
|
+
"version": "0.15.1-rc.3e90908.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -24,32 +24,32 @@
|
|
|
24
24
|
"author": "Angelo Veltens",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/preset-env": "^7.
|
|
28
|
-
"@babel/preset-typescript": "^7.
|
|
29
|
-
"@eslint/js": "^9.
|
|
27
|
+
"@babel/preset-env": "^7.27.2",
|
|
28
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
29
|
+
"@eslint/js": "^9.28.0",
|
|
30
30
|
"@types/jest": "^29.5.14",
|
|
31
31
|
"@types/jest-when": "^3.5.5",
|
|
32
32
|
"@types/sparqljs": "^3.1.12",
|
|
33
|
-
"esbuild": "^0.
|
|
34
|
-
"eslint": "^9.
|
|
33
|
+
"esbuild": "^0.25.5",
|
|
34
|
+
"eslint": "^9.28.0",
|
|
35
35
|
"jest": "^29.7.0",
|
|
36
36
|
"jest-when": "^3.7.0",
|
|
37
|
-
"prettier": "^3.
|
|
38
|
-
"rdf-namespaces": "^1.
|
|
37
|
+
"prettier": "^3.5.3",
|
|
38
|
+
"rdf-namespaces": "^1.13.1",
|
|
39
39
|
"rimraf": "^6.0.1",
|
|
40
40
|
"sparqljs": "^3.7.3",
|
|
41
|
-
"typescript": "5.
|
|
41
|
+
"typescript": "5.8.3",
|
|
42
42
|
"typescript-eslint": "^7.18.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@inrupt/solid-client-authn-browser": "^2.
|
|
45
|
+
"@inrupt/solid-client-authn-browser": "^2.5.0",
|
|
46
46
|
"@solid-data-modules/contacts-rdflib": "^0.7.0",
|
|
47
|
-
"@solid-data-modules/rdflib-utils": "^0.
|
|
47
|
+
"@solid-data-modules/rdflib-utils": "^0.6.0",
|
|
48
48
|
"@types/lunr": "^2.3.7",
|
|
49
49
|
"buffer": "^6.0.3",
|
|
50
50
|
"lunr": "^2.3.9",
|
|
51
|
-
"rdflib": "^2.2.
|
|
52
|
-
"rxjs": "^7.8.
|
|
51
|
+
"rdflib": "^2.2.37",
|
|
52
|
+
"rxjs": "^7.8.2",
|
|
53
53
|
"slugify": "^1.6.6",
|
|
54
54
|
"url": "^0.11.4"
|
|
55
55
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/Store.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Fetcher, IndexedFormula, UpdateManager } from "rdflib";
|
|
|
2
2
|
import { PodOsSession } from "./authentication";
|
|
3
3
|
import { Thing } from "./thing";
|
|
4
4
|
import { UpdateOperation } from "@solid-data-modules/rdflib-utils";
|
|
5
|
+
import { OfflineCache, OnlineStatus } from "./offline-cache";
|
|
5
6
|
/**
|
|
6
7
|
* The store contains all data that is known locally.
|
|
7
8
|
* It can be used to fetch additional data from the web and also update data and sync it back to editable resources.
|
|
@@ -10,7 +11,7 @@ export declare class Store {
|
|
|
10
11
|
fetcher: Fetcher;
|
|
11
12
|
updater: UpdateManager;
|
|
12
13
|
graph: IndexedFormula;
|
|
13
|
-
constructor(session: PodOsSession);
|
|
14
|
+
constructor(session: PodOsSession, offlineCache?: OfflineCache, onlineStatus?: OnlineStatus);
|
|
14
15
|
/**
|
|
15
16
|
* Fetch data for the given URI to the store
|
|
16
17
|
* @param uri
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContactsModule } from "@solid-data-modules/contacts-rdflib";
|
|
2
2
|
import { BehaviorSubject } from "rxjs";
|
|
3
|
-
import { SessionInfo } from "./authentication";
|
|
3
|
+
import { BrowserSession, SessionInfo } from "./authentication";
|
|
4
4
|
import { SolidFile } from "./files";
|
|
5
5
|
import { WebIdProfile } from "./profile";
|
|
6
6
|
import { LabelIndex } from "./search";
|
|
@@ -8,6 +8,7 @@ import { Store } from "./Store";
|
|
|
8
8
|
import { Term } from "./terms";
|
|
9
9
|
import { Thing } from "./thing";
|
|
10
10
|
import { UriService } from "./uri/UriService";
|
|
11
|
+
import { OfflineCache, OnlineStatus } from "./offline-cache";
|
|
11
12
|
export * from "./authentication";
|
|
12
13
|
export * from "./files";
|
|
13
14
|
export * from "./thing";
|
|
@@ -15,13 +16,20 @@ export * from "./rdf-document";
|
|
|
15
16
|
export * from "./ldp-container";
|
|
16
17
|
export * from "./profile";
|
|
17
18
|
export * from "./search";
|
|
19
|
+
export * from "./offline-cache";
|
|
20
|
+
export interface PodOsConfiguration {
|
|
21
|
+
offlineCache?: OfflineCache;
|
|
22
|
+
onlineStatus?: OnlineStatus;
|
|
23
|
+
session?: BrowserSession;
|
|
24
|
+
}
|
|
18
25
|
export declare class PodOS {
|
|
19
26
|
private readonly session;
|
|
20
27
|
readonly store: Store;
|
|
21
28
|
readonly uriService: UriService;
|
|
22
|
-
private fileFetcher;
|
|
23
|
-
private searchGateway;
|
|
24
|
-
|
|
29
|
+
private readonly fileFetcher;
|
|
30
|
+
private readonly searchGateway;
|
|
31
|
+
private readonly offlineCache;
|
|
32
|
+
constructor({ session, offlineCache, onlineStatus, }?: PodOsConfiguration);
|
|
25
33
|
private flagAuthorizationMetaDataOnSessionChange;
|
|
26
34
|
handleIncomingRedirect(restorePreviousSession?: boolean): void;
|
|
27
35
|
fetch(uri: string): Promise<Response>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface CachedRdfDocument {
|
|
2
|
+
url: string;
|
|
3
|
+
revision: string;
|
|
4
|
+
statements: string;
|
|
5
|
+
}
|
|
6
|
+
export interface OfflineCache {
|
|
7
|
+
put(document: CachedRdfDocument): void;
|
|
8
|
+
get(url: string): Promise<CachedRdfDocument | undefined>;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class NoOfflineCache implements OfflineCache {
|
|
12
|
+
put(): void;
|
|
13
|
+
get(): Promise<undefined>;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AutoInitOptions, Fetcher, IndexedFormula, NamedNode } from "rdflib";
|
|
2
|
+
import { OfflineCache } from "./OfflineCache";
|
|
3
|
+
export interface OfflineCapableFetcherOptions {
|
|
4
|
+
fetch: (uri: string) => Promise<Response>;
|
|
5
|
+
isOnline: () => boolean;
|
|
6
|
+
offlineCache: OfflineCache;
|
|
7
|
+
}
|
|
8
|
+
export declare class OfflineCapableFetcher extends Fetcher {
|
|
9
|
+
private readonly offlineCache;
|
|
10
|
+
private readonly isOnline;
|
|
11
|
+
private readonly store;
|
|
12
|
+
constructor(store: IndexedFormula, options: Partial<AutoInitOptions> & OfflineCapableFetcherOptions);
|
|
13
|
+
load(uri: string, options?: Partial<AutoInitOptions>): Promise<Response>;
|
|
14
|
+
load(uri: NamedNode, options?: Partial<AutoInitOptions>): Promise<Response>;
|
|
15
|
+
load(uri: Array<string | NamedNode>, options?: Partial<AutoInitOptions>): Promise<Response[]>;
|
|
16
|
+
private putToCache;
|
|
17
|
+
private retrieveFromCache;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|