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

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
@@ -189,6 +189,8 @@ __export(index_exports, {
189
189
  SQLAction: () => import_sdk_services9.SQLAction,
190
190
  SQLService: () => import_sdk_services9.SQLService,
191
191
  STORAGE_FULL_MESSAGE: () => import_sdk_services9.STORAGE_FULL_MESSAGE,
192
+ STORAGE_MANAGE_URL: () => import_sdk_services9.STORAGE_MANAGE_URL,
193
+ STORAGE_NEARLY_FULL_RATIO: () => import_sdk_services9.STORAGE_NEARLY_FULL_RATIO,
192
194
  STORAGE_WRITE_TOO_LARGE_MESSAGE: () => import_sdk_services9.STORAGE_WRITE_TOO_LARGE_MESSAGE,
193
195
  SecretsService: () => import_sdk_services9.SecretsService,
194
196
  SenderShareStore: () => SenderShareStore,
@@ -217,6 +219,7 @@ __export(index_exports, {
217
219
  Space: () => Space,
218
220
  SpaceErrorCodes: () => SpaceErrorCodes,
219
221
  SpaceService: () => SpaceService,
222
+ StorageFullMonitor: () => import_sdk_services9.StorageFullMonitor,
220
223
  TC832_RESERVED_SCOPES: () => import_sdk_services9.TC832_RESERVED_SCOPES,
221
224
  TINYCLOUD_ACCOUNT_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_ACCOUNT_SPACE_MANIFEST,
222
225
  TINYCLOUD_AGENTS_SPACE_MANIFEST: () => import_bootstrap4.TINYCLOUD_AGENTS_SPACE_MANIFEST,
@@ -351,7 +354,6 @@ __export(index_exports, {
351
354
  generateRandomReceiverKey: () => import_sdk_services9.generateRandomReceiverKey,
352
355
  getPolicyRootStatusV3: () => getPolicyRootStatusV3,
353
356
  getTinyCloudDebugLogs: () => import_sdk_services9.getTinyCloudDebugLogs,
354
- grantPathsForSelector: () => grantPathsForSelector,
355
357
  hasTinyCloudManageKeyScope: () => hasTinyCloudManageKeyScope,
356
358
  hexDecode: () => import_sdk_services9.hexDecode,
357
359
  hexEncode: () => import_sdk_services9.hexEncode,
@@ -407,6 +409,8 @@ __export(index_exports, {
407
409
  parseShareUrl: () => parseShareUrl,
408
410
  parseSignedCompactUcanAttenuation: () => parseSignedCompactUcanAttenuation,
409
411
  parseSpaceUri: () => parseSpaceUri,
412
+ parseStorageRejection: () => import_sdk_services9.parseStorageRejection,
413
+ parseStorageStatus: () => import_sdk_services9.parseStorageStatus,
410
414
  pkhDid: () => pkhDid,
411
415
  policyCidFromCanonicalBytes: () => policyCidFromCanonicalBytes,
412
416
  policyDigestHex: () => policyDigestHex,
@@ -443,6 +447,7 @@ __export(index_exports, {
443
447
  signPolicyCredentialPresentationV4: () => signPolicyCredentialPresentationV4,
444
448
  signShareEnvelope: () => signShareEnvelope,
445
449
  signedObjectIdFor: () => signedObjectIdFor,
450
+ storageUsageState: () => import_sdk_services9.storageUsageState,
446
451
  submitHostDelegation: () => submitHostDelegation,
447
452
  tinyCloudDebugLogger: () => import_sdk_services9.tinyCloudDebugLogger,
448
453
  toSignedObjectError: () => toSignedObjectError,
@@ -12788,7 +12793,11 @@ var SpaceServiceConfigSchema = import_zod9.z.object({
12788
12793
  /** Optional SharingService for v2 sharing links (client-side) */
12789
12794
  sharingService: import_zod9.z.unknown().optional(),
12790
12795
  /** Factory function to create delegations using SIWE-based flow */
12791
- createDelegation: import_zod9.z.function().optional()
12796
+ createDelegation: import_zod9.z.function().optional(),
12797
+ /** Best-effort hook after the SDK discovers or creates a space */
12798
+ onSpaceRegistered: import_zod9.z.function().optional(),
12799
+ /** True once the owner's storage is known full; list() then skips registration */
12800
+ isStorageFull: import_zod9.z.function().optional()
12792
12801
  });
12793
12802
  var SpaceDelegationParamsSchema = CreateDelegationParamsSchema.extend({
12794
12803
  /** The space ID to create the delegation for */
@@ -13043,6 +13052,7 @@ var SpaceService = class {
13043
13052
  this.sharingService = config.sharingService;
13044
13053
  this.createDelegationFn = config.createDelegation;
13045
13054
  this.onSpaceRegisteredFn = config.onSpaceRegistered;
13055
+ this.isStorageFullFn = config.isStorageFull;
13046
13056
  }
13047
13057
  /**
13048
13058
  * Update the service configuration.
@@ -13060,6 +13070,7 @@ var SpaceService = class {
13060
13070
  if (config.sharingService) this.sharingService = config.sharingService;
13061
13071
  if (config.createDelegation) this.createDelegationFn = config.createDelegation;
13062
13072
  if (config.onSpaceRegistered) this.onSpaceRegisteredFn = config.onSpaceRegistered;
13073
+ if (config.isStorageFull) this.isStorageFullFn = config.isStorageFull;
13063
13074
  this.spaceCache.clear();
13064
13075
  this.infoCache.clear();
13065
13076
  }
@@ -13113,8 +13124,10 @@ var SpaceService = class {
13113
13124
  spaces.push(...delegatedSpaces);
13114
13125
  }
13115
13126
  const uniqueSpaces = this.deduplicateSpaces(spaces);
13116
- for (const space of uniqueSpaces) {
13117
- this.notifySpaceRegistered(space);
13127
+ if (!this.isStorageFullFn?.()) {
13128
+ for (const space of uniqueSpaces) {
13129
+ this.notifySpaceRegistered(space);
13130
+ }
13118
13131
  }
13119
13132
  return (0, import_sdk_services5.ok)(uniqueSpaces);
13120
13133
  } catch (error) {
@@ -18950,9 +18963,4 @@ function decodeBase64Url4(value) {
18950
18963
  }
18951
18964
  return Uint8Array.from(bytes2);
18952
18965
  }
18953
-
18954
- // src/replication/selector.ts
18955
- function grantPathsForSelector(selector) {
18956
- return selector === "" || selector.endsWith("/") ? [selector] : [selector, `${selector}/`];
18957
- }
18958
18966
  //# sourceMappingURL=index.cjs.map