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.
@@ -6846,6 +6846,9 @@ function createProfileLogic(store, authn, utilityLogic) {
6846
6846
 
6847
6847
  function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
6848
6848
  const ns = ns_ns;
6849
+ function isAbsoluteHttpUri(uri) {
6850
+ return !!uri && (uri.startsWith('https://') || uri.startsWith('http://'));
6851
+ }
6849
6852
  function getRegistrations(instance, theClass) {
6850
6853
  return store
6851
6854
  .each(undefined, ns.solid('instance'), instance)
@@ -6938,14 +6941,23 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
6938
6941
  const communities = store.each(user, ns.solid('community'), undefined, preferencesFile).concat(store.each(user, ns.solid('community'), undefined, user.doc()));
6939
6942
  let result = [];
6940
6943
  for (const org of communities) {
6941
- result = result.concat(await loadTypeIndexesFor(org));
6944
+ if (org.termType !== 'NamedNode' || !isAbsoluteHttpUri(org.uri)) {
6945
+ warn(`Skipping malformed community node for ${user}: ${org}`);
6946
+ continue;
6947
+ }
6948
+ try {
6949
+ result = result.concat(await loadTypeIndexesFor(org));
6950
+ }
6951
+ catch (err) {
6952
+ warn(`Skipping community type indexes for ${org.uri}: ${err}`);
6953
+ }
6942
6954
  }
6943
6955
  return result;
6944
6956
  }
6945
6957
  return []; // No communities
6946
6958
  }
6947
6959
  async function loadAllTypeIndexes(user) {
6948
- return (await loadTypeIndexesFor(user)).concat((await loadCommunityTypeIndexes(user)).flat());
6960
+ return (await loadTypeIndexesFor(user)).concat(await loadCommunityTypeIndexes(user));
6949
6961
  }
6950
6962
  async function getScopedAppInstances(klass, user) {
6951
6963
  const scopes = await loadAllTypeIndexes(user);
@@ -6969,11 +6981,11 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
6969
6981
  function docDirUri(node) {
6970
6982
  const doc = node.doc();
6971
6983
  const dir = doc.dir();
6972
- if (dir === null || dir === void 0 ? void 0 : dir.uri)
6984
+ if ((dir === null || dir === void 0 ? void 0 : dir.uri) && isAbsoluteHttpUri(dir.uri))
6973
6985
  return dir.uri;
6974
6986
  const docUri = doc.uri;
6975
- if (!docUri) {
6976
- log(`docDirUri: missing doc uri for ${node === null || node === void 0 ? void 0 : node.uri}`);
6987
+ if (!docUri || !isAbsoluteHttpUri(docUri)) {
6988
+ log(`docDirUri: missing or non-http(s) doc uri for ${node === null || node === void 0 ? void 0 : node.uri}`);
6977
6989
  return null;
6978
6990
  }
6979
6991
  const withoutFragment = docUri.split('#')[0];