@opendatalabs/vana-sdk 3.3.0 → 3.4.1

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.
@@ -43,5 +43,5 @@ export { AccountPersonalServerLiteOwnerBindingError, signPersonalServerLiteOwner
43
43
  export { isDataPortabilityGatewayConfig, parseGrantRegistrationPayload, verifyGrantRegistration, type DataPortabilityGrantPayload, type VerifyGrantRegistrationInput, type VerifyGrantRegistrationResult, } from "./protocol/grants";
44
44
  export { ScopeSchema, parseScope, scopeToPathSegments, scopeMatchesPattern, scopeCoveredByGrant, type Scope, type ParsedScope, } from "./protocol/scopes";
45
45
  export { DataFileEnvelopeSchema, createDataFileEnvelope, IngestResponseSchema, type DataFileEnvelope, type IngestResponse, } from "./protocol/data-file";
46
- export { createGatewayClient, type GatewayEnvelope, type GatewayProof, type Builder, type Schema, type ServerInfo, type GatewayGrantResponse, type GrantListItem, type FileRecord, type FileListResult, type RegisterServerParams, type RegisterServerResult, type RegisterFileParams, type CreateGrantParams, type RevokeGrantParams, type DeleteFileParams, type GatewayClient, } from "./protocol/gateway";
46
+ export { createGatewayClient, type GatewayEnvelope, type GatewayProof, type Builder, type Schema, type ServerInfo, type GatewayGrantResponse, type GrantListItem, type FileRecord, type FileListResult, type ListFilesOptions, type RegisterServerParams, type RegisterServerResult, type RegisterFileParams, type CreateGrantParams, type RevokeGrantParams, type DeleteFileParams, type GatewayClient, } from "./protocol/gateway";
47
47
  export { PSError, parsePSError, type PSErrorCode } from "./types/ps-errors";
@@ -32593,7 +32593,8 @@ function createGatewayClient(baseUrl) {
32593
32593
  owner: record.owner ?? record.ownerAddress ?? "",
32594
32594
  url: record.url,
32595
32595
  schemaId: record.schemaId,
32596
- createdAt: record.createdAt ?? record.addedAt ?? ""
32596
+ createdAt: record.createdAt ?? record.addedAt ?? "",
32597
+ deletedAt: record.deletedAt ?? null
32597
32598
  };
32598
32599
  }
32599
32600
  function getMutationId(body, key) {
@@ -32653,19 +32654,24 @@ function createGatewayClient(baseUrl) {
32653
32654
  }
32654
32655
  return normalizeFileRecord(await unwrapEnvelope(res));
32655
32656
  },
32656
- async listFilesSince(owner, cursor) {
32657
+ async listFilesSince(owner, cursor, options) {
32657
32658
  const params = new URLSearchParams({ user: owner });
32658
32659
  if (cursor !== null) {
32659
- params.set("since", cursor);
32660
+ params.set("cursor", cursor);
32661
+ }
32662
+ if (options?.includeDeleted) {
32663
+ params.set("includeDeleted", "true");
32660
32664
  }
32661
32665
  const res = await fetch(`${base}/v1/files?${params.toString()}`);
32662
32666
  if (!res.ok) {
32663
32667
  throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
32664
32668
  }
32665
- const data = await unwrapEnvelope(res);
32669
+ const envelope = await res.json();
32670
+ const { pagination } = envelope;
32671
+ const nextCursor = pagination?.hasMore === false ? null : pagination?.nextCursor ?? envelope.data.cursor ?? null;
32666
32672
  return {
32667
- files: data.files.map(normalizeFileRecord),
32668
- cursor: data.cursor
32673
+ files: envelope.data.files.map(normalizeFileRecord),
32674
+ cursor: nextCursor
32669
32675
  };
32670
32676
  },
32671
32677
  async getSchema(schemaId) {