@tinycloud/node-sdk 2.6.1-beta.1 → 2.6.2-beta.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
@@ -18848,7 +18848,8 @@ var _TinyCloudNode = class _TinyCloudNode {
18848
18848
  return operation ? [operation] : [];
18849
18849
  })
18850
18850
  );
18851
- return this.wasmBindings.invokeAny(grant?.session ?? session, entries, facts);
18851
+ const invocationSession = !grant || grant.provenance === "primary" ? session : grant.session;
18852
+ return this.wasmBindings.invokeAny(invocationSession, entries, facts);
18852
18853
  };
18853
18854
  this.explicitHost = config.host;
18854
18855
  this.config = {
@@ -21402,7 +21403,8 @@ var _TinyCloudNode = class _TinyCloudNode {
21402
21403
  const { subset, missing } = isCapabilitySubset(expandedEntries, granted);
21403
21404
  if (!subset) {
21404
21405
  const runtimeGrant = this.findGrantForOperations(
21405
- this.permissionEntriesToOperations(expandedEntries, session)
21406
+ this.permissionEntriesToOperations(expandedEntries, session),
21407
+ { excludePrimary: true }
21406
21408
  );
21407
21409
  if (runtimeGrant) {
21408
21410
  const marginMs = _TinyCloudNode.SESSION_EXPIRY_SAFETY_MARGIN_MS;
@@ -21861,7 +21863,10 @@ var _TinyCloudNode = class _TinyCloudNode {
21861
21863
  path,
21862
21864
  action
21863
21865
  });
21864
- return grant?.session ?? fallback;
21866
+ if (!grant) {
21867
+ return fallback;
21868
+ }
21869
+ return grant.provenance === "primary" ? fallback : grant.session;
21865
21870
  }
21866
21871
  findGrantForOperations(operations, options) {
21867
21872
  if (operations.length === 0) {