@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.
- package/dist/index.browser.d.ts +2 -2
- package/dist/index.browser.js +36 -2
- package/dist/index.browser.js.map +2 -2
- package/dist/index.node.cjs +38 -2
- package/dist/index.node.cjs.map +2 -2
- package/dist/index.node.d.ts +2 -2
- package/dist/index.node.js +36 -2
- package/dist/index.node.js.map +2 -2
- package/dist/protocol/eip712.cjs +16 -0
- package/dist/protocol/eip712.cjs.map +1 -1
- package/dist/protocol/eip712.d.ts +19 -0
- package/dist/protocol/eip712.js +14 -0
- package/dist/protocol/eip712.js.map +1 -1
- package/dist/protocol/gateway.cjs +22 -2
- package/dist/protocol/gateway.cjs.map +1 -1
- package/dist/protocol/gateway.d.ts +27 -1
- package/dist/protocol/gateway.js +22 -2
- package/dist/protocol/gateway.js.map +1 -1
- package/package.json +1 -1
package/dist/index.node.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export { MissingAuthError, InvalidSignatureError, ExpiredTokenError, } from "./a
|
|
|
35
35
|
export { generatePkceVerifier, computePkceChallenge, verifyPkceChallenge, assertValidPkceVerifier, PKCE_VERIFIER_PATTERN, PKCE_CHALLENGE_PATTERN, } from "./auth/pkce";
|
|
36
36
|
export { InMemoryTokenStore, type TokenStore, type TokenRecord, } from "./auth/token-store";
|
|
37
37
|
export { OAuthClient, type OAuthClientConfig, type AuthorizationUrlResult, } from "./auth/oauth-client";
|
|
38
|
-
export { fileRegistrationDomain, grantRegistrationDomain, grantRevocationDomain, serverRegistrationDomain, builderRegistrationDomain, FILE_REGISTRATION_TYPES, GRANT_REGISTRATION_TYPES, GRANT_REVOCATION_TYPES, SERVER_REGISTRATION_TYPES, BUILDER_REGISTRATION_TYPES, type DataPortabilityContracts, type DataPortabilityGatewayConfig, type FileRegistrationMessage, type GrantRegistrationMessage, type GrantRevocationMessage, type ServerRegistrationMessage, type BuilderRegistrationMessage, } from "./protocol/eip712";
|
|
38
|
+
export { fileRegistrationDomain, fileDeletionDomain, grantRegistrationDomain, grantRevocationDomain, serverRegistrationDomain, builderRegistrationDomain, FILE_REGISTRATION_TYPES, FILE_DELETION_TYPES, GRANT_REGISTRATION_TYPES, GRANT_REVOCATION_TYPES, SERVER_REGISTRATION_TYPES, BUILDER_REGISTRATION_TYPES, type DataPortabilityContracts, type DataPortabilityGatewayConfig, type FileRegistrationMessage, type FileDeletionMessage, type GrantRegistrationMessage, type GrantRevocationMessage, type ServerRegistrationMessage, type BuilderRegistrationMessage, } from "./protocol/eip712";
|
|
39
39
|
export { PERSONAL_SERVER_REGISTRATION_DEFAULT_CHAIN_ID, PERSONAL_SERVER_REGISTRATION_DEFAULT_VERIFYING_CONTRACT, personalServerRegistrationDomain, createViemPersonalServerRegistrationSigner, buildPersonalServerRegistrationTypedData, buildPersonalServerRegistrationSignature, registerPersonalServerSignature, type PersonalServerRegistrationTypedData, type PersonalServerRegistrationSigner, type PersonalServerRegistrationDomainInput, type ViemPersonalServerRegistrationWalletClient, type ViemPersonalServerRegistrationSignerSource, type BuildPersonalServerRegistrationTypedDataInput, type BuildPersonalServerRegistrationSignatureInput, type PersonalServerRegistrationSignature, } from "./protocol/personal-server-registration";
|
|
40
40
|
export { PERSONAL_SERVER_LITE_OWNER_BINDING_VERSION, PERSONAL_SERVER_LITE_OWNER_BINDING_PURPOSE, PERSONAL_SERVER_LITE_OWNER_BINDING_PREFIX, buildPersonalServerLiteOwnerBindingMessage, createViemPersonalServerLiteOwnerBindingSigner, buildPersonalServerLiteOwnerBindingSignature, signPersonalServerLiteOwnerBinding, type PersonalServerLiteOwnerBindingPurpose, type PersonalServerLiteOwnerBindingMessage, type PersonalServerLiteOwnerBindingSigner, type ViemPersonalServerLiteOwnerBindingWalletClient, type ViemPersonalServerLiteOwnerBindingSignerSource, type BuildPersonalServerLiteOwnerBindingSignatureInput, type PersonalServerLiteOwnerBindingSignature, } from "./protocol/personal-server-lite-owner-binding";
|
|
41
41
|
export { ACCOUNT_PERSONAL_SERVER_REGISTRATION_INTENT, AccountPersonalServerRegistrationError, signPersonalServerRegistrationWithAccount, type AccountPersonalServerRegistrationIntent, type AccountPersonalServerRegistrationSignature, type AccountPersonalServerRegistrationStatus, type AccountPersonalServerRegistrationRequest, type AccountPersonalServerRegistrationConfig, type AccountSignedPersonalServerRegistration, type AccountConfirmationRequiredPersonalServerRegistration, type AccountFallbackSignedPersonalServerRegistration, type AccountPersonalServerRegistrationResult, } from "./account/personal-server-registration";
|
|
@@ -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 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";
|
package/dist/index.node.js
CHANGED
|
@@ -32523,6 +32523,12 @@ function fileRegistrationDomain(config) {
|
|
|
32523
32523
|
config.contracts.dataRegistry
|
|
32524
32524
|
);
|
|
32525
32525
|
}
|
|
32526
|
+
function fileDeletionDomain(config) {
|
|
32527
|
+
return buildDomain(
|
|
32528
|
+
config.chainId,
|
|
32529
|
+
config.contracts.dataRegistry
|
|
32530
|
+
);
|
|
32531
|
+
}
|
|
32526
32532
|
function grantRegistrationDomain(config) {
|
|
32527
32533
|
return buildDomain(
|
|
32528
32534
|
config.chainId,
|
|
@@ -32554,6 +32560,12 @@ var FILE_REGISTRATION_TYPES = {
|
|
|
32554
32560
|
{ name: "schemaId", type: "bytes32" }
|
|
32555
32561
|
]
|
|
32556
32562
|
};
|
|
32563
|
+
var FILE_DELETION_TYPES = {
|
|
32564
|
+
FileDeletion: [
|
|
32565
|
+
{ name: "ownerAddress", type: "address" },
|
|
32566
|
+
{ name: "fileId", type: "bytes32" }
|
|
32567
|
+
]
|
|
32568
|
+
};
|
|
32557
32569
|
var GRANT_REGISTRATION_TYPES = {
|
|
32558
32570
|
GrantRegistration: [
|
|
32559
32571
|
{ name: "grantorAddress", type: "address" },
|
|
@@ -33208,7 +33220,8 @@ function createGatewayClient(baseUrl) {
|
|
|
33208
33220
|
owner: record.owner ?? record.ownerAddress ?? "",
|
|
33209
33221
|
url: record.url,
|
|
33210
33222
|
schemaId: record.schemaId,
|
|
33211
|
-
createdAt: record.createdAt ?? record.addedAt ?? ""
|
|
33223
|
+
createdAt: record.createdAt ?? record.addedAt ?? "",
|
|
33224
|
+
deletedAt: record.deletedAt ?? null
|
|
33212
33225
|
};
|
|
33213
33226
|
}
|
|
33214
33227
|
function getMutationId(body, key) {
|
|
@@ -33268,11 +33281,14 @@ function createGatewayClient(baseUrl) {
|
|
|
33268
33281
|
}
|
|
33269
33282
|
return normalizeFileRecord(await unwrapEnvelope(res));
|
|
33270
33283
|
},
|
|
33271
|
-
async listFilesSince(owner, cursor) {
|
|
33284
|
+
async listFilesSince(owner, cursor, options) {
|
|
33272
33285
|
const params = new URLSearchParams({ user: owner });
|
|
33273
33286
|
if (cursor !== null) {
|
|
33274
33287
|
params.set("since", cursor);
|
|
33275
33288
|
}
|
|
33289
|
+
if (options?.includeDeleted) {
|
|
33290
|
+
params.set("includeDeleted", "true");
|
|
33291
|
+
}
|
|
33276
33292
|
const res = await fetch(`${base}/v1/files?${params.toString()}`);
|
|
33277
33293
|
if (!res.ok) {
|
|
33278
33294
|
throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
|
|
@@ -33391,6 +33407,22 @@ function createGatewayClient(baseUrl) {
|
|
|
33391
33407
|
if (!res.ok) {
|
|
33392
33408
|
throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
|
|
33393
33409
|
}
|
|
33410
|
+
},
|
|
33411
|
+
async deleteFile(params) {
|
|
33412
|
+
const res = await fetch(`${base}/v1/files/${params.fileId}`, {
|
|
33413
|
+
method: "DELETE",
|
|
33414
|
+
headers: {
|
|
33415
|
+
"Content-Type": "application/json",
|
|
33416
|
+
Authorization: `Web3Signed ${params.signature}`
|
|
33417
|
+
},
|
|
33418
|
+
body: JSON.stringify({
|
|
33419
|
+
ownerAddress: params.ownerAddress
|
|
33420
|
+
})
|
|
33421
|
+
});
|
|
33422
|
+
if (res.status === 409) return;
|
|
33423
|
+
if (!res.ok) {
|
|
33424
|
+
throw new Error(`Gateway error: ${res.status} ${res.statusText}`);
|
|
33425
|
+
}
|
|
33394
33426
|
}
|
|
33395
33427
|
};
|
|
33396
33428
|
}
|
|
@@ -33472,6 +33504,7 @@ export {
|
|
|
33472
33504
|
DropboxStorage,
|
|
33473
33505
|
ECIESError,
|
|
33474
33506
|
ExpiredTokenError,
|
|
33507
|
+
FILE_DELETION_TYPES,
|
|
33475
33508
|
FILE_REGISTRATION_TYPES,
|
|
33476
33509
|
GRANT_REGISTRATION_TYPES,
|
|
33477
33510
|
GRANT_REVOCATION_TYPES,
|
|
@@ -33541,6 +33574,7 @@ export {
|
|
|
33541
33574
|
deserializeECIES,
|
|
33542
33575
|
detectPlatform,
|
|
33543
33576
|
encryptWithPassword,
|
|
33577
|
+
fileDeletionDomain,
|
|
33544
33578
|
fileRegistrationDomain,
|
|
33545
33579
|
generatePkceVerifier,
|
|
33546
33580
|
getAbi,
|