UNPKG

nylas

Version:

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.

38 lines (37 loc) 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SmartCompose = void 0; const resource_js_1 = require("./resource.js"); const utils_js_1 = require("../utils.js"); /** * A collection of Smart Compose related API endpoints. * * These endpoints allow for the generation of message suggestions. */ class SmartCompose extends resource_js_1.Resource { /** * Compose a message * @return The generated message */ composeMessage({ identifier, requestBody, overrides, }) { return super._create({ path: (0, utils_js_1.makePathParams)('/v3/grants/{identifier}/messages/smart-compose', { identifier, }), requestBody, overrides, }); } /** * Compose a message reply * @return The generated message reply */ composeMessageReply({ identifier, messageId, requestBody, overrides, }) { return super._create({ path: (0, utils_js_1.makePathParams)('/v3/grants/{identifier}/messages/{messageId}/smart-compose', { identifier, messageId }), requestBody, overrides, }); } } exports.SmartCompose = SmartCompose;