@tinycloud/sdk-core 3.2.0-beta.0 → 3.2.0-beta.3

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
@@ -132,6 +132,7 @@ __export(index_exports, {
132
132
  MAX_CONTENT_BYTES: () => MAX_CONTENT_BYTES,
133
133
  MAX_LEGACY_ENVELOPE_EXPIRES_AT: () => MAX_LEGACY_ENVELOPE_EXPIRES_AT,
134
134
  MAX_SEALED_SHARE_CONTENT_BYTES: () => MAX_SEALED_SHARE_CONTENT_BYTES,
135
+ MAX_SECRET_SCOPE_LENGTH: () => import_sdk_services9.MAX_SECRET_SCOPE_LENGTH,
135
136
  MAX_SHARE_ARTIFACT_BYTES: () => MAX_SHARE_ARTIFACT_BYTES,
136
137
  MAX_SHARE_CONTENT_BYTES: () => MAX_SHARE_CONTENT_BYTES,
137
138
  ManifestValidationError: () => ManifestValidationError,
@@ -180,6 +181,7 @@ __export(index_exports, {
180
181
  SECRETS_SPACE: () => SECRETS_SPACE,
181
182
  SECRET_NAME_RE: () => import_sdk_services9.SECRET_NAME_RE,
182
183
  SECRET_RECORDS_SCHEMA: () => import_bootstrap4.SECRET_RECORDS_SCHEMA,
184
+ SECRET_SCOPE_RE: () => import_sdk_services9.SECRET_SCOPE_RE,
183
185
  SERVICE_LONG_TO_SHORT: () => SERVICE_LONG_TO_SHORT,
184
186
  SERVICE_SHORT_TO_LONG: () => SERVICE_SHORT_TO_LONG,
185
187
  SPACE: () => import_bootstrap4.SPACE,
@@ -215,6 +217,7 @@ __export(index_exports, {
215
217
  Space: () => Space,
216
218
  SpaceErrorCodes: () => SpaceErrorCodes,
217
219
  SpaceService: () => SpaceService,
220
+ TC832_RESERVED_SCOPES: () => import_sdk_services9.TC832_RESERVED_SCOPES,
218
221
  TINYCLOUD_ACCOUNT_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_ACCOUNT_SPACE_MANIFEST,
219
222
  TINYCLOUD_AGENTS_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_AGENTS_SPACE_MANIFEST,
220
223
  TINYCLOUD_APPLICATIONS_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_APPLICATIONS_SPACE_MANIFEST,
@@ -238,6 +241,7 @@ __export(index_exports, {
238
241
  addressStorageKey: () => addressStorageKey,
239
242
  admitPolicyCredentialV3: () => admitPolicyCredentialV3,
240
243
  admitPolicyCredentialV4: () => admitPolicyCredentialV4,
244
+ appSecretScope: () => import_sdk_services9.appSecretScope,
241
245
  applyPrefix: () => applyPrefix,
242
246
  authorizationVerdictOf: () => import_sdk_services9.authorizationVerdictOf,
243
247
  bootstrapEncryptionNetworkId: () => import_bootstrap4.bootstrapEncryptionNetworkId,
@@ -347,6 +351,7 @@ __export(index_exports, {
347
351
  generateRandomReceiverKey: () => import_sdk_services9.generateRandomReceiverKey,
348
352
  getPolicyRootStatusV3: () => getPolicyRootStatusV3,
349
353
  getTinyCloudDebugLogs: () => import_sdk_services9.getTinyCloudDebugLogs,
354
+ grantPathsForSelector: () => grantPathsForSelector,
350
355
  hasTinyCloudManageKeyScope: () => hasTinyCloudManageKeyScope,
351
356
  hexDecode: () => import_sdk_services9.hexDecode,
352
357
  hexEncode: () => import_sdk_services9.hexEncode,
@@ -15291,9 +15296,10 @@ async function ignoreIndexFailure(task) {
15291
15296
  var import_sdk_services9 = require("@tinycloud/sdk-services");
15292
15297
 
15293
15298
  // src/space.ts
15294
- async function fetchPeerId(host, spaceId) {
15299
+ async function fetchPeerId(host, spaceId, signal) {
15295
15300
  const res = await fetch(
15296
- `${host}/peer/generate/${encodeURIComponent(spaceId)}`
15301
+ `${host}/peer/generate/${encodeURIComponent(spaceId)}`,
15302
+ { signal }
15297
15303
  );
15298
15304
  if (!res.ok) {
15299
15305
  const error = await res.text().catch(() => res.statusText);
@@ -15303,10 +15309,11 @@ async function fetchPeerId(host, spaceId) {
15303
15309
  }
15304
15310
  return res.text();
15305
15311
  }
15306
- async function submitHostDelegation(host, headers) {
15312
+ async function submitHostDelegation(host, headers, signal) {
15307
15313
  const res = await fetch(`${host}/delegate`, {
15308
15314
  method: "POST",
15309
- headers
15315
+ headers,
15316
+ signal
15310
15317
  });
15311
15318
  if (!res.ok) {
15312
15319
  return {
@@ -15335,7 +15342,8 @@ function activationFlightKey(host, delegationHeader) {
15335
15342
  );
15336
15343
  return JSON.stringify([host, entries]);
15337
15344
  }
15338
- async function activateSessionWithHost(host, delegationHeader) {
15345
+ async function activateSessionWithHost(host, delegationHeader, signal) {
15346
+ if (signal) return postSessionActivation(host, delegationHeader, signal);
15339
15347
  const key = activationFlightKey(host, delegationHeader);
15340
15348
  const existing = inFlightActivations.get(key);
15341
15349
  if (!existing) return startActivationFlight(key, host, delegationHeader);
@@ -15357,10 +15365,11 @@ function startActivationFlight(key, host, delegationHeader) {
15357
15365
  flight.then(evict, evict);
15358
15366
  return flight;
15359
15367
  }
15360
- async function postSessionActivation(host, delegationHeader) {
15368
+ async function postSessionActivation(host, delegationHeader, signal) {
15361
15369
  const res = await fetch(`${host}/delegate`, {
15362
15370
  method: "POST",
15363
- headers: delegationHeader
15371
+ headers: delegationHeader,
15372
+ signal
15364
15373
  });
15365
15374
  if (res.ok) {
15366
15375
  try {
@@ -18941,4 +18950,9 @@ function decodeBase64Url4(value) {
18941
18950
  }
18942
18951
  return Uint8Array.from(bytes2);
18943
18952
  }
18953
+
18954
+ // src/replication/selector.ts
18955
+ function grantPathsForSelector(selector) {
18956
+ return selector === "" || selector.endsWith("/") ? [selector] : [selector, `${selector}/`];
18957
+ }
18944
18958
  //# sourceMappingURL=index.cjs.map