@pod-os/core 0.33.0-rc.f51bdc0.0 → 0.33.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
@@ -30980,6 +30980,33 @@ var Store = class {
30980
30980
  st(namedNode2(thing.uri), namedNode2(property4), lit(value8), namedNode2(docUrl))
30981
30981
  );
30982
30982
  }
30983
+ /**
30984
+ * Updates the value of the given property of the given thing to the new value
30985
+ * @param thing
30986
+ * @param property
30987
+ * @param oldValue
30988
+ * @param newValue
30989
+ */
30990
+ async editPropertyValue(thing, property4, oldValue, newValue) {
30991
+ const docUrl = this.determineDocumentToUpdate(thing);
30992
+ const remove = st(
30993
+ namedNode2(thing.uri),
30994
+ namedNode2(property4),
30995
+ lit(oldValue),
30996
+ namedNode2(docUrl)
30997
+ );
30998
+ const insert = st(
30999
+ namedNode2(thing.uri),
31000
+ namedNode2(property4),
31001
+ lit(newValue),
31002
+ namedNode2(docUrl)
31003
+ );
31004
+ return this.updater.update([remove], [insert], void 0, false, {
31005
+ // explicitly omit credentials due to
31006
+ // https://github.com/pod-os/PodOS/issues/17
31007
+ credentials: "omit"
31008
+ });
31009
+ }
30983
31010
  insert(statement2) {
30984
31011
  return this.updater.update([], [statement2], void 0, false, {
30985
31012
  // explicitly omit credentials due to
@@ -53224,6 +53251,16 @@ var PodOS = class {
53224
53251
  addPropertyValue(thing, property4, value8) {
53225
53252
  return this.store.addPropertyValue(thing, property4, value8);
53226
53253
  }
53254
+ /**
53255
+ * Updates the value of the given property of the given thing to the new value
53256
+ * @param thing
53257
+ * @param property
53258
+ * @param oldValue
53259
+ * @param newValue
53260
+ */
53261
+ editPropertyValue(thing, property4, oldValue, newValue) {
53262
+ return this.store.editPropertyValue(thing, property4, oldValue, newValue);
53263
+ }
53227
53264
  /**
53228
53265
  * Adds a new relation (link) from the thing to the given uri using the property
53229
53266
  * @param thing
package/lib/index.js CHANGED
@@ -39422,6 +39422,33 @@ _:patch
39422
39422
  st(namedNode2(thing.uri), namedNode2(property4), lit(value8), namedNode2(docUrl))
39423
39423
  );
39424
39424
  }
39425
+ /**
39426
+ * Updates the value of the given property of the given thing to the new value
39427
+ * @param thing
39428
+ * @param property
39429
+ * @param oldValue
39430
+ * @param newValue
39431
+ */
39432
+ async editPropertyValue(thing, property4, oldValue, newValue) {
39433
+ const docUrl = this.determineDocumentToUpdate(thing);
39434
+ const remove = st(
39435
+ namedNode2(thing.uri),
39436
+ namedNode2(property4),
39437
+ lit(oldValue),
39438
+ namedNode2(docUrl)
39439
+ );
39440
+ const insert = st(
39441
+ namedNode2(thing.uri),
39442
+ namedNode2(property4),
39443
+ lit(newValue),
39444
+ namedNode2(docUrl)
39445
+ );
39446
+ return this.updater.update([remove], [insert], void 0, false, {
39447
+ // explicitly omit credentials due to
39448
+ // https://github.com/pod-os/PodOS/issues/17
39449
+ credentials: "omit"
39450
+ });
39451
+ }
39425
39452
  insert(statement2) {
39426
39453
  return this.updater.update([], [statement2], void 0, false, {
39427
39454
  // explicitly omit credentials due to
@@ -61666,6 +61693,16 @@ _:patch
61666
61693
  addPropertyValue(thing, property4, value8) {
61667
61694
  return this.store.addPropertyValue(thing, property4, value8);
61668
61695
  }
61696
+ /**
61697
+ * Updates the value of the given property of the given thing to the new value
61698
+ * @param thing
61699
+ * @param property
61700
+ * @param oldValue
61701
+ * @param newValue
61702
+ */
61703
+ editPropertyValue(thing, property4, oldValue, newValue) {
61704
+ return this.store.editPropertyValue(thing, property4, oldValue, newValue);
61705
+ }
61669
61706
  /**
61670
61707
  * Adds a new relation (link) from the thing to the given uri using the property
61671
61708
  * @param thing
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.33.0-rc.f51bdc0.0",
4
+ "version": "0.33.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./types/index.d.ts",
@@ -30,8 +30,7 @@
30
30
  "build:types": "rimraf types && tsc --emitDeclarationOnly --outDir types",
31
31
  "build:types:watch": "rimraf types && tsc --emitDeclarationOnly --outDir types --watch",
32
32
  "build:watch": "node esbuild/watch-esm.mjs",
33
- "build:doc": "typedoc --gitRevision main",
34
- "postbuild:doc": "./scripts/postprocess-typedoc.sh",
33
+ "build:doc": "typedoc --gitRevision main && ./scripts/postprocess-typedoc.sh",
35
34
  "dev": "run-p build:types:watch build:watch",
36
35
  "build": " npm run build:bundle && npm run build:types && npm run build:esm"
37
36
  },
@@ -57,7 +56,7 @@
57
56
  "typedoc-plugin-markdown": "^4.12.0",
58
57
  "typescript": "^6.0.3",
59
58
  "typescript-eslint": "^8.67.0",
60
- "vitest": "^4.1.10",
59
+ "vitest": "^4.1.11",
61
60
  "vitest-when": "^0.10.0"
62
61
  },
63
62
  "dependencies": {
package/types/Store.d.ts CHANGED
@@ -42,6 +42,14 @@ export declare class Store {
42
42
  * @param value
43
43
  */
44
44
  addPropertyValue(thing: Thing, property: string, value: string): Promise<void>;
45
+ /**
46
+ * Updates the value of the given property of the given thing to the new value
47
+ * @param thing
48
+ * @param property
49
+ * @param oldValue
50
+ * @param newValue
51
+ */
52
+ editPropertyValue(thing: Thing, property: string, oldValue: string, newValue: string): Promise<void>;
45
53
  private insert;
46
54
  /**
47
55
  * Adds a new relation (link) from the thing to the given uri using the property
package/types/index.d.ts CHANGED
@@ -68,6 +68,14 @@ export declare class PodOS {
68
68
  * @param value
69
69
  */
70
70
  addPropertyValue(thing: Thing, property: string, value: string): Promise<void>;
71
+ /**
72
+ * Updates the value of the given property of the given thing to the new value
73
+ * @param thing
74
+ * @param property
75
+ * @param oldValue
76
+ * @param newValue
77
+ */
78
+ editPropertyValue(thing: Thing, property: string, oldValue: string, newValue: string): Promise<void>;
71
79
  /**
72
80
  * Adds a new relation (link) from the thing to the given uri using the property
73
81
  * @param thing