@tinycloud/node-sdk 2.6.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.cjs CHANGED
@@ -18876,7 +18876,8 @@ var _TinyCloudNode = class _TinyCloudNode {
18876
18876
  return operation ? [operation] : [];
18877
18877
  })
18878
18878
  );
18879
- return this.wasmBindings.invokeAny(grant?.session ?? session, entries, facts);
18879
+ const invocationSession = !grant || grant.provenance === "primary" ? session : grant.session;
18880
+ return this.wasmBindings.invokeAny(invocationSession, entries, facts);
18880
18881
  };
18881
18882
  this.explicitHost = config.host;
18882
18883
  this.config = {
@@ -21430,7 +21431,8 @@ var _TinyCloudNode = class _TinyCloudNode {
21430
21431
  const { subset, missing } = (0, import_sdk_core7.isCapabilitySubset)(expandedEntries, granted);
21431
21432
  if (!subset) {
21432
21433
  const runtimeGrant = this.findGrantForOperations(
21433
- this.permissionEntriesToOperations(expandedEntries, session)
21434
+ this.permissionEntriesToOperations(expandedEntries, session),
21435
+ { excludePrimary: true }
21434
21436
  );
21435
21437
  if (runtimeGrant) {
21436
21438
  const marginMs = _TinyCloudNode.SESSION_EXPIRY_SAFETY_MARGIN_MS;
@@ -21889,7 +21891,10 @@ var _TinyCloudNode = class _TinyCloudNode {
21889
21891
  path,
21890
21892
  action
21891
21893
  });
21892
- return grant?.session ?? fallback;
21894
+ if (!grant) {
21895
+ return fallback;
21896
+ }
21897
+ return grant.provenance === "primary" ? fallback : grant.session;
21893
21898
  }
21894
21899
  findGrantForOperations(operations, options) {
21895
21900
  if (operations.length === 0) {