@simplito/privmx-webendpoint
Version:
PrivMX Web Endpoint library
70 lines (67 loc) • 3.03 kB
JavaScript
;
/*!
PrivMX Web Endpoint.
Copyright © 2024 Simplito sp. z o.o.
This file is part of the PrivMX Platform (https://privmx.dev).
This software is Licensed under the PrivMX Free License.
See the License for the specific language governing permissions and
limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ThreadApiNative = void 0;
const BaseNative_1 = require("./BaseNative");
class ThreadApiNative extends BaseNative_1.BaseNative {
async newApi(connectionPtr) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_newThreadApi(taskId, connectionPtr));
}
async deleteApi(ptr) {
await this.runAsync((taskId) => this.api.lib.ThreadApi_deleteThreadApi(taskId, ptr));
this.deleteApiRef();
}
async create(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_create(taskId, ptr, args));
}
async createThread(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_createThread(taskId, ptr, args));
}
async updateThread(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_updateThread(taskId, ptr, args));
}
async deleteThread(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_deleteThread(taskId, ptr, args));
}
async getThread(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_getThread(taskId, ptr, args));
}
async listThreads(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_listThreads(taskId, ptr, args));
}
async getMessage(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_getMessage(taskId, ptr, args));
}
async listMessages(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_listMessages(taskId, ptr, args));
}
async sendMessage(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_sendMessage(taskId, ptr, args));
}
async deleteMessage(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_deleteMessage(taskId, ptr, args));
}
async updateMessage(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_updateMessage(taskId, ptr, args));
}
async subscribeForThreadEvents(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_subscribeForThreadEvents(taskId, ptr, args));
}
async unsubscribeFromThreadEvents(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_unsubscribeFromThreadEvents(taskId, ptr, args));
}
async subscribeForMessageEvents(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_subscribeForMessageEvents(taskId, ptr, args));
}
async unsubscribeFromMessageEvents(ptr, args) {
return this.runAsync((taskId) => this.api.lib.ThreadApi_unsubscribeFromMessageEvents(taskId, ptr, args));
}
}
exports.ThreadApiNative = ThreadApiNative;