@pod-os/core 0.23.1-rc.d5481ff.0 → 0.24.0-rc.47722fb.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.
@@ -1,2 +1,4 @@
1
1
  export declare const rdfs: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
2
2
  export declare const pim: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
3
+ export declare const schema: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
4
+ export declare const flow: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
@@ -1,12 +1,13 @@
1
1
  import { ResultAsync } from "neverthrow";
2
2
  import { Thing } from "../thing";
3
- import { Store } from "../Store";
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 store;
8
- private readonly fileFetcher;
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 {};
@@ -1,2 +1 @@
1
1
  export * from "./PictureGateway";
2
- export * from "./createPictureLinkOperation";
@@ -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 to find things related to the WebID and their profile document
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 te URI of the preferences document
13
+ * Returns the URI of the preferences document
13
14
  */
14
- getPreferencesFile(): string | void;
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
  */
@@ -1 +1,2 @@
1
1
  export { WebIdProfile } from "./WebIdProfile";
2
+ export { ProfileGateway } from "./ProfileGateway";
@@ -0,0 +1 @@
1
+ export {};
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { TypeIndex } from "./TypeIndex";
2
+ export { TypeRegistration } from "./TypeRegistration";
@@ -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;