@pod-os/core 0.22.1-rc.f2eaee2.0 → 0.23.1-rc.11e4e07.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 +261 -63
- package/lib/index.js +274 -71
- package/package.json +1 -1
- package/types/attachments/AttachmentGateway.d.ts +23 -0
- package/types/attachments/index.d.ts +1 -0
- package/types/files/FileFetcher.d.ts +3 -0
- package/types/files/FileGateway.d.ts +26 -0
- package/types/files/FileGateway.spec.d.ts +1 -0
- package/types/files/createFileLinkOperation.d.ts +13 -0
- package/types/files/createFileLinkOperation.spec.d.ts +1 -0
- package/types/files/index.d.ts +1 -0
- package/types/index.d.ts +13 -3
- package/types/namespaces/index.d.ts +2 -0
- package/types/picture/PictureGateway.d.ts +6 -7
- package/types/picture/index.d.ts +0 -1
- package/types/profile/ProfileGateway.d.ts +10 -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/thing/Thing.attachments.spec.d.ts +1 -0
- package/types/thing/Thing.d.ts +8 -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 +30 -0
- package/types/type-index/index.d.ts +2 -0
- package/types/picture/createPictureLinkOperation.d.ts +0 -12
- /package/types/{picture/createPictureLinkOperation.spec.d.ts → attachments/AttachmentGateway.spec.d.ts} +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ResultAsync } from "neverthrow";
|
|
2
2
|
import { Thing } from "../thing";
|
|
3
|
-
import {
|
|
4
|
-
import { FileFetcher, NewFile } from "../files";
|
|
3
|
+
import { FileGateway, NewFile } from "../files";
|
|
5
4
|
import { HttpProblem, NetworkProblem } from "../problems";
|
|
5
|
+
/**
|
|
6
|
+
* Gateway for picture-related operations on Solid Pods and the store.
|
|
7
|
+
*/
|
|
6
8
|
export declare class PictureGateway {
|
|
7
|
-
private readonly
|
|
8
|
-
|
|
9
|
-
constructor(store: Store, fileFetcher: FileFetcher);
|
|
9
|
+
private readonly attachmentGateway;
|
|
10
|
+
constructor(attachmentGateway: FileGateway);
|
|
10
11
|
/**
|
|
11
12
|
* Uploads a picture file and associates it with a thing.
|
|
12
13
|
* The container is automatically derived from the thing's URI.
|
|
@@ -17,8 +18,6 @@ export declare class PictureGateway {
|
|
|
17
18
|
* @returns Result with the uploaded picture metadata (url, name, contentType) or error
|
|
18
19
|
*/
|
|
19
20
|
uploadAndAddPicture(thing: Thing, pictureFile: File): ResultAsync<UploadedPicture, HttpProblem | NetworkProblem>;
|
|
20
|
-
private linkPictureToThing;
|
|
21
|
-
private getContainerFromThing;
|
|
22
21
|
}
|
|
23
22
|
type UploadedPicture = NewFile;
|
|
24
23
|
export {};
|
package/types/picture/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WebIdProfile } from "./WebIdProfile";
|
|
2
|
+
import { Store } from "../Store";
|
|
3
|
+
/**
|
|
4
|
+
* Gateway for profile-related operations on Solid Pods and the store.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProfileGateway {
|
|
7
|
+
private readonly store;
|
|
8
|
+
constructor(store: Store);
|
|
9
|
+
fetchProfile(webId: string): Promise<WebIdProfile>;
|
|
10
|
+
}
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
package/types/thing/Thing.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export interface RdfType {
|
|
|
13
13
|
uri: string;
|
|
14
14
|
label: string;
|
|
15
15
|
}
|
|
16
|
+
export interface Attachment {
|
|
17
|
+
uri: string;
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
16
20
|
export declare class Thing {
|
|
17
21
|
readonly uri: string;
|
|
18
22
|
readonly store: IndexedFormula;
|
|
@@ -69,6 +73,10 @@ export declare class Thing {
|
|
|
69
73
|
* Retrieves a list of RDF types for this thing.
|
|
70
74
|
*/
|
|
71
75
|
types(): RdfType[];
|
|
76
|
+
/**
|
|
77
|
+
* Returns all attachments linked to this thing
|
|
78
|
+
*/
|
|
79
|
+
attachments(): Attachment[];
|
|
72
80
|
/**
|
|
73
81
|
* Call this method to switch to a more specific subclass of Thing.
|
|
74
82
|
*
|
|
@@ -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,30 @@
|
|
|
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
|
+
* Short label for the class URI
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* The containers or things this registration points to
|
|
15
|
+
*/
|
|
16
|
+
targets: RegistrationTarget[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Target of a type registration
|
|
20
|
+
*/
|
|
21
|
+
export interface RegistrationTarget {
|
|
22
|
+
/**
|
|
23
|
+
* container containing instances or direct reference to a single instance
|
|
24
|
+
*/
|
|
25
|
+
type: "container" | "instance";
|
|
26
|
+
/**
|
|
27
|
+
* URI the index points to (resembling terms:instance or terms:instanceContainer)
|
|
28
|
+
*/
|
|
29
|
+
uri: string;
|
|
30
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UpdateOperation } from "@solid-data-modules/rdflib-utils";
|
|
2
|
-
import { Thing } from "../thing";
|
|
3
|
-
import { NewFile } from "../files";
|
|
4
|
-
/**
|
|
5
|
-
* Creates an update operation to link a picture file to a thing.
|
|
6
|
-
* Uses schema:image as the predicate to establish the relationship.
|
|
7
|
-
*
|
|
8
|
-
* @param thing - The thing to link the picture to
|
|
9
|
-
* @param file - The uploaded picture file metadata
|
|
10
|
-
* @returns UpdateOperation that adds the picture link to the thing's document
|
|
11
|
-
*/
|
|
12
|
-
export declare function createPictureLinkOperation(thing: Thing, file: NewFile): UpdateOperation;
|
|
File without changes
|