@tinycloud/node-sdk 3.2.5 → 3.2.6-beta.1

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/core.cjs CHANGED
@@ -445,6 +445,9 @@ function addRawAbility(rawAbilities, resource, action) {
445
445
  actions.push(action);
446
446
  }
447
447
  }
448
+ function primaryManifestSpace(resources) {
449
+ return resources.find((entry) => entry.space !== "account")?.space ?? resources[0]?.space ?? import_sdk_core4.DEFAULT_MANIFEST_SPACE;
450
+ }
448
451
  function cloneAbilitiesMap(actions) {
449
452
  return Object.fromEntries(
450
453
  Object.entries(actions).map(([service, paths]) => [
@@ -815,7 +818,7 @@ var NodeUserAuthorization = class {
815
818
  const spaceResources = request.resources.filter(
816
819
  (entry) => entry.service !== import_sdk_core4.ENCRYPTION_PERMISSION_SERVICE
817
820
  );
818
- const primarySpaceName = spaceResources.find((entry) => entry.space !== "account")?.space ?? import_sdk_core4.DEFAULT_MANIFEST_SPACE;
821
+ const primarySpaceName = primaryManifestSpace(spaceResources);
819
822
  const primarySpaceId = this.resolveSpaceName(
820
823
  primarySpaceName,
821
824
  address,
@@ -930,7 +933,7 @@ var NodeUserAuthorization = class {
930
933
  }
931
934
  return false;
932
935
  });
933
- const primarySpaceName = spaceResources.find((entry) => entry.space !== "account")?.space ?? import_sdk_core4.DEFAULT_MANIFEST_SPACE;
936
+ const primarySpaceName = primaryManifestSpace(spaceResources);
934
937
  const primarySpaceId = this.resolveSpaceName(
935
938
  primarySpaceName,
936
939
  address,