UNPKG

dc-management-sdk-js

Version:
51 lines 3.05 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.Snapshot = void 0; var HalResource_1 = require("../hal/models/HalResource"); var ContentItem_1 = require("./ContentItem"); var Hub_1 = require("./Hub"); /** * Class representing the [Snapshot](https://amplience.com/docs/api/dynamic-content/management/#tag/Snapshots) resource. * A Snapshot is an immutable representation of a content item with all of its descendants (including their versions) at a given point in time. */ var Snapshot = /** @class */ (function (_super) { __extends(Snapshot, _super); function Snapshot() { var _this = _super !== null && _super.apply(this, arguments) || this; /** * Resources and actions related to a Snapshot */ _this.related = { /** * Retrieves the Hub this snapshot is stored in */ hub: function () { return _this.fetchLinkedResource('hub', {}, Hub_1.Hub); }, /** * Retrieves the specific version of a content item referenced by the Snapshot * @param id Content item id */ snapshotContentItem: function (id) { return _this.client.fetchResource("snapshots/".concat(_this.id, "/content-items/").concat(id), ContentItem_1.ContentItem); }, }; return _this; } return Snapshot; }(HalResource_1.HalResource)); exports.Snapshot = Snapshot; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU25hcHNob3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbGliL21vZGVsL1NuYXBzaG90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlEQUF3RDtBQUN4RCw2Q0FBNEM7QUFDNUMsNkJBQTRCO0FBSTVCOzs7R0FHRztBQUNIO0lBQThCLDRCQUFXO0lBQXpDOztRQStCRTs7V0FFRztRQUNhLGFBQU8sR0FBRztZQUN4Qjs7ZUFFRztZQUNILEdBQUcsRUFBRSxjQUFvQixPQUFBLEtBQUksQ0FBQyxtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsRUFBRSxFQUFFLFNBQUcsQ0FBQyxFQUF4QyxDQUF3QztZQUVqRTs7O2VBR0c7WUFDSCxtQkFBbUIsRUFBRSxVQUFDLEVBQVU7Z0JBQzlCLE9BQUEsS0FBSSxDQUFDLE1BQU0sQ0FBQyxhQUFhLENBQ3ZCLG9CQUFhLEtBQUksQ0FBQyxFQUFFLDRCQUFrQixFQUFFLENBQUUsRUFDMUMseUJBQVcsQ0FDWjtZQUhELENBR0M7U0FDSixDQUFDOztJQUNKLENBQUM7SUFBRCxlQUFDO0FBQUQsQ0FBQyxBQWxERCxDQUE4Qix5QkFBVyxHQWtEeEM7QUFsRFksNEJBQVEifQ==