@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";
@@ -33220,7 +33220,8 @@ function createGatewayClient(baseUrl) {
33220
33220
  owner: record.owner ?? record.ownerAddress ?? "",
33221
33221
  url: record.url,
33222
33222
  schemaId: record.schemaId,
33223
- createdAt: record.createdAt ?? record.addedAt ?? ""
33223
+ createdAt: record.createdAt ?? record.addedAt ?? "",
33224
+ deletedAt: record.deletedAt ?? null
33224
33225
  };
33225
33226
  }
33226
33227
  function getMutationId(body, key) {
@@ -33280,19 +33281,24 @@ function createGatewayClient(baseUrl) {
33280
33281
  }
33281
33282
  return normalizeFileRecord(await unwrapEnvelope(res));
33282
33283
  },
33283
- async listFilesSince(owner, cursor) {
33284
+ async listFilesSince(owner, cursor, options) {
33284
33285
  const params = new URLSearchParams({ user: owner });
33285
33286
  if (cursor !== null) {
33286
- params.set("since", cursor);
33287
+ params.set("cursor", cursor);
33288
+ }
33289
+ if (options?.includeDeleted) {
33290
+ params.set("includeDeleted", "true");
33287
33291
  }
33288
33292
  const res = await fetch(`${base}/v1/files?${params.toString()}`);
33289
33293
  if (!res.ok) {
33290
33294
  throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
33291
33295
  }
33292
- const data = await unwrapEnvelope(res);
33296
+ const envelope = await res.json();
33297
+ const { pagination } = envelope;
33298
+ const nextCursor = pagination?.hasMore === false ? null : pagination?.nextCursor ?? envelope.data.cursor ?? null;
33293
33299
  return {
33294
- files: data.files.map(normalizeFileRecord),
33295
- cursor: data.cursor
33300
+ files: envelope.data.files.map(normalizeFileRecord),
33301
+ cursor: nextCursor
33296
33302
  };
33297
33303
  },
33298
33304
  async getSchema(schemaId) {