askexperts
Version:
AskExperts SDK: build and use AI experts - ask them questions and pay with bitcoin on an open protocol
68 lines • 2.79 kB
JavaScript
/**
* Remote implementation of the ExpertClient interface
* Communicates with a remote server for expert-related operations
*/
export class RemoteExpertClient {
/**
* Creates a new RemoteExpertClient instance
* @param url - URL of the remote server
*/
constructor(url) {
this.url = url;
}
/**
* List all experts
* @returns Promise resolving to an array of expert objects
* @throws Error indicating this method is not implemented yet
*/
async listExperts() {
throw new Error(`RemoteExpertClient.listExperts not implemented yet (url: ${this.url})`);
}
/**
* Get an expert by pubkey
* @param pubkey - Pubkey of the expert to get
* @returns Promise resolving to the expert if found, null otherwise
* @throws Error indicating this method is not implemented yet
*/
async getExpert(pubkey) {
throw new Error(`RemoteExpertClient.getExpert not implemented yet (url: ${this.url}, pubkey: ${pubkey})`);
}
/**
* Insert a new expert
* @param expert - Expert to insert
* @returns Promise resolving to true if expert was inserted, false otherwise
* @throws Error indicating this method is not implemented yet
*/
async insertExpert(expert) {
throw new Error(`RemoteExpertClient.insertExpert not implemented yet (url: ${this.url}, pubkey: ${expert.pubkey})`);
}
/**
* Update an existing expert
* @param expert - Expert to update
* @returns Promise resolving to true if expert was updated, false otherwise
* @throws Error indicating this method is not implemented yet
*/
async updateExpert(expert) {
throw new Error(`RemoteExpertClient.updateExpert not implemented yet (url: ${this.url}, pubkey: ${expert.pubkey})`);
}
/**
* Set the disabled status of an expert
* @param pubkey - Pubkey of the expert to update
* @param disabled - Whether the expert should be disabled
* @returns Promise resolving to true if expert was updated, false otherwise
* @throws Error indicating this method is not implemented yet
*/
async setExpertDisabled(pubkey, disabled) {
throw new Error(`RemoteExpertClient.setExpertDisabled not implemented yet (url: ${this.url}, pubkey: ${pubkey}, disabled: ${disabled})`);
}
/**
* Delete an expert
* @param pubkey - Pubkey of the expert to delete
* @returns Promise resolving to true if expert was deleted, false otherwise
* @throws Error indicating this method is not implemented yet
*/
async deleteExpert(pubkey) {
throw new Error(`RemoteExpertClient.deleteExpert not implemented yet (url: ${this.url}, pubkey: ${pubkey})`);
}
}
//# sourceMappingURL=RemoteExpertClient.js.map