@pod-os/core 0.28.0-rc.dc9b993.0 → 0.28.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 CHANGED
@@ -28800,6 +28800,25 @@ var Store = class {
28800
28800
  }
28801
28801
  );
28802
28802
  }
28803
+ /**
28804
+ * Adds a new relation (link) from the thing to the given uri using the property
28805
+ * @param thing
28806
+ * @param property
28807
+ * @param uri
28808
+ */
28809
+ addRelation(thing, property4, uri6) {
28810
+ return this.updater.update(
28811
+ [],
28812
+ [st(namedNode(thing.uri), namedNode(property4), namedNode(uri6), namedNode(thing.uri).doc())],
28813
+ void 0,
28814
+ false,
28815
+ {
28816
+ // explicitly omit credentials due to
28817
+ // https://github.com/pod-os/PodOS/issues/17
28818
+ credentials: "omit"
28819
+ }
28820
+ );
28821
+ }
28803
28822
  async addNewThing(uri6, name9, type5) {
28804
28823
  await this.updater.update(
28805
28824
  [],
@@ -50634,9 +50653,24 @@ var PodOS = class {
50634
50653
  files() {
50635
50654
  return this.fileFetcher;
50636
50655
  }
50656
+ /**
50657
+ * Adds a new value to the property of the given thing
50658
+ * @param thing
50659
+ * @param property
50660
+ * @param value
50661
+ */
50637
50662
  addPropertyValue(thing, property4, value7) {
50638
50663
  return this.store.addPropertyValue(thing, property4, value7);
50639
50664
  }
50665
+ /**
50666
+ * Adds a new relation (link) from the thing to the given uri using the property
50667
+ * @param thing
50668
+ * @param property
50669
+ * @param uri
50670
+ */
50671
+ addRelation(thing, property4, value7) {
50672
+ return this.store.addRelation(thing, property4, value7);
50673
+ }
50640
50674
  listKnownTerms() {
50641
50675
  return listKnownTerms();
50642
50676
  }
package/lib/index.js CHANGED
@@ -37237,6 +37237,25 @@ _:patch
37237
37237
  }
37238
37238
  );
37239
37239
  }
37240
+ /**
37241
+ * Adds a new relation (link) from the thing to the given uri using the property
37242
+ * @param thing
37243
+ * @param property
37244
+ * @param uri
37245
+ */
37246
+ addRelation(thing, property4, uri6) {
37247
+ return this.updater.update(
37248
+ [],
37249
+ [st(namedNode(thing.uri), namedNode(property4), namedNode(uri6), namedNode(thing.uri).doc())],
37250
+ void 0,
37251
+ false,
37252
+ {
37253
+ // explicitly omit credentials due to
37254
+ // https://github.com/pod-os/PodOS/issues/17
37255
+ credentials: "omit"
37256
+ }
37257
+ );
37258
+ }
37240
37259
  async addNewThing(uri6, name9, type5) {
37241
37260
  await this.updater.update(
37242
37261
  [],
@@ -59071,9 +59090,24 @@ _:patch
59071
59090
  files() {
59072
59091
  return this.fileFetcher;
59073
59092
  }
59093
+ /**
59094
+ * Adds a new value to the property of the given thing
59095
+ * @param thing
59096
+ * @param property
59097
+ * @param value
59098
+ */
59074
59099
  addPropertyValue(thing, property4, value7) {
59075
59100
  return this.store.addPropertyValue(thing, property4, value7);
59076
59101
  }
59102
+ /**
59103
+ * Adds a new relation (link) from the thing to the given uri using the property
59104
+ * @param thing
59105
+ * @param property
59106
+ * @param uri
59107
+ */
59108
+ addRelation(thing, property4, value7) {
59109
+ return this.store.addRelation(thing, property4, value7);
59110
+ }
59077
59111
  listKnownTerms() {
59078
59112
  return listKnownTerms();
59079
59113
  }
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.28.0-rc.dc9b993.0",
4
+ "version": "0.28.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./types/index.d.ts",
@@ -23,6 +23,7 @@
23
23
  "scripts": {
24
24
  "test": "jest",
25
25
  "test:watch": "jest --watch",
26
+ "typecheck": "tsc --noEmit",
26
27
  "lint": "eslint ./src",
27
28
  "build:bundle": "rimraf lib && node esbuild/build-bundle.mjs",
28
29
  "build:esm": "rimraf dist && node esbuild/build-esm.mjs",
package/types/Store.d.ts CHANGED
@@ -38,6 +38,13 @@ export declare class Store {
38
38
  * @param value
39
39
  */
40
40
  addPropertyValue(thing: Thing, property: string, value: string): Promise<void>;
41
+ /**
42
+ * Adds a new relation (link) from the thing to the given uri using the property
43
+ * @param thing
44
+ * @param property
45
+ * @param uri
46
+ */
47
+ addRelation(thing: Thing, property: string, uri: string): Promise<void>;
41
48
  addNewThing(uri: string, name: string, type: string): Promise<void>;
42
49
  executeUpdate(operation: UpdateOperation): Promise<void>;
43
50
  flagAuthorizationMetadata(): void;
package/types/index.d.ts CHANGED
@@ -61,7 +61,20 @@ export declare class PodOS {
61
61
  * @returns {FileFetcher} An instance of FileFetcher that handles file operations
62
62
  */
63
63
  files(): FileFetcher;
64
+ /**
65
+ * Adds a new value to the property of the given thing
66
+ * @param thing
67
+ * @param property
68
+ * @param value
69
+ */
64
70
  addPropertyValue(thing: Thing, property: string, value: string): Promise<void>;
71
+ /**
72
+ * Adds a new relation (link) from the thing to the given uri using the property
73
+ * @param thing
74
+ * @param property
75
+ * @param uri
76
+ */
77
+ addRelation(thing: Thing, property: string, value: string): Promise<void>;
65
78
  listKnownTerms(): Term[];
66
79
  addNewThing(uri: string, name: string, type: string): Promise<void>;
67
80
  proposeUriForNewThing(referenceUri: string, name: string): string;