Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fleekhq/space-client

Package Overview
Dependencies
Maintainers
6
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fleekhq/space-client - npm Package Compare versions

Comparing version 0.1.5 to 1.0.0

49

dist/client.d.ts
import grpcWeb, { ClientReadableStream } from 'grpc-web';
import { SpaceApiClient } from './definitions/SpaceServiceClientPb';
import { OpenFilePayload, CreateBucketPayload, AddItemsPayload, CreateFolderPayload, GetIdentityByUsernamePayload, CreateUsernameAndEmailPayload, ShareBucketViaEmailPayload, ShareBucketViaIdentityPayload, GenerateFileShareLinkPayload, BackupKeysByPassphrasePayload, RecoverKeysByPassphrasePayload, ToggleFusePayload, GetFuseDriveStatusPayload, ListDirectoriesPayload, ListDirectoryPayload, ShareBucketPayload, JoinBucketPayload } from './types';
import { TextileEventResponse, ListDirectoriesResponse, OpenFileResponse, CreateBucketResponse, AddItemsResponse, CreateFolderResponse, GetIdentityByUsernameResponse, CreateUsernameAndEmailResponse, ShareBucketViaEmailResponse, ShareBucketViaIdentityResponse, GenerateFileShareLinkResponse, BackupKeysByPassphraseResponse, RecoverKeysByPassphraseResponse, FuseDriveResponse, FileEventResponse, ListBucketsResponse, ListDirectoryResponse, ShareBucketResponse, JoinBucketResponse } from './definitions/space_pb';
import { OpenFilePayload, CreateBucketPayload, AddItemsPayload, CreateFolderPayload, BackupKeysByPassphrasePayload, RecoverKeysByPassphrasePayload, ToggleFusePayload, GetFuseDriveStatusPayload, ListDirectoriesPayload, ListDirectoryPayload, ToggleBucketBackupPayload, ShareBucketPayload, JoinBucketPayload, ReadNotificationPayload, GetNotificationsPayload, RestoreKeyPairViaMnemonicPayload, GetSharedWithMeFilesPayload, ShareFilesViaPublicKeyPayload, GeneratePublicFileLinkPayload, TestKeysPassphrasePayload, SetNotificationsLastSeenAtPayload, HandleFilesInvitationPayload } from './types';
import { TextileEventResponse, ListDirectoriesResponse, ToggleBucketBackupResponse, OpenFileResponse, CreateBucketResponse, AddItemsResponse, CreateFolderResponse, BackupKeysByPassphraseResponse, RecoverKeysByPassphraseResponse, FuseDriveResponse, FileEventResponse, FileInfoEventResponse, ListBucketsResponse, ListDirectoryResponse, ShareBucketResponse, JoinBucketResponse, GetPublicKeyResponse, NotificationEventResponse, ReadNotificationResponse, GetNotificationsResponse, HandleFilesInvitationResponse, DeleteKeyPairResponse, GetUsageInfoResponse, GetStoredMnemonicResponse, RestoreKeyPairViaMnemonicResponse, GetSharedWithMeFilesResponse, ShareFilesViaPublicKeyResponse, GetAPISessionTokensResponse, GetRecentlySharedWithResponse, GeneratePublicFileLinkResponse, TestKeysPassphraseResponse, SetNotificationsLastSeenAtResponse, GenerateKeyPairResponse } from './definitions/space_pb';
export interface SpaceClientOpts {

@@ -17,2 +17,4 @@ url: string;

listDirectories(payload: ListDirectoriesPayload, metadata?: grpcWeb.Metadata): Promise<ListDirectoriesResponse>;
toggleBucketBackup(payload: ToggleBucketBackupPayload, metadata?: grpcWeb.Metadata): Promise<ToggleBucketBackupResponse>;
fileInfoSubscribe(metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<FileInfoEventResponse>;
txlSubscribe(metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<TextileEventResponse>;

@@ -23,28 +25,3 @@ openFile(payload: OpenFilePayload, metadata?: grpcWeb.Metadata): Promise<OpenFileResponse>;

createFolder(payload: CreateFolderPayload, metadata?: grpcWeb.Metadata): Promise<CreateFolderResponse>;
createUsernameAndEmail(payload: CreateUsernameAndEmailPayload, metadata?: grpcWeb.Metadata): Promise<CreateUsernameAndEmailResponse>;
getIdentityByUsername(payload: GetIdentityByUsernamePayload, metadata?: grpcWeb.Metadata): Promise<GetIdentityByUsernameResponse>;
/**
* [WIP] shareBucketViaEmail
*
* Not supported by space daemon
*/
shareBucketViaEmail(payload: ShareBucketViaEmailPayload, metadata?: grpcWeb.Metadata): Promise<ShareBucketViaEmailResponse>;
shareBucketViaIdentity(payload: ShareBucketViaIdentityPayload, metadata?: grpcWeb.Metadata): Promise<ShareBucketViaIdentityResponse>;
/**
* [WIP] generateFileShareLink
*
* Not supported by space daemon
*/
generateFileShareLink(payload: GenerateFileShareLinkPayload, metadata?: grpcWeb.Metadata): Promise<GenerateFileShareLinkResponse>;
/**
* [WIP] backupKeysByPassphrase
*
* Not supported by space daemon
*/
backupKeysByPassphrase(payload: BackupKeysByPassphrasePayload, metadata?: grpcWeb.Metadata): Promise<BackupKeysByPassphraseResponse>;
/**
* [WIP] recoverKeysByPassphrase
*
* Not supported by space daemon
*/
recoverKeysByPassphrase(payload: RecoverKeysByPassphrasePayload, metadata?: grpcWeb.Metadata): Promise<RecoverKeysByPassphraseResponse>;

@@ -72,3 +49,21 @@ /**

joinBucket(payload: JoinBucketPayload, metadata?: grpcWeb.Metadata): Promise<JoinBucketResponse>;
setNotificationsLastSeenAt(payload: SetNotificationsLastSeenAtPayload, metadata?: grpcWeb.Metadata): Promise<SetNotificationsLastSeenAtResponse>;
getNotifications(payload: GetNotificationsPayload, metadata?: grpcWeb.Metadata): Promise<GetNotificationsResponse>;
handleFilesInvitation(payload: HandleFilesInvitationPayload, metadata?: grpcWeb.Metadata): Promise<HandleFilesInvitationResponse>;
getPublicKey(metadata?: grpcWeb.Metadata): Promise<GetPublicKeyResponse>;
notificationSubscribe(metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<NotificationEventResponse>;
readNotification(payload: ReadNotificationPayload, metadata?: grpcWeb.Metadata): Promise<ReadNotificationResponse>;
deleteAccount(payload?: null, metadata?: grpcWeb.Metadata): Promise<ReadNotificationResponse>;
deleteKeyPair(metadata?: grpcWeb.Metadata): Promise<DeleteKeyPairResponse>;
getUsageInfo(metadata?: grpcWeb.Metadata): Promise<GetUsageInfoResponse>;
getStoredMnemonic(metadata?: grpcWeb.Metadata): Promise<GetStoredMnemonicResponse>;
restoreKeyPairViaMnemonic(payload: RestoreKeyPairViaMnemonicPayload, metadata?: grpcWeb.Metadata): Promise<RestoreKeyPairViaMnemonicResponse>;
getSharedWithMeFiles(payload: GetSharedWithMeFilesPayload, metadata?: grpcWeb.Metadata): Promise<GetSharedWithMeFilesResponse>;
shareFilesViaPublicKey(payload: ShareFilesViaPublicKeyPayload, metadata?: grpcWeb.Metadata): Promise<ShareFilesViaPublicKeyResponse>;
getAPISessionTokens(metadata?: grpcWeb.Metadata): Promise<GetAPISessionTokensResponse>;
getRecentlySharedWith(metadata?: grpcWeb.Metadata): Promise<GetRecentlySharedWithResponse>;
generatePublicFileLink(payload: GeneratePublicFileLinkPayload, metadata?: grpcWeb.Metadata): Promise<GeneratePublicFileLinkResponse>;
testKeysPassphrase(payload: TestKeysPassphrasePayload, metadata?: grpcWeb.Metadata): Promise<TestKeysPassphraseResponse>;
generateKeyPairWithForce(metadata?: grpcWeb.Metadata): Promise<GenerateKeyPairResponse>;
}
export default SpaceClient;

@@ -43,2 +43,21 @@ "use strict";

}
toggleBucketBackup(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ToggleBucketBackupRequest();
const { backup, bucket } = payload;
request.setBucket(bucket);
request.setBackup(backup);
this.instance.toggleBucketBackup(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
fileInfoSubscribe(metadata = {}) {
const request = new empty_pb_1.Empty();
return this.instance.fileInfoSubscribe(request, metadata);
}
txlSubscribe(metadata = {}) {

@@ -103,8 +122,8 @@ const request = new empty_pb_1.Empty();

}
createUsernameAndEmail(payload, metadata = {}) {
backupKeysByPassphrase(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.CreateUsernameAndEmailRequest();
request.setEmail(payload.email || '');
request.setUsername(payload.username);
this.instance.createUsernameAndEmail(request, metadata, (err, res) => {
const request = new space_pb_1.BackupKeysByPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
this.instance.backupKeysByPassphrase(request, metadata, (err, res) => {
if (err) {

@@ -118,7 +137,8 @@ reject(err);

}
getIdentityByUsername(payload, metadata = {}) {
recoverKeysByPassphrase(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetIdentityByUsernameRequest();
request.setUsername(payload.username);
this.instance.getIdentityByUsername(request, metadata, (err, res) => {
const request = new space_pb_1.RecoverKeysByPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
this.instance.recoverKeysByPassphrase(request, metadata, (err, res) => {
if (err) {

@@ -133,13 +153,11 @@ reject(err);

/**
* [WIP] shareBucketViaEmail
* [WIP] toggleFuseDrive
*
* Not supported by space daemon
*/
shareBucketViaEmail(payload, metadata = {}) {
toggleFuseDrive(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ShareBucketViaEmailRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setEmail(payload.email);
request.setBucket(bucket || this.defaultBucket);
this.instance.shareBucketViaEmail(request, metadata, (err, res) => {
const request = new space_pb_1.ToggleFuseRequest();
request.setMountdrive(payload.mountDrive);
this.instance.toggleFuseDrive(request, metadata, (err, res) => {
if (err) {

@@ -153,10 +171,11 @@ reject(err);

}
shareBucketViaIdentity(payload, metadata = {}) {
/**
* [WIP] getFuseDriveStatus
*
* Not supported by space daemon
*/
getFuseDriveStatus(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ShareBucketViaIdentityRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setIdentitytype(space_pb_1.IdentityType[payload.identityType]);
request.setIdentityvalue(payload.identityValue);
request.setBucket(bucket || this.defaultBucket);
this.instance.shareBucketViaIdentity(request, metadata, (err, res) => {
const request = new empty_pb_1.Empty();
this.instance.getFuseDriveStatus(request, metadata, (err, res) => {
if (err) {

@@ -170,14 +189,29 @@ reject(err);

}
subscribe(metadata = {}) {
const request = new empty_pb_1.Empty();
return this.instance.subscribe(request, metadata);
}
/**
* [WIP] generateFileShareLink
* [WIP] listBuckets
*
* Not supported by space daemon
*/
generateFileShareLink(payload, metadata = {}) {
listBuckets(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GenerateFileShareLinkRequest();
const request = new space_pb_1.ListBucketsRequest();
this.instance.listBuckets(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
shareBucket(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ShareBucketRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setFilepath(payload.filePath);
request.setBucket(bucket || this.defaultBucket);
this.instance.generateFileShareLink(request, metadata, (err, res) => {
this.instance.shareBucket(request, metadata, (err, res) => {
if (err) {

@@ -191,12 +225,12 @@ reject(err);

}
/**
* [WIP] backupKeysByPassphrase
*
* Not supported by space daemon
*/
backupKeysByPassphrase(payload, metadata = {}) {
joinBucket(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.BackupKeysByPassphraseRequest();
request.setPassphrase(payload.passphrase);
this.instance.backupKeysByPassphrase(request, metadata, (err, res) => {
const threadInfo = new space_pb_1.ThreadInfo();
threadInfo.setKey(payload.threadInfo.key);
threadInfo.setAddressesList(payload.threadInfo.addresses);
const request = new space_pb_1.JoinBucketRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setThreadinfo(threadInfo);
request.setBucket(bucket || this.defaultBucket);
this.instance.joinBucket(request, metadata, (err, res) => {
if (err) {

@@ -210,12 +244,7 @@ reject(err);

}
/**
* [WIP] recoverKeysByPassphrase
*
* Not supported by space daemon
*/
recoverKeysByPassphrase(payload, metadata = {}) {
setNotificationsLastSeenAt(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.RecoverKeysByPassphraseRequest();
request.setPassphrase(payload.passphrase);
this.instance.recoverKeysByPassphrase(request, metadata, (err, res) => {
const request = new space_pb_1.SetNotificationsLastSeenAtRequest();
request.setTimestamp(payload.timestamp);
this.instance.setNotificationsLastSeenAt(request, metadata, (err, res) => {
if (err) {

@@ -229,12 +258,8 @@ reject(err);

}
/**
* [WIP] toggleFuseDrive
*
* Not supported by space daemon
*/
toggleFuseDrive(payload, metadata = {}) {
getNotifications(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ToggleFuseRequest();
request.setMountdrive(payload.mountDrive);
this.instance.toggleFuseDrive(request, metadata, (err, res) => {
const request = new space_pb_1.GetNotificationsRequest();
request.setSeek(payload.seek);
request.setLimit(payload.limit);
this.instance.getNotifications(request, metadata, (err, res) => {
if (err) {

@@ -248,11 +273,8 @@ reject(err);

}
/**
* [WIP] getFuseDriveStatus
*
* Not supported by space daemon
*/
getFuseDriveStatus(payload, metadata = {}) {
handleFilesInvitation(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new empty_pb_1.Empty();
this.instance.getFuseDriveStatus(request, metadata, (err, res) => {
const request = new space_pb_1.HandleFilesInvitationRequest();
request.setInvitationid(payload.invitationID);
request.setAccept(payload.accept);
this.instance.handleFilesInvitation(request, metadata, (err, res) => {
if (err) {

@@ -266,15 +288,23 @@ reject(err);

}
subscribe(metadata = {}) {
getPublicKey(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetPublicKeyRequest();
this.instance.getPublicKey(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
notificationSubscribe(metadata = {}) {
const request = new empty_pb_1.Empty();
return this.instance.subscribe(request, metadata);
return this.instance.notificationSubscribe(request, metadata);
}
/**
* [WIP] listBuckets
*
* Not supported by space daemon
*/
listBuckets(metadata = {}) {
readNotification(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ListBucketsRequest();
this.instance.listBuckets(request, metadata, (err, res) => {
const request = new space_pb_1.ReadNotificationRequest();
request.setId(payload.ID);
this.instance.readNotification(request, metadata, (err, res) => {
if (err) {

@@ -288,8 +318,8 @@ reject(err);

}
shareBucket(payload, metadata = {}) {
deleteAccount(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
payload = null, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ShareBucketRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setBucket(bucket || this.defaultBucket);
this.instance.shareBucket(request, metadata, (err, res) => {
const request = new space_pb_1.DeleteAccountRequest();
this.instance.deleteAccount(request, metadata, (err, res) => {
if (err) {

@@ -303,12 +333,123 @@ reject(err);

}
joinBucket(payload, metadata = {}) {
deleteKeyPair(metadata = {}) {
return new Promise((resolve, reject) => {
const threadInfo = new space_pb_1.ThreadInfo();
threadInfo.setKey(payload.threadInfo.key);
threadInfo.setAddressesList(payload.threadInfo.addresses);
const request = new space_pb_1.JoinBucketRequest();
const request = new space_pb_1.DeleteKeyPairRequest();
this.instance.deleteKeyPair(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
getUsageInfo(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetUsageInfoRequest();
this.instance.getUsageInfo(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
getStoredMnemonic(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetStoredMnemonicRequest();
this.instance.getStoredMnemonic(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
restoreKeyPairViaMnemonic(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.RestoreKeyPairViaMnemonicRequest();
request.setMnemonic(payload.mnemonic);
this.instance.restoreKeyPairViaMnemonic(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
getSharedWithMeFiles(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetSharedWithMeFilesRequest();
request.setSeek(payload.seek);
request.setLimit(payload.limit);
this.instance.getSharedWithMeFiles(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
shareFilesViaPublicKey(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.ShareFilesViaPublicKeyRequest();
const paths = payload.paths.map((path) => {
const fullPath = new space_pb_1.FullPath();
const bucket = path.bucket === '' ? null : path.bucket;
fullPath.setBucket(bucket || this.defaultBucket);
fullPath.setPath(path.path);
if (path.dbId) {
fullPath.setDbid(path.dbId);
}
return fullPath;
});
request.setPathsList(paths);
request.setPublickeysList(payload.publicKeys);
this.instance.shareFilesViaPublicKey(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
getAPISessionTokens(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetAPISessionTokensRequest();
this.instance.getAPISessionTokens(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
getRecentlySharedWith(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GetRecentlySharedWithRequest();
this.instance.getRecentlySharedWith(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
generatePublicFileLink(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GeneratePublicFileLinkRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setThreadinfo(threadInfo);
const itemPaths = payload.itemPaths.map((path) => path.replace(/^\//, ''));
request.setDbid(payload.dbId);
request.setPassword(payload.password);
request.setItempathsList(itemPaths);
request.setBucket(bucket || this.defaultBucket);
this.instance.joinBucket(request, metadata, (err, res) => {
this.instance.generatePublicFileLink(request, metadata, (err, res) => {
if (err) {

@@ -322,4 +463,30 @@ reject(err);

}
testKeysPassphrase(payload, metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.TestKeysPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
this.instance.testKeysPassphrase(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
generateKeyPairWithForce(metadata = {}) {
return new Promise((resolve, reject) => {
const request = new space_pb_1.GenerateKeyPairRequest();
this.instance.generateKeyPairWithForce(request, metadata, (err, res) => {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
}
}
exports.default = SpaceClient;
//# sourceMappingURL=client.js.map

@@ -8,3 +8,3 @@ /**

import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import { AddItemsRequest, AddItemsResponse, BackupKeysByPassphraseRequest, BackupKeysByPassphraseResponse, ConfigInfoResponse, CreateBucketRequest, CreateBucketResponse, CreateFolderRequest, CreateFolderResponse, CreateUsernameAndEmailRequest, CreateUsernameAndEmailResponse, FileEventResponse, FuseDriveResponse, GenerateFileShareLinkRequest, GenerateFileShareLinkResponse, GenerateKeyPairRequest, GenerateKeyPairResponse, GetIdentityByUsernameRequest, GetIdentityByUsernameResponse, JoinBucketRequest, JoinBucketResponse, ListBucketsRequest, ListBucketsResponse, ListDirectoriesRequest, ListDirectoriesResponse, ListDirectoryRequest, ListDirectoryResponse, OpenFileRequest, OpenFileResponse, RecoverKeysByPassphraseRequest, RecoverKeysByPassphraseResponse, ShareBucketRequest, ShareBucketResponse, ShareBucketViaEmailRequest, ShareBucketViaEmailResponse, ShareBucketViaIdentityRequest, ShareBucketViaIdentityResponse, TextileEventResponse, ToggleFuseRequest } from './space_pb';
import { AddItemsRequest, AddItemsResponse, BackupKeysByPassphraseRequest, BackupKeysByPassphraseResponse, CreateBucketRequest, CreateBucketResponse, CreateFolderRequest, CreateFolderResponse, CreateLocalKeysBackupRequest, CreateLocalKeysBackupResponse, DeleteAccountRequest, DeleteAccountResponse, DeleteKeyPairRequest, DeleteKeyPairResponse, FileEventResponse, FileInfoEventResponse, FuseDriveResponse, GenerateKeyPairRequest, GenerateKeyPairResponse, GeneratePublicFileLinkRequest, GeneratePublicFileLinkResponse, GetAPISessionTokensRequest, GetAPISessionTokensResponse, GetNotificationsRequest, GetNotificationsResponse, GetPublicKeyRequest, GetPublicKeyResponse, GetRecentlySharedWithRequest, GetRecentlySharedWithResponse, GetSharedWithMeFilesRequest, GetSharedWithMeFilesResponse, GetStoredMnemonicRequest, GetStoredMnemonicResponse, GetUsageInfoRequest, GetUsageInfoResponse, HandleFilesInvitationRequest, HandleFilesInvitationResponse, JoinBucketRequest, JoinBucketResponse, ListBucketsRequest, ListBucketsResponse, ListDirectoriesRequest, ListDirectoriesResponse, ListDirectoryRequest, ListDirectoryResponse, NotificationEventResponse, OpenFileRequest, OpenFileResponse, OpenPublicFileRequest, OpenPublicFileResponse, ReadNotificationRequest, ReadNotificationResponse, RecoverKeysByLocalBackupRequest, RecoverKeysByLocalBackupResponse, RecoverKeysByPassphraseRequest, RecoverKeysByPassphraseResponse, RestoreKeyPairViaMnemonicRequest, RestoreKeyPairViaMnemonicResponse, SetNotificationsLastSeenAtRequest, SetNotificationsLastSeenAtResponse, ShareBucketRequest, ShareBucketResponse, ShareFilesViaPublicKeyRequest, ShareFilesViaPublicKeyResponse, TestKeysPassphraseRequest, TestKeysPassphraseResponse, TextileEventResponse, ToggleBucketBackupRequest, ToggleBucketBackupResponse, ToggleFuseRequest } from './space_pb';
export declare class SpaceApiClient {

@@ -30,13 +30,24 @@ client_: grpcWeb.AbstractClientBase;

listDirectory(request: ListDirectoryRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ListDirectoryResponse) => void): grpcWeb.ClientReadableStream<ListDirectoryResponse>;
methodInfoGetConfigInfo: grpcWeb.AbstractClientBase.MethodInfo<google_protobuf_empty_pb.Empty, ConfigInfoResponse>;
getConfigInfo(request: google_protobuf_empty_pb.Empty, metadata: grpcWeb.Metadata | null): Promise<ConfigInfoResponse>;
getConfigInfo(request: google_protobuf_empty_pb.Empty, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ConfigInfoResponse) => void): grpcWeb.ClientReadableStream<ConfigInfoResponse>;
methodInfoGenerateKeyPair: grpcWeb.AbstractClientBase.MethodInfo<GenerateKeyPairRequest, GenerateKeyPairResponse>;
generateKeyPair(request: GenerateKeyPairRequest, metadata: grpcWeb.Metadata | null): Promise<GenerateKeyPairResponse>;
generateKeyPair(request: GenerateKeyPairRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GenerateKeyPairResponse) => void): grpcWeb.ClientReadableStream<GenerateKeyPairResponse>;
methodInfoGetStoredMnemonic: grpcWeb.AbstractClientBase.MethodInfo<GetStoredMnemonicRequest, GetStoredMnemonicResponse>;
getStoredMnemonic(request: GetStoredMnemonicRequest, metadata: grpcWeb.Metadata | null): Promise<GetStoredMnemonicResponse>;
getStoredMnemonic(request: GetStoredMnemonicRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetStoredMnemonicResponse) => void): grpcWeb.ClientReadableStream<GetStoredMnemonicResponse>;
methodInfoRestoreKeyPairViaMnemonic: grpcWeb.AbstractClientBase.MethodInfo<RestoreKeyPairViaMnemonicRequest, RestoreKeyPairViaMnemonicResponse>;
restoreKeyPairViaMnemonic(request: RestoreKeyPairViaMnemonicRequest, metadata: grpcWeb.Metadata | null): Promise<RestoreKeyPairViaMnemonicResponse>;
restoreKeyPairViaMnemonic(request: RestoreKeyPairViaMnemonicRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: RestoreKeyPairViaMnemonicResponse) => void): grpcWeb.ClientReadableStream<RestoreKeyPairViaMnemonicResponse>;
methodInfoDeleteKeyPair: grpcWeb.AbstractClientBase.MethodInfo<DeleteKeyPairRequest, DeleteKeyPairResponse>;
deleteKeyPair(request: DeleteKeyPairRequest, metadata: grpcWeb.Metadata | null): Promise<DeleteKeyPairResponse>;
deleteKeyPair(request: DeleteKeyPairRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: DeleteKeyPairResponse) => void): grpcWeb.ClientReadableStream<DeleteKeyPairResponse>;
methodInfoGenerateKeyPairWithForce: grpcWeb.AbstractClientBase.MethodInfo<GenerateKeyPairRequest, GenerateKeyPairResponse>;
generateKeyPairWithForce(request: GenerateKeyPairRequest, metadata: grpcWeb.Metadata | null): Promise<GenerateKeyPairResponse>;
generateKeyPairWithForce(request: GenerateKeyPairRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GenerateKeyPairResponse) => void): grpcWeb.ClientReadableStream<GenerateKeyPairResponse>;
methodInfoGetPublicKey: grpcWeb.AbstractClientBase.MethodInfo<GetPublicKeyRequest, GetPublicKeyResponse>;
getPublicKey(request: GetPublicKeyRequest, metadata: grpcWeb.Metadata | null): Promise<GetPublicKeyResponse>;
getPublicKey(request: GetPublicKeyRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetPublicKeyResponse) => void): grpcWeb.ClientReadableStream<GetPublicKeyResponse>;
methodInfoSubscribe: grpcWeb.AbstractClientBase.MethodInfo<google_protobuf_empty_pb.Empty, FileEventResponse>;
subscribe(request: google_protobuf_empty_pb.Empty, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<FileEventResponse>;
methodInfoFileInfoSubscribe: grpcWeb.AbstractClientBase.MethodInfo<google_protobuf_empty_pb.Empty, FileInfoEventResponse>;
fileInfoSubscribe(request: google_protobuf_empty_pb.Empty, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<FileInfoEventResponse>;
methodInfoTxlSubscribe: grpcWeb.AbstractClientBase.MethodInfo<google_protobuf_empty_pb.Empty, TextileEventResponse>;

@@ -47,2 +58,11 @@ txlSubscribe(request: google_protobuf_empty_pb.Empty, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<TextileEventResponse>;

openFile(request: OpenFileRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: OpenFileResponse) => void): grpcWeb.ClientReadableStream<OpenFileResponse>;
methodInfoGeneratePublicFileLink: grpcWeb.AbstractClientBase.MethodInfo<GeneratePublicFileLinkRequest, GeneratePublicFileLinkResponse>;
generatePublicFileLink(request: GeneratePublicFileLinkRequest, metadata: grpcWeb.Metadata | null): Promise<GeneratePublicFileLinkResponse>;
generatePublicFileLink(request: GeneratePublicFileLinkRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GeneratePublicFileLinkResponse) => void): grpcWeb.ClientReadableStream<GeneratePublicFileLinkResponse>;
methodInfoGetSharedWithMeFiles: grpcWeb.AbstractClientBase.MethodInfo<GetSharedWithMeFilesRequest, GetSharedWithMeFilesResponse>;
getSharedWithMeFiles(request: GetSharedWithMeFilesRequest, metadata: grpcWeb.Metadata | null): Promise<GetSharedWithMeFilesResponse>;
getSharedWithMeFiles(request: GetSharedWithMeFilesRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetSharedWithMeFilesResponse) => void): grpcWeb.ClientReadableStream<GetSharedWithMeFilesResponse>;
methodInfoOpenPublicFile: grpcWeb.AbstractClientBase.MethodInfo<OpenPublicFileRequest, OpenPublicFileResponse>;
openPublicFile(request: OpenPublicFileRequest, metadata: grpcWeb.Metadata | null): Promise<OpenPublicFileResponse>;
openPublicFile(request: OpenPublicFileRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: OpenPublicFileResponse) => void): grpcWeb.ClientReadableStream<OpenPublicFileResponse>;
methodInfoAddItems: grpcWeb.AbstractClientBase.MethodInfo<AddItemsRequest, AddItemsResponse>;

@@ -62,8 +82,2 @@ addItems(request: AddItemsRequest, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<AddItemsResponse>;

createBucket(request: CreateBucketRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: CreateBucketResponse) => void): grpcWeb.ClientReadableStream<CreateBucketResponse>;
methodInfoGetIdentityByUsername: grpcWeb.AbstractClientBase.MethodInfo<GetIdentityByUsernameRequest, GetIdentityByUsernameResponse>;
getIdentityByUsername(request: GetIdentityByUsernameRequest, metadata: grpcWeb.Metadata | null): Promise<GetIdentityByUsernameResponse>;
getIdentityByUsername(request: GetIdentityByUsernameRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetIdentityByUsernameResponse) => void): grpcWeb.ClientReadableStream<GetIdentityByUsernameResponse>;
methodInfoCreateUsernameAndEmail: grpcWeb.AbstractClientBase.MethodInfo<CreateUsernameAndEmailRequest, CreateUsernameAndEmailResponse>;
createUsernameAndEmail(request: CreateUsernameAndEmailRequest, metadata: grpcWeb.Metadata | null): Promise<CreateUsernameAndEmailResponse>;
createUsernameAndEmail(request: CreateUsernameAndEmailRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: CreateUsernameAndEmailResponse) => void): grpcWeb.ClientReadableStream<CreateUsernameAndEmailResponse>;
methodInfoBackupKeysByPassphrase: grpcWeb.AbstractClientBase.MethodInfo<BackupKeysByPassphraseRequest, BackupKeysByPassphraseResponse>;

@@ -75,2 +89,11 @@ backupKeysByPassphrase(request: BackupKeysByPassphraseRequest, metadata: grpcWeb.Metadata | null): Promise<BackupKeysByPassphraseResponse>;

recoverKeysByPassphrase(request: RecoverKeysByPassphraseRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: RecoverKeysByPassphraseResponse) => void): grpcWeb.ClientReadableStream<RecoverKeysByPassphraseResponse>;
methodInfoTestKeysPassphrase: grpcWeb.AbstractClientBase.MethodInfo<TestKeysPassphraseRequest, TestKeysPassphraseResponse>;
testKeysPassphrase(request: TestKeysPassphraseRequest, metadata: grpcWeb.Metadata | null): Promise<TestKeysPassphraseResponse>;
testKeysPassphrase(request: TestKeysPassphraseRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: TestKeysPassphraseResponse) => void): grpcWeb.ClientReadableStream<TestKeysPassphraseResponse>;
methodInfoCreateLocalKeysBackup: grpcWeb.AbstractClientBase.MethodInfo<CreateLocalKeysBackupRequest, CreateLocalKeysBackupResponse>;
createLocalKeysBackup(request: CreateLocalKeysBackupRequest, metadata: grpcWeb.Metadata | null): Promise<CreateLocalKeysBackupResponse>;
createLocalKeysBackup(request: CreateLocalKeysBackupRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: CreateLocalKeysBackupResponse) => void): grpcWeb.ClientReadableStream<CreateLocalKeysBackupResponse>;
methodInfoRecoverKeysByLocalBackup: grpcWeb.AbstractClientBase.MethodInfo<RecoverKeysByLocalBackupRequest, RecoverKeysByLocalBackupResponse>;
recoverKeysByLocalBackup(request: RecoverKeysByLocalBackupRequest, metadata: grpcWeb.Metadata | null): Promise<RecoverKeysByLocalBackupResponse>;
recoverKeysByLocalBackup(request: RecoverKeysByLocalBackupRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: RecoverKeysByLocalBackupResponse) => void): grpcWeb.ClientReadableStream<RecoverKeysByLocalBackupResponse>;
methodInfoShareBucket: grpcWeb.AbstractClientBase.MethodInfo<ShareBucketRequest, ShareBucketResponse>;

@@ -82,14 +105,37 @@ shareBucket(request: ShareBucketRequest, metadata: grpcWeb.Metadata | null): Promise<ShareBucketResponse>;

joinBucket(request: JoinBucketRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: JoinBucketResponse) => void): grpcWeb.ClientReadableStream<JoinBucketResponse>;
methodInfoShareBucketViaEmail: grpcWeb.AbstractClientBase.MethodInfo<ShareBucketViaEmailRequest, ShareBucketViaEmailResponse>;
shareBucketViaEmail(request: ShareBucketViaEmailRequest, metadata: grpcWeb.Metadata | null): Promise<ShareBucketViaEmailResponse>;
shareBucketViaEmail(request: ShareBucketViaEmailRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ShareBucketViaEmailResponse) => void): grpcWeb.ClientReadableStream<ShareBucketViaEmailResponse>;
methodInfoShareBucketViaIdentity: grpcWeb.AbstractClientBase.MethodInfo<ShareBucketViaIdentityRequest, ShareBucketViaIdentityResponse>;
shareBucketViaIdentity(request: ShareBucketViaIdentityRequest, metadata: grpcWeb.Metadata | null): Promise<ShareBucketViaIdentityResponse>;
shareBucketViaIdentity(request: ShareBucketViaIdentityRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ShareBucketViaIdentityResponse) => void): grpcWeb.ClientReadableStream<ShareBucketViaIdentityResponse>;
methodInfoGenerateFileShareLink: grpcWeb.AbstractClientBase.MethodInfo<GenerateFileShareLinkRequest, GenerateFileShareLinkResponse>;
generateFileShareLink(request: GenerateFileShareLinkRequest, metadata: grpcWeb.Metadata | null): Promise<GenerateFileShareLinkResponse>;
generateFileShareLink(request: GenerateFileShareLinkRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GenerateFileShareLinkResponse) => void): grpcWeb.ClientReadableStream<GenerateFileShareLinkResponse>;
methodInfoShareFilesViaPublicKey: grpcWeb.AbstractClientBase.MethodInfo<ShareFilesViaPublicKeyRequest, ShareFilesViaPublicKeyResponse>;
shareFilesViaPublicKey(request: ShareFilesViaPublicKeyRequest, metadata: grpcWeb.Metadata | null): Promise<ShareFilesViaPublicKeyResponse>;
shareFilesViaPublicKey(request: ShareFilesViaPublicKeyRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ShareFilesViaPublicKeyResponse) => void): grpcWeb.ClientReadableStream<ShareFilesViaPublicKeyResponse>;
methodInfoHandleFilesInvitation: grpcWeb.AbstractClientBase.MethodInfo<HandleFilesInvitationRequest, HandleFilesInvitationResponse>;
handleFilesInvitation(request: HandleFilesInvitationRequest, metadata: grpcWeb.Metadata | null): Promise<HandleFilesInvitationResponse>;
handleFilesInvitation(request: HandleFilesInvitationRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: HandleFilesInvitationResponse) => void): grpcWeb.ClientReadableStream<HandleFilesInvitationResponse>;
methodInfoNotificationSubscribe: grpcWeb.AbstractClientBase.MethodInfo<google_protobuf_empty_pb.Empty, NotificationEventResponse>;
notificationSubscribe(request: google_protobuf_empty_pb.Empty, metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<NotificationEventResponse>;
methodInfoListBuckets: grpcWeb.AbstractClientBase.MethodInfo<ListBucketsRequest, ListBucketsResponse>;
listBuckets(request: ListBucketsRequest, metadata: grpcWeb.Metadata | null): Promise<ListBucketsResponse>;
listBuckets(request: ListBucketsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ListBucketsResponse) => void): grpcWeb.ClientReadableStream<ListBucketsResponse>;
methodInfoGetNotifications: grpcWeb.AbstractClientBase.MethodInfo<GetNotificationsRequest, GetNotificationsResponse>;
getNotifications(request: GetNotificationsRequest, metadata: grpcWeb.Metadata | null): Promise<GetNotificationsResponse>;
getNotifications(request: GetNotificationsRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetNotificationsResponse) => void): grpcWeb.ClientReadableStream<GetNotificationsResponse>;
methodInfoReadNotification: grpcWeb.AbstractClientBase.MethodInfo<ReadNotificationRequest, ReadNotificationResponse>;
readNotification(request: ReadNotificationRequest, metadata: grpcWeb.Metadata | null): Promise<ReadNotificationResponse>;
readNotification(request: ReadNotificationRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ReadNotificationResponse) => void): grpcWeb.ClientReadableStream<ReadNotificationResponse>;
methodInfoDeleteAccount: grpcWeb.AbstractClientBase.MethodInfo<DeleteAccountRequest, DeleteAccountResponse>;
deleteAccount(request: DeleteAccountRequest, metadata: grpcWeb.Metadata | null): Promise<DeleteAccountResponse>;
deleteAccount(request: DeleteAccountRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: DeleteAccountResponse) => void): grpcWeb.ClientReadableStream<DeleteAccountResponse>;
methodInfoToggleBucketBackup: grpcWeb.AbstractClientBase.MethodInfo<ToggleBucketBackupRequest, ToggleBucketBackupResponse>;
toggleBucketBackup(request: ToggleBucketBackupRequest, metadata: grpcWeb.Metadata | null): Promise<ToggleBucketBackupResponse>;
toggleBucketBackup(request: ToggleBucketBackupRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: ToggleBucketBackupResponse) => void): grpcWeb.ClientReadableStream<ToggleBucketBackupResponse>;
methodInfoGetUsageInfo: grpcWeb.AbstractClientBase.MethodInfo<GetUsageInfoRequest, GetUsageInfoResponse>;
getUsageInfo(request: GetUsageInfoRequest, metadata: grpcWeb.Metadata | null): Promise<GetUsageInfoResponse>;
getUsageInfo(request: GetUsageInfoRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetUsageInfoResponse) => void): grpcWeb.ClientReadableStream<GetUsageInfoResponse>;
methodInfoGetAPISessionTokens: grpcWeb.AbstractClientBase.MethodInfo<GetAPISessionTokensRequest, GetAPISessionTokensResponse>;
getAPISessionTokens(request: GetAPISessionTokensRequest, metadata: grpcWeb.Metadata | null): Promise<GetAPISessionTokensResponse>;
getAPISessionTokens(request: GetAPISessionTokensRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetAPISessionTokensResponse) => void): grpcWeb.ClientReadableStream<GetAPISessionTokensResponse>;
methodInfoGetRecentlySharedWith: grpcWeb.AbstractClientBase.MethodInfo<GetRecentlySharedWithRequest, GetRecentlySharedWithResponse>;
getRecentlySharedWith(request: GetRecentlySharedWithRequest, metadata: grpcWeb.Metadata | null): Promise<GetRecentlySharedWithResponse>;
getRecentlySharedWith(request: GetRecentlySharedWithRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: GetRecentlySharedWithResponse) => void): grpcWeb.ClientReadableStream<GetRecentlySharedWithResponse>;
methodInfoSetNotificationsLastSeenAt: grpcWeb.AbstractClientBase.MethodInfo<SetNotificationsLastSeenAtRequest, SetNotificationsLastSeenAtResponse>;
setNotificationsLastSeenAt(request: SetNotificationsLastSeenAtRequest, metadata: grpcWeb.Metadata | null): Promise<SetNotificationsLastSeenAtResponse>;
setNotificationsLastSeenAt(request: SetNotificationsLastSeenAtRequest, metadata: grpcWeb.Metadata | null, callback: (err: grpcWeb.Error, response: SetNotificationsLastSeenAtResponse) => void): grpcWeb.ClientReadableStream<SetNotificationsLastSeenAtResponse>;
}

@@ -41,14 +41,26 @@ "use strict";

}, space_pb_1.ListDirectoryResponse.deserializeBinary);
this.methodInfoGetConfigInfo = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ConfigInfoResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.ConfigInfoResponse.deserializeBinary);
this.methodInfoGenerateKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GenerateKeyPairResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GenerateKeyPairResponse.deserializeBinary);
this.methodInfoGetStoredMnemonic = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetStoredMnemonicResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetStoredMnemonicResponse.deserializeBinary);
this.methodInfoRestoreKeyPairViaMnemonic = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.RestoreKeyPairViaMnemonicResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.RestoreKeyPairViaMnemonicResponse.deserializeBinary);
this.methodInfoDeleteKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.DeleteKeyPairResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.DeleteKeyPairResponse.deserializeBinary);
this.methodInfoGenerateKeyPairWithForce = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GenerateKeyPairResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GenerateKeyPairResponse.deserializeBinary);
this.methodInfoGetPublicKey = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetPublicKeyResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetPublicKeyResponse.deserializeBinary);
this.methodInfoSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.FileEventResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.FileEventResponse.deserializeBinary);
this.methodInfoFileInfoSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.FileInfoEventResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.FileInfoEventResponse.deserializeBinary);
this.methodInfoTxlSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.TextileEventResponse, (request) => {

@@ -60,2 +72,11 @@ return request.serializeBinary();

}, space_pb_1.OpenFileResponse.deserializeBinary);
this.methodInfoGeneratePublicFileLink = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GeneratePublicFileLinkResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GeneratePublicFileLinkResponse.deserializeBinary);
this.methodInfoGetSharedWithMeFiles = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetSharedWithMeFilesResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetSharedWithMeFilesResponse.deserializeBinary);
this.methodInfoOpenPublicFile = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.OpenPublicFileResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.OpenPublicFileResponse.deserializeBinary);
this.methodInfoAddItems = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.AddItemsResponse, (request) => {

@@ -76,8 +97,2 @@ return request.serializeBinary();

}, space_pb_1.CreateBucketResponse.deserializeBinary);
this.methodInfoGetIdentityByUsername = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetIdentityByUsernameResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetIdentityByUsernameResponse.deserializeBinary);
this.methodInfoCreateUsernameAndEmail = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.CreateUsernameAndEmailResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.CreateUsernameAndEmailResponse.deserializeBinary);
this.methodInfoBackupKeysByPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.BackupKeysByPassphraseResponse, (request) => {

@@ -89,2 +104,11 @@ return request.serializeBinary();

}, space_pb_1.RecoverKeysByPassphraseResponse.deserializeBinary);
this.methodInfoTestKeysPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.TestKeysPassphraseResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.TestKeysPassphraseResponse.deserializeBinary);
this.methodInfoCreateLocalKeysBackup = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.CreateLocalKeysBackupResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.CreateLocalKeysBackupResponse.deserializeBinary);
this.methodInfoRecoverKeysByLocalBackup = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.RecoverKeysByLocalBackupResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.RecoverKeysByLocalBackupResponse.deserializeBinary);
this.methodInfoShareBucket = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ShareBucketResponse, (request) => {

@@ -96,14 +120,38 @@ return request.serializeBinary();

}, space_pb_1.JoinBucketResponse.deserializeBinary);
this.methodInfoShareBucketViaEmail = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ShareBucketViaEmailResponse, (request) => {
this.methodInfoShareFilesViaPublicKey = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ShareFilesViaPublicKeyResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.ShareBucketViaEmailResponse.deserializeBinary);
this.methodInfoShareBucketViaIdentity = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ShareBucketViaIdentityResponse, (request) => {
}, space_pb_1.ShareFilesViaPublicKeyResponse.deserializeBinary);
this.methodInfoHandleFilesInvitation = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.HandleFilesInvitationResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.ShareBucketViaIdentityResponse.deserializeBinary);
this.methodInfoGenerateFileShareLink = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GenerateFileShareLinkResponse, (request) => {
}, space_pb_1.HandleFilesInvitationResponse.deserializeBinary);
this.methodInfoNotificationSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.NotificationEventResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GenerateFileShareLinkResponse.deserializeBinary);
}, space_pb_1.NotificationEventResponse.deserializeBinary);
this.methodInfoListBuckets = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ListBucketsResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.ListBucketsResponse.deserializeBinary);
this.methodInfoGetNotifications = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetNotificationsResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetNotificationsResponse.deserializeBinary);
this.methodInfoReadNotification = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ReadNotificationResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.ReadNotificationResponse.deserializeBinary);
this.methodInfoDeleteAccount = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.DeleteAccountResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.DeleteAccountResponse.deserializeBinary);
this.methodInfoToggleBucketBackup = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.ToggleBucketBackupResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.ToggleBucketBackupResponse.deserializeBinary);
this.methodInfoGetUsageInfo = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetUsageInfoResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetUsageInfoResponse.deserializeBinary);
this.methodInfoGetAPISessionTokens = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetAPISessionTokensResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetAPISessionTokensResponse.deserializeBinary);
this.methodInfoGetRecentlySharedWith = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.GetRecentlySharedWithResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.GetRecentlySharedWithResponse.deserializeBinary);
this.methodInfoSetNotificationsLastSeenAt = new grpcWeb.AbstractClientBase.MethodInfo(space_pb_1.SetNotificationsLastSeenAtResponse, (request) => {
return request.serializeBinary();
}, space_pb_1.SetNotificationsLastSeenAtResponse.deserializeBinary);
if (!options)

@@ -133,16 +181,30 @@ options = {};

}
getConfigInfo(request, metadata, callback) {
generateKeyPair(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetConfigInfo', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetConfigInfo, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/GenerateKeyPair', this.hostname_).toString(), request, metadata || {}, this.methodInfoGenerateKeyPair, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetConfigInfo', request, metadata || {}, this.methodInfoGetConfigInfo);
'/space.SpaceApi/GenerateKeyPair', request, metadata || {}, this.methodInfoGenerateKeyPair);
}
generateKeyPair(request, metadata, callback) {
getStoredMnemonic(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GenerateKeyPair', this.hostname_).toString(), request, metadata || {}, this.methodInfoGenerateKeyPair, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/GetStoredMnemonic', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetStoredMnemonic, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GenerateKeyPair', request, metadata || {}, this.methodInfoGenerateKeyPair);
'/space.SpaceApi/GetStoredMnemonic', request, metadata || {}, this.methodInfoGetStoredMnemonic);
}
restoreKeyPairViaMnemonic(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/RestoreKeyPairViaMnemonic', this.hostname_).toString(), request, metadata || {}, this.methodInfoRestoreKeyPairViaMnemonic, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/RestoreKeyPairViaMnemonic', request, metadata || {}, this.methodInfoRestoreKeyPairViaMnemonic);
}
deleteKeyPair(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/DeleteKeyPair', this.hostname_).toString(), request, metadata || {}, this.methodInfoDeleteKeyPair, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/DeleteKeyPair', request, metadata || {}, this.methodInfoDeleteKeyPair);
}
generateKeyPairWithForce(request, metadata, callback) {

@@ -155,5 +217,15 @@ if (callback !== undefined) {

}
getPublicKey(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetPublicKey', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetPublicKey, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetPublicKey', request, metadata || {}, this.methodInfoGetPublicKey);
}
subscribe(request, metadata) {
return this.client_.serverStreaming(new URL('/space.SpaceApi/Subscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoSubscribe);
}
fileInfoSubscribe(request, metadata) {
return this.client_.serverStreaming(new URL('/space.SpaceApi/FileInfoSubscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoFileInfoSubscribe);
}
txlSubscribe(request, metadata) {

@@ -169,2 +241,23 @@ return this.client_.serverStreaming(new URL('/space.SpaceApi/TxlSubscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoTxlSubscribe);

}
generatePublicFileLink(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GeneratePublicFileLink', this.hostname_).toString(), request, metadata || {}, this.methodInfoGeneratePublicFileLink, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GeneratePublicFileLink', request, metadata || {}, this.methodInfoGeneratePublicFileLink);
}
getSharedWithMeFiles(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetSharedWithMeFiles', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetSharedWithMeFiles, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetSharedWithMeFiles', request, metadata || {}, this.methodInfoGetSharedWithMeFiles);
}
openPublicFile(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/OpenPublicFile', this.hostname_).toString(), request, metadata || {}, this.methodInfoOpenPublicFile, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/OpenPublicFile', request, metadata || {}, this.methodInfoOpenPublicFile);
}
addItems(request, metadata) {

@@ -201,30 +294,37 @@ return this.client_.serverStreaming(new URL('/space.SpaceApi/AddItems', this.hostname_).toString(), request, metadata || {}, this.methodInfoAddItems);

}
getIdentityByUsername(request, metadata, callback) {
backupKeysByPassphrase(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetIdentityByUsername', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetIdentityByUsername, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/BackupKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoBackupKeysByPassphrase, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetIdentityByUsername', request, metadata || {}, this.methodInfoGetIdentityByUsername);
'/space.SpaceApi/BackupKeysByPassphrase', request, metadata || {}, this.methodInfoBackupKeysByPassphrase);
}
createUsernameAndEmail(request, metadata, callback) {
recoverKeysByPassphrase(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/CreateUsernameAndEmail', this.hostname_).toString(), request, metadata || {}, this.methodInfoCreateUsernameAndEmail, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/RecoverKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoRecoverKeysByPassphrase, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/CreateUsernameAndEmail', request, metadata || {}, this.methodInfoCreateUsernameAndEmail);
'/space.SpaceApi/RecoverKeysByPassphrase', request, metadata || {}, this.methodInfoRecoverKeysByPassphrase);
}
backupKeysByPassphrase(request, metadata, callback) {
testKeysPassphrase(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/BackupKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoBackupKeysByPassphrase, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/TestKeysPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoTestKeysPassphrase, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/BackupKeysByPassphrase', request, metadata || {}, this.methodInfoBackupKeysByPassphrase);
'/space.SpaceApi/TestKeysPassphrase', request, metadata || {}, this.methodInfoTestKeysPassphrase);
}
recoverKeysByPassphrase(request, metadata, callback) {
createLocalKeysBackup(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/RecoverKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoRecoverKeysByPassphrase, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/CreateLocalKeysBackup', this.hostname_).toString(), request, metadata || {}, this.methodInfoCreateLocalKeysBackup, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/RecoverKeysByPassphrase', request, metadata || {}, this.methodInfoRecoverKeysByPassphrase);
'/space.SpaceApi/CreateLocalKeysBackup', request, metadata || {}, this.methodInfoCreateLocalKeysBackup);
}
recoverKeysByLocalBackup(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/RecoverKeysByLocalBackup', this.hostname_).toString(), request, metadata || {}, this.methodInfoRecoverKeysByLocalBackup, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/RecoverKeysByLocalBackup', request, metadata || {}, this.methodInfoRecoverKeysByLocalBackup);
}
shareBucket(request, metadata, callback) {

@@ -244,22 +344,18 @@ if (callback !== undefined) {

}
shareBucketViaEmail(request, metadata, callback) {
shareFilesViaPublicKey(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ShareBucketViaEmail', this.hostname_).toString(), request, metadata || {}, this.methodInfoShareBucketViaEmail, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/ShareFilesViaPublicKey', this.hostname_).toString(), request, metadata || {}, this.methodInfoShareFilesViaPublicKey, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ShareBucketViaEmail', request, metadata || {}, this.methodInfoShareBucketViaEmail);
'/space.SpaceApi/ShareFilesViaPublicKey', request, metadata || {}, this.methodInfoShareFilesViaPublicKey);
}
shareBucketViaIdentity(request, metadata, callback) {
handleFilesInvitation(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ShareBucketViaIdentity', this.hostname_).toString(), request, metadata || {}, this.methodInfoShareBucketViaIdentity, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/HandleFilesInvitation', this.hostname_).toString(), request, metadata || {}, this.methodInfoHandleFilesInvitation, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ShareBucketViaIdentity', request, metadata || {}, this.methodInfoShareBucketViaIdentity);
'/space.SpaceApi/HandleFilesInvitation', request, metadata || {}, this.methodInfoHandleFilesInvitation);
}
generateFileShareLink(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GenerateFileShareLink', this.hostname_).toString(), request, metadata || {}, this.methodInfoGenerateFileShareLink, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GenerateFileShareLink', request, metadata || {}, this.methodInfoGenerateFileShareLink);
notificationSubscribe(request, metadata) {
return this.client_.serverStreaming(new URL('/space.SpaceApi/NotificationSubscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoNotificationSubscribe);
}

@@ -273,4 +369,60 @@ listBuckets(request, metadata, callback) {

}
getNotifications(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetNotifications', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetNotifications, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetNotifications', request, metadata || {}, this.methodInfoGetNotifications);
}
readNotification(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ReadNotification', this.hostname_).toString(), request, metadata || {}, this.methodInfoReadNotification, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ReadNotification', request, metadata || {}, this.methodInfoReadNotification);
}
deleteAccount(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/DeleteAccount', this.hostname_).toString(), request, metadata || {}, this.methodInfoDeleteAccount, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/DeleteAccount', request, metadata || {}, this.methodInfoDeleteAccount);
}
toggleBucketBackup(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ToggleBucketBackup', this.hostname_).toString(), request, metadata || {}, this.methodInfoToggleBucketBackup, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ToggleBucketBackup', request, metadata || {}, this.methodInfoToggleBucketBackup);
}
getUsageInfo(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetUsageInfo', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetUsageInfo, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetUsageInfo', request, metadata || {}, this.methodInfoGetUsageInfo);
}
getAPISessionTokens(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetAPISessionTokens', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetAPISessionTokens, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetAPISessionTokens', request, metadata || {}, this.methodInfoGetAPISessionTokens);
}
getRecentlySharedWith(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetRecentlySharedWith', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetRecentlySharedWith, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetRecentlySharedWith', request, metadata || {}, this.methodInfoGetRecentlySharedWith);
}
setNotificationsLastSeenAt(request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/SetNotificationsLastSeenAt', this.hostname_).toString(), request, metadata || {}, this.methodInfoSetNotificationsLastSeenAt, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/SetNotificationsLastSeenAt', request, metadata || {}, this.methodInfoSetNotificationsLastSeenAt);
}
}
exports.SpaceApiClient = SpaceApiClient;
//# sourceMappingURL=SpaceServiceClientPb.js.map
import { Empty } from 'google-protobuf/google/protobuf/empty_pb';
import { SpaceApiClient } from './definitions/SpaceServiceClientPb';
import { ListDirectoriesRequest, OpenFileRequest, CreateBucketRequest, AddItemsRequest, CreateFolderRequest, GetIdentityByUsernameRequest, CreateUsernameAndEmailRequest, ShareBucketViaEmailRequest, ShareBucketViaIdentityRequest, GenerateFileShareLinkRequest, BackupKeysByPassphraseRequest, RecoverKeysByPassphraseRequest, ToggleFuseRequest, IdentityType, ListBucketsRequest, ListDirectoryRequest, ShareBucketRequest, JoinBucketRequest, ThreadInfo, } from './definitions/space_pb';
import { ListDirectoriesRequest, ToggleBucketBackupRequest, OpenFileRequest, CreateBucketRequest, AddItemsRequest, CreateFolderRequest, BackupKeysByPassphraseRequest, RecoverKeysByPassphraseRequest, ToggleFuseRequest, ListBucketsRequest, ListDirectoryRequest, ShareBucketRequest, JoinBucketRequest, ThreadInfo, GetPublicKeyRequest, ReadNotificationRequest, GetNotificationsRequest, HandleFilesInvitationRequest, DeleteKeyPairRequest, DeleteAccountRequest, GetUsageInfoRequest, GetStoredMnemonicRequest, RestoreKeyPairViaMnemonicRequest, GetSharedWithMeFilesRequest, ShareFilesViaPublicKeyRequest, GetAPISessionTokensRequest, GetRecentlySharedWithRequest, GeneratePublicFileLinkRequest, TestKeysPassphraseRequest, SetNotificationsLastSeenAtRequest, GenerateKeyPairRequest, FullPath, } from './definitions/space_pb';
var DEFAULT_BUCKET = 'personal';

@@ -45,2 +45,24 @@ var SpaceClient = /** @class */ (function () {

};
SpaceClient.prototype.toggleBucketBackup = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ToggleBucketBackupRequest();
var backup = payload.backup, bucket = payload.bucket;
request.setBucket(bucket);
request.setBackup(backup);
_this.instance.toggleBucketBackup(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.fileInfoSubscribe = function (metadata) {
if (metadata === void 0) { metadata = {}; }
var request = new Empty();
return this.instance.fileInfoSubscribe(request, metadata);
};
SpaceClient.prototype.txlSubscribe = function (metadata) {

@@ -113,10 +135,10 @@ if (metadata === void 0) { metadata = {}; }

};
SpaceClient.prototype.createUsernameAndEmail = function (payload, metadata) {
SpaceClient.prototype.backupKeysByPassphrase = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new CreateUsernameAndEmailRequest();
request.setEmail(payload.email || '');
request.setUsername(payload.username);
_this.instance.createUsernameAndEmail(request, metadata, function (err, res) {
var request = new BackupKeysByPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
_this.instance.backupKeysByPassphrase(request, metadata, function (err, res) {
if (err) {

@@ -130,9 +152,10 @@ reject(err);

};
SpaceClient.prototype.getIdentityByUsername = function (payload, metadata) {
SpaceClient.prototype.recoverKeysByPassphrase = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetIdentityByUsernameRequest();
request.setUsername(payload.username);
_this.instance.getIdentityByUsername(request, metadata, function (err, res) {
var request = new RecoverKeysByPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
_this.instance.recoverKeysByPassphrase(request, metadata, function (err, res) {
if (err) {

@@ -147,15 +170,13 @@ reject(err);

/**
* [WIP] shareBucketViaEmail
* [WIP] toggleFuseDrive
*
* Not supported by space daemon
*/
SpaceClient.prototype.shareBucketViaEmail = function (payload, metadata) {
SpaceClient.prototype.toggleFuseDrive = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ShareBucketViaEmailRequest();
var bucket = payload.bucket === '' ? null : payload.bucket;
request.setEmail(payload.email);
request.setBucket(bucket || _this.defaultBucket);
_this.instance.shareBucketViaEmail(request, metadata, function (err, res) {
var request = new ToggleFuseRequest();
request.setMountdrive(payload.mountDrive);
_this.instance.toggleFuseDrive(request, metadata, function (err, res) {
if (err) {

@@ -169,12 +190,13 @@ reject(err);

};
SpaceClient.prototype.shareBucketViaIdentity = function (payload, metadata) {
/**
* [WIP] getFuseDriveStatus
*
* Not supported by space daemon
*/
SpaceClient.prototype.getFuseDriveStatus = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ShareBucketViaIdentityRequest();
var bucket = payload.bucket === '' ? null : payload.bucket;
request.setIdentitytype(IdentityType[payload.identityType]);
request.setIdentityvalue(payload.identityValue);
request.setBucket(bucket || _this.defaultBucket);
_this.instance.shareBucketViaIdentity(request, metadata, function (err, res) {
var request = new Empty();
_this.instance.getFuseDriveStatus(request, metadata, function (err, res) {
if (err) {

@@ -188,16 +210,34 @@ reject(err);

};
SpaceClient.prototype.subscribe = function (metadata) {
if (metadata === void 0) { metadata = {}; }
var request = new Empty();
return this.instance.subscribe(request, metadata);
};
/**
* [WIP] generateFileShareLink
* [WIP] listBuckets
*
* Not supported by space daemon
*/
SpaceClient.prototype.generateFileShareLink = function (payload, metadata) {
SpaceClient.prototype.listBuckets = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GenerateFileShareLinkRequest();
var request = new ListBucketsRequest();
_this.instance.listBuckets(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.shareBucket = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ShareBucketRequest();
var bucket = payload.bucket === '' ? null : payload.bucket;
request.setFilepath(payload.filePath);
request.setBucket(bucket || _this.defaultBucket);
_this.instance.generateFileShareLink(request, metadata, function (err, res) {
_this.instance.shareBucket(request, metadata, function (err, res) {
if (err) {

@@ -211,14 +251,14 @@ reject(err);

};
/**
* [WIP] backupKeysByPassphrase
*
* Not supported by space daemon
*/
SpaceClient.prototype.backupKeysByPassphrase = function (payload, metadata) {
SpaceClient.prototype.joinBucket = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new BackupKeysByPassphraseRequest();
request.setPassphrase(payload.passphrase);
_this.instance.backupKeysByPassphrase(request, metadata, function (err, res) {
var threadInfo = new ThreadInfo();
threadInfo.setKey(payload.threadInfo.key);
threadInfo.setAddressesList(payload.threadInfo.addresses);
var request = new JoinBucketRequest();
var bucket = payload.bucket === '' ? null : payload.bucket;
request.setThreadinfo(threadInfo);
request.setBucket(bucket || _this.defaultBucket);
_this.instance.joinBucket(request, metadata, function (err, res) {
if (err) {

@@ -232,14 +272,9 @@ reject(err);

};
/**
* [WIP] recoverKeysByPassphrase
*
* Not supported by space daemon
*/
SpaceClient.prototype.recoverKeysByPassphrase = function (payload, metadata) {
SpaceClient.prototype.setNotificationsLastSeenAt = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new RecoverKeysByPassphraseRequest();
request.setPassphrase(payload.passphrase);
_this.instance.recoverKeysByPassphrase(request, metadata, function (err, res) {
var request = new SetNotificationsLastSeenAtRequest();
request.setTimestamp(payload.timestamp);
_this.instance.setNotificationsLastSeenAt(request, metadata, function (err, res) {
if (err) {

@@ -253,14 +288,10 @@ reject(err);

};
/**
* [WIP] toggleFuseDrive
*
* Not supported by space daemon
*/
SpaceClient.prototype.toggleFuseDrive = function (payload, metadata) {
SpaceClient.prototype.getNotifications = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ToggleFuseRequest();
request.setMountdrive(payload.mountDrive);
_this.instance.toggleFuseDrive(request, metadata, function (err, res) {
var request = new GetNotificationsRequest();
request.setSeek(payload.seek);
request.setLimit(payload.limit);
_this.instance.getNotifications(request, metadata, function (err, res) {
if (err) {

@@ -274,13 +305,10 @@ reject(err);

};
/**
* [WIP] getFuseDriveStatus
*
* Not supported by space daemon
*/
SpaceClient.prototype.getFuseDriveStatus = function (payload, metadata) {
SpaceClient.prototype.handleFilesInvitation = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new Empty();
_this.instance.getFuseDriveStatus(request, metadata, function (err, res) {
var request = new HandleFilesInvitationRequest();
request.setInvitationid(payload.invitationID);
request.setAccept(payload.accept);
_this.instance.handleFilesInvitation(request, metadata, function (err, res) {
if (err) {

@@ -294,18 +322,28 @@ reject(err);

};
SpaceClient.prototype.subscribe = function (metadata) {
SpaceClient.prototype.getPublicKey = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetPublicKeyRequest();
_this.instance.getPublicKey(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.notificationSubscribe = function (metadata) {
if (metadata === void 0) { metadata = {}; }
var request = new Empty();
return this.instance.subscribe(request, metadata);
return this.instance.notificationSubscribe(request, metadata);
};
/**
* [WIP] listBuckets
*
* Not supported by space daemon
*/
SpaceClient.prototype.listBuckets = function (metadata) {
SpaceClient.prototype.readNotification = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ListBucketsRequest();
_this.instance.listBuckets(request, metadata, function (err, res) {
var request = new ReadNotificationRequest();
request.setId(payload.ID);
_this.instance.readNotification(request, metadata, function (err, res) {
if (err) {

@@ -319,10 +357,11 @@ reject(err);

};
SpaceClient.prototype.shareBucket = function (payload, metadata) {
SpaceClient.prototype.deleteAccount = function (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
payload, metadata) {
var _this = this;
if (payload === void 0) { payload = null; }
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ShareBucketRequest();
var bucket = payload.bucket === '' ? null : payload.bucket;
request.setBucket(bucket || _this.defaultBucket);
_this.instance.shareBucket(request, metadata, function (err, res) {
var request = new DeleteAccountRequest();
_this.instance.deleteAccount(request, metadata, function (err, res) {
if (err) {

@@ -336,14 +375,141 @@ reject(err);

};
SpaceClient.prototype.joinBucket = function (payload, metadata) {
SpaceClient.prototype.deleteKeyPair = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var threadInfo = new ThreadInfo();
threadInfo.setKey(payload.threadInfo.key);
threadInfo.setAddressesList(payload.threadInfo.addresses);
var request = new JoinBucketRequest();
var request = new DeleteKeyPairRequest();
_this.instance.deleteKeyPair(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.getUsageInfo = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetUsageInfoRequest();
_this.instance.getUsageInfo(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.getStoredMnemonic = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetStoredMnemonicRequest();
_this.instance.getStoredMnemonic(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.restoreKeyPairViaMnemonic = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new RestoreKeyPairViaMnemonicRequest();
request.setMnemonic(payload.mnemonic);
_this.instance.restoreKeyPairViaMnemonic(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.getSharedWithMeFiles = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetSharedWithMeFilesRequest();
request.setSeek(payload.seek);
request.setLimit(payload.limit);
_this.instance.getSharedWithMeFiles(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.shareFilesViaPublicKey = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new ShareFilesViaPublicKeyRequest();
var paths = payload.paths.map(function (path) {
var fullPath = new FullPath();
var bucket = path.bucket === '' ? null : path.bucket;
fullPath.setBucket(bucket || _this.defaultBucket);
fullPath.setPath(path.path);
if (path.dbId) {
fullPath.setDbid(path.dbId);
}
return fullPath;
});
request.setPathsList(paths);
request.setPublickeysList(payload.publicKeys);
_this.instance.shareFilesViaPublicKey(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.getAPISessionTokens = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetAPISessionTokensRequest();
_this.instance.getAPISessionTokens(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.getRecentlySharedWith = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GetRecentlySharedWithRequest();
_this.instance.getRecentlySharedWith(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.generatePublicFileLink = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GeneratePublicFileLinkRequest();
var bucket = payload.bucket === '' ? null : payload.bucket;
request.setThreadinfo(threadInfo);
var itemPaths = payload.itemPaths.map(function (path) { return path.replace(/^\//, ''); });
request.setDbid(payload.dbId);
request.setPassword(payload.password);
request.setItempathsList(itemPaths);
request.setBucket(bucket || _this.defaultBucket);
_this.instance.joinBucket(request, metadata, function (err, res) {
_this.instance.generatePublicFileLink(request, metadata, function (err, res) {
if (err) {

@@ -357,2 +523,32 @@ reject(err);

};
SpaceClient.prototype.testKeysPassphrase = function (payload, metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new TestKeysPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
_this.instance.testKeysPassphrase(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
SpaceClient.prototype.generateKeyPairWithForce = function (metadata) {
var _this = this;
if (metadata === void 0) { metadata = {}; }
return new Promise(function (resolve, reject) {
var request = new GenerateKeyPairRequest();
_this.instance.generateKeyPairWithForce(request, metadata, function (err, res) {
if (err) {
reject(err);
return;
}
resolve(res);
});
});
};
return SpaceClient;

@@ -359,0 +555,0 @@ }());

@@ -10,3 +10,3 @@ /**

import * as grpcWeb from 'grpc-web';
import { AddItemsResponse, BackupKeysByPassphraseResponse, ConfigInfoResponse, CreateBucketResponse, CreateFolderResponse, CreateUsernameAndEmailResponse, FileEventResponse, FuseDriveResponse, GenerateFileShareLinkResponse, GenerateKeyPairResponse, GetIdentityByUsernameResponse, JoinBucketResponse, ListBucketsResponse, ListDirectoriesResponse, ListDirectoryResponse, OpenFileResponse, RecoverKeysByPassphraseResponse, ShareBucketResponse, ShareBucketViaEmailResponse, ShareBucketViaIdentityResponse, TextileEventResponse } from './space_pb';
import { AddItemsResponse, BackupKeysByPassphraseResponse, CreateBucketResponse, CreateFolderResponse, CreateLocalKeysBackupResponse, DeleteAccountResponse, DeleteKeyPairResponse, FileEventResponse, FileInfoEventResponse, FuseDriveResponse, GenerateKeyPairResponse, GeneratePublicFileLinkResponse, GetAPISessionTokensResponse, GetNotificationsResponse, GetPublicKeyResponse, GetRecentlySharedWithResponse, GetSharedWithMeFilesResponse, GetStoredMnemonicResponse, GetUsageInfoResponse, HandleFilesInvitationResponse, JoinBucketResponse, ListBucketsResponse, ListDirectoriesResponse, ListDirectoryResponse, NotificationEventResponse, OpenFileResponse, OpenPublicFileResponse, ReadNotificationResponse, RecoverKeysByLocalBackupResponse, RecoverKeysByPassphraseResponse, RestoreKeyPairViaMnemonicResponse, SetNotificationsLastSeenAtResponse, ShareBucketResponse, ShareFilesViaPublicKeyResponse, TestKeysPassphraseResponse, TextileEventResponse, ToggleBucketBackupResponse } from './space_pb';
var SpaceApiClient = /** @class */ (function () {

@@ -20,14 +20,26 @@ function SpaceApiClient(hostname, credentials, options) {

}, ListDirectoryResponse.deserializeBinary);
this.methodInfoGetConfigInfo = new grpcWeb.AbstractClientBase.MethodInfo(ConfigInfoResponse, function (request) {
return request.serializeBinary();
}, ConfigInfoResponse.deserializeBinary);
this.methodInfoGenerateKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(GenerateKeyPairResponse, function (request) {
return request.serializeBinary();
}, GenerateKeyPairResponse.deserializeBinary);
this.methodInfoGetStoredMnemonic = new grpcWeb.AbstractClientBase.MethodInfo(GetStoredMnemonicResponse, function (request) {
return request.serializeBinary();
}, GetStoredMnemonicResponse.deserializeBinary);
this.methodInfoRestoreKeyPairViaMnemonic = new grpcWeb.AbstractClientBase.MethodInfo(RestoreKeyPairViaMnemonicResponse, function (request) {
return request.serializeBinary();
}, RestoreKeyPairViaMnemonicResponse.deserializeBinary);
this.methodInfoDeleteKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(DeleteKeyPairResponse, function (request) {
return request.serializeBinary();
}, DeleteKeyPairResponse.deserializeBinary);
this.methodInfoGenerateKeyPairWithForce = new grpcWeb.AbstractClientBase.MethodInfo(GenerateKeyPairResponse, function (request) {
return request.serializeBinary();
}, GenerateKeyPairResponse.deserializeBinary);
this.methodInfoGetPublicKey = new grpcWeb.AbstractClientBase.MethodInfo(GetPublicKeyResponse, function (request) {
return request.serializeBinary();
}, GetPublicKeyResponse.deserializeBinary);
this.methodInfoSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(FileEventResponse, function (request) {
return request.serializeBinary();
}, FileEventResponse.deserializeBinary);
this.methodInfoFileInfoSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(FileInfoEventResponse, function (request) {
return request.serializeBinary();
}, FileInfoEventResponse.deserializeBinary);
this.methodInfoTxlSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(TextileEventResponse, function (request) {

@@ -39,2 +51,11 @@ return request.serializeBinary();

}, OpenFileResponse.deserializeBinary);
this.methodInfoGeneratePublicFileLink = new grpcWeb.AbstractClientBase.MethodInfo(GeneratePublicFileLinkResponse, function (request) {
return request.serializeBinary();
}, GeneratePublicFileLinkResponse.deserializeBinary);
this.methodInfoGetSharedWithMeFiles = new grpcWeb.AbstractClientBase.MethodInfo(GetSharedWithMeFilesResponse, function (request) {
return request.serializeBinary();
}, GetSharedWithMeFilesResponse.deserializeBinary);
this.methodInfoOpenPublicFile = new grpcWeb.AbstractClientBase.MethodInfo(OpenPublicFileResponse, function (request) {
return request.serializeBinary();
}, OpenPublicFileResponse.deserializeBinary);
this.methodInfoAddItems = new grpcWeb.AbstractClientBase.MethodInfo(AddItemsResponse, function (request) {

@@ -55,8 +76,2 @@ return request.serializeBinary();

}, CreateBucketResponse.deserializeBinary);
this.methodInfoGetIdentityByUsername = new grpcWeb.AbstractClientBase.MethodInfo(GetIdentityByUsernameResponse, function (request) {
return request.serializeBinary();
}, GetIdentityByUsernameResponse.deserializeBinary);
this.methodInfoCreateUsernameAndEmail = new grpcWeb.AbstractClientBase.MethodInfo(CreateUsernameAndEmailResponse, function (request) {
return request.serializeBinary();
}, CreateUsernameAndEmailResponse.deserializeBinary);
this.methodInfoBackupKeysByPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(BackupKeysByPassphraseResponse, function (request) {

@@ -68,2 +83,11 @@ return request.serializeBinary();

}, RecoverKeysByPassphraseResponse.deserializeBinary);
this.methodInfoTestKeysPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(TestKeysPassphraseResponse, function (request) {
return request.serializeBinary();
}, TestKeysPassphraseResponse.deserializeBinary);
this.methodInfoCreateLocalKeysBackup = new grpcWeb.AbstractClientBase.MethodInfo(CreateLocalKeysBackupResponse, function (request) {
return request.serializeBinary();
}, CreateLocalKeysBackupResponse.deserializeBinary);
this.methodInfoRecoverKeysByLocalBackup = new grpcWeb.AbstractClientBase.MethodInfo(RecoverKeysByLocalBackupResponse, function (request) {
return request.serializeBinary();
}, RecoverKeysByLocalBackupResponse.deserializeBinary);
this.methodInfoShareBucket = new grpcWeb.AbstractClientBase.MethodInfo(ShareBucketResponse, function (request) {

@@ -75,14 +99,38 @@ return request.serializeBinary();

}, JoinBucketResponse.deserializeBinary);
this.methodInfoShareBucketViaEmail = new grpcWeb.AbstractClientBase.MethodInfo(ShareBucketViaEmailResponse, function (request) {
this.methodInfoShareFilesViaPublicKey = new grpcWeb.AbstractClientBase.MethodInfo(ShareFilesViaPublicKeyResponse, function (request) {
return request.serializeBinary();
}, ShareBucketViaEmailResponse.deserializeBinary);
this.methodInfoShareBucketViaIdentity = new grpcWeb.AbstractClientBase.MethodInfo(ShareBucketViaIdentityResponse, function (request) {
}, ShareFilesViaPublicKeyResponse.deserializeBinary);
this.methodInfoHandleFilesInvitation = new grpcWeb.AbstractClientBase.MethodInfo(HandleFilesInvitationResponse, function (request) {
return request.serializeBinary();
}, ShareBucketViaIdentityResponse.deserializeBinary);
this.methodInfoGenerateFileShareLink = new grpcWeb.AbstractClientBase.MethodInfo(GenerateFileShareLinkResponse, function (request) {
}, HandleFilesInvitationResponse.deserializeBinary);
this.methodInfoNotificationSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(NotificationEventResponse, function (request) {
return request.serializeBinary();
}, GenerateFileShareLinkResponse.deserializeBinary);
}, NotificationEventResponse.deserializeBinary);
this.methodInfoListBuckets = new grpcWeb.AbstractClientBase.MethodInfo(ListBucketsResponse, function (request) {
return request.serializeBinary();
}, ListBucketsResponse.deserializeBinary);
this.methodInfoGetNotifications = new grpcWeb.AbstractClientBase.MethodInfo(GetNotificationsResponse, function (request) {
return request.serializeBinary();
}, GetNotificationsResponse.deserializeBinary);
this.methodInfoReadNotification = new grpcWeb.AbstractClientBase.MethodInfo(ReadNotificationResponse, function (request) {
return request.serializeBinary();
}, ReadNotificationResponse.deserializeBinary);
this.methodInfoDeleteAccount = new grpcWeb.AbstractClientBase.MethodInfo(DeleteAccountResponse, function (request) {
return request.serializeBinary();
}, DeleteAccountResponse.deserializeBinary);
this.methodInfoToggleBucketBackup = new grpcWeb.AbstractClientBase.MethodInfo(ToggleBucketBackupResponse, function (request) {
return request.serializeBinary();
}, ToggleBucketBackupResponse.deserializeBinary);
this.methodInfoGetUsageInfo = new grpcWeb.AbstractClientBase.MethodInfo(GetUsageInfoResponse, function (request) {
return request.serializeBinary();
}, GetUsageInfoResponse.deserializeBinary);
this.methodInfoGetAPISessionTokens = new grpcWeb.AbstractClientBase.MethodInfo(GetAPISessionTokensResponse, function (request) {
return request.serializeBinary();
}, GetAPISessionTokensResponse.deserializeBinary);
this.methodInfoGetRecentlySharedWith = new grpcWeb.AbstractClientBase.MethodInfo(GetRecentlySharedWithResponse, function (request) {
return request.serializeBinary();
}, GetRecentlySharedWithResponse.deserializeBinary);
this.methodInfoSetNotificationsLastSeenAt = new grpcWeb.AbstractClientBase.MethodInfo(SetNotificationsLastSeenAtResponse, function (request) {
return request.serializeBinary();
}, SetNotificationsLastSeenAtResponse.deserializeBinary);
if (!options)

@@ -112,16 +160,30 @@ options = {};

};
SpaceApiClient.prototype.getConfigInfo = function (request, metadata, callback) {
SpaceApiClient.prototype.generateKeyPair = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetConfigInfo', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetConfigInfo, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/GenerateKeyPair', this.hostname_).toString(), request, metadata || {}, this.methodInfoGenerateKeyPair, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetConfigInfo', request, metadata || {}, this.methodInfoGetConfigInfo);
'/space.SpaceApi/GenerateKeyPair', request, metadata || {}, this.methodInfoGenerateKeyPair);
};
SpaceApiClient.prototype.generateKeyPair = function (request, metadata, callback) {
SpaceApiClient.prototype.getStoredMnemonic = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GenerateKeyPair', this.hostname_).toString(), request, metadata || {}, this.methodInfoGenerateKeyPair, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/GetStoredMnemonic', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetStoredMnemonic, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GenerateKeyPair', request, metadata || {}, this.methodInfoGenerateKeyPair);
'/space.SpaceApi/GetStoredMnemonic', request, metadata || {}, this.methodInfoGetStoredMnemonic);
};
SpaceApiClient.prototype.restoreKeyPairViaMnemonic = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/RestoreKeyPairViaMnemonic', this.hostname_).toString(), request, metadata || {}, this.methodInfoRestoreKeyPairViaMnemonic, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/RestoreKeyPairViaMnemonic', request, metadata || {}, this.methodInfoRestoreKeyPairViaMnemonic);
};
SpaceApiClient.prototype.deleteKeyPair = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/DeleteKeyPair', this.hostname_).toString(), request, metadata || {}, this.methodInfoDeleteKeyPair, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/DeleteKeyPair', request, metadata || {}, this.methodInfoDeleteKeyPair);
};
SpaceApiClient.prototype.generateKeyPairWithForce = function (request, metadata, callback) {

@@ -134,5 +196,15 @@ if (callback !== undefined) {

};
SpaceApiClient.prototype.getPublicKey = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetPublicKey', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetPublicKey, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetPublicKey', request, metadata || {}, this.methodInfoGetPublicKey);
};
SpaceApiClient.prototype.subscribe = function (request, metadata) {
return this.client_.serverStreaming(new URL('/space.SpaceApi/Subscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoSubscribe);
};
SpaceApiClient.prototype.fileInfoSubscribe = function (request, metadata) {
return this.client_.serverStreaming(new URL('/space.SpaceApi/FileInfoSubscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoFileInfoSubscribe);
};
SpaceApiClient.prototype.txlSubscribe = function (request, metadata) {

@@ -148,2 +220,23 @@ return this.client_.serverStreaming(new URL('/space.SpaceApi/TxlSubscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoTxlSubscribe);

};
SpaceApiClient.prototype.generatePublicFileLink = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GeneratePublicFileLink', this.hostname_).toString(), request, metadata || {}, this.methodInfoGeneratePublicFileLink, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GeneratePublicFileLink', request, metadata || {}, this.methodInfoGeneratePublicFileLink);
};
SpaceApiClient.prototype.getSharedWithMeFiles = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetSharedWithMeFiles', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetSharedWithMeFiles, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetSharedWithMeFiles', request, metadata || {}, this.methodInfoGetSharedWithMeFiles);
};
SpaceApiClient.prototype.openPublicFile = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/OpenPublicFile', this.hostname_).toString(), request, metadata || {}, this.methodInfoOpenPublicFile, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/OpenPublicFile', request, metadata || {}, this.methodInfoOpenPublicFile);
};
SpaceApiClient.prototype.addItems = function (request, metadata) {

@@ -180,30 +273,37 @@ return this.client_.serverStreaming(new URL('/space.SpaceApi/AddItems', this.hostname_).toString(), request, metadata || {}, this.methodInfoAddItems);

};
SpaceApiClient.prototype.getIdentityByUsername = function (request, metadata, callback) {
SpaceApiClient.prototype.backupKeysByPassphrase = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetIdentityByUsername', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetIdentityByUsername, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/BackupKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoBackupKeysByPassphrase, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetIdentityByUsername', request, metadata || {}, this.methodInfoGetIdentityByUsername);
'/space.SpaceApi/BackupKeysByPassphrase', request, metadata || {}, this.methodInfoBackupKeysByPassphrase);
};
SpaceApiClient.prototype.createUsernameAndEmail = function (request, metadata, callback) {
SpaceApiClient.prototype.recoverKeysByPassphrase = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/CreateUsernameAndEmail', this.hostname_).toString(), request, metadata || {}, this.methodInfoCreateUsernameAndEmail, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/RecoverKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoRecoverKeysByPassphrase, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/CreateUsernameAndEmail', request, metadata || {}, this.methodInfoCreateUsernameAndEmail);
'/space.SpaceApi/RecoverKeysByPassphrase', request, metadata || {}, this.methodInfoRecoverKeysByPassphrase);
};
SpaceApiClient.prototype.backupKeysByPassphrase = function (request, metadata, callback) {
SpaceApiClient.prototype.testKeysPassphrase = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/BackupKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoBackupKeysByPassphrase, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/TestKeysPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoTestKeysPassphrase, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/BackupKeysByPassphrase', request, metadata || {}, this.methodInfoBackupKeysByPassphrase);
'/space.SpaceApi/TestKeysPassphrase', request, metadata || {}, this.methodInfoTestKeysPassphrase);
};
SpaceApiClient.prototype.recoverKeysByPassphrase = function (request, metadata, callback) {
SpaceApiClient.prototype.createLocalKeysBackup = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/RecoverKeysByPassphrase', this.hostname_).toString(), request, metadata || {}, this.methodInfoRecoverKeysByPassphrase, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/CreateLocalKeysBackup', this.hostname_).toString(), request, metadata || {}, this.methodInfoCreateLocalKeysBackup, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/RecoverKeysByPassphrase', request, metadata || {}, this.methodInfoRecoverKeysByPassphrase);
'/space.SpaceApi/CreateLocalKeysBackup', request, metadata || {}, this.methodInfoCreateLocalKeysBackup);
};
SpaceApiClient.prototype.recoverKeysByLocalBackup = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/RecoverKeysByLocalBackup', this.hostname_).toString(), request, metadata || {}, this.methodInfoRecoverKeysByLocalBackup, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/RecoverKeysByLocalBackup', request, metadata || {}, this.methodInfoRecoverKeysByLocalBackup);
};
SpaceApiClient.prototype.shareBucket = function (request, metadata, callback) {

@@ -223,22 +323,18 @@ if (callback !== undefined) {

};
SpaceApiClient.prototype.shareBucketViaEmail = function (request, metadata, callback) {
SpaceApiClient.prototype.shareFilesViaPublicKey = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ShareBucketViaEmail', this.hostname_).toString(), request, metadata || {}, this.methodInfoShareBucketViaEmail, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/ShareFilesViaPublicKey', this.hostname_).toString(), request, metadata || {}, this.methodInfoShareFilesViaPublicKey, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ShareBucketViaEmail', request, metadata || {}, this.methodInfoShareBucketViaEmail);
'/space.SpaceApi/ShareFilesViaPublicKey', request, metadata || {}, this.methodInfoShareFilesViaPublicKey);
};
SpaceApiClient.prototype.shareBucketViaIdentity = function (request, metadata, callback) {
SpaceApiClient.prototype.handleFilesInvitation = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ShareBucketViaIdentity', this.hostname_).toString(), request, metadata || {}, this.methodInfoShareBucketViaIdentity, callback);
return this.client_.rpcCall(new URL('/space.SpaceApi/HandleFilesInvitation', this.hostname_).toString(), request, metadata || {}, this.methodInfoHandleFilesInvitation, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ShareBucketViaIdentity', request, metadata || {}, this.methodInfoShareBucketViaIdentity);
'/space.SpaceApi/HandleFilesInvitation', request, metadata || {}, this.methodInfoHandleFilesInvitation);
};
SpaceApiClient.prototype.generateFileShareLink = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GenerateFileShareLink', this.hostname_).toString(), request, metadata || {}, this.methodInfoGenerateFileShareLink, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GenerateFileShareLink', request, metadata || {}, this.methodInfoGenerateFileShareLink);
SpaceApiClient.prototype.notificationSubscribe = function (request, metadata) {
return this.client_.serverStreaming(new URL('/space.SpaceApi/NotificationSubscribe', this.hostname_).toString(), request, metadata || {}, this.methodInfoNotificationSubscribe);
};

@@ -252,2 +348,58 @@ SpaceApiClient.prototype.listBuckets = function (request, metadata, callback) {

};
SpaceApiClient.prototype.getNotifications = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetNotifications', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetNotifications, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetNotifications', request, metadata || {}, this.methodInfoGetNotifications);
};
SpaceApiClient.prototype.readNotification = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ReadNotification', this.hostname_).toString(), request, metadata || {}, this.methodInfoReadNotification, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ReadNotification', request, metadata || {}, this.methodInfoReadNotification);
};
SpaceApiClient.prototype.deleteAccount = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/DeleteAccount', this.hostname_).toString(), request, metadata || {}, this.methodInfoDeleteAccount, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/DeleteAccount', request, metadata || {}, this.methodInfoDeleteAccount);
};
SpaceApiClient.prototype.toggleBucketBackup = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/ToggleBucketBackup', this.hostname_).toString(), request, metadata || {}, this.methodInfoToggleBucketBackup, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/ToggleBucketBackup', request, metadata || {}, this.methodInfoToggleBucketBackup);
};
SpaceApiClient.prototype.getUsageInfo = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetUsageInfo', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetUsageInfo, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetUsageInfo', request, metadata || {}, this.methodInfoGetUsageInfo);
};
SpaceApiClient.prototype.getAPISessionTokens = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetAPISessionTokens', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetAPISessionTokens, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetAPISessionTokens', request, metadata || {}, this.methodInfoGetAPISessionTokens);
};
SpaceApiClient.prototype.getRecentlySharedWith = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/GetRecentlySharedWith', this.hostname_).toString(), request, metadata || {}, this.methodInfoGetRecentlySharedWith, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/GetRecentlySharedWith', request, metadata || {}, this.methodInfoGetRecentlySharedWith);
};
SpaceApiClient.prototype.setNotificationsLastSeenAt = function (request, metadata, callback) {
if (callback !== undefined) {
return this.client_.rpcCall(new URL('/space.SpaceApi/SetNotificationsLastSeenAt', this.hostname_).toString(), request, metadata || {}, this.methodInfoSetNotificationsLastSeenAt, callback);
}
return this.client_.unaryCall(this.hostname_ +
'/space.SpaceApi/SetNotificationsLastSeenAt', request, metadata || {}, this.methodInfoSetNotificationsLastSeenAt);
};
return SpaceApiClient;

@@ -254,0 +406,0 @@ }());

@@ -21,28 +21,14 @@ export interface ListDirectoryPayload {

}
export interface GetIdentityByUsernamePayload {
username: string;
}
export interface CreateUsernameAndEmailPayload {
email?: string;
username: string;
}
export interface ShareBucketViaEmailPayload {
bucket?: string;
email: string;
}
export interface ShareBucketViaIdentityPayload {
identityType: 'EMAIL' | 'USERNAME';
identityValue: string;
bucket?: string;
}
export interface GenerateFileShareLinkPayload {
bucket?: string;
filePath: string;
}
export interface BackupKeysByPassphrasePayload {
uuid: string;
passphrase: string;
}
export interface RecoverKeysByPassphrasePayload {
uuid: string;
passphrase: string;
}
export interface TestKeysPassphrasePayload {
uuid: string;
passphrase: string;
}
export interface ToggleFusePayload {

@@ -56,2 +42,6 @@ mountDrive: boolean;

}
export interface ToggleBucketBackupPayload {
bucket: string;
backup: boolean;
}
export interface ShareBucketPayload {

@@ -67,1 +57,36 @@ bucket?: string;

}
export interface ReadNotificationPayload {
ID: string;
}
export interface GetNotificationsPayload {
seek: string;
limit: number;
}
export interface HandleFilesInvitationPayload {
invitationID: string;
accept: boolean;
}
export interface SetNotificationsLastSeenAtPayload {
timestamp: number;
}
export interface RestoreKeyPairViaMnemonicPayload {
mnemonic: string;
}
export interface GetSharedWithMeFilesPayload {
seek: string;
limit: number;
}
export interface ShareFilesViaPublicKeyPayload {
paths: {
dbId?: string;
bucket?: string;
path: string;
}[];
publicKeys: [string];
}
export interface GeneratePublicFileLinkPayload {
dbId: string;
bucket?: string;
password: string;
itemPaths: [string];
}

@@ -5,2 +5,9 @@ module.exports = {

resetMocks: true,
testMatch: ['**/__tests__/**/*.+(ts)'],
transform: {
'^.+\\.(ts)$': 'ts-jest',
},
collectCoverageFrom: [
'src/{!(definitions),}',
],
globals: {

@@ -7,0 +14,0 @@ 'ts-jest': {

{
"name": "@fleekhq/space-client",
"version": "0.1.5",
"version": "1.0.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "dist/esm/index.js",

@@ -0,1 +1,4 @@

![Publish Action Status](https://github.com/FleekHQ/space-client/workflows/Publish/badge.svg?branch=master)
![Tests Action Status](https://github.com/FleekHQ/space-client/workflows/Tests/badge.svg)
# Space Client

@@ -100,2 +103,5 @@

console.log(entry.getFileextension());
console.log(entry.getIslocallyavailable());
console.log(entry.getBackupcount());
console.log(entry.getMembersList());
});

@@ -139,2 +145,5 @@ })

console.log(entry.getFileextension());
console.log(entry.getIslocallyavailable());
console.log(entry.getBackupcount());
console.log(entry.getMembersList());
});

@@ -171,2 +180,15 @@ })

#### .fileInfoSubscribe()
Returns a ReadableStream that notifies when a change related to the a file has occured such as the amount of members the file is shared with or whether the file is backup in Space.
```js
const fileInfoStream = client.fileInfoSubscribe();
fileInfoStream.on('data', (res) => {
const file = res.getFile();
console.log(file);
});
```
#### .openFile({ path: string, bucket?: string })

@@ -275,11 +297,11 @@

#### .createUsernameAndEmail({ username: string, email?: string })
#### `[WIP]` <em>.toggleBucketBackup({ bucket: string, backup: boolean }) </em>
Create a new username with/out email. Returns a Promise that resolves to the username.
Toggles whether or not to back up the content of a bucket to Space.
```js
client
.createUsernameAndEmail({ username: 'myusername' })
.toggleBucketBackup({ bucket: 'bucket-name', backup: true })
.then(() => {
console.log('username created');
console.log('bucket-name is backed up in Space!');
})

@@ -293,41 +315,18 @@ .catch((err) => {

const asyncFunc = async () => {
await client.createUsernameAndEmail({ username: 'myusername', email: 'my-email@mydomain.com' });
await client.toggleBucketBackup({ bucket: 'bucket-name', backup: true });
};
```
#### .getIdentityByUsername({ username: string, email?: string })
#### .backupKeysByPassphrase({ uuid: string, passphrase: string })
Get an indentity based on a username. Returns a Promise that resolves if a username already exists.
Backup keys by a passphrase
```js
client
.getIdentityByUsername({ username: 'myusername' })
.then((res) => {
console.log(res.getIdentity());
.backupKeysByPassphrase({
uuid: 'user-uuid',
passphrase: 'my-passphrase',
})
.catch(() => {
console.log('Username doesnt exists.');
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getIdentityByUsername({ username: 'myusername' });
console.log(res.getIdentity());
};
```
#### `[WIP]` <em>.shareBucketViaEmail({ bucket?: string, email: string })</em>
> this method is still not supported by [space-daemon](https://github.com/FleekHQ/space-daemon)
Shares a bucket via email.
If you don't specify the `bucket` property, `client.defaultBucket` value is going to be used instead.
```js
client
.shareBucketViaEmail({ bucket: 'my-bucket-slug', email: 'email@gmail.com' })
.then((res) => {
console.log(res);
.then(() => {
console.log('keys backup');
})

@@ -338,62 +337,24 @@ .catch((err) => {

/* Or using Asyn/Await */
const asyncFunc = async () => {
const res = await client.shareBucketViaEmail({
bucket: 'my-bucket-slug',
email: 'email@gmail.com',
});
console.log(res);
};
```
#### .shareBucketViaIdentity({ identityType: 'USERNAME' | 'EMAIL', identityValue: string, bucket?: string })
Shares a bucket via identity.
If you don't specify the `bucket` property, `client.defaultBucket` value is going to be used instead.
```js
client
.shareBucketViaIdentity({
bucket: 'my-bucket-slug',
identityType: 'USERNAME',
identityValue: 'user123',
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.shareBucketViaIdentity({
bucket: 'my-bucket-slug',
identityType: 'USERNAME',
identityValue: 'user123',
await client.backupKeysByPassphrase({
uuid: 'user-uuid',
passphrase: 'my-passphrase',
});
console.log(res);
};
```
#### `[WIP]` <em>.generateFileShareLink({ bucket?: string, filePath: string })</em>
#### .recoverKeysByPassphrase({ uuid: string, passphrase: string })
> this method is still not supported by [space-daemon](https://github.com/FleekHQ/space-daemon)
Recovery keys by passphrase
Generates a share link.
If you don't specify the `bucket` property, `client.defaultBucket` value is going to be used instead.
```js
client
.generateFileShareLink({
bucket: 'my-bucket-slug',
filePath: 'path/to/file.js',
.recoverKeysByPassphrase({
uuid: 'user-uuid',
passphrase: 'my-passphrase',
})
.then((res) => {
console.log(res.getLink());
.then(() => {
console.log('recovery keys');
})

@@ -407,24 +368,21 @@ .catch((err) => {

const asyncFunc = async () => {
const res = await client.generateFileShareLink({
bucket: 'my-bucket-slug',
filePath: 'path/to/file.js',
await client.recoverKeysByPassphrase({
uuid: 'user-uuid',
passphrase: 'my-passphrase',
});
console.log(res.getLink());
};
```
#### `[WIP]` <em>.backupKeysByPassphrase({ passphrase: string })</em>
#### .testKeysPassphrase({ uuid: string, passphrase: string })
> this method is still not supported by [space-daemon](https://github.com/FleekHQ/space-daemon)
Test keys with passphrase
Backup keys by passphrase
```js
client
.backupKeysByPassphrase({
.testKeysPassphrase({
uuid: 'user-uuid',
passphrase: 'my-passphrase',
})
.then(() => {
console.log('keys backup');
console.log('test success');
})

@@ -438,3 +396,4 @@ .catch((err) => {

const asyncFunc = async () => {
await client.backupKeysByPassphrase({
await client.testKeysPassphrase({
uuid: 'user-uuid',
passphrase: 'my-passphrase',

@@ -445,15 +404,11 @@ });

#### `[WIP]` <em>.recoverKeysByPassphrase({ passphrase: string })</em>
#### .generateKeyPairWithForce()
> this method is still not supported by [space-daemon](https://github.com/FleekHQ/space-daemon)
Generate key pair with force
Recovery keys by passphrase
```js
client
.recoverKeysByPassphrase({
passphrase: 'my-passphrase',
})
.generateKeyPairWithForce()
.then(() => {
console.log('recovery keys');
console.log('keys generated');
})

@@ -467,5 +422,3 @@ .catch((err) => {

const asyncFunc = async () => {
await client.recoverKeysByPassphrase({
passphrase: 'my-passphrase',
});
await client.generateKeyPairWithForce();
};

@@ -653,3 +606,483 @@ ```

#### .getPublicKey()
Get the current public key generated by the daemon and the hub auth token.
```js
client
.getPublicKey()
.then((res) => {
const publicKey = res.getPublickey();
const hubAuthToken = res.getHubauthtoken();
console.log('publicKey', publicKey);
console.log('hubAuthToken', hubAuthToken);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getPublicKey();
console.log('publicKey', res.getPublickey());
console.log('hubAuthToken', res.getHubauthtoken());
...
};
```
#### .notificationSubscribe()
Returns a ReadableStream that notifies about new notifications.
Notifications are triggered upon another member's interaction with a shared file or bucket, for example if he attempts to add a new file to a shared bucket.
```js
const notificationStream = client.notificationSubscribe();
notificationStream.on('data', (res) => {
const notification = res.getNotification();
console.log(notification);
});
```
#### .readNotification({ ID: string })
Mark a notification as read.
```js
client
.readNotifcation({ ID: '1234' })
.then(() => {
console.log('notifcation was marked as read');
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.readNotification({ ID: '1234' });
console.log('notifcation was marked as read');
...
};
```
#### .getNotifications({ seek: string, limit: number })
Returns a list of notifications objects. Notifications objects represent just share file invitations for now.
```js
client
.getNotifications({ seek: 'some-value', limit: 20 })
.then((res) => {
const objectRes = {
nextOffset: res.getNextoffset(),
notifications: res.getNotificationsList().map((notification) => ({
id: notification.getId(),
body: notification.getBody(),
type: notification.getType(),
readAt: notification.getReadat(),
subject: notification.getSubject(),
createdAt: notification.getCreatedat(),
relatedObject: notification.getRelatedobjectCase(),
})),
};
console.log(objectRes);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getNotifications({ seek: 'some-value', limit: 20 });
console.log(res);
...
};
```
#### .handleFilesInvitation({ invitationID: string, accept: boolean })
This method is for accepting or rejecting an invitation to a sharing request of a file.
```js
client
.handleFilesInvitation({ invitationID: '123-123-123', accept: true })
.then((response) => {
console.log(response);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
await client.handleFilesInvitation({ invitationID: '123-123-123', accept: true });
...
};
```
#### .setNotificationsLastSeenAt({ timestamp: number })
Updates the timestamp which is returned by the `getNotifications()` method through calling `getLastseenat()`.
This timestamp can be used to track which notification has not yet been seen by the user.
```js
client
.setNotificationsLastSeenAt({ timestamp: 1598889151456 })
.then(() => {
console.log('Updated the notifications timestamp');
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
await client.setNotificationsLastSeenAt({ timestamp: 1598889151456 });
...
};
```
#### .deleteAccount()
Delete an account.
```js
client.deleteAccount().then((res) => {
console.log('account delted');
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
await client.deleteAccount();
console.log('account delted');
};
```
#### .deleteKeyPair()
Deletes the Key Pair
```js
client
.deleteKeyPair()
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.deleteKeyPair();
console.log(res);
...
};
```
#### .getUsageInfo()
Fetches account storage usage info such as amount of space used locally and in Space, alongside bandwith quotas and limits.
```js
client
.getUsageInfo()
.then((usageInfoRes) => {
const usageInfo = {
localstorageused: usageInfoRes.getLocalstorageused(),
localbandwidthused: usageInfoRes.getLocalbandwidthused(),
spacestorageused: usageInfoRes.getSpacestorageused(),
spacebandwidthused: usageInfoRes.getSpacebandwidthused(),
usagequota: usageInfoRes.getUsagequota(),
}
console.log(usageInfo);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const usageInfoRes = await client.getUsageInfo();
const usageInfo = {
localstorageused: usageInfoRes.getLocalstorageused(),
localbandwidthused: usageInfoRes.getLocalbandwidthused(),
spacestorageused: usageInfoRes.getSpacestorageused(),
spacebandwidthused: usageInfoRes.getSpacebandwidthused(),
usagequota: usageInfoRes.getUsagequota(),
}
console.log(usageInfo);
...
};
```
#### .getStoredMnemonic()
Get the stored mnemonic seed.
```js
client
.getStoredMnemonic()
.then((res) => {
console.log(res.getMnemonic());
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getMnemonic();
console.log(res.getMnemonic());
...
};
```
#### .restoreKeyPairViaMnemonic({ mnemonic: string })
Restore key pair via mnemonic
```js
client
.restoreKeyPairViaMnemonic({
mnemonic: 'my-mnemonic',
})
.then(() => {
console.log('restore keys');
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
await client.restoreKeyPairViaMnemonic({
mnemonic: 'my-mnemonic',
});
};
```
#### .getSharedWithMeFiles({ seek: string, limit: number })
Returns the list of files shared with me
```js
client
.getSharedWithMeFiles({
seek: "seek_value",
limit: 30,
})
.then((res) => {
const result = {
nextOffset: result.getNextoffset(),
items: result.getItemsList().map((item) => {
const entry = item.getEntry();
return {
dbId: item.getDbid(),
bucket: item.getBucket(),
path: entry.getEntrygetPath(),
isDir: entry.getIsdir(),
name: entry.getName(),
sizeInBytes: entry.getSizeinbytes(),
created: entry.getCreated(),
updated: entry.getUpdated(),
fileExtension: entry.getFileextension(),
ipfsHash: entry.getIpfshash(),
isLocallyAvailable: entry.getIslocallyavailable(),
backupCount: entry.getBackupcount(),
members: entry.getMembersList().map((member) => ({
publicKey: member.getPublickey(),
})),
};
}),
};
console.log(result);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getSharedWithMeFiles({
seek: "seek_value",
limit: 30,
});
console.log(res.getItemsList());
...
};
```
#### .shareFilesViaPublicKey({ publicKeys: [string], paths: [{ dbId?: string, bucket?: string, path: string }] })
Share files with other users via their public keys
```js
client
.shareFilesViaPublicKey({
publicKeys: ['pubKey1', 'pubKey2', 'pubKey3'],
paths: [{
path: 'path1/file.jpeg',
dbId: 'db-id-1',
bucket: 'my-bucket',
}],
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.shareFilesViaPublicKey({
publicKeys: ['pubKey1', 'pubKey2', 'pubKey3'],
paths: [{
path: 'path1/file.jpeg',
dbId: 'db-id-1',
bucket: 'my-bucket',
}],
});
console.log(res);
...
};
```
#### .getAPISessionTokens()
Get the current api session tokens.
```js
client
.getAPISessionTokens()
.then((res) => {
const hubToken = res.getHubtoken();
const servicestoken = res.getServicestoken();
console.log('hubToken', hubToken);
console.log('servicestoken', servicestoken);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getAPISessionTokens();
console.log('hubToken', res.getHubtoken());
console.log('servicestoken', res.getServicestoken());
...
};
```
#### .getRecentlySharedWith()
Returns a list of the recently members that you shared with
```js
client
.getRecentlySharedWith()
.then((res) => {
const membersList = res.getMembersList();
const members = membersList.map((member) => ({
address: member.getAddress(),
publicKey: member.getPublickey(),
}));
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.getRecentlySharedWith();
const membersList = res.getMembersList();
...
};
```
#### .generatePublicFileLink({ bucket?: string, password: string, itemPaths: [string], dbId: string })
Generates a sharing public link for the files specified.
If you don't specify the `bucket` property, `client.defaultBucket` value is going to be used instead.
```js
client
.generatePublicFileLink({
dbId: 'db-id-string',
bucket: 'my-bucket',
password: '123asd',
itemPaths: ['path/to/file1.txt', 'path/to/file2.txt'],
})
.then((res) => {
const fileInfo = {
link: res.getLink(),
fileCid: res.getFilecid(),
};
console.log(fileInfo);
})
.catch((err) => {
console.error(err);
});
/* Or using Async/Await */
const asyncFunc = async () => {
const res = await client.generatePublicFileLink({
bucket: 'my-bucket',
password: '123asd',
itemPaths: ['path/to/file1.txt', 'path/to/file2.txt'],
});
const fileInfo = {
link: res.getLink(),
fileCid: res.getFilecid(),
};
...
};
```
## Example

@@ -656,0 +1089,0 @@ You can check the example included in the `example` folder.

@@ -11,3 +11,5 @@ // We disable the type checking because it interferes with jest's mocking function

listDirectories: jest.fn(),
toggleBucketBackup: jest.fn(),
addItems: jest.fn(),
fileInfoSubscribe: jest.fn(),
txlSubscribe: jest.fn(),

@@ -30,2 +32,20 @@ openFile: jest.fn(),

joinBucket: jest.fn(),
shareItemsToSelectGroup: jest.fn(),
notificationSubscribe: jest.fn(),
getPublicKey: jest.fn(),
readNotification: jest.fn(),
getNotifications: jest.fn(),
handleFilesInvitation: jest.fn(),
setNotificationsLastSeenAt: jest.fn(),
deleteKeyPair: jest.fn(),
deleteAccount: jest.fn(),
getUsageInfo: jest.fn(),
getStoredMnemonic: jest.fn(),
getSharedWithMeFiles: jest.fn(),
shareFilesViaPublicKey: jest.fn(),
getAPISessionTokens: jest.fn(),
getRecentlySharedWith: jest.fn(),
generatePublicFileLink: jest.fn(),
testKeysPassphrase: jest.fn(),
generateKeyPairWithForce: jest.fn(),
};

@@ -56,2 +76,8 @@

it('fileInfoSubscribe makes the right requests', async () => {
client.fileInfoSubscribe({});
expect(client.instance.fileInfoSubscribe).toHaveBeenCalledTimes(1);
});
it('openFile makes the right requests', async () => {

@@ -74,2 +100,11 @@ client.openFile({

it('toggleBucketBackup makes the right requests', async () => {
client.toggleBucketBackup({
bucket: 'my-bucket',
backup: true,
});
expect(client.instance.toggleBucketBackup).toHaveBeenCalledTimes(1);
});
it('addItems makes the right requests', async () => {

@@ -94,49 +129,5 @@ client.addItems({

it('createUsernameAndEmail makes the right requests', async () => {
client.createUsernameAndEmail({
email: 'hi@fleek.co',
username: 'fleek',
});
expect(client.instance.createUsernameAndEmail).toHaveBeenCalledTimes(1);
});
it('getIdentityByUsername makes the right requests', async () => {
client.getIdentityByUsername({
username: 'fleek',
});
expect(client.instance.getIdentityByUsername).toHaveBeenCalledTimes(1);
});
it('shareBucketViaEmail makes the right requests', async () => {
client.shareBucketViaEmail({
email: 'hi@fleek.co',
bucket: 'my-bucket',
});
expect(client.instance.shareBucketViaEmail).toHaveBeenCalledTimes(1);
});
it('shareBucketViaIdentity makes the right requests', async () => {
client.shareBucketViaIdentity({
identityType: 0,
identityValue: 'fleek',
bucket: 'my-bucket',
});
expect(client.instance.shareBucketViaIdentity).toHaveBeenCalledTimes(1);
});
it('generateFileShareLink makes the right requests', async () => {
client.generateFileShareLink({
filepath: '/',
bucket: 'my-bucket',
});
expect(client.instance.generateFileShareLink).toHaveBeenCalledTimes(1);
});
it('backupKeysByPassphrase makes the right requests', async () => {
client.backupKeysByPassphrase({
uuid: '123',
passphrase: '123',

@@ -150,2 +141,3 @@ });

client.recoverKeysByPassphrase({
uuid: 'user-uuid',
passphrase: '123',

@@ -202,1 +194,123 @@ });

});
it('notificationSubscribe makes the right requests', async () => {
client.notificationSubscribe({});
expect(client.instance.notificationSubscribe).toHaveBeenCalledTimes(1);
});
it('getPublicKey makes the right requests', async () => {
client.getPublicKey({});
expect(client.instance.getPublicKey).toHaveBeenCalledTimes(1);
});
it('readNotification makes the right requests', async () => {
client.readNotification({
ID: '1234',
});
expect(client.instance.readNotification).toHaveBeenCalledTimes(1);
});
it('should call getNotifications', async () => {
client.getNotifications({ seek: 'value', limit: 10 });
expect(client.instance.getNotifications).toHaveBeenCalledTimes(1);
});
it('handleFilesInvitation makes the right request', async () => {
client.handleFilesInvitation({ invitationID: '123', accept: true });
expect(client.instance.handleFilesInvitation).toHaveBeenCalledTimes(1);
});
it('should call setNotificationsLastSeenAt', async () => {
client.setNotificationsLastSeenAt({ timestamp: 10 });
expect(client.instance.setNotificationsLastSeenAt).toHaveBeenCalledTimes(1);
});
it('should call deleteKeyPair', async () => {
client.deleteKeyPair();
expect(client.instance.deleteKeyPair).toHaveBeenCalledTimes(1);
});
it('should call deleteAccount', async () => {
client.deleteAccount();
expect(client.instance.deleteAccount).toHaveBeenCalledTimes(1);
});
it('getUsageInfo makes the right request', async () => {
client.getUsageInfo({});
expect(client.instance.getUsageInfo).toHaveBeenCalledTimes(1);
});
it('getStoredMnemonic makes the right request', async () => {
client.getStoredMnemonic();
expect(client.instance.getStoredMnemonic).toHaveBeenCalledTimes(1);
});
it('getSharedWithMeFiles makes the right request', async () => {
client.getSharedWithMeFiles({
limit: 10,
seek: 'seek',
});
expect(client.instance.getSharedWithMeFiles).toHaveBeenCalledTimes(1);
});
it('shareFilesViaPublicKey makes the right request', async () => {
client.shareFilesViaPublicKey({
publicKeys: ['pubkey1', 'pubkey2', 'pubkey3'],
paths: [{
path: 'path1/file.jpeg',
dbId: 'db-id-1',
bucket: 'my-bucket',
}],
});
expect(client.instance.shareFilesViaPublicKey).toHaveBeenCalledTimes(1);
});
it('getAPISessionTooken makes the right request', async () => {
client.getAPISessionTokens();
expect(client.instance.getAPISessionTokens).toHaveBeenCalledTimes(1);
});
it('getRecentlySharedWith makes the right request', async () => {
client.getRecentlySharedWith();
expect(client.instance.getRecentlySharedWith).toHaveBeenCalledTimes(1);
});
it('generatePublicFileLink makes the right request', async () => {
client.generatePublicFileLink({
dbId: 'db-id-string',
bucket: 'personal',
password: '123asd',
itemPaths: ['path/to/file1.txt', 'path/to/file2.txt'],
});
expect(client.instance.generatePublicFileLink).toHaveBeenCalledTimes(1);
});
it('testKeysPassphrase makes the right request', async () => {
client.testKeysPassphrase({
uuid: 'user-uuid',
passphrase: '123',
});
expect(client.instance.testKeysPassphrase).toHaveBeenCalledTimes(1);
});
it('generateKeyPairWithForce makes the right request', async () => {
client.generateKeyPairWithForce();
expect(client.instance.generateKeyPairWithForce).toHaveBeenCalledTimes(1);
});

@@ -10,7 +10,2 @@ import grpcWeb, { ClientReadableStream } from 'grpc-web';

CreateFolderPayload,
GetIdentityByUsernamePayload,
CreateUsernameAndEmailPayload,
ShareBucketViaEmailPayload,
ShareBucketViaIdentityPayload,
GenerateFileShareLinkPayload,
BackupKeysByPassphrasePayload,

@@ -22,4 +17,14 @@ RecoverKeysByPassphrasePayload,

ListDirectoryPayload,
ToggleBucketBackupPayload,
ShareBucketPayload,
JoinBucketPayload,
ReadNotificationPayload,
GetNotificationsPayload,
RestoreKeyPairViaMnemonicPayload,
GetSharedWithMeFilesPayload,
ShareFilesViaPublicKeyPayload,
GeneratePublicFileLinkPayload,
TestKeysPassphrasePayload,
SetNotificationsLastSeenAtPayload,
HandleFilesInvitationPayload,
} from './types';

@@ -31,2 +36,4 @@

ListDirectoriesResponse,
ToggleBucketBackupResponse,
ToggleBucketBackupRequest,
OpenFileRequest,

@@ -40,12 +47,2 @@ OpenFileResponse,

CreateFolderResponse,
GetIdentityByUsernameRequest,
GetIdentityByUsernameResponse,
CreateUsernameAndEmailRequest,
CreateUsernameAndEmailResponse,
ShareBucketViaEmailRequest,
ShareBucketViaEmailResponse,
ShareBucketViaIdentityRequest,
ShareBucketViaIdentityResponse,
GenerateFileShareLinkRequest,
GenerateFileShareLinkResponse,
BackupKeysByPassphraseRequest,

@@ -58,3 +55,3 @@ BackupKeysByPassphraseResponse,

FileEventResponse,
IdentityType,
FileInfoEventResponse,
ListBucketsRequest,

@@ -69,2 +66,38 @@ ListBucketsResponse,

ThreadInfo,
GetPublicKeyRequest,
GetPublicKeyResponse,
NotificationEventResponse,
ReadNotificationRequest,
ReadNotificationResponse,
GetNotificationsRequest,
GetNotificationsResponse,
HandleFilesInvitationResponse,
HandleFilesInvitationRequest,
DeleteKeyPairRequest,
DeleteKeyPairResponse,
DeleteAccountRequest,
DeleteAccountResponse,
GetUsageInfoRequest,
GetUsageInfoResponse,
GetStoredMnemonicRequest,
GetStoredMnemonicResponse,
RestoreKeyPairViaMnemonicRequest,
RestoreKeyPairViaMnemonicResponse,
GetSharedWithMeFilesRequest,
GetSharedWithMeFilesResponse,
ShareFilesViaPublicKeyRequest,
ShareFilesViaPublicKeyResponse,
GetAPISessionTokensRequest,
GetAPISessionTokensResponse,
GetRecentlySharedWithResponse,
GetRecentlySharedWithRequest,
GeneratePublicFileLinkRequest,
GeneratePublicFileLinkResponse,
TestKeysPassphraseRequest,
TestKeysPassphraseResponse,
SetNotificationsLastSeenAtRequest,
SetNotificationsLastSeenAtResponse,
GenerateKeyPairRequest,
GenerateKeyPairResponse,
FullPath,
} from './definitions/space_pb';

@@ -151,2 +184,36 @@

toggleBucketBackup(
payload: ToggleBucketBackupPayload,
metadata: grpcWeb.Metadata = {},
): Promise<ToggleBucketBackupResponse> {
return new Promise((resolve, reject) => {
const request = new ToggleBucketBackupRequest();
const { backup, bucket } = payload;
request.setBucket(bucket);
request.setBackup(backup);
this.instance.toggleBucketBackup(
request,
metadata,
(err: grpcWeb.Error, res: ToggleBucketBackupResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
fileInfoSubscribe(
metadata: grpcWeb.Metadata = {},
): grpcWeb.ClientReadableStream<FileInfoEventResponse> {
const request = new Empty();
return this.instance.fileInfoSubscribe(request, metadata);
}
txlSubscribe(

@@ -257,15 +324,15 @@ metadata: grpcWeb.Metadata = {},

createUsernameAndEmail(
payload: CreateUsernameAndEmailPayload,
backupKeysByPassphrase(
payload: BackupKeysByPassphrasePayload,
metadata: grpcWeb.Metadata = {},
): Promise<CreateUsernameAndEmailResponse> {
): Promise<BackupKeysByPassphraseResponse> {
return new Promise((resolve, reject) => {
const request = new CreateUsernameAndEmailRequest();
request.setEmail(payload.email || '');
request.setUsername(payload.username);
const request = new BackupKeysByPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
this.instance.createUsernameAndEmail(
this.instance.backupKeysByPassphrase(
request,
metadata,
(err: grpcWeb.Error, res: CreateUsernameAndEmailResponse) => {
(err: grpcWeb.Error, res: BackupKeysByPassphraseResponse) => {
if (err) {

@@ -282,14 +349,15 @@ reject(err);

getIdentityByUsername(
payload: GetIdentityByUsernamePayload,
recoverKeysByPassphrase(
payload: RecoverKeysByPassphrasePayload,
metadata: grpcWeb.Metadata = {},
): Promise<GetIdentityByUsernameResponse> {
): Promise<RecoverKeysByPassphraseResponse> {
return new Promise((resolve, reject) => {
const request = new GetIdentityByUsernameRequest();
request.setUsername(payload.username);
const request = new RecoverKeysByPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
this.instance.getIdentityByUsername(
this.instance.recoverKeysByPassphrase(
request,
metadata,
(err: grpcWeb.Error, res: GetIdentityByUsernameResponse) => {
(err: grpcWeb.Error, res: RecoverKeysByPassphraseResponse) => {
if (err) {

@@ -307,21 +375,18 @@ reject(err);

/**
* [WIP] shareBucketViaEmail
* [WIP] toggleFuseDrive
*
* Not supported by space daemon
*/
shareBucketViaEmail(
payload: ShareBucketViaEmailPayload,
toggleFuseDrive(
payload: ToggleFusePayload,
metadata: grpcWeb.Metadata = {},
): Promise<ShareBucketViaEmailResponse> {
): Promise<FuseDriveResponse> {
return new Promise((resolve, reject) => {
const request = new ShareBucketViaEmailRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
const request = new ToggleFuseRequest();
request.setMountdrive(payload.mountDrive);
request.setEmail(payload.email);
request.setBucket(bucket || this.defaultBucket);
this.instance.shareBucketViaEmail(
this.instance.toggleFuseDrive(
request,
metadata,
(err: grpcWeb.Error, res: ShareBucketViaEmailResponse) => {
(err: grpcWeb.Error, res: FuseDriveResponse) => {
if (err) {

@@ -338,18 +403,18 @@ reject(err);

shareBucketViaIdentity(
payload: ShareBucketViaIdentityPayload,
/**
* [WIP] getFuseDriveStatus
*
* Not supported by space daemon
*/
getFuseDriveStatus(
payload: GetFuseDriveStatusPayload,
metadata: grpcWeb.Metadata = {},
): Promise<ShareBucketViaIdentityResponse> {
): Promise<FuseDriveResponse> {
return new Promise((resolve, reject) => {
const request = new ShareBucketViaIdentityRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
const request = new Empty();
request.setIdentitytype(IdentityType[payload.identityType]);
request.setIdentityvalue(payload.identityValue);
request.setBucket(bucket || this.defaultBucket);
this.instance.shareBucketViaIdentity(
this.instance.getFuseDriveStatus(
request,
metadata,
(err: grpcWeb.Error, res: ShareBucketViaIdentityResponse) => {
(err: grpcWeb.Error, res: FuseDriveResponse) => {
if (err) {

@@ -366,22 +431,50 @@ reject(err);

subscribe(
metadata: grpcWeb.Metadata = {},
): grpcWeb.ClientReadableStream<FileEventResponse> {
const request = new Empty();
return this.instance.subscribe(request, metadata);
}
/**
* [WIP] generateFileShareLink
* [WIP] listBuckets
*
* Not supported by space daemon
*/
generateFileShareLink(
payload: GenerateFileShareLinkPayload,
listBuckets(
metadata: grpcWeb.Metadata = {},
): Promise<GenerateFileShareLinkResponse> {
): Promise<ListBucketsResponse> {
return new Promise((resolve, reject) => {
const request = new GenerateFileShareLinkRequest();
const request = new ListBucketsRequest();
this.instance.listBuckets(
request,
metadata,
(err: grpcWeb.Error, res: ListBucketsResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
shareBucket(
payload: ShareBucketPayload,
metadata: grpcWeb.Metadata = {},
): Promise<ShareBucketResponse> {
return new Promise((resolve, reject) => {
const request = new ShareBucketRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setFilepath(payload.filePath);
request.setBucket(bucket || this.defaultBucket);
this.instance.generateFileShareLink(
this.instance.shareBucket(
request,
metadata,
(err: grpcWeb.Error, res: GenerateFileShareLinkResponse) => {
(err: grpcWeb.Error, res: ShareBucketResponse) => {
if (err) {

@@ -398,19 +491,21 @@ reject(err);

/**
* [WIP] backupKeysByPassphrase
*
* Not supported by space daemon
*/
backupKeysByPassphrase(
payload: BackupKeysByPassphrasePayload,
joinBucket(
payload: JoinBucketPayload,
metadata: grpcWeb.Metadata = {},
): Promise<BackupKeysByPassphraseResponse> {
): Promise<JoinBucketResponse> {
return new Promise((resolve, reject) => {
const request = new BackupKeysByPassphraseRequest();
request.setPassphrase(payload.passphrase);
const threadInfo = new ThreadInfo();
threadInfo.setKey(payload.threadInfo.key);
threadInfo.setAddressesList(payload.threadInfo.addresses);
this.instance.backupKeysByPassphrase(
const request = new JoinBucketRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setThreadinfo(threadInfo);
request.setBucket(bucket || this.defaultBucket);
this.instance.joinBucket(
request,
metadata,
(err: grpcWeb.Error, res: BackupKeysByPassphraseResponse) => {
(err: grpcWeb.Error, res: JoinBucketResponse) => {
if (err) {

@@ -427,19 +522,14 @@ reject(err);

/**
* [WIP] recoverKeysByPassphrase
*
* Not supported by space daemon
*/
recoverKeysByPassphrase(
payload: RecoverKeysByPassphrasePayload,
setNotificationsLastSeenAt(
payload: SetNotificationsLastSeenAtPayload,
metadata: grpcWeb.Metadata = {},
): Promise<RecoverKeysByPassphraseResponse> {
): Promise<SetNotificationsLastSeenAtResponse> {
return new Promise((resolve, reject) => {
const request = new RecoverKeysByPassphraseRequest();
request.setPassphrase(payload.passphrase);
const request = new SetNotificationsLastSeenAtRequest();
request.setTimestamp(payload.timestamp);
this.instance.recoverKeysByPassphrase(
this.instance.setNotificationsLastSeenAt(
request,
metadata,
(err: grpcWeb.Error, res: RecoverKeysByPassphraseResponse) => {
(err, res) => {
if (err) {

@@ -456,19 +546,15 @@ reject(err);

/**
* [WIP] toggleFuseDrive
*
* Not supported by space daemon
*/
toggleFuseDrive(
payload: ToggleFusePayload,
getNotifications(
payload: GetNotificationsPayload,
metadata: grpcWeb.Metadata = {},
): Promise<FuseDriveResponse> {
): Promise<GetNotificationsResponse> {
return new Promise((resolve, reject) => {
const request = new ToggleFuseRequest();
request.setMountdrive(payload.mountDrive);
const request = new GetNotificationsRequest();
request.setSeek(payload.seek);
request.setLimit(payload.limit);
this.instance.toggleFuseDrive(
this.instance.getNotifications(
request,
metadata,
(err: grpcWeb.Error, res: FuseDriveResponse) => {
(err, res) => {
if (err) {

@@ -485,18 +571,15 @@ reject(err);

/**
* [WIP] getFuseDriveStatus
*
* Not supported by space daemon
*/
getFuseDriveStatus(
payload: GetFuseDriveStatusPayload,
handleFilesInvitation(
payload: HandleFilesInvitationPayload,
metadata: grpcWeb.Metadata = {},
): Promise<FuseDriveResponse> {
): Promise<HandleFilesInvitationResponse> {
return new Promise((resolve, reject) => {
const request = new Empty();
const request = new HandleFilesInvitationRequest();
request.setInvitationid(payload.invitationID);
request.setAccept(payload.accept);
this.instance.getFuseDriveStatus(
this.instance.handleFilesInvitation(
request,
metadata,
(err: grpcWeb.Error, res: FuseDriveResponse) => {
(err, res) => {
if (err) {

@@ -513,25 +596,43 @@ reject(err);

subscribe(
getPublicKey(
metadata: grpcWeb.Metadata = {},
): grpcWeb.ClientReadableStream<FileEventResponse> {
): Promise<GetPublicKeyResponse> {
return new Promise((resolve, reject) => {
const request = new GetPublicKeyRequest();
this.instance.getPublicKey(
request,
metadata,
(err: grpcWeb.Error, res: GetPublicKeyResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
notificationSubscribe(
metadata: grpcWeb.Metadata = {},
): grpcWeb.ClientReadableStream<NotificationEventResponse> {
const request = new Empty();
return this.instance.subscribe(request, metadata);
return this.instance.notificationSubscribe(request, metadata);
}
/**
* [WIP] listBuckets
*
* Not supported by space daemon
*/
listBuckets(
readNotification(
payload: ReadNotificationPayload,
metadata: grpcWeb.Metadata = {},
): Promise<ListBucketsResponse> {
): Promise<ReadNotificationResponse> {
return new Promise((resolve, reject) => {
const request = new ListBucketsRequest();
const request = new ReadNotificationRequest();
request.setId(payload.ID);
this.instance.listBuckets(
this.instance.readNotification(
request,
metadata,
(err: grpcWeb.Error, res: ListBucketsResponse) => {
(err: grpcWeb.Error, res: ReadNotificationResponse) => {
if (err) {

@@ -548,16 +649,33 @@ reject(err);

shareBucket(
payload: ShareBucketPayload,
deleteAccount(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
payload = null,
metadata: grpcWeb.Metadata = {},
): Promise<ShareBucketResponse> {
): Promise<ReadNotificationResponse> {
return new Promise((resolve, reject) => {
const request = new ShareBucketRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
const request = new DeleteAccountRequest();
request.setBucket(bucket || this.defaultBucket);
this.instance.deleteAccount(
request,
metadata,
(err: grpcWeb.Error, res: DeleteAccountResponse) => {
if (err) {
reject(err);
return;
}
this.instance.shareBucket(
resolve(res);
},
);
});
}
deleteKeyPair(metadata: grpcWeb.Metadata = {}): Promise<DeleteKeyPairResponse> {
return new Promise((resolve, reject) => {
const request = new DeleteKeyPairRequest();
this.instance.deleteKeyPair(
request,
metadata,
(err: grpcWeb.Error, res: ShareBucketResponse) => {
(err: grpcWeb.Error, res: DeleteKeyPairResponse) => {
if (err) {

@@ -574,21 +692,192 @@ reject(err);

joinBucket(
payload: JoinBucketPayload,
getUsageInfo(
metadata: grpcWeb.Metadata = {},
): Promise<JoinBucketResponse> {
): Promise<GetUsageInfoResponse> {
return new Promise((resolve, reject) => {
const threadInfo = new ThreadInfo();
threadInfo.setKey(payload.threadInfo.key);
threadInfo.setAddressesList(payload.threadInfo.addresses);
const request = new GetUsageInfoRequest();
const request = new JoinBucketRequest();
this.instance.getUsageInfo(
request,
metadata,
(err: grpcWeb.Error, res: GetUsageInfoResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
getStoredMnemonic(
metadata: grpcWeb.Metadata = {},
): Promise<GetStoredMnemonicResponse> {
return new Promise((resolve, reject) => {
const request = new GetStoredMnemonicRequest();
this.instance.getStoredMnemonic(
request,
metadata,
(err: grpcWeb.Error, res: GetStoredMnemonicResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
restoreKeyPairViaMnemonic(
payload: RestoreKeyPairViaMnemonicPayload,
metadata: grpcWeb.Metadata = {},
): Promise<RestoreKeyPairViaMnemonicResponse> {
return new Promise((resolve, reject) => {
const request = new RestoreKeyPairViaMnemonicRequest();
request.setMnemonic(payload.mnemonic);
this.instance.restoreKeyPairViaMnemonic(
request,
metadata,
(err: grpcWeb.Error, res: RestoreKeyPairViaMnemonicResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
getSharedWithMeFiles(
payload: GetSharedWithMeFilesPayload,
metadata: grpcWeb.Metadata = {},
): Promise<GetSharedWithMeFilesResponse> {
return new Promise((resolve, reject) => {
const request = new GetSharedWithMeFilesRequest();
request.setSeek(payload.seek);
request.setLimit(payload.limit);
this.instance.getSharedWithMeFiles(
request,
metadata,
(err: grpcWeb.Error, res: GetSharedWithMeFilesResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
shareFilesViaPublicKey(
payload: ShareFilesViaPublicKeyPayload,
metadata: grpcWeb.Metadata = {},
): Promise<ShareFilesViaPublicKeyResponse> {
return new Promise((resolve, reject) => {
const request = new ShareFilesViaPublicKeyRequest();
const paths = payload.paths.map((path) => {
const fullPath = new FullPath();
const bucket = path.bucket === '' ? null : path.bucket;
fullPath.setBucket(bucket || this.defaultBucket);
fullPath.setPath(path.path);
if (path.dbId) {
fullPath.setDbid(path.dbId);
}
return fullPath;
});
request.setPathsList(paths);
request.setPublickeysList(payload.publicKeys);
this.instance.shareFilesViaPublicKey(
request,
metadata,
(err: grpcWeb.Error, res: ShareFilesViaPublicKeyResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
getAPISessionTokens(
metadata: grpcWeb.Metadata = {},
): Promise<GetAPISessionTokensResponse> {
return new Promise((resolve, reject) => {
const request = new GetAPISessionTokensRequest();
this.instance.getAPISessionTokens(
request,
metadata,
(err: grpcWeb.Error, res: GetAPISessionTokensResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
getRecentlySharedWith(
metadata: grpcWeb.Metadata = {},
): Promise<GetRecentlySharedWithResponse> {
return new Promise((resolve, reject) => {
const request = new GetRecentlySharedWithRequest();
this.instance.getRecentlySharedWith(
request,
metadata,
(err: grpcWeb.Error, res: GetRecentlySharedWithResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
generatePublicFileLink(
payload: GeneratePublicFileLinkPayload,
metadata: grpcWeb.Metadata = {},
): Promise<GeneratePublicFileLinkResponse> {
return new Promise((resolve, reject) => {
const request = new GeneratePublicFileLinkRequest();
const bucket = payload.bucket === '' ? null : payload.bucket;
request.setThreadinfo(threadInfo);
const itemPaths = payload.itemPaths.map((path) => path.replace(/^\//, ''));
request.setDbid(payload.dbId);
request.setPassword(payload.password);
request.setItempathsList(itemPaths);
request.setBucket(bucket || this.defaultBucket);
this.instance.joinBucket(
this.instance.generatePublicFileLink(
request,
metadata,
(err: grpcWeb.Error, res: JoinBucketResponse) => {
(err: grpcWeb.Error, res: GeneratePublicFileLinkResponse) => {
if (err) {

@@ -604,4 +893,49 @@ reject(err);

}
testKeysPassphrase(
payload: TestKeysPassphrasePayload,
metadata: grpcWeb.Metadata = {},
): Promise<TestKeysPassphraseResponse> {
return new Promise((resolve, reject) => {
const request = new TestKeysPassphraseRequest();
request.setUuid(payload.uuid);
request.setPassphrase(payload.passphrase);
this.instance.testKeysPassphrase(
request,
metadata,
(err: grpcWeb.Error, res: TestKeysPassphraseResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
generateKeyPairWithForce(
metadata: grpcWeb.Metadata = {},
): Promise<GenerateKeyPairResponse> {
return new Promise((resolve, reject) => {
const request = new GenerateKeyPairRequest();
this.instance.generateKeyPairWithForce(
request,
metadata,
(err: grpcWeb.Error, res: GenerateKeyPairResponse) => {
if (err) {
reject(err);
return;
}
resolve(res);
},
);
});
}
}
export default SpaceClient;

@@ -23,3 +23,2 @@ /**

BackupKeysByPassphraseResponse,
ConfigInfoResponse,
CreateBucketRequest,

@@ -29,12 +28,31 @@ CreateBucketResponse,

CreateFolderResponse,
CreateUsernameAndEmailRequest,
CreateUsernameAndEmailResponse,
CreateLocalKeysBackupRequest,
CreateLocalKeysBackupResponse,
DeleteAccountRequest,
DeleteAccountResponse,
DeleteKeyPairRequest,
DeleteKeyPairResponse,
FileEventResponse,
FileInfoEventResponse,
FuseDriveResponse,
GenerateFileShareLinkRequest,
GenerateFileShareLinkResponse,
GenerateKeyPairRequest,
GenerateKeyPairResponse,
GetIdentityByUsernameRequest,
GetIdentityByUsernameResponse,
GeneratePublicFileLinkRequest,
GeneratePublicFileLinkResponse,
GetAPISessionTokensRequest,
GetAPISessionTokensResponse,
GetNotificationsRequest,
GetNotificationsResponse,
GetPublicKeyRequest,
GetPublicKeyResponse,
GetRecentlySharedWithRequest,
GetRecentlySharedWithResponse,
GetSharedWithMeFilesRequest,
GetSharedWithMeFilesResponse,
GetStoredMnemonicRequest,
GetStoredMnemonicResponse,
GetUsageInfoRequest,
GetUsageInfoResponse,
HandleFilesInvitationRequest,
HandleFilesInvitationResponse,
JoinBucketRequest,

@@ -48,13 +66,26 @@ JoinBucketResponse,

ListDirectoryResponse,
NotificationEventResponse,
OpenFileRequest,
OpenFileResponse,
OpenPublicFileRequest,
OpenPublicFileResponse,
ReadNotificationRequest,
ReadNotificationResponse,
RecoverKeysByLocalBackupRequest,
RecoverKeysByLocalBackupResponse,
RecoverKeysByPassphraseRequest,
RecoverKeysByPassphraseResponse,
RestoreKeyPairViaMnemonicRequest,
RestoreKeyPairViaMnemonicResponse,
SetNotificationsLastSeenAtRequest,
SetNotificationsLastSeenAtResponse,
ShareBucketRequest,
ShareBucketResponse,
ShareBucketViaEmailRequest,
ShareBucketViaEmailResponse,
ShareBucketViaIdentityRequest,
ShareBucketViaIdentityResponse,
ShareFilesViaPublicKeyRequest,
ShareFilesViaPublicKeyResponse,
TestKeysPassphraseRequest,
TestKeysPassphraseResponse,
TextileEventResponse,
ToggleBucketBackupRequest,
ToggleBucketBackupResponse,
ToggleFuseRequest} from './space_pb';

@@ -159,31 +190,31 @@

methodInfoGetConfigInfo = new grpcWeb.AbstractClientBase.MethodInfo(
ConfigInfoResponse,
(request: google_protobuf_empty_pb.Empty) => {
methodInfoGenerateKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(
GenerateKeyPairResponse,
(request: GenerateKeyPairRequest) => {
return request.serializeBinary();
},
ConfigInfoResponse.deserializeBinary
GenerateKeyPairResponse.deserializeBinary
);
getConfigInfo(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | null): Promise<ConfigInfoResponse>;
generateKeyPair(
request: GenerateKeyPairRequest,
metadata: grpcWeb.Metadata | null): Promise<GenerateKeyPairResponse>;
getConfigInfo(
request: google_protobuf_empty_pb.Empty,
generateKeyPair(
request: GenerateKeyPairRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: ConfigInfoResponse) => void): grpcWeb.ClientReadableStream<ConfigInfoResponse>;
response: GenerateKeyPairResponse) => void): grpcWeb.ClientReadableStream<GenerateKeyPairResponse>;
getConfigInfo(
request: google_protobuf_empty_pb.Empty,
generateKeyPair(
request: GenerateKeyPairRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: ConfigInfoResponse) => void) {
response: GenerateKeyPairResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetConfigInfo', this.hostname_).toString(),
new URL('/space.SpaceApi/GenerateKeyPair', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetConfigInfo,
this.methodInfoGenerateKeyPair,
callback);

@@ -193,37 +224,37 @@ }

this.hostname_ +
'/space.SpaceApi/GetConfigInfo',
'/space.SpaceApi/GenerateKeyPair',
request,
metadata || {},
this.methodInfoGetConfigInfo);
this.methodInfoGenerateKeyPair);
}
methodInfoGenerateKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(
GenerateKeyPairResponse,
(request: GenerateKeyPairRequest) => {
methodInfoGetStoredMnemonic = new grpcWeb.AbstractClientBase.MethodInfo(
GetStoredMnemonicResponse,
(request: GetStoredMnemonicRequest) => {
return request.serializeBinary();
},
GenerateKeyPairResponse.deserializeBinary
GetStoredMnemonicResponse.deserializeBinary
);
generateKeyPair(
request: GenerateKeyPairRequest,
metadata: grpcWeb.Metadata | null): Promise<GenerateKeyPairResponse>;
getStoredMnemonic(
request: GetStoredMnemonicRequest,
metadata: grpcWeb.Metadata | null): Promise<GetStoredMnemonicResponse>;
generateKeyPair(
request: GenerateKeyPairRequest,
getStoredMnemonic(
request: GetStoredMnemonicRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GenerateKeyPairResponse) => void): grpcWeb.ClientReadableStream<GenerateKeyPairResponse>;
response: GetStoredMnemonicResponse) => void): grpcWeb.ClientReadableStream<GetStoredMnemonicResponse>;
generateKeyPair(
request: GenerateKeyPairRequest,
getStoredMnemonic(
request: GetStoredMnemonicRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GenerateKeyPairResponse) => void) {
response: GetStoredMnemonicResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GenerateKeyPair', this.hostname_).toString(),
new URL('/space.SpaceApi/GetStoredMnemonic', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGenerateKeyPair,
this.methodInfoGetStoredMnemonic,
callback);

@@ -233,8 +264,86 @@ }

this.hostname_ +
'/space.SpaceApi/GenerateKeyPair',
'/space.SpaceApi/GetStoredMnemonic',
request,
metadata || {},
this.methodInfoGenerateKeyPair);
this.methodInfoGetStoredMnemonic);
}
methodInfoRestoreKeyPairViaMnemonic = new grpcWeb.AbstractClientBase.MethodInfo(
RestoreKeyPairViaMnemonicResponse,
(request: RestoreKeyPairViaMnemonicRequest) => {
return request.serializeBinary();
},
RestoreKeyPairViaMnemonicResponse.deserializeBinary
);
restoreKeyPairViaMnemonic(
request: RestoreKeyPairViaMnemonicRequest,
metadata: grpcWeb.Metadata | null): Promise<RestoreKeyPairViaMnemonicResponse>;
restoreKeyPairViaMnemonic(
request: RestoreKeyPairViaMnemonicRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: RestoreKeyPairViaMnemonicResponse) => void): grpcWeb.ClientReadableStream<RestoreKeyPairViaMnemonicResponse>;
restoreKeyPairViaMnemonic(
request: RestoreKeyPairViaMnemonicRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: RestoreKeyPairViaMnemonicResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/RestoreKeyPairViaMnemonic', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoRestoreKeyPairViaMnemonic,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/RestoreKeyPairViaMnemonic',
request,
metadata || {},
this.methodInfoRestoreKeyPairViaMnemonic);
}
methodInfoDeleteKeyPair = new grpcWeb.AbstractClientBase.MethodInfo(
DeleteKeyPairResponse,
(request: DeleteKeyPairRequest) => {
return request.serializeBinary();
},
DeleteKeyPairResponse.deserializeBinary
);
deleteKeyPair(
request: DeleteKeyPairRequest,
metadata: grpcWeb.Metadata | null): Promise<DeleteKeyPairResponse>;
deleteKeyPair(
request: DeleteKeyPairRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: DeleteKeyPairResponse) => void): grpcWeb.ClientReadableStream<DeleteKeyPairResponse>;
deleteKeyPair(
request: DeleteKeyPairRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: DeleteKeyPairResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/DeleteKeyPair', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoDeleteKeyPair,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/DeleteKeyPair',
request,
metadata || {},
this.methodInfoDeleteKeyPair);
}
methodInfoGenerateKeyPairWithForce = new grpcWeb.AbstractClientBase.MethodInfo(

@@ -279,2 +388,41 @@ GenerateKeyPairResponse,

methodInfoGetPublicKey = new grpcWeb.AbstractClientBase.MethodInfo(
GetPublicKeyResponse,
(request: GetPublicKeyRequest) => {
return request.serializeBinary();
},
GetPublicKeyResponse.deserializeBinary
);
getPublicKey(
request: GetPublicKeyRequest,
metadata: grpcWeb.Metadata | null): Promise<GetPublicKeyResponse>;
getPublicKey(
request: GetPublicKeyRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetPublicKeyResponse) => void): grpcWeb.ClientReadableStream<GetPublicKeyResponse>;
getPublicKey(
request: GetPublicKeyRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetPublicKeyResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetPublicKey', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetPublicKey,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GetPublicKey',
request,
metadata || {},
this.methodInfoGetPublicKey);
}
methodInfoSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(

@@ -298,2 +446,20 @@ FileEventResponse,

methodInfoFileInfoSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(
FileInfoEventResponse,
(request: google_protobuf_empty_pb.Empty) => {
return request.serializeBinary();
},
FileInfoEventResponse.deserializeBinary
);
fileInfoSubscribe(
request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata) {
return this.client_.serverStreaming(
new URL('/space.SpaceApi/FileInfoSubscribe', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoFileInfoSubscribe);
}
methodInfoTxlSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(

@@ -356,2 +522,119 @@ TextileEventResponse,

methodInfoGeneratePublicFileLink = new grpcWeb.AbstractClientBase.MethodInfo(
GeneratePublicFileLinkResponse,
(request: GeneratePublicFileLinkRequest) => {
return request.serializeBinary();
},
GeneratePublicFileLinkResponse.deserializeBinary
);
generatePublicFileLink(
request: GeneratePublicFileLinkRequest,
metadata: grpcWeb.Metadata | null): Promise<GeneratePublicFileLinkResponse>;
generatePublicFileLink(
request: GeneratePublicFileLinkRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GeneratePublicFileLinkResponse) => void): grpcWeb.ClientReadableStream<GeneratePublicFileLinkResponse>;
generatePublicFileLink(
request: GeneratePublicFileLinkRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GeneratePublicFileLinkResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GeneratePublicFileLink', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGeneratePublicFileLink,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GeneratePublicFileLink',
request,
metadata || {},
this.methodInfoGeneratePublicFileLink);
}
methodInfoGetSharedWithMeFiles = new grpcWeb.AbstractClientBase.MethodInfo(
GetSharedWithMeFilesResponse,
(request: GetSharedWithMeFilesRequest) => {
return request.serializeBinary();
},
GetSharedWithMeFilesResponse.deserializeBinary
);
getSharedWithMeFiles(
request: GetSharedWithMeFilesRequest,
metadata: grpcWeb.Metadata | null): Promise<GetSharedWithMeFilesResponse>;
getSharedWithMeFiles(
request: GetSharedWithMeFilesRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetSharedWithMeFilesResponse) => void): grpcWeb.ClientReadableStream<GetSharedWithMeFilesResponse>;
getSharedWithMeFiles(
request: GetSharedWithMeFilesRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetSharedWithMeFilesResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetSharedWithMeFiles', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetSharedWithMeFiles,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GetSharedWithMeFiles',
request,
metadata || {},
this.methodInfoGetSharedWithMeFiles);
}
methodInfoOpenPublicFile = new grpcWeb.AbstractClientBase.MethodInfo(
OpenPublicFileResponse,
(request: OpenPublicFileRequest) => {
return request.serializeBinary();
},
OpenPublicFileResponse.deserializeBinary
);
openPublicFile(
request: OpenPublicFileRequest,
metadata: grpcWeb.Metadata | null): Promise<OpenPublicFileResponse>;
openPublicFile(
request: OpenPublicFileRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: OpenPublicFileResponse) => void): grpcWeb.ClientReadableStream<OpenPublicFileResponse>;
openPublicFile(
request: OpenPublicFileRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: OpenPublicFileResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/OpenPublicFile', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoOpenPublicFile,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/OpenPublicFile',
request,
metadata || {},
this.methodInfoOpenPublicFile);
}
methodInfoAddItems = new grpcWeb.AbstractClientBase.MethodInfo(

@@ -531,31 +814,31 @@ AddItemsResponse,

methodInfoGetIdentityByUsername = new grpcWeb.AbstractClientBase.MethodInfo(
GetIdentityByUsernameResponse,
(request: GetIdentityByUsernameRequest) => {
methodInfoBackupKeysByPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(
BackupKeysByPassphraseResponse,
(request: BackupKeysByPassphraseRequest) => {
return request.serializeBinary();
},
GetIdentityByUsernameResponse.deserializeBinary
BackupKeysByPassphraseResponse.deserializeBinary
);
getIdentityByUsername(
request: GetIdentityByUsernameRequest,
metadata: grpcWeb.Metadata | null): Promise<GetIdentityByUsernameResponse>;
backupKeysByPassphrase(
request: BackupKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null): Promise<BackupKeysByPassphraseResponse>;
getIdentityByUsername(
request: GetIdentityByUsernameRequest,
backupKeysByPassphrase(
request: BackupKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetIdentityByUsernameResponse) => void): grpcWeb.ClientReadableStream<GetIdentityByUsernameResponse>;
response: BackupKeysByPassphraseResponse) => void): grpcWeb.ClientReadableStream<BackupKeysByPassphraseResponse>;
getIdentityByUsername(
request: GetIdentityByUsernameRequest,
backupKeysByPassphrase(
request: BackupKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetIdentityByUsernameResponse) => void) {
response: BackupKeysByPassphraseResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetIdentityByUsername', this.hostname_).toString(),
new URL('/space.SpaceApi/BackupKeysByPassphrase', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetIdentityByUsername,
this.methodInfoBackupKeysByPassphrase,
callback);

@@ -565,37 +848,37 @@ }

this.hostname_ +
'/space.SpaceApi/GetIdentityByUsername',
'/space.SpaceApi/BackupKeysByPassphrase',
request,
metadata || {},
this.methodInfoGetIdentityByUsername);
this.methodInfoBackupKeysByPassphrase);
}
methodInfoCreateUsernameAndEmail = new grpcWeb.AbstractClientBase.MethodInfo(
CreateUsernameAndEmailResponse,
(request: CreateUsernameAndEmailRequest) => {
methodInfoRecoverKeysByPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(
RecoverKeysByPassphraseResponse,
(request: RecoverKeysByPassphraseRequest) => {
return request.serializeBinary();
},
CreateUsernameAndEmailResponse.deserializeBinary
RecoverKeysByPassphraseResponse.deserializeBinary
);
createUsernameAndEmail(
request: CreateUsernameAndEmailRequest,
metadata: grpcWeb.Metadata | null): Promise<CreateUsernameAndEmailResponse>;
recoverKeysByPassphrase(
request: RecoverKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null): Promise<RecoverKeysByPassphraseResponse>;
createUsernameAndEmail(
request: CreateUsernameAndEmailRequest,
recoverKeysByPassphrase(
request: RecoverKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: CreateUsernameAndEmailResponse) => void): grpcWeb.ClientReadableStream<CreateUsernameAndEmailResponse>;
response: RecoverKeysByPassphraseResponse) => void): grpcWeb.ClientReadableStream<RecoverKeysByPassphraseResponse>;
createUsernameAndEmail(
request: CreateUsernameAndEmailRequest,
recoverKeysByPassphrase(
request: RecoverKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: CreateUsernameAndEmailResponse) => void) {
response: RecoverKeysByPassphraseResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/CreateUsernameAndEmail', this.hostname_).toString(),
new URL('/space.SpaceApi/RecoverKeysByPassphrase', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoCreateUsernameAndEmail,
this.methodInfoRecoverKeysByPassphrase,
callback);

@@ -605,37 +888,37 @@ }

this.hostname_ +
'/space.SpaceApi/CreateUsernameAndEmail',
'/space.SpaceApi/RecoverKeysByPassphrase',
request,
metadata || {},
this.methodInfoCreateUsernameAndEmail);
this.methodInfoRecoverKeysByPassphrase);
}
methodInfoBackupKeysByPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(
BackupKeysByPassphraseResponse,
(request: BackupKeysByPassphraseRequest) => {
methodInfoTestKeysPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(
TestKeysPassphraseResponse,
(request: TestKeysPassphraseRequest) => {
return request.serializeBinary();
},
BackupKeysByPassphraseResponse.deserializeBinary
TestKeysPassphraseResponse.deserializeBinary
);
backupKeysByPassphrase(
request: BackupKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null): Promise<BackupKeysByPassphraseResponse>;
testKeysPassphrase(
request: TestKeysPassphraseRequest,
metadata: grpcWeb.Metadata | null): Promise<TestKeysPassphraseResponse>;
backupKeysByPassphrase(
request: BackupKeysByPassphraseRequest,
testKeysPassphrase(
request: TestKeysPassphraseRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: BackupKeysByPassphraseResponse) => void): grpcWeb.ClientReadableStream<BackupKeysByPassphraseResponse>;
response: TestKeysPassphraseResponse) => void): grpcWeb.ClientReadableStream<TestKeysPassphraseResponse>;
backupKeysByPassphrase(
request: BackupKeysByPassphraseRequest,
testKeysPassphrase(
request: TestKeysPassphraseRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: BackupKeysByPassphraseResponse) => void) {
response: TestKeysPassphraseResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/BackupKeysByPassphrase', this.hostname_).toString(),
new URL('/space.SpaceApi/TestKeysPassphrase', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoBackupKeysByPassphrase,
this.methodInfoTestKeysPassphrase,
callback);

@@ -645,37 +928,37 @@ }

this.hostname_ +
'/space.SpaceApi/BackupKeysByPassphrase',
'/space.SpaceApi/TestKeysPassphrase',
request,
metadata || {},
this.methodInfoBackupKeysByPassphrase);
this.methodInfoTestKeysPassphrase);
}
methodInfoRecoverKeysByPassphrase = new grpcWeb.AbstractClientBase.MethodInfo(
RecoverKeysByPassphraseResponse,
(request: RecoverKeysByPassphraseRequest) => {
methodInfoCreateLocalKeysBackup = new grpcWeb.AbstractClientBase.MethodInfo(
CreateLocalKeysBackupResponse,
(request: CreateLocalKeysBackupRequest) => {
return request.serializeBinary();
},
RecoverKeysByPassphraseResponse.deserializeBinary
CreateLocalKeysBackupResponse.deserializeBinary
);
recoverKeysByPassphrase(
request: RecoverKeysByPassphraseRequest,
metadata: grpcWeb.Metadata | null): Promise<RecoverKeysByPassphraseResponse>;
createLocalKeysBackup(
request: CreateLocalKeysBackupRequest,
metadata: grpcWeb.Metadata | null): Promise<CreateLocalKeysBackupResponse>;
recoverKeysByPassphrase(
request: RecoverKeysByPassphraseRequest,
createLocalKeysBackup(
request: CreateLocalKeysBackupRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: RecoverKeysByPassphraseResponse) => void): grpcWeb.ClientReadableStream<RecoverKeysByPassphraseResponse>;
response: CreateLocalKeysBackupResponse) => void): grpcWeb.ClientReadableStream<CreateLocalKeysBackupResponse>;
recoverKeysByPassphrase(
request: RecoverKeysByPassphraseRequest,
createLocalKeysBackup(
request: CreateLocalKeysBackupRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: RecoverKeysByPassphraseResponse) => void) {
response: CreateLocalKeysBackupResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/RecoverKeysByPassphrase', this.hostname_).toString(),
new URL('/space.SpaceApi/CreateLocalKeysBackup', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoRecoverKeysByPassphrase,
this.methodInfoCreateLocalKeysBackup,
callback);

@@ -685,8 +968,47 @@ }

this.hostname_ +
'/space.SpaceApi/RecoverKeysByPassphrase',
'/space.SpaceApi/CreateLocalKeysBackup',
request,
metadata || {},
this.methodInfoRecoverKeysByPassphrase);
this.methodInfoCreateLocalKeysBackup);
}
methodInfoRecoverKeysByLocalBackup = new grpcWeb.AbstractClientBase.MethodInfo(
RecoverKeysByLocalBackupResponse,
(request: RecoverKeysByLocalBackupRequest) => {
return request.serializeBinary();
},
RecoverKeysByLocalBackupResponse.deserializeBinary
);
recoverKeysByLocalBackup(
request: RecoverKeysByLocalBackupRequest,
metadata: grpcWeb.Metadata | null): Promise<RecoverKeysByLocalBackupResponse>;
recoverKeysByLocalBackup(
request: RecoverKeysByLocalBackupRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: RecoverKeysByLocalBackupResponse) => void): grpcWeb.ClientReadableStream<RecoverKeysByLocalBackupResponse>;
recoverKeysByLocalBackup(
request: RecoverKeysByLocalBackupRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: RecoverKeysByLocalBackupResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/RecoverKeysByLocalBackup', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoRecoverKeysByLocalBackup,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/RecoverKeysByLocalBackup',
request,
metadata || {},
this.methodInfoRecoverKeysByLocalBackup);
}
methodInfoShareBucket = new grpcWeb.AbstractClientBase.MethodInfo(

@@ -770,31 +1092,31 @@ ShareBucketResponse,

methodInfoShareBucketViaEmail = new grpcWeb.AbstractClientBase.MethodInfo(
ShareBucketViaEmailResponse,
(request: ShareBucketViaEmailRequest) => {
methodInfoShareFilesViaPublicKey = new grpcWeb.AbstractClientBase.MethodInfo(
ShareFilesViaPublicKeyResponse,
(request: ShareFilesViaPublicKeyRequest) => {
return request.serializeBinary();
},
ShareBucketViaEmailResponse.deserializeBinary
ShareFilesViaPublicKeyResponse.deserializeBinary
);
shareBucketViaEmail(
request: ShareBucketViaEmailRequest,
metadata: grpcWeb.Metadata | null): Promise<ShareBucketViaEmailResponse>;
shareFilesViaPublicKey(
request: ShareFilesViaPublicKeyRequest,
metadata: grpcWeb.Metadata | null): Promise<ShareFilesViaPublicKeyResponse>;
shareBucketViaEmail(
request: ShareBucketViaEmailRequest,
shareFilesViaPublicKey(
request: ShareFilesViaPublicKeyRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: ShareBucketViaEmailResponse) => void): grpcWeb.ClientReadableStream<ShareBucketViaEmailResponse>;
response: ShareFilesViaPublicKeyResponse) => void): grpcWeb.ClientReadableStream<ShareFilesViaPublicKeyResponse>;
shareBucketViaEmail(
request: ShareBucketViaEmailRequest,
shareFilesViaPublicKey(
request: ShareFilesViaPublicKeyRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: ShareBucketViaEmailResponse) => void) {
response: ShareFilesViaPublicKeyResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/ShareBucketViaEmail', this.hostname_).toString(),
new URL('/space.SpaceApi/ShareFilesViaPublicKey', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoShareBucketViaEmail,
this.methodInfoShareFilesViaPublicKey,
callback);

@@ -804,37 +1126,37 @@ }

this.hostname_ +
'/space.SpaceApi/ShareBucketViaEmail',
'/space.SpaceApi/ShareFilesViaPublicKey',
request,
metadata || {},
this.methodInfoShareBucketViaEmail);
this.methodInfoShareFilesViaPublicKey);
}
methodInfoShareBucketViaIdentity = new grpcWeb.AbstractClientBase.MethodInfo(
ShareBucketViaIdentityResponse,
(request: ShareBucketViaIdentityRequest) => {
methodInfoHandleFilesInvitation = new grpcWeb.AbstractClientBase.MethodInfo(
HandleFilesInvitationResponse,
(request: HandleFilesInvitationRequest) => {
return request.serializeBinary();
},
ShareBucketViaIdentityResponse.deserializeBinary
HandleFilesInvitationResponse.deserializeBinary
);
shareBucketViaIdentity(
request: ShareBucketViaIdentityRequest,
metadata: grpcWeb.Metadata | null): Promise<ShareBucketViaIdentityResponse>;
handleFilesInvitation(
request: HandleFilesInvitationRequest,
metadata: grpcWeb.Metadata | null): Promise<HandleFilesInvitationResponse>;
shareBucketViaIdentity(
request: ShareBucketViaIdentityRequest,
handleFilesInvitation(
request: HandleFilesInvitationRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: ShareBucketViaIdentityResponse) => void): grpcWeb.ClientReadableStream<ShareBucketViaIdentityResponse>;
response: HandleFilesInvitationResponse) => void): grpcWeb.ClientReadableStream<HandleFilesInvitationResponse>;
shareBucketViaIdentity(
request: ShareBucketViaIdentityRequest,
handleFilesInvitation(
request: HandleFilesInvitationRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: ShareBucketViaIdentityResponse) => void) {
response: HandleFilesInvitationResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/ShareBucketViaIdentity', this.hostname_).toString(),
new URL('/space.SpaceApi/HandleFilesInvitation', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoShareBucketViaIdentity,
this.methodInfoHandleFilesInvitation,
callback);

@@ -844,45 +1166,24 @@ }

this.hostname_ +
'/space.SpaceApi/ShareBucketViaIdentity',
'/space.SpaceApi/HandleFilesInvitation',
request,
metadata || {},
this.methodInfoShareBucketViaIdentity);
this.methodInfoHandleFilesInvitation);
}
methodInfoGenerateFileShareLink = new grpcWeb.AbstractClientBase.MethodInfo(
GenerateFileShareLinkResponse,
(request: GenerateFileShareLinkRequest) => {
methodInfoNotificationSubscribe = new grpcWeb.AbstractClientBase.MethodInfo(
NotificationEventResponse,
(request: google_protobuf_empty_pb.Empty) => {
return request.serializeBinary();
},
GenerateFileShareLinkResponse.deserializeBinary
NotificationEventResponse.deserializeBinary
);
generateFileShareLink(
request: GenerateFileShareLinkRequest,
metadata: grpcWeb.Metadata | null): Promise<GenerateFileShareLinkResponse>;
generateFileShareLink(
request: GenerateFileShareLinkRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GenerateFileShareLinkResponse) => void): grpcWeb.ClientReadableStream<GenerateFileShareLinkResponse>;
generateFileShareLink(
request: GenerateFileShareLinkRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GenerateFileShareLinkResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GenerateFileShareLink', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGenerateFileShareLink,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GenerateFileShareLink',
request,
metadata || {},
this.methodInfoGenerateFileShareLink);
notificationSubscribe(
request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata) {
return this.client_.serverStreaming(
new URL('/space.SpaceApi/NotificationSubscribe', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoNotificationSubscribe);
}

@@ -929,3 +1230,315 @@

methodInfoGetNotifications = new grpcWeb.AbstractClientBase.MethodInfo(
GetNotificationsResponse,
(request: GetNotificationsRequest) => {
return request.serializeBinary();
},
GetNotificationsResponse.deserializeBinary
);
getNotifications(
request: GetNotificationsRequest,
metadata: grpcWeb.Metadata | null): Promise<GetNotificationsResponse>;
getNotifications(
request: GetNotificationsRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetNotificationsResponse) => void): grpcWeb.ClientReadableStream<GetNotificationsResponse>;
getNotifications(
request: GetNotificationsRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetNotificationsResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetNotifications', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetNotifications,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GetNotifications',
request,
metadata || {},
this.methodInfoGetNotifications);
}
methodInfoReadNotification = new grpcWeb.AbstractClientBase.MethodInfo(
ReadNotificationResponse,
(request: ReadNotificationRequest) => {
return request.serializeBinary();
},
ReadNotificationResponse.deserializeBinary
);
readNotification(
request: ReadNotificationRequest,
metadata: grpcWeb.Metadata | null): Promise<ReadNotificationResponse>;
readNotification(
request: ReadNotificationRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: ReadNotificationResponse) => void): grpcWeb.ClientReadableStream<ReadNotificationResponse>;
readNotification(
request: ReadNotificationRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: ReadNotificationResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/ReadNotification', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoReadNotification,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/ReadNotification',
request,
metadata || {},
this.methodInfoReadNotification);
}
methodInfoDeleteAccount = new grpcWeb.AbstractClientBase.MethodInfo(
DeleteAccountResponse,
(request: DeleteAccountRequest) => {
return request.serializeBinary();
},
DeleteAccountResponse.deserializeBinary
);
deleteAccount(
request: DeleteAccountRequest,
metadata: grpcWeb.Metadata | null): Promise<DeleteAccountResponse>;
deleteAccount(
request: DeleteAccountRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: DeleteAccountResponse) => void): grpcWeb.ClientReadableStream<DeleteAccountResponse>;
deleteAccount(
request: DeleteAccountRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: DeleteAccountResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/DeleteAccount', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoDeleteAccount,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/DeleteAccount',
request,
metadata || {},
this.methodInfoDeleteAccount);
}
methodInfoToggleBucketBackup = new grpcWeb.AbstractClientBase.MethodInfo(
ToggleBucketBackupResponse,
(request: ToggleBucketBackupRequest) => {
return request.serializeBinary();
},
ToggleBucketBackupResponse.deserializeBinary
);
toggleBucketBackup(
request: ToggleBucketBackupRequest,
metadata: grpcWeb.Metadata | null): Promise<ToggleBucketBackupResponse>;
toggleBucketBackup(
request: ToggleBucketBackupRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: ToggleBucketBackupResponse) => void): grpcWeb.ClientReadableStream<ToggleBucketBackupResponse>;
toggleBucketBackup(
request: ToggleBucketBackupRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: ToggleBucketBackupResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/ToggleBucketBackup', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoToggleBucketBackup,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/ToggleBucketBackup',
request,
metadata || {},
this.methodInfoToggleBucketBackup);
}
methodInfoGetUsageInfo = new grpcWeb.AbstractClientBase.MethodInfo(
GetUsageInfoResponse,
(request: GetUsageInfoRequest) => {
return request.serializeBinary();
},
GetUsageInfoResponse.deserializeBinary
);
getUsageInfo(
request: GetUsageInfoRequest,
metadata: grpcWeb.Metadata | null): Promise<GetUsageInfoResponse>;
getUsageInfo(
request: GetUsageInfoRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetUsageInfoResponse) => void): grpcWeb.ClientReadableStream<GetUsageInfoResponse>;
getUsageInfo(
request: GetUsageInfoRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetUsageInfoResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetUsageInfo', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetUsageInfo,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GetUsageInfo',
request,
metadata || {},
this.methodInfoGetUsageInfo);
}
methodInfoGetAPISessionTokens = new grpcWeb.AbstractClientBase.MethodInfo(
GetAPISessionTokensResponse,
(request: GetAPISessionTokensRequest) => {
return request.serializeBinary();
},
GetAPISessionTokensResponse.deserializeBinary
);
getAPISessionTokens(
request: GetAPISessionTokensRequest,
metadata: grpcWeb.Metadata | null): Promise<GetAPISessionTokensResponse>;
getAPISessionTokens(
request: GetAPISessionTokensRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetAPISessionTokensResponse) => void): grpcWeb.ClientReadableStream<GetAPISessionTokensResponse>;
getAPISessionTokens(
request: GetAPISessionTokensRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetAPISessionTokensResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetAPISessionTokens', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetAPISessionTokens,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GetAPISessionTokens',
request,
metadata || {},
this.methodInfoGetAPISessionTokens);
}
methodInfoGetRecentlySharedWith = new grpcWeb.AbstractClientBase.MethodInfo(
GetRecentlySharedWithResponse,
(request: GetRecentlySharedWithRequest) => {
return request.serializeBinary();
},
GetRecentlySharedWithResponse.deserializeBinary
);
getRecentlySharedWith(
request: GetRecentlySharedWithRequest,
metadata: grpcWeb.Metadata | null): Promise<GetRecentlySharedWithResponse>;
getRecentlySharedWith(
request: GetRecentlySharedWithRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: GetRecentlySharedWithResponse) => void): grpcWeb.ClientReadableStream<GetRecentlySharedWithResponse>;
getRecentlySharedWith(
request: GetRecentlySharedWithRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: GetRecentlySharedWithResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/GetRecentlySharedWith', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoGetRecentlySharedWith,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/GetRecentlySharedWith',
request,
metadata || {},
this.methodInfoGetRecentlySharedWith);
}
methodInfoSetNotificationsLastSeenAt = new grpcWeb.AbstractClientBase.MethodInfo(
SetNotificationsLastSeenAtResponse,
(request: SetNotificationsLastSeenAtRequest) => {
return request.serializeBinary();
},
SetNotificationsLastSeenAtResponse.deserializeBinary
);
setNotificationsLastSeenAt(
request: SetNotificationsLastSeenAtRequest,
metadata: grpcWeb.Metadata | null): Promise<SetNotificationsLastSeenAtResponse>;
setNotificationsLastSeenAt(
request: SetNotificationsLastSeenAtRequest,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.Error,
response: SetNotificationsLastSeenAtResponse) => void): grpcWeb.ClientReadableStream<SetNotificationsLastSeenAtResponse>;
setNotificationsLastSeenAt(
request: SetNotificationsLastSeenAtRequest,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.Error,
response: SetNotificationsLastSeenAtResponse) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
new URL('/space.SpaceApi/SetNotificationsLastSeenAt', this.hostname_).toString(),
request,
metadata || {},
this.methodInfoSetNotificationsLastSeenAt,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/space.SpaceApi/SetNotificationsLastSeenAt',
request,
metadata || {},
this.methodInfoSetNotificationsLastSeenAt);
}
}

@@ -26,28 +26,4 @@ export interface ListDirectoryPayload {

export interface GetIdentityByUsernamePayload {
username: string;
}
export interface CreateUsernameAndEmailPayload {
email?: string;
username: string;
}
export interface ShareBucketViaEmailPayload {
bucket?: string;
email: string;
}
export interface ShareBucketViaIdentityPayload {
identityType: 'EMAIL' | 'USERNAME';
identityValue: string;
bucket?: string;
}
export interface GenerateFileShareLinkPayload {
bucket?: string;
filePath: string;
}
export interface BackupKeysByPassphrasePayload {
uuid: string;
passphrase: string;

@@ -57,5 +33,11 @@ }

export interface RecoverKeysByPassphrasePayload {
uuid: string;
passphrase: string;
}
export interface TestKeysPassphrasePayload {
uuid: string;
passphrase: string;
}
export interface ToggleFusePayload {

@@ -72,2 +54,7 @@ mountDrive: boolean;

export interface ToggleBucketBackupPayload {
bucket: string;
backup: boolean;
}
export interface ShareBucketPayload {

@@ -84,1 +71,49 @@ bucket?: string;

}
export interface ReadNotificationPayload {
ID: string;
}
type InvitationType = {
invitationType: 'INVITE_THROUGH_EMAIL' | 'INVITE_THROUGH_ADDRESS';
invitationValue: string;
};
export interface GetNotificationsPayload {
seek: string;
limit: number;
}
export interface HandleFilesInvitationPayload {
invitationID: string,
accept: boolean,
}
export interface SetNotificationsLastSeenAtPayload {
timestamp: number;
}
export interface RestoreKeyPairViaMnemonicPayload {
mnemonic: string;
}
export interface GetSharedWithMeFilesPayload {
seek: string;
limit: number;
}
export interface ShareFilesViaPublicKeyPayload {
paths: {
dbId?: string;
bucket?: string;
path: string;
}[];
publicKeys: [string];
}
export interface GeneratePublicFileLinkPayload {
dbId: string;
bucket?: string;
password: string;
itemPaths: [string],
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc