@opendatalabs/vana-sdk 3.2.0 → 3.4.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.
@@ -1187,6 +1187,7 @@ __export(index_node_exports, {
1187
1187
  DropboxStorage: () => DropboxStorage,
1188
1188
  ECIESError: () => ECIESError,
1189
1189
  ExpiredTokenError: () => ExpiredTokenError,
1190
+ FILE_DELETION_TYPES: () => FILE_DELETION_TYPES,
1190
1191
  FILE_REGISTRATION_TYPES: () => FILE_REGISTRATION_TYPES,
1191
1192
  GRANT_REGISTRATION_TYPES: () => GRANT_REGISTRATION_TYPES,
1192
1193
  GRANT_REVOCATION_TYPES: () => GRANT_REVOCATION_TYPES,
@@ -1256,6 +1257,7 @@ __export(index_node_exports, {
1256
1257
  deserializeECIES: () => deserializeECIES,
1257
1258
  detectPlatform: () => detectPlatform,
1258
1259
  encryptWithPassword: () => encryptWithPassword,
1260
+ fileDeletionDomain: () => fileDeletionDomain,
1259
1261
  fileRegistrationDomain: () => fileRegistrationDomain,
1260
1262
  generatePkceVerifier: () => generatePkceVerifier,
1261
1263
  getAbi: () => getAbi,
@@ -32661,6 +32663,12 @@ function fileRegistrationDomain(config) {
32661
32663
  config.contracts.dataRegistry
32662
32664
  );
32663
32665
  }
32666
+ function fileDeletionDomain(config) {
32667
+ return buildDomain(
32668
+ config.chainId,
32669
+ config.contracts.dataRegistry
32670
+ );
32671
+ }
32664
32672
  function grantRegistrationDomain(config) {
32665
32673
  return buildDomain(
32666
32674
  config.chainId,
@@ -32692,6 +32700,12 @@ var FILE_REGISTRATION_TYPES = {
32692
32700
  { name: "schemaId", type: "bytes32" }
32693
32701
  ]
32694
32702
  };
32703
+ var FILE_DELETION_TYPES = {
32704
+ FileDeletion: [
32705
+ { name: "ownerAddress", type: "address" },
32706
+ { name: "fileId", type: "bytes32" }
32707
+ ]
32708
+ };
32695
32709
  var GRANT_REGISTRATION_TYPES = {
32696
32710
  GrantRegistration: [
32697
32711
  { name: "grantorAddress", type: "address" },
@@ -33342,7 +33356,8 @@ function createGatewayClient(baseUrl) {
33342
33356
  owner: record.owner ?? record.ownerAddress ?? "",
33343
33357
  url: record.url,
33344
33358
  schemaId: record.schemaId,
33345
- createdAt: record.createdAt ?? record.addedAt ?? ""
33359
+ createdAt: record.createdAt ?? record.addedAt ?? "",
33360
+ deletedAt: record.deletedAt ?? null
33346
33361
  };
33347
33362
  }
33348
33363
  function getMutationId(body, key) {
@@ -33402,11 +33417,14 @@ function createGatewayClient(baseUrl) {
33402
33417
  }
33403
33418
  return normalizeFileRecord(await unwrapEnvelope(res));
33404
33419
  },
33405
- async listFilesSince(owner, cursor) {
33420
+ async listFilesSince(owner, cursor, options) {
33406
33421
  const params = new URLSearchParams({ user: owner });
33407
33422
  if (cursor !== null) {
33408
33423
  params.set("since", cursor);
33409
33424
  }
33425
+ if (options?.includeDeleted) {
33426
+ params.set("includeDeleted", "true");
33427
+ }
33410
33428
  const res = await fetch(`${base}/v1/files?${params.toString()}`);
33411
33429
  if (!res.ok) {
33412
33430
  throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
@@ -33525,6 +33543,22 @@ function createGatewayClient(baseUrl) {
33525
33543
  if (!res.ok) {
33526
33544
  throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
33527
33545
  }
33546
+ },
33547
+ async deleteFile(params) {
33548
+ const res = await fetch(`${base}/v1/files/${params.fileId}`, {
33549
+ method: "DELETE",
33550
+ headers: {
33551
+ "Content-Type": "application/json",
33552
+ Authorization: `Web3Signed ${params.signature}`
33553
+ },
33554
+ body: JSON.stringify({
33555
+ ownerAddress: params.ownerAddress
33556
+ })
33557
+ });
33558
+ if (res.status === 409) return;
33559
+ if (!res.ok) {
33560
+ throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
33561
+ }
33528
33562
  }
33529
33563
  };
33530
33564
  }
@@ -33607,6 +33641,7 @@ async function parsePSError(response) {
33607
33641
  DropboxStorage,
33608
33642
  ECIESError,
33609
33643
  ExpiredTokenError,
33644
+ FILE_DELETION_TYPES,
33610
33645
  FILE_REGISTRATION_TYPES,
33611
33646
  GRANT_REGISTRATION_TYPES,
33612
33647
  GRANT_REVOCATION_TYPES,
@@ -33676,6 +33711,7 @@ async function parsePSError(response) {
33676
33711
  deserializeECIES,
33677
33712
  detectPlatform,
33678
33713
  encryptWithPassword,
33714
+ fileDeletionDomain,
33679
33715
  fileRegistrationDomain,
33680
33716
  generatePkceVerifier,
33681
33717
  getAbi,