@pod-os/core 0.34.0-rc.acb3dcb.0 → 0.34.0-rc.b310d8a.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
@@ -31116,30 +31116,28 @@ var Store = class {
31116
31116
  return docUrl;
31117
31117
  }
31118
31118
  async addNewThing(uri6, name9, type5) {
31119
- await this.updater.update(
31120
- [],
31121
- [
31122
- st(
31123
- namedNode2(uri6),
31124
- namedNode2("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
31125
- namedNode2(type5),
31126
- namedNode2(uri6).doc()
31127
- ),
31128
- st(
31129
- namedNode2(uri6),
31130
- namedNode2("http://www.w3.org/2000/01/rdf-schema#label"),
31131
- lit(name9),
31132
- namedNode2(uri6).doc()
31133
- )
31134
- ],
31135
- void 0,
31136
- false,
31137
- {
31138
- // explicitly omit credentials due to
31139
- // https://github.com/pod-os/PodOS/issues/17
31140
- credentials: "omit"
31141
- }
31142
- );
31119
+ const typeInsertion = type5 ? [
31120
+ st(
31121
+ namedNode2(uri6),
31122
+ namedNode2("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
31123
+ namedNode2(type5),
31124
+ namedNode2(uri6).doc()
31125
+ )
31126
+ ] : [];
31127
+ const insertions = [
31128
+ ...typeInsertion,
31129
+ st(
31130
+ namedNode2(uri6),
31131
+ namedNode2("http://www.w3.org/2000/01/rdf-schema#label"),
31132
+ lit(name9),
31133
+ namedNode2(uri6).doc()
31134
+ )
31135
+ ];
31136
+ await this.updater.update([], insertions, void 0, false, {
31137
+ // explicitly omit credentials due to
31138
+ // https://github.com/pod-os/PodOS/issues/17
31139
+ credentials: "omit"
31140
+ });
31143
31141
  }
31144
31142
  async executeUpdate(operation3) {
31145
31143
  await executeUpdate(this.fetcher, this.updater, operation3);
package/lib/index.js CHANGED
@@ -39558,30 +39558,28 @@ _:patch
39558
39558
  return docUrl;
39559
39559
  }
39560
39560
  async addNewThing(uri6, name9, type5) {
39561
- await this.updater.update(
39562
- [],
39563
- [
39564
- st(
39565
- namedNode2(uri6),
39566
- namedNode2("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
39567
- namedNode2(type5),
39568
- namedNode2(uri6).doc()
39569
- ),
39570
- st(
39571
- namedNode2(uri6),
39572
- namedNode2("http://www.w3.org/2000/01/rdf-schema#label"),
39573
- lit(name9),
39574
- namedNode2(uri6).doc()
39575
- )
39576
- ],
39577
- void 0,
39578
- false,
39579
- {
39580
- // explicitly omit credentials due to
39581
- // https://github.com/pod-os/PodOS/issues/17
39582
- credentials: "omit"
39583
- }
39584
- );
39561
+ const typeInsertion = type5 ? [
39562
+ st(
39563
+ namedNode2(uri6),
39564
+ namedNode2("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
39565
+ namedNode2(type5),
39566
+ namedNode2(uri6).doc()
39567
+ )
39568
+ ] : [];
39569
+ const insertions = [
39570
+ ...typeInsertion,
39571
+ st(
39572
+ namedNode2(uri6),
39573
+ namedNode2("http://www.w3.org/2000/01/rdf-schema#label"),
39574
+ lit(name9),
39575
+ namedNode2(uri6).doc()
39576
+ )
39577
+ ];
39578
+ await this.updater.update([], insertions, void 0, false, {
39579
+ // explicitly omit credentials due to
39580
+ // https://github.com/pod-os/PodOS/issues/17
39581
+ credentials: "omit"
39582
+ });
39585
39583
  }
39586
39584
  async executeUpdate(operation3) {
39587
39585
  await executeUpdate(this.fetcher, this.updater, operation3);
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.34.0-rc.acb3dcb.0",
4
+ "version": "0.34.0-rc.b310d8a.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./types/index.d.ts",
package/types/Store.d.ts CHANGED
@@ -59,7 +59,7 @@ export declare class Store {
59
59
  */
60
60
  addRelation(thing: Thing, property: string, uri: string): Promise<void>;
61
61
  private determineDocumentToUpdate;
62
- addNewThing(uri: string, name: string, type: string): Promise<void>;
62
+ addNewThing(uri: string, name: string, type?: string): Promise<void>;
63
63
  executeUpdate(operation: UpdateOperation): Promise<void>;
64
64
  flagAuthorizationMetadata(): void;
65
65
  loadModule<T>(module: PodOsModule<T>): T;
package/types/index.d.ts CHANGED
@@ -84,7 +84,7 @@ export declare class PodOS {
84
84
  */
85
85
  addRelation(thing: Thing, property: string, value: string): Promise<void>;
86
86
  listKnownTerms(): Term[];
87
- addNewThing(uri: string, name: string, type: string): Promise<void>;
87
+ addNewThing(uri: string, name: string, type?: string): Promise<void>;
88
88
  proposeUriForNewThing(referenceUri: string, name: string): string;
89
89
  /**
90
90
  * returns a behavior subject that can be used to observe changes in the session state