@tinycloud/sdk-core 3.2.0-beta.5 → 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,
@@ -406,6 +409,8 @@ __export(index_exports, {
406
409
  parseShareUrl: () => parseShareUrl,
407
410
  parseSignedCompactUcanAttenuation: () => parseSignedCompactUcanAttenuation,
408
411
  parseSpaceUri: () => parseSpaceUri,
412
+ parseStorageRejection: () => import_sdk_services9.parseStorageRejection,
413
+ parseStorageStatus: () => import_sdk_services9.parseStorageStatus,
409
414
  pkhDid: () => pkhDid,
410
415
  policyCidFromCanonicalBytes: () => policyCidFromCanonicalBytes,
411
416
  policyDigestHex: () => policyDigestHex,
@@ -442,6 +447,7 @@ __export(index_exports, {
442
447
  signPolicyCredentialPresentationV4: () => signPolicyCredentialPresentationV4,
443
448
  signShareEnvelope: () => signShareEnvelope,
444
449
  signedObjectIdFor: () => signedObjectIdFor,
450
+ storageUsageState: () => import_sdk_services9.storageUsageState,
445
451
  submitHostDelegation: () => submitHostDelegation,
446
452
  tinyCloudDebugLogger: () => import_sdk_services9.tinyCloudDebugLogger,
447
453
  toSignedObjectError: () => toSignedObjectError,
@@ -12787,7 +12793,11 @@ var SpaceServiceConfigSchema = import_zod9.z.object({
12787
12793
  /** Optional SharingService for v2 sharing links (client-side) */
12788
12794
  sharingService: import_zod9.z.unknown().optional(),
12789
12795
  /** Factory function to create delegations using SIWE-based flow */
12790
- 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()
12791
12801
  });
12792
12802
  var SpaceDelegationParamsSchema = CreateDelegationParamsSchema.extend({
12793
12803
  /** The space ID to create the delegation for */
@@ -13042,6 +13052,7 @@ var SpaceService = class {
13042
13052
  this.sharingService = config.sharingService;
13043
13053
  this.createDelegationFn = config.createDelegation;
13044
13054
  this.onSpaceRegisteredFn = config.onSpaceRegistered;
13055
+ this.isStorageFullFn = config.isStorageFull;
13045
13056
  }
13046
13057
  /**
13047
13058
  * Update the service configuration.
@@ -13059,6 +13070,7 @@ var SpaceService = class {
13059
13070
  if (config.sharingService) this.sharingService = config.sharingService;
13060
13071
  if (config.createDelegation) this.createDelegationFn = config.createDelegation;
13061
13072
  if (config.onSpaceRegistered) this.onSpaceRegisteredFn = config.onSpaceRegistered;
13073
+ if (config.isStorageFull) this.isStorageFullFn = config.isStorageFull;
13062
13074
  this.spaceCache.clear();
13063
13075
  this.infoCache.clear();
13064
13076
  }
@@ -13112,8 +13124,10 @@ var SpaceService = class {
13112
13124
  spaces.push(...delegatedSpaces);
13113
13125
  }
13114
13126
  const uniqueSpaces = this.deduplicateSpaces(spaces);
13115
- for (const space of uniqueSpaces) {
13116
- this.notifySpaceRegistered(space);
13127
+ if (!this.isStorageFullFn?.()) {
13128
+ for (const space of uniqueSpaces) {
13129
+ this.notifySpaceRegistered(space);
13130
+ }
13117
13131
  }
13118
13132
  return (0, import_sdk_services5.ok)(uniqueSpaces);
13119
13133
  } catch (error) {