crisp-api
Version:
Crisp API wrapper for Node - official, maintained by Crisp
83 lines (82 loc) • 2.53 kB
JavaScript
"use strict";
/*
* This file is part of node-crisp-api
*
* Copyright (c) 2026 Crisp IM SAS
* All rights belong to Crisp IM SAS
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**************************************************************************
* IMPORTS
***************************************************************************/
// PROJECT: RESOURCES
const BaseResource_1 = __importDefault(require("./BaseResource"));
/**************************************************************************
* CLASSES
***************************************************************************/
/**
* Crisp WebsiteInbox Resource
*/
class WebsiteInboxService extends BaseResource_1.default {
/**
* List Inboxes
*/
listInboxes(websiteID, pageNumber = 1) {
return this.crisp.get(this.crisp.prepareRestUrl([
"website", websiteID, "inboxes", "list", String(pageNumber)
]));
}
/**
* Batch Order Inboxes
*/
batchOrderInboxes(websiteID, orders) {
return this.crisp.patch(this.crisp.prepareRestUrl([
"website", websiteID, "inboxes", "batch", "order"
]), null, orders);
}
;
/**
* Create A New Inbox
*/
createNewInbox(websiteID, inbox) {
return this.crisp.post(this.crisp.prepareRestUrl(["website", websiteID, "inbox"]), null, inbox);
}
;
/**
* Check If Inbox Exists
*/
checkInboxExists(websiteID, inboxID) {
return this.crisp.head(this.crisp.prepareRestUrl(["website", websiteID, "inbox", inboxID]));
}
;
/**
* Get Inbox
*/
getInbox(websiteID, inboxID) {
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "inbox", inboxID]));
}
;
/**
* Save Inbox
*/
saveInbox(websiteID, inboxID, inbox) {
return this.crisp.put(this.crisp.prepareRestUrl([
"website", websiteID, "inbox", inboxID
]), null, inbox);
}
;
/**
* Delete Inbox
*/
deleteInbox(websiteID, inboxID) {
return this.crisp.delete(this.crisp.prepareRestUrl(["website", websiteID, "inbox", inboxID]));
}
;
}
/**************************************************************************
* EXPORTS
***************************************************************************/
exports.default = WebsiteInboxService;