UNPKG

@prismicio/client

Version:

The official JavaScript + TypeScript client library for Prismic

48 lines (47 loc) 1.84 kB
var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); class PrismicMigrationDocument { /** * Creates a Prismic migration document instance. * * @param document - The document to be sent to the Migration API. * @param title - The name of the document displayed in the editor. * @param params - Parameters to create/update the document with on the * Migration API. * * @returns A Prismic migration document instance. */ constructor(document, title, params) { /** * The document to be sent to the Migration API. */ __publicField(this, "document"); /** * The name of the document displayed in the editor. */ __publicField(this, "title"); /** * The link to the master language document to relate the document to if any. */ __publicField(this, "masterLanguageDocument"); /** * Original Prismic document when the migration document came from another * Prismic repository. * * @remarks * When migrating a document from another repository, one might want to alter * it with migration specific types, hence accepting an * `ExistingPrismicDocument` instead of a regular `PrismicDocument`. */ __publicField(this, "originalPrismicDocument"); this.document = document; this.title = title; this.masterLanguageDocument = params == null ? void 0 : params.masterLanguageDocument; this.originalPrismicDocument = params == null ? void 0 : params.originalPrismicDocument; } } export { PrismicMigrationDocument }; //# sourceMappingURL=Document.js.map