UNPKG

@agility/management-sdk

Version:
604 lines (603 loc) 34.4 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PageMethods = void 0; var clientInstance_1 = require("./clientInstance"); var batchMethods_1 = require("./batchMethods"); var exception_1 = require("../models/exception"); var batchState_1 = require("../enums/batchState."); var workflowOperationType_1 = require("../enums/workflowOperationType"); var PageMethods = /** @class */ (function () { function PageMethods(options) { this._options = options; this._clientInstance = new clientInstance_1.ClientInstance(this._options); this._batchMethods = new batchMethods_1.BatchMethods(this._options); } PageMethods.prototype.getSitemap = function (guid, locale) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_1; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/sitemap"); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_1 = _a.sent(); throw new exception_1.Exception("Unable to retrieve sitemap.", err_1); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPageTemplates = function (guid_1, locale_1, includeModuleZones_1) { return __awaiter(this, arguments, void 0, function (guid, locale, includeModuleZones, searchFilter) { var apiPath, resp, err_2; if (searchFilter === void 0) { searchFilter = null; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); if (!searchFilter) searchFilter = ''; apiPath = "".concat(locale, "/page/templates?includeModuleZones=").concat(includeModuleZones, "&searchFilter=").concat(searchFilter); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_2 = _a.sent(); throw new exception_1.Exception("Unable to retrieve Page Templates.", err_2); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPageTemplate = function (guid, locale, pageTemplateId) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_3; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_3 = _a.sent(); throw new exception_1.Exception("Unable to retrieve Page Template.", err_3); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPageTemplateName = function (guid, locale, templateName) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_4; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/page/template/").concat(templateName); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_4 = _a.sent(); throw new exception_1.Exception("Unable to retrieve Page Template.", err_4); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.deletePageTemplate = function (guid, locale, pageTemplateId) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_5; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId); return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_5 = _a.sent(); throw new exception_1.Exception("Unable to delete Page Template.", err_5); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPageItemTemplates = function (guid, locale, id) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_6; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/page/template/items/").concat(id); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_6 = _a.sent(); throw new exception_1.Exception("Unable to retrieve Page Template Items.", err_6); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.savePageTemplate = function (guid, locale, pageModel) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_7; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/page/template"); return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageModel)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_7 = _a.sent(); throw new exception_1.Exception("Unable to save Page Template.", err_7); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPage = function (pageID, guid, locale) { return __awaiter(this, void 0, void 0, function () { var apiPath, resp, err_8; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/page/").concat(pageID); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_8 = _a.sent(); throw new exception_1.Exception("Unable to retrieve page for id ".concat(pageID, "."), err_8); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.publishPage = function (pageID_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) { var apiPath, resp, batchID_1, batch, pageIDs_1, err_9; var _this = this; if (comments === void 0) { comments = null; } if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page/").concat(pageID, "/publish?comments=").concat(comments); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); batchID_1 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_1]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_1, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_1 = []; batch.items.forEach(function (element) { return pageIDs_1.push(element.itemID); }); return [2 /*return*/, pageIDs_1]; case 3: err_9 = _a.sent(); throw new exception_1.Exception("Unable to publish the page for id: ".concat(pageID), err_9); case 4: return [2 /*return*/]; } }); }); }; PageMethods.prototype.unPublishPage = function (pageID_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) { var apiPath, resp, batchID_2, batch, pageIDs_2, err_10; var _this = this; if (comments === void 0) { comments = null; } if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page/").concat(pageID, "/unpublish?comments=").concat(comments); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); batchID_2 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_2]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_2, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_2 = []; batch.items.forEach(function (element) { return pageIDs_2.push(element.itemID); }); return [2 /*return*/, pageIDs_2]; case 3: err_10 = _a.sent(); throw new exception_1.Exception("Unable to un-publish the page for id: ".concat(pageID), err_10); case 4: return [2 /*return*/]; } }); }); }; /** * Perform a batch workflow operation on multiple pages. * Supports Publish, Unpublish, Approve, Decline, and RequestApproval operations. * @param pageIDs Array of page IDs to process * @param guid The GUID of the user making the request * @param locale The locale of the pages * @param operation The workflow operation type (Publish, Unpublish, Approve, Decline, RequestApproval) * @param returnBatchId Whether to return the batch ID immediately * @returns The IDs of the processed pages */ PageMethods.prototype.batchWorkflowPages = function (pageIDs_3, guid_1, locale_1, operation_1) { return __awaiter(this, arguments, void 0, function (pageIDs, guid, locale, operation, returnBatchId) { var pageIDsParam, operationName, apiPath, resp, batchID_3, batch, processedPageIDs_1, err_11; var _this = this; if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); pageIDsParam = pageIDs.join(','); operationName = workflowOperationType_1.WorkflowOperationType[operation]; apiPath = "".concat(locale, "/page/batch-workflow?pageIDs=").concat(pageIDsParam, "&operation=").concat(operationName); return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)]; case 1: resp = _a.sent(); batchID_3 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_3]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_3, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); if (batch.batchState === batchState_1.BatchState.Processed && batch.errorData && batch.errorData.length > 0) { throw new exception_1.Exception("Unable to batch ".concat(operationName.toLowerCase(), " pages. Batch is not completed. Error: ").concat(batch.errorData), null); } processedPageIDs_1 = []; batch.items.forEach(function (element) { return processedPageIDs_1.push(element.itemID); }); return [2 /*return*/, processedPageIDs_1]; case 3: err_11 = _a.sent(); throw new exception_1.Exception("Unable to batch ".concat(workflowOperationType_1.WorkflowOperationType[operation].toLowerCase(), " pages."), err_11); case 4: return [2 /*return*/]; } }); }); }; PageMethods.prototype.pageRequestApproval = function (pageID_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) { var apiPath, resp, batchID_4, batch, pageIDs_3, err_12; var _this = this; if (comments === void 0) { comments = null; } if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page/").concat(pageID, "/request-approval?comments=").concat(comments); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); batchID_4 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_4]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_4, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_3 = []; batch.items.forEach(function (element) { return pageIDs_3.push(element.itemID); }); return [2 /*return*/, pageIDs_3]; case 3: err_12 = _a.sent(); throw new exception_1.Exception("Unable to request approval the page for id: ".concat(pageID), err_12); case 4: return [2 /*return*/]; } }); }); }; PageMethods.prototype.approvePage = function (pageID_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) { var apiPath, resp, batchID_5, batch, pageIDs_4, err_13; var _this = this; if (comments === void 0) { comments = null; } if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page/").concat(pageID, "/approve?comments=").concat(comments); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); batchID_5 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_5]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_5, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_4 = []; batch.items.forEach(function (element) { return pageIDs_4.push(element.itemID); }); return [2 /*return*/, pageIDs_4]; case 3: err_13 = _a.sent(); throw new exception_1.Exception("Unable to approve the page for id: ".concat(pageID), err_13); case 4: return [2 /*return*/]; } }); }); }; PageMethods.prototype.declinePage = function (pageID_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) { var apiPath, resp, batchID_6, batch, pageIDs_5, err_14; var _this = this; if (comments === void 0) { comments = null; } if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page/").concat(pageID, "/decline?comments=").concat(comments); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); batchID_6 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_6]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_6, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_5 = []; batch.items.forEach(function (element) { return pageIDs_5.push(element.itemID); }); return [2 /*return*/, pageIDs_5]; case 3: err_14 = _a.sent(); throw new exception_1.Exception("Unable to decline the page for id: ".concat(pageID), err_14); case 4: return [2 /*return*/]; } }); }); }; PageMethods.prototype.deletePage = function (pageID_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) { var apiPath, resp, batchID_7, batch, pageIDs_6, err_15; var _this = this; if (comments === void 0) { comments = null; } if (returnBatchId === void 0) { returnBatchId = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page/").concat(pageID, "?comments=").concat(comments); return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); batchID_7 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_7]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_7, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_6 = []; batch.items.forEach(function (element) { return pageIDs_6.push(element.itemID); }); return [2 /*return*/, pageIDs_6]; case 3: err_15 = _a.sent(); throw new exception_1.Exception("Unable to delete the page for id: ".concat(pageID), err_15); case 4: return [2 /*return*/]; } }); }); }; /** * Save a new page or update an existing page. * @param pageItem The PageItem to save * @param guid The GUID of the user making the request * @param locale The locale of the page * @param parentPageID The ID of the parent page * @param placeBeforePageItemID The ID of the page item to place this page before * @param returnBatchId Whether to return the batch ID immediately * @param pageIDInOtherLocale The ID of the page in the other locale if you need to link it up. * @param otherLocale The other locale to link the page to. * @param linkExistingComponents Whether to link existing components to the page. If not set, the page save will create new components for each content zone. * @returns The IDs of the created or updated pages */ PageMethods.prototype.savePage = function (pageItem_1, guid_1, locale_1) { return __awaiter(this, arguments, void 0, function (pageItem, guid, locale, parentPageID, placeBeforePageItemID, returnBatchId, pageIDInOtherLocale, otherLocale, linkExistingComponents) { var apiPath, resp, batchID_8, batch, pageIDs_7, err_16; var _this = this; if (parentPageID === void 0) { parentPageID = -1; } if (placeBeforePageItemID === void 0) { placeBeforePageItemID = -1; } if (returnBatchId === void 0) { returnBatchId = false; } if (pageIDInOtherLocale === void 0) { pageIDInOtherLocale = -1; } if (otherLocale === void 0) { otherLocale = null; } if (linkExistingComponents === void 0) { linkExistingComponents = false; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 3, , 4]); apiPath = "".concat(locale, "/page?parentPageID=").concat(parentPageID, "&placeBeforePageItemID=").concat(placeBeforePageItemID); if (pageIDInOtherLocale > -1 && otherLocale) { // If we have the other locale and the pageID in that locale, we need to link it up. apiPath += "&pageIDInOtherLocale=".concat(pageIDInOtherLocale, "&otherLocale=").concat(otherLocale); } // if not set, the page save will create new components for each content zone. if (linkExistingComponents) { apiPath += "&linkExistingComponents=true"; } return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageItem)]; case 1: resp = _a.sent(); batchID_8 = resp.data; // If user wants batchID immediately, return it for custom polling if (returnBatchId) { return [2 /*return*/, [batchID_8]]; } return [4 /*yield*/, this._batchMethods.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._batchMethods.getBatch(batchID_8, guid)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); })]; case 2: batch = _a.sent(); pageIDs_7 = []; batch.items.forEach(function (element) { return pageIDs_7.push(element.itemID); }); return [2 /*return*/, pageIDs_7]; case 3: err_16 = _a.sent(); throw new exception_1.Exception("Unable to create page. ".concat(err_16), err_16); case 4: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPageHistory = function (locale_1, guid_1, pageID_1) { return __awaiter(this, arguments, void 0, function (locale, guid, pageID, take, skip) { var apiPath, resp, err_17; if (take === void 0) { take = 50; } if (skip === void 0) { skip = 0; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/item/").concat(pageID, "/history?take=").concat(take, "&skip=").concat(skip); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_17 = _a.sent(); throw new exception_1.Exception("Unable to retrieve history for pageID: ".concat(pageID)); case 3: return [2 /*return*/]; } }); }); }; PageMethods.prototype.getPageComments = function (locale_1, guid_1, pageID_1) { return __awaiter(this, arguments, void 0, function (locale, guid, pageID, take, skip) { var apiPath, resp, err_18; if (take === void 0) { take = 50; } if (skip === void 0) { skip = 0; } return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); apiPath = "".concat(locale, "/item/").concat(pageID, "/history?take=").concat(take, "&skip=").concat(skip); return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)]; case 1: resp = _a.sent(); return [2 /*return*/, resp.data]; case 2: err_18 = _a.sent(); throw new exception_1.Exception("Unable to retrieve history for pageID: ".concat(pageID)); case 3: return [2 /*return*/]; } }); }); }; return PageMethods; }()); exports.PageMethods = PageMethods;