@tinycloud/sdk-core 3.8.0-beta.3 → 3.8.0-beta.5

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.
@@ -813,8 +813,14 @@ var DelegationManager = class {
813
813
  };
814
814
  }
815
815
  }
816
- /** Query lifecycle-complete delegation history for the authenticated account. */
817
- async query(options = {}) {
816
+ /**
817
+ * Query lifecycle-complete delegation history for the authenticated account.
818
+ *
819
+ * `scope.spaces` lists the spaces to sign `tinycloud.delegation/list` for, in order. Omitted, the
820
+ * account space is tried, then the session's own space. A caller that knows which of them the session
821
+ * holds passes only those; an empty list sends nothing and answers PERMISSION_DENIED.
822
+ */
823
+ async query(options = {}, scope = {}) {
818
824
  const validated = AccountDelegationQueryOptionsSchema.safeParse(options);
819
825
  if (!validated.success) {
820
826
  return {
@@ -848,7 +854,7 @@ var DelegationManager = class {
848
854
  }
849
855
  try {
850
856
  let response;
851
- for (const spaceId of /* @__PURE__ */ new Set([accountSpaceId, this.session.spaceId])) {
857
+ for (const spaceId of new Set(scope.spaces ?? [accountSpaceId, this.session.spaceId])) {
852
858
  const headers = Object.fromEntries(new Headers(this.invokeAny(this.session, [{
853
859
  spaceId,
854
860
  service: "delegation",
@@ -1260,6 +1266,9 @@ var SERVICE_LONG_TO_SHORT = Object.freeze(
1260
1266
  Object.entries(SERVICE_SHORT_TO_LONG).map(([s, l]) => [l, s])
1261
1267
  )
1262
1268
  );
1269
+ var KEY_SEGMENT = "[a-z0-9][a-z0-9._-]{0,63}";
1270
+ var KEY_APP_ID = new RegExp(`^${KEY_SEGMENT}$`);
1271
+ var KEY_PATH = new RegExp(`^${KEY_SEGMENT}(?:/${KEY_SEGMENT}){2,7}$`);
1263
1272
 
1264
1273
  // src/identity.ts
1265
1274
  var import_viem = require("viem");