@pod-os/core 0.17.1-rc.2988a4e.0 → 0.17.1-rc.3040327.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 +4464 -13082
- package/lib/index.js +917 -9535
- package/package.json +6 -3
- package/types/authentication/BrowserSession.d.ts +15 -0
- package/types/authentication/index.d.ts +5 -19
- package/types/index.d.ts +2 -6
- package/types/thing/Thing.d.ts +1 -1
- package/types/authentication/observeSession.d.ts +0 -4
- /package/types/authentication/{observeSession.spec.d.ts → BrowserSession.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pod-os/core",
|
|
3
|
-
"version": "0.17.1-rc.
|
|
3
|
+
"version": "0.17.1-rc.3040327.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"build:bundle": "rimraf lib && node esbuild/build-bundle.mjs",
|
|
16
16
|
"build:esm": "rimraf dist && node esbuild/build-esm.mjs",
|
|
17
17
|
"build:types": "rimraf types && tsc --emitDeclarationOnly --outDir types",
|
|
18
|
+
"build:types:watch": "rimraf types && tsc --emitDeclarationOnly --outDir types --watch",
|
|
18
19
|
"build:watch": "node esbuild/watch-esm.mjs",
|
|
20
|
+
"dev": "run-p build:types:watch build:watch",
|
|
19
21
|
"build": " npm run build:bundle && npm run build:types && npm run build:esm"
|
|
20
22
|
},
|
|
21
23
|
"keywords": [
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"eslint": "^9.30.0",
|
|
35
37
|
"jest": "^29.7.0",
|
|
36
38
|
"jest-when": "^3.7.0",
|
|
39
|
+
"npm-run-all": "^4.1.5",
|
|
37
40
|
"prettier": "^3.6.2",
|
|
38
41
|
"rimraf": "^6.0.1",
|
|
39
42
|
"sparqljs": "^3.7.3",
|
|
@@ -41,14 +44,14 @@
|
|
|
41
44
|
"typescript-eslint": "^8.35.1"
|
|
42
45
|
},
|
|
43
46
|
"dependencies": {
|
|
44
|
-
"@inrupt/solid-client-authn-browser": "^2.3.0",
|
|
45
47
|
"@solid-data-modules/contacts-rdflib": "^0.7.0",
|
|
46
48
|
"@solid-data-modules/rdflib-utils": "^0.6.0",
|
|
47
49
|
"@types/lunr": "^2.3.7",
|
|
50
|
+
"@uvdsl/solid-oidc-client-browser": "^0.1.1",
|
|
48
51
|
"buffer": "^6.0.3",
|
|
49
52
|
"lunr": "^2.3.9",
|
|
50
|
-
"rdflib": "^2.2.37",
|
|
51
53
|
"rdf-namespaces": "^1.14.0",
|
|
54
|
+
"rdflib": "^2.2.37",
|
|
52
55
|
"rxjs": "^7.8.2",
|
|
53
56
|
"slugify": "^1.6.6",
|
|
54
57
|
"url": "^0.11.4"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BehaviorSubject } from "rxjs";
|
|
2
|
+
import { PodOsSession, SessionInfo } from "./index";
|
|
3
|
+
export declare class BrowserSession implements PodOsSession {
|
|
4
|
+
private readonly session;
|
|
5
|
+
private onSessionRestoreCallback;
|
|
6
|
+
private readonly _authenticatedFetch;
|
|
7
|
+
private readonly sessionInfo$;
|
|
8
|
+
get authenticatedFetch(): (url: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
9
|
+
constructor();
|
|
10
|
+
handleIncomingRedirect(restorePreviousSession?: boolean): Promise<void>;
|
|
11
|
+
login(oidcIssuer: string): Promise<void>;
|
|
12
|
+
logout(): Promise<void>;
|
|
13
|
+
observeSession(): BehaviorSubject<SessionInfo>;
|
|
14
|
+
onSessionRestore(callback: (url: string) => void): void;
|
|
15
|
+
}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import { ISessionInfo } from "@inrupt/solid-client-authn-browser";
|
|
2
|
-
import { BehaviorSubject } from "rxjs";
|
|
3
1
|
export type AuthenticatedFetch = (url: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
4
|
-
export type SessionInfo =
|
|
2
|
+
export type SessionInfo = {
|
|
3
|
+
isLoggedIn: boolean;
|
|
4
|
+
webId?: string;
|
|
5
|
+
};
|
|
5
6
|
export interface PodOsSession {
|
|
6
7
|
authenticatedFetch: AuthenticatedFetch;
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
-
private readonly session;
|
|
10
|
-
private readonly _authenticatedFetch;
|
|
11
|
-
private readonly sessionInfo$;
|
|
12
|
-
get authenticatedFetch(): (url: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
|
13
|
-
constructor();
|
|
14
|
-
handleIncomingRedirect(restorePreviousSession?: boolean): Promise<ISessionInfo | undefined>;
|
|
15
|
-
login(oidcIssuer: string): Promise<void>;
|
|
16
|
-
logout(): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated use observeSession instead
|
|
19
|
-
*/
|
|
20
|
-
trackSession(callback: (session: SessionInfo) => unknown): void;
|
|
21
|
-
observeSession(): BehaviorSubject<SessionInfo>;
|
|
22
|
-
onSessionRestore(callback: (url: string) => void): void;
|
|
23
|
-
}
|
|
9
|
+
export * from "./BrowserSession";
|
package/types/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./ldp-container";
|
|
|
17
17
|
export * from "./profile";
|
|
18
18
|
export * from "./search";
|
|
19
19
|
export * from "./offline-cache";
|
|
20
|
+
export * from "./terms";
|
|
20
21
|
export interface PodOsConfiguration {
|
|
21
22
|
offlineCache?: OfflineCache;
|
|
22
23
|
onlineStatus?: OnlineStatus;
|
|
@@ -31,7 +32,7 @@ export declare class PodOS {
|
|
|
31
32
|
private readonly offlineCache;
|
|
32
33
|
constructor({ session, offlineCache, onlineStatus, }?: PodOsConfiguration);
|
|
33
34
|
private flagAuthorizationMetaDataOnSessionChange;
|
|
34
|
-
handleIncomingRedirect(restorePreviousSession?: boolean): void
|
|
35
|
+
handleIncomingRedirect(restorePreviousSession?: boolean): Promise<void>;
|
|
35
36
|
fetch(uri: string): Promise<Response>;
|
|
36
37
|
fetchAll(uris: string[]): Promise<PromiseSettledResult<Response>[]>;
|
|
37
38
|
fetchFile(url: string): Promise<SolidFile>;
|
|
@@ -39,11 +40,6 @@ export declare class PodOS {
|
|
|
39
40
|
listKnownTerms(): Term[];
|
|
40
41
|
addNewThing(uri: string, name: string, type: string): Promise<void>;
|
|
41
42
|
proposeUriForNewThing(referenceUri: string, name: string): string;
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated use observeSession instead
|
|
44
|
-
* @param callback
|
|
45
|
-
*/
|
|
46
|
-
trackSession(callback: (session: SessionInfo) => unknown): void;
|
|
47
43
|
/**
|
|
48
44
|
* returns a behavior subject that can be used to observe changes in the session state
|
|
49
45
|
*/
|
package/types/thing/Thing.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class Thing {
|
|
|
28
28
|
label(): string;
|
|
29
29
|
literals(): Literal[];
|
|
30
30
|
relations(predicate?: string): Relation[];
|
|
31
|
-
reverseRelations(): Relation[];
|
|
31
|
+
reverseRelations(predicate?: string): Relation[];
|
|
32
32
|
anyValue(...predicateUris: string[]): undefined;
|
|
33
33
|
description(): undefined;
|
|
34
34
|
picture(): {
|
|
File without changes
|