@pod-os/core 0.34.0-rc.aff4dc6.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
@@ -18462,7 +18462,8 @@ var Mime = class {
18462
18462
  getAllExtensions(type5) {
18463
18463
  if (typeof type5 !== "string")
18464
18464
  return null;
18465
- return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type5.toLowerCase()) ?? null;
18465
+ type5 = type5.split(";")[0].trim().toLowerCase();
18466
+ return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type5) ?? null;
18466
18467
  }
18467
18468
  _freeze() {
18468
18469
  this.define = () => {
@@ -31115,30 +31116,28 @@ var Store = class {
31115
31116
  return docUrl;
31116
31117
  }
31117
31118
  async addNewThing(uri6, name9, type5) {
31118
- await this.updater.update(
31119
- [],
31120
- [
31121
- st(
31122
- namedNode2(uri6),
31123
- namedNode2("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
31124
- namedNode2(type5),
31125
- namedNode2(uri6).doc()
31126
- ),
31127
- st(
31128
- namedNode2(uri6),
31129
- namedNode2("http://www.w3.org/2000/01/rdf-schema#label"),
31130
- lit(name9),
31131
- namedNode2(uri6).doc()
31132
- )
31133
- ],
31134
- void 0,
31135
- false,
31136
- {
31137
- // explicitly omit credentials due to
31138
- // https://github.com/pod-os/PodOS/issues/17
31139
- credentials: "omit"
31140
- }
31141
- );
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
+ });
31142
31141
  }
31143
31142
  async executeUpdate(operation3) {
31144
31143
  await executeUpdate(this.fetcher, this.updater, operation3);
package/lib/index.js CHANGED
@@ -26904,7 +26904,8 @@ var PodOS = (() => {
26904
26904
  getAllExtensions(type5) {
26905
26905
  if (typeof type5 !== "string")
26906
26906
  return null;
26907
- return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type5.toLowerCase()) ?? null;
26907
+ type5 = type5.split(";")[0].trim().toLowerCase();
26908
+ return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type5) ?? null;
26908
26909
  }
26909
26910
  _freeze() {
26910
26911
  this.define = () => {
@@ -39557,30 +39558,28 @@ _:patch
39557
39558
  return docUrl;
39558
39559
  }
39559
39560
  async addNewThing(uri6, name9, type5) {
39560
- await this.updater.update(
39561
- [],
39562
- [
39563
- st(
39564
- namedNode2(uri6),
39565
- namedNode2("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
39566
- namedNode2(type5),
39567
- namedNode2(uri6).doc()
39568
- ),
39569
- st(
39570
- namedNode2(uri6),
39571
- namedNode2("http://www.w3.org/2000/01/rdf-schema#label"),
39572
- lit(name9),
39573
- namedNode2(uri6).doc()
39574
- )
39575
- ],
39576
- void 0,
39577
- false,
39578
- {
39579
- // explicitly omit credentials due to
39580
- // https://github.com/pod-os/PodOS/issues/17
39581
- credentials: "omit"
39582
- }
39583
- );
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
+ });
39584
39583
  }
39585
39584
  async executeUpdate(operation3) {
39586
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.aff4dc6.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",
@@ -53,7 +53,7 @@
53
53
  "rimraf": "^6.1.3",
54
54
  "sparqljs": "^3.7.4",
55
55
  "typedoc": "^0.28.20",
56
- "typedoc-plugin-markdown": "^4.13.1",
56
+ "typedoc-plugin-markdown": "^4.14.0",
57
57
  "typescript": "^6.0.3",
58
58
  "typescript-eslint": "^8.71.0",
59
59
  "vitest": "^4.1.11",
@@ -64,7 +64,7 @@
64
64
  "@types/lunr": "^2.3.7",
65
65
  "buffer": "^6.0.3",
66
66
  "lunr": "^2.3.9",
67
- "mime": "^4.1.0",
67
+ "mime": "^4.1.1",
68
68
  "neverthrow": "^8.2.0",
69
69
  "rdf-namespaces": "^1.17.0",
70
70
  "rdflib": "2.4.1",
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