UNPKG

@datocms/cma-client

Version:
110 lines 3.95 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Utils = __importStar(require("@datocms/rest-client-utils")); const BaseResource_1 = __importDefault(require("../../BaseResource")); class EditingSession extends BaseResource_1.default { /** * List all editing sessions * * Read more: https://www.datocms.com/docs/content-management-api/resources/editing-session/instances * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ list() { return this.rawList().then((body) => Utils.deserializeResponseBody(body)); } /** * List all editing sessions * * Read more: https://www.datocms.com/docs/content-management-api/resources/editing-session/instances * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawList() { return this.client.request({ method: 'GET', url: '/editing-sessions', }); } /** * Allows all actions on editing sessions * * Read more: https://www.datocms.com/docs/content-management-api/resources/editing-session/update * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawUpdate(editingSessionId, body) { return this.client.request({ method: 'PUT', url: `/editing-sessions/${editingSessionId}`, body, }); } /** * Delete an editing session * * Read more: https://www.datocms.com/docs/content-management-api/resources/editing-session/destroy * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ destroy(editingSessionId) { return this.rawDestroy(Utils.toId(editingSessionId)).then((body) => Utils.deserializeResponseBody(body)); } /** * Delete an editing session * * Read more: https://www.datocms.com/docs/content-management-api/resources/editing-session/destroy * * @throws {ApiError} * @throws {TimeoutError} * * @deprecated This API call is to be considered private and might change without notice */ rawDestroy(editingSessionId) { return this.client.request({ method: 'DELETE', url: `/editing-sessions/${editingSessionId}`, }); } } exports.default = EditingSession; EditingSession.TYPE = 'editing_session'; //# sourceMappingURL=EditingSession.js.map