solid-logic 4.0.3 → 4.0.4-49a9fc7

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.
@@ -6901,6 +6901,9 @@ function createProfileLogic(store, authn, utilityLogic) {
6901
6901
 
6902
6902
  function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
6903
6903
  const ns = ns_ns;
6904
+ function isAbsoluteHttpUri(uri) {
6905
+ return !!uri && (uri.startsWith('https://') || uri.startsWith('http://'));
6906
+ }
6904
6907
  function getRegistrations(instance, theClass) {
6905
6908
  return store
6906
6909
  .each(undefined, ns.solid('instance'), instance)
@@ -6993,14 +6996,23 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
6993
6996
  const communities = store.each(user, ns.solid('community'), undefined, preferencesFile).concat(store.each(user, ns.solid('community'), undefined, user.doc()));
6994
6997
  let result = [];
6995
6998
  for (const org of communities) {
6996
- result = result.concat(await loadTypeIndexesFor(org));
6999
+ if (org.termType !== 'NamedNode' || !isAbsoluteHttpUri(org.uri)) {
7000
+ warn(`Skipping malformed community node for ${user}: ${org}`);
7001
+ continue;
7002
+ }
7003
+ try {
7004
+ result = result.concat(await loadTypeIndexesFor(org));
7005
+ }
7006
+ catch (err) {
7007
+ warn(`Skipping community type indexes for ${org.uri}: ${err}`);
7008
+ }
6997
7009
  }
6998
7010
  return result;
6999
7011
  }
7000
7012
  return []; // No communities
7001
7013
  }
7002
7014
  async function loadAllTypeIndexes(user) {
7003
- return (await loadTypeIndexesFor(user)).concat((await loadCommunityTypeIndexes(user)).flat());
7015
+ return (await loadTypeIndexesFor(user)).concat(await loadCommunityTypeIndexes(user));
7004
7016
  }
7005
7017
  async function getScopedAppInstances(klass, user) {
7006
7018
  const scopes = await loadAllTypeIndexes(user);
@@ -7024,11 +7036,11 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
7024
7036
  function docDirUri(node) {
7025
7037
  const doc = node.doc();
7026
7038
  const dir = doc.dir();
7027
- if (dir === null || dir === void 0 ? void 0 : dir.uri)
7039
+ if ((dir === null || dir === void 0 ? void 0 : dir.uri) && isAbsoluteHttpUri(dir.uri))
7028
7040
  return dir.uri;
7029
7041
  const docUri = doc.uri;
7030
- if (!docUri) {
7031
- log(`docDirUri: missing doc uri for ${node === null || node === void 0 ? void 0 : node.uri}`);
7042
+ if (!docUri || !isAbsoluteHttpUri(docUri)) {
7043
+ log(`docDirUri: missing or non-http(s) doc uri for ${node === null || node === void 0 ? void 0 : node.uri}`);
7032
7044
  return null;
7033
7045
  }
7034
7046
  const withoutFragment = docUri.split('#')[0];