crisp-api
Version:
Crisp API wrapper for Node - official, maintained by Crisp
100 lines (99 loc) • 3.08 kB
JavaScript
"use strict";
/*
* This file is part of node-crisp-api
*
* Copyright (c) 2025 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 WebsiteOperator Resource
*/
class WebsiteOperatorService extends BaseResource_1.default {
/**
* List Website Operators
*/
listWebsiteOperators(websiteID) {
return this.crisp.get(this.crisp.prepareRestUrl([
"website", websiteID, "operators", "list"
]));
}
;
/**
* List Last Active Website Operators
*/
listLastActiveWebsiteOperators(websiteID) {
return this.crisp.get(this.crisp.prepareRestUrl([
"website", websiteID, "operators", "active"
]));
}
;
/**
* Flush Last Active Website Operators
*/
flushLastActiveWebsiteOperators(websiteID) {
return this.crisp.delete(this.crisp.prepareRestUrl([
"website", websiteID, "operators", "active"
]));
}
;
/**
* Send Email To Website Operators
*/
sendEmailToWebsiteOperators(websiteID, emailData) {
return this.crisp.post(this.crisp.prepareRestUrl(["website", websiteID, "operators", "email"]), null, emailData);
}
;
/**
* Get A Website Operator
*/
getWebsiteOperator(websiteID, userID) {
return this.crisp.get(this.crisp.prepareRestUrl([
"website", websiteID, "operator", userID
]));
}
;
/**
* Invite A Website Operator
*/
inviteWebsiteOperator(websiteID, email, role, verify) {
return this.crisp.post(this.crisp.prepareRestUrl(["website", websiteID, "operator"]), null, {
email: email,
role: role,
verify: verify
});
}
;
/**
* Change Operator Membership
*/
changeOperatorMembership(websiteID, userID, role, title) {
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "operator", userID]), null, {
role: role,
title: title
});
}
;
/**
* Unlink Operator From Website
*/
unlinkOperatorFromWebsite(websiteID, userID) {
return this.crisp.delete(this.crisp.prepareRestUrl(["website", websiteID, "operator", userID]));
}
;
}
/**************************************************************************
* EXPORTS
***************************************************************************/
exports.default = WebsiteOperatorService;