@prismicio/client 7.20.2-alpha.0 → 7.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/dist/Client.cjs +120 -132
  2. package/dist/Client.cjs.map +1 -1
  3. package/dist/Client.d.ts +7 -7
  4. package/dist/Client.js +120 -132
  5. package/dist/Client.js.map +1 -1
  6. package/dist/Migration.cjs +83 -101
  7. package/dist/Migration.cjs.map +1 -1
  8. package/dist/Migration.d.ts +9 -9
  9. package/dist/Migration.js +83 -101
  10. package/dist/Migration.js.map +1 -1
  11. package/dist/WriteClient.cjs +115 -92
  12. package/dist/WriteClient.cjs.map +1 -1
  13. package/dist/WriteClient.d.ts +6 -6
  14. package/dist/WriteClient.js +115 -92
  15. package/dist/WriteClient.js.map +1 -1
  16. package/dist/buildQueryURL.cjs.map +1 -1
  17. package/dist/buildQueryURL.d.ts +29 -21
  18. package/dist/buildQueryURL.js.map +1 -1
  19. package/dist/createClient.cjs.map +1 -1
  20. package/dist/createClient.d.ts +13 -10
  21. package/dist/createClient.js.map +1 -1
  22. package/dist/createMigration.cjs.map +1 -1
  23. package/dist/createMigration.d.ts +2 -2
  24. package/dist/createMigration.js.map +1 -1
  25. package/dist/createWriteClient.cjs.map +1 -1
  26. package/dist/createWriteClient.d.ts +2 -2
  27. package/dist/errors/ForbiddenError.d.ts +1 -1
  28. package/dist/errors/InvalidDataError.d.ts +1 -1
  29. package/dist/errors/NotFoundError.d.ts +1 -1
  30. package/dist/errors/ParsingError.d.ts +1 -1
  31. package/dist/errors/PreviewTokenExpired.d.ts +1 -1
  32. package/dist/errors/PrismicError.cjs +2 -5
  33. package/dist/errors/PrismicError.cjs.map +1 -1
  34. package/dist/errors/PrismicError.js +2 -5
  35. package/dist/errors/PrismicError.js.map +1 -1
  36. package/dist/errors/RefExpiredError.d.ts +1 -1
  37. package/dist/errors/RefNotFoundError.d.ts +1 -1
  38. package/dist/errors/RepositoryNotFoundError.d.ts +1 -1
  39. package/dist/filter.cjs.map +1 -1
  40. package/dist/filter.js.map +1 -1
  41. package/dist/getGraphQLEndpoint.cjs.map +1 -1
  42. package/dist/getGraphQLEndpoint.js.map +1 -1
  43. package/dist/getRepositoryEndpoint.cjs.map +1 -1
  44. package/dist/getRepositoryEndpoint.d.ts +9 -2
  45. package/dist/getRepositoryEndpoint.js.map +1 -1
  46. package/dist/getRepositoryName.cjs.map +1 -1
  47. package/dist/getRepositoryName.js.map +1 -1
  48. package/dist/getToolbarSrc.cjs.map +1 -1
  49. package/dist/getToolbarSrc.js.map +1 -1
  50. package/dist/helpers/asDate.cjs.map +1 -1
  51. package/dist/helpers/asDate.d.ts +13 -6
  52. package/dist/helpers/asDate.js.map +1 -1
  53. package/dist/helpers/asHTML.cjs +22 -22
  54. package/dist/helpers/asHTML.cjs.map +1 -1
  55. package/dist/helpers/asHTML.d.ts +37 -29
  56. package/dist/helpers/asHTML.js +22 -22
  57. package/dist/helpers/asHTML.js.map +1 -1
  58. package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
  59. package/dist/helpers/asImagePixelDensitySrcSet.d.ts +17 -16
  60. package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
  61. package/dist/helpers/asImageSrc.cjs.map +1 -1
  62. package/dist/helpers/asImageSrc.d.ts +12 -11
  63. package/dist/helpers/asImageSrc.js.map +1 -1
  64. package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
  65. package/dist/helpers/asImageWidthSrcSet.d.ts +19 -18
  66. package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
  67. package/dist/helpers/asLink.cjs.map +1 -1
  68. package/dist/helpers/asLink.d.ts +36 -35
  69. package/dist/helpers/asLink.js.map +1 -1
  70. package/dist/helpers/asLinkAttrs.cjs.map +1 -1
  71. package/dist/helpers/asLinkAttrs.d.ts +11 -14
  72. package/dist/helpers/asLinkAttrs.js.map +1 -1
  73. package/dist/helpers/asText.cjs.map +1 -1
  74. package/dist/helpers/asText.d.ts +21 -11
  75. package/dist/helpers/asText.js.map +1 -1
  76. package/dist/helpers/documentToLinkField.cjs +1 -2
  77. package/dist/helpers/documentToLinkField.cjs.map +1 -1
  78. package/dist/helpers/documentToLinkField.d.ts +2 -2
  79. package/dist/helpers/documentToLinkField.js +1 -2
  80. package/dist/helpers/documentToLinkField.js.map +1 -1
  81. package/dist/helpers/isFilled.cjs +1 -1
  82. package/dist/helpers/isFilled.cjs.map +1 -1
  83. package/dist/helpers/isFilled.d.ts +35 -34
  84. package/dist/helpers/isFilled.js +1 -1
  85. package/dist/helpers/isFilled.js.map +1 -1
  86. package/dist/helpers/mapSliceZone.cjs.map +1 -1
  87. package/dist/helpers/mapSliceZone.d.ts +11 -11
  88. package/dist/helpers/mapSliceZone.js.map +1 -1
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.ts +120 -120
  91. package/dist/index.js.map +1 -1
  92. package/dist/isRepositoryEndpoint.cjs.map +1 -1
  93. package/dist/isRepositoryEndpoint.d.ts +2 -2
  94. package/dist/isRepositoryEndpoint.js.map +1 -1
  95. package/dist/isRepositoryName.cjs.map +1 -1
  96. package/dist/isRepositoryName.js.map +1 -1
  97. package/dist/lib/appendFilters.cjs.map +1 -1
  98. package/dist/lib/appendFilters.js.map +1 -1
  99. package/dist/lib/castArray.cjs.map +1 -1
  100. package/dist/lib/castArray.js.map +1 -1
  101. package/dist/lib/castThunk.cjs.map +1 -1
  102. package/dist/lib/castThunk.js.map +1 -1
  103. package/dist/lib/devMsg.cjs.map +1 -1
  104. package/dist/lib/devMsg.js.map +1 -1
  105. package/dist/lib/escapeHTML.cjs.map +1 -1
  106. package/dist/lib/escapeHTML.js.map +1 -1
  107. package/dist/lib/everyTagFilter.cjs.map +1 -1
  108. package/dist/lib/everyTagFilter.js.map +1 -1
  109. package/dist/lib/findMasterRef.cjs.map +1 -1
  110. package/dist/lib/findMasterRef.d.ts +1 -1
  111. package/dist/lib/findMasterRef.js.map +1 -1
  112. package/dist/lib/findRef.cjs.map +1 -1
  113. package/dist/lib/findRef.d.ts +1 -1
  114. package/dist/lib/findRef.js.map +1 -1
  115. package/dist/lib/findRefByID.cjs.map +1 -1
  116. package/dist/lib/findRefByID.d.ts +1 -1
  117. package/dist/lib/findRefByID.js.map +1 -1
  118. package/dist/lib/findRefByLabel.cjs.map +1 -1
  119. package/dist/lib/findRefByLabel.d.ts +1 -1
  120. package/dist/lib/findRefByLabel.js.map +1 -1
  121. package/dist/lib/getOptionalLinkProperties.cjs.map +1 -1
  122. package/dist/lib/getOptionalLinkProperties.d.ts +1 -1
  123. package/dist/lib/getOptionalLinkProperties.js.map +1 -1
  124. package/dist/lib/getPreviewCookie.cjs.map +1 -1
  125. package/dist/lib/getPreviewCookie.js.map +1 -1
  126. package/dist/lib/isInternalURL.cjs.map +1 -1
  127. package/dist/lib/isInternalURL.js.map +1 -1
  128. package/dist/lib/isMigrationValue.cjs.map +1 -1
  129. package/dist/lib/isMigrationValue.d.ts +8 -8
  130. package/dist/lib/isMigrationValue.js.map +1 -1
  131. package/dist/lib/isValue.cjs.map +1 -1
  132. package/dist/lib/isValue.d.ts +10 -10
  133. package/dist/lib/isValue.js.map +1 -1
  134. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
  135. package/dist/lib/minifyGraphQLQuery.js.map +1 -1
  136. package/dist/lib/pLimit.cjs +3 -4
  137. package/dist/lib/pLimit.cjs.map +1 -1
  138. package/dist/lib/pLimit.js +3 -4
  139. package/dist/lib/pLimit.js.map +1 -1
  140. package/dist/lib/request.cjs +8 -10
  141. package/dist/lib/request.cjs.map +1 -1
  142. package/dist/lib/request.js +8 -10
  143. package/dist/lib/request.js.map +1 -1
  144. package/dist/lib/resolveMigrationDocumentData.cjs +4 -6
  145. package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -1
  146. package/dist/lib/resolveMigrationDocumentData.d.ts +8 -8
  147. package/dist/lib/resolveMigrationDocumentData.js +4 -6
  148. package/dist/lib/resolveMigrationDocumentData.js.map +1 -1
  149. package/dist/lib/serializerHelpers.cjs +2 -2
  150. package/dist/lib/serializerHelpers.cjs.map +1 -1
  151. package/dist/lib/serializerHelpers.d.ts +3 -3
  152. package/dist/lib/serializerHelpers.js +2 -2
  153. package/dist/lib/serializerHelpers.js.map +1 -1
  154. package/dist/lib/someTagsFilter.cjs.map +1 -1
  155. package/dist/lib/someTagsFilter.js.map +1 -1
  156. package/dist/lib/throttledLog.cjs.map +1 -1
  157. package/dist/lib/throttledLog.js.map +1 -1
  158. package/dist/lib/typeFilter.cjs.map +1 -1
  159. package/dist/lib/typeFilter.js.map +1 -1
  160. package/dist/lib/validateAssetMetadata.cjs.map +1 -1
  161. package/dist/lib/validateAssetMetadata.d.ts +1 -1
  162. package/dist/lib/validateAssetMetadata.js.map +1 -1
  163. package/dist/package.json.cjs +1 -1
  164. package/dist/package.json.js +1 -1
  165. package/dist/richtext/asText.cjs.map +1 -1
  166. package/dist/richtext/asText.d.ts +6 -6
  167. package/dist/richtext/asText.js.map +1 -1
  168. package/dist/richtext/asTree.cjs.map +1 -1
  169. package/dist/richtext/asTree.d.ts +2 -2
  170. package/dist/richtext/asTree.js.map +1 -1
  171. package/dist/richtext/composeSerializers.cjs.map +1 -1
  172. package/dist/richtext/composeSerializers.d.ts +1 -1
  173. package/dist/richtext/composeSerializers.js.map +1 -1
  174. package/dist/richtext/index.d.ts +7 -7
  175. package/dist/richtext/serialize.cjs.map +1 -1
  176. package/dist/richtext/serialize.d.ts +10 -10
  177. package/dist/richtext/serialize.js.map +1 -1
  178. package/dist/richtext/types.cjs.map +1 -1
  179. package/dist/richtext/types.d.ts +7 -7
  180. package/dist/richtext/types.js.map +1 -1
  181. package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
  182. package/dist/richtext/wrapMapSerializer.d.ts +1 -1
  183. package/dist/richtext/wrapMapSerializer.js.map +1 -1
  184. package/dist/types/api/asset/asset.d.ts +1 -1
  185. package/dist/types/api/integration.d.ts +1 -1
  186. package/dist/types/api/migration/document.d.ts +1 -1
  187. package/dist/types/api/query.d.ts +1 -1
  188. package/dist/types/api/release.d.ts +1 -1
  189. package/dist/types/api/repository.d.ts +1 -1
  190. package/dist/types/migration/Asset.cjs +12 -15
  191. package/dist/types/migration/Asset.cjs.map +1 -1
  192. package/dist/types/migration/Asset.d.ts +7 -7
  193. package/dist/types/migration/Asset.js +12 -15
  194. package/dist/types/migration/Asset.js.map +1 -1
  195. package/dist/types/migration/ContentRelationship.d.ts +3 -3
  196. package/dist/types/migration/Document.cjs +24 -27
  197. package/dist/types/migration/Document.cjs.map +1 -1
  198. package/dist/types/migration/Document.d.ts +9 -9
  199. package/dist/types/migration/Document.js +24 -27
  200. package/dist/types/migration/Document.js.map +1 -1
  201. package/dist/types/migration/Link.d.ts +1 -1
  202. package/dist/types/model/boolean.d.ts +1 -1
  203. package/dist/types/model/color.d.ts +1 -1
  204. package/dist/types/model/contentRelationship.d.ts +3 -2
  205. package/dist/types/model/customType.d.ts +1 -1
  206. package/dist/types/model/date.d.ts +1 -1
  207. package/dist/types/model/embed.d.ts +1 -1
  208. package/dist/types/model/geoPoint.d.ts +1 -1
  209. package/dist/types/model/group.d.ts +1 -1
  210. package/dist/types/model/image.d.ts +1 -1
  211. package/dist/types/model/integration.d.ts +1 -1
  212. package/dist/types/model/keyText.d.ts +1 -1
  213. package/dist/types/model/link.d.ts +1 -1
  214. package/dist/types/model/linkToMedia.d.ts +2 -2
  215. package/dist/types/model/number.d.ts +1 -1
  216. package/dist/types/model/range.d.ts +1 -1
  217. package/dist/types/model/richText.d.ts +1 -1
  218. package/dist/types/model/select.d.ts +1 -1
  219. package/dist/types/model/separator.d.ts +1 -1
  220. package/dist/types/model/sharedSlice.d.ts +2 -2
  221. package/dist/types/model/sharedSliceVariation.d.ts +1 -1
  222. package/dist/types/model/slice.d.ts +3 -3
  223. package/dist/types/model/sliceZone.d.ts +2 -2
  224. package/dist/types/model/table.d.ts +1 -1
  225. package/dist/types/model/timestamp.d.ts +1 -1
  226. package/dist/types/model/title.d.ts +1 -1
  227. package/dist/types/model/types.d.ts +22 -22
  228. package/dist/types/model/uid.d.ts +1 -1
  229. package/dist/types/value/color.d.ts +1 -1
  230. package/dist/types/value/contentRelationship.d.ts +3 -3
  231. package/dist/types/value/date.d.ts +1 -1
  232. package/dist/types/value/document.d.ts +4 -4
  233. package/dist/types/value/embed.d.ts +1 -1
  234. package/dist/types/value/geoPoint.d.ts +1 -1
  235. package/dist/types/value/group.d.ts +1 -1
  236. package/dist/types/value/image.d.ts +1 -1
  237. package/dist/types/value/integration.d.ts +1 -1
  238. package/dist/types/value/keyText.d.ts +1 -1
  239. package/dist/types/value/link.d.ts +5 -5
  240. package/dist/types/value/linkToMedia.d.ts +2 -2
  241. package/dist/types/value/number.d.ts +1 -1
  242. package/dist/types/value/richText.d.ts +3 -3
  243. package/dist/types/value/select.d.ts +1 -1
  244. package/dist/types/value/sharedSlice.d.ts +1 -1
  245. package/dist/types/value/sharedSliceVariation.d.ts +1 -1
  246. package/dist/types/value/slice.d.ts +1 -1
  247. package/dist/types/value/sliceZone.d.ts +3 -3
  248. package/dist/types/value/table.d.ts +2 -2
  249. package/dist/types/value/timestamp.d.ts +2 -2
  250. package/dist/types/value/title.d.ts +2 -2
  251. package/dist/types/value/types.d.ts +18 -18
  252. package/dist/types/webhook/apiUpdate.d.ts +1 -1
  253. package/dist/types/webhook/testTrigger.d.ts +1 -1
  254. package/dist/types/webhook/types.d.ts +2 -2
  255. package/package.json +11 -11
  256. package/src/WriteClient.ts +32 -21
  257. package/src/buildQueryURL.ts +29 -21
  258. package/src/createClient.ts +11 -8
  259. package/src/getRepositoryEndpoint.ts +9 -2
  260. package/src/helpers/asDate.ts +11 -4
  261. package/src/helpers/asHTML.ts +34 -26
  262. package/src/helpers/asImagePixelDensitySrcSet.ts +16 -15
  263. package/src/helpers/asImageSrc.ts +11 -10
  264. package/src/helpers/asImageWidthSrcSet.ts +18 -17
  265. package/src/helpers/asLink.ts +33 -32
  266. package/src/helpers/asLinkAttrs.ts +6 -9
  267. package/src/helpers/asText.ts +20 -10
  268. package/src/helpers/isFilled.ts +15 -14
  269. package/src/helpers/mapSliceZone.ts +10 -10
  270. package/src/index.ts +2 -2
  271. package/src/isRepositoryEndpoint.ts +2 -2
  272. package/src/richtext/asText.ts +5 -5
  273. package/src/richtext/serialize.ts +8 -8
  274. package/src/richtext/types.ts +6 -6
  275. package/src/types/migration/Asset.ts +10 -2
  276. package/src/types/model/contentRelationship.ts +1 -0
@@ -1,9 +1,28 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
3
  class PrismicMigrationDocument {
4
+ /**
5
+ * The document to be sent to the Migration API.
6
+ */
7
+ document;
8
+ /**
9
+ * The name of the document displayed in the editor.
10
+ */
11
+ title;
12
+ /**
13
+ * The link to the master language document to relate the document to if any.
14
+ */
15
+ masterLanguageDocument;
16
+ /**
17
+ * Original Prismic document when the migration document came from another
18
+ * Prismic repository.
19
+ *
20
+ * @remarks
21
+ * When migrating a document from another repository, one might want to alter
22
+ * it with migration specific types, hence accepting an
23
+ * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.
24
+ */
25
+ originalPrismicDocument;
7
26
  /**
8
27
  * Creates a Prismic migration document instance.
9
28
  *
@@ -15,32 +34,10 @@ class PrismicMigrationDocument {
15
34
  * @returns A Prismic migration document instance.
16
35
  */
17
36
  constructor(document, title, params) {
18
- /**
19
- * The document to be sent to the Migration API.
20
- */
21
- __publicField(this, "document");
22
- /**
23
- * The name of the document displayed in the editor.
24
- */
25
- __publicField(this, "title");
26
- /**
27
- * The link to the master language document to relate the document to if any.
28
- */
29
- __publicField(this, "masterLanguageDocument");
30
- /**
31
- * Original Prismic document when the migration document came from another
32
- * Prismic repository.
33
- *
34
- * @remarks
35
- * When migrating a document from another repository, one might want to alter
36
- * it with migration specific types, hence accepting an
37
- * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.
38
- */
39
- __publicField(this, "originalPrismicDocument");
40
37
  this.document = document;
41
38
  this.title = title;
42
- this.masterLanguageDocument = params == null ? void 0 : params.masterLanguageDocument;
43
- this.originalPrismicDocument = params == null ? void 0 : params.originalPrismicDocument;
39
+ this.masterLanguageDocument = params?.masterLanguageDocument;
40
+ this.originalPrismicDocument = params?.originalPrismicDocument;
44
41
  }
45
42
  }
46
43
  exports.PrismicMigrationDocument = PrismicMigrationDocument;
@@ -1 +1 @@
1
- {"version":3,"file":"Document.cjs","sources":["../../../../src/types/migration/Document.ts"],"sourcesContent":["import type { FilledContentRelationshipField } from \"../value/contentRelationship\"\nimport type { PrismicDocument, PrismicDocumentWithUID } from \"../value/document\"\nimport type { AnyOEmbed, EmbedField, OEmbedExtra } from \"../value/embed\"\nimport type { FilledImageFieldImage } from \"../value/image\"\nimport type { FilledLinkToMediaField } from \"../value/linkToMedia\"\nimport type { RTImageNode } from \"../value/richText\"\nimport type { SharedSlice } from \"../value/sharedSlice\"\n\nimport type {\n\tMigrationImage,\n\tMigrationLinkToMedia,\n\tMigrationRTImageNode,\n} from \"./Asset\"\nimport type { MigrationContentRelationship } from \"./ContentRelationship\"\n\n/**\n * A utility type that extends any fields in a record with their migration\n * fields equivalent.\n *\n * @typeParam T - Type of the record to extend.\n */\nexport type InjectMigrationSpecificTypes<T> = T extends RTImageNode\n\t?\n\t\t\t| T\n\t\t\t| (Omit<T, \"linkTo\"> & InjectMigrationSpecificTypes<Pick<T, \"linkTo\">>)\n\t\t\t| MigrationRTImageNode\n\t\t\t| undefined\n\t: T extends FilledImageFieldImage\n\t\t? T | MigrationImage | undefined\n\t\t: T extends FilledLinkToMediaField\n\t\t\t? T | MigrationLinkToMedia | undefined\n\t\t\t: T extends FilledContentRelationshipField\n\t\t\t\t? T | MigrationContentRelationship\n\t\t\t\t: T extends EmbedField<AnyOEmbed & OEmbedExtra, \"filled\">\n\t\t\t\t\t? T | Pick<T, \"embed_url\">\n\t\t\t\t\t: T extends SharedSlice\n\t\t\t\t\t\t?\n\t\t\t\t\t\t\t\t| T\n\t\t\t\t\t\t\t\t| InjectMigrationSpecificTypes<\n\t\t\t\t\t\t\t\t\t\tOmit<T, \"id\" | \"slice_label\" | \"version\">\n\t\t\t\t\t\t\t\t >\n\t\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tT extends Record<any, any>\n\t\t\t\t\t\t\t? { [P in keyof T]: InjectMigrationSpecificTypes<T[P]> }\n\t\t\t\t\t\t\t: T extends Array<infer U>\n\t\t\t\t\t\t\t\t? Array<InjectMigrationSpecificTypes<U>>\n\t\t\t\t\t\t\t\t: T\n\n/**\n * A utility type that ties the type and data of a Prismic document, creating a\n * strict union.\n */\ntype TiedDocumentTypeAndData<TDocument extends PrismicDocument> =\n\tTDocument extends PrismicDocument<infer TData, infer TType>\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Type of the document.\n\t\t\t\t */\n\t\t\t\ttype: TType\n\n\t\t\t\t/**\n\t\t\t\t * Data contained in the document.\n\t\t\t\t */\n\t\t\t\tdata: InjectMigrationSpecificTypes<TData>\n\t\t\t} & (TDocument extends PrismicDocumentWithUID\n\t\t\t\t? Pick<TDocument, \"uid\">\n\t\t\t\t: Partial<Pick<TDocument, \"uid\">>)\n\t\t: never\n\n/**\n * A pending Prismic document to be created with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type PendingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Pick<TDocument, \"lang\"> &\n\tPartial<Pick<TDocument, \"tags\">> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * An existing Prismic document to be updated with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type ExistingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Omit<TDocument, \"uid\" | \"type\" | \"data\"> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * A Prismic document to be sent to the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type MigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = PendingPrismicDocument<TDocument> | ExistingPrismicDocument<TDocument>\n\n/**\n * A Prismic migration document instance.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport class PrismicMigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> {\n\t/**\n\t * The document to be sent to the Migration API.\n\t */\n\tdocument: MigrationDocument<TDocument> & Partial<Pick<TDocument, \"id\">>\n\n\t/**\n\t * The name of the document displayed in the editor.\n\t */\n\ttitle?: string\n\n\t/**\n\t * The link to the master language document to relate the document to if any.\n\t */\n\tmasterLanguageDocument?: MigrationContentRelationship\n\n\t/**\n\t * Original Prismic document when the migration document came from another\n\t * Prismic repository.\n\t *\n\t * @remarks\n\t * When migrating a document from another repository, one might want to alter\n\t * it with migration specific types, hence accepting an\n\t * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.\n\t */\n\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\n\t/**\n\t * Creates a Prismic migration document instance.\n\t *\n\t * @param document - The document to be sent to the Migration API.\n\t * @param title - The name of the document displayed in the editor.\n\t * @param params - Parameters to create/update the document with on the\n\t * Migration API.\n\t *\n\t * @returns A Prismic migration document instance.\n\t */\n\tconstructor(\n\t\tdocument: MigrationDocument<TDocument>,\n\t\ttitle?: string,\n\t\tparams?: {\n\t\t\tmasterLanguageDocument?: MigrationContentRelationship\n\t\t\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\t\t},\n\t) {\n\t\tthis.document = document\n\t\tthis.title = title\n\t\tthis.masterLanguageDocument = params?.masterLanguageDocument\n\t\tthis.originalPrismicDocument = params?.originalPrismicDocument\n\t}\n}\n"],"names":[],"mappings":";;;;;MAwGa,yBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuCpC,YACC,UACA,OACA,QAGC;AAvCF;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBC,SAAK,WAAW;AAChB,SAAK,QAAQ;AACb,SAAK,yBAAyB,iCAAQ;AACtC,SAAK,0BAA0B,iCAAQ;AAAA,EAAA;AAExC;;"}
1
+ {"version":3,"file":"Document.cjs","sources":["../../../../src/types/migration/Document.ts"],"sourcesContent":["import type { FilledContentRelationshipField } from \"../value/contentRelationship\"\nimport type { PrismicDocument, PrismicDocumentWithUID } from \"../value/document\"\nimport type { AnyOEmbed, EmbedField, OEmbedExtra } from \"../value/embed\"\nimport type { FilledImageFieldImage } from \"../value/image\"\nimport type { FilledLinkToMediaField } from \"../value/linkToMedia\"\nimport type { RTImageNode } from \"../value/richText\"\nimport type { SharedSlice } from \"../value/sharedSlice\"\n\nimport type {\n\tMigrationImage,\n\tMigrationLinkToMedia,\n\tMigrationRTImageNode,\n} from \"./Asset\"\nimport type { MigrationContentRelationship } from \"./ContentRelationship\"\n\n/**\n * A utility type that extends any fields in a record with their migration\n * fields equivalent.\n *\n * @typeParam T - Type of the record to extend.\n */\nexport type InjectMigrationSpecificTypes<T> = T extends RTImageNode\n\t?\n\t\t\t| T\n\t\t\t| (Omit<T, \"linkTo\"> & InjectMigrationSpecificTypes<Pick<T, \"linkTo\">>)\n\t\t\t| MigrationRTImageNode\n\t\t\t| undefined\n\t: T extends FilledImageFieldImage\n\t\t? T | MigrationImage | undefined\n\t\t: T extends FilledLinkToMediaField\n\t\t\t? T | MigrationLinkToMedia | undefined\n\t\t\t: T extends FilledContentRelationshipField\n\t\t\t\t? T | MigrationContentRelationship\n\t\t\t\t: T extends EmbedField<AnyOEmbed & OEmbedExtra, \"filled\">\n\t\t\t\t\t? T | Pick<T, \"embed_url\">\n\t\t\t\t\t: T extends SharedSlice\n\t\t\t\t\t\t?\n\t\t\t\t\t\t\t\t| T\n\t\t\t\t\t\t\t\t| InjectMigrationSpecificTypes<\n\t\t\t\t\t\t\t\t\t\tOmit<T, \"id\" | \"slice_label\" | \"version\">\n\t\t\t\t\t\t\t\t >\n\t\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tT extends Record<any, any>\n\t\t\t\t\t\t\t? { [P in keyof T]: InjectMigrationSpecificTypes<T[P]> }\n\t\t\t\t\t\t\t: T extends Array<infer U>\n\t\t\t\t\t\t\t\t? Array<InjectMigrationSpecificTypes<U>>\n\t\t\t\t\t\t\t\t: T\n\n/**\n * A utility type that ties the type and data of a Prismic document, creating a\n * strict union.\n */\ntype TiedDocumentTypeAndData<TDocument extends PrismicDocument> =\n\tTDocument extends PrismicDocument<infer TData, infer TType>\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Type of the document.\n\t\t\t\t */\n\t\t\t\ttype: TType\n\n\t\t\t\t/**\n\t\t\t\t * Data contained in the document.\n\t\t\t\t */\n\t\t\t\tdata: InjectMigrationSpecificTypes<TData>\n\t\t\t} & (TDocument extends PrismicDocumentWithUID\n\t\t\t\t? Pick<TDocument, \"uid\">\n\t\t\t\t: Partial<Pick<TDocument, \"uid\">>)\n\t\t: never\n\n/**\n * A pending Prismic document to be created with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type PendingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Pick<TDocument, \"lang\"> &\n\tPartial<Pick<TDocument, \"tags\">> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * An existing Prismic document to be updated with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type ExistingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Omit<TDocument, \"uid\" | \"type\" | \"data\"> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * A Prismic document to be sent to the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type MigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = PendingPrismicDocument<TDocument> | ExistingPrismicDocument<TDocument>\n\n/**\n * A Prismic migration document instance.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport class PrismicMigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> {\n\t/**\n\t * The document to be sent to the Migration API.\n\t */\n\tdocument: MigrationDocument<TDocument> & Partial<Pick<TDocument, \"id\">>\n\n\t/**\n\t * The name of the document displayed in the editor.\n\t */\n\ttitle?: string\n\n\t/**\n\t * The link to the master language document to relate the document to if any.\n\t */\n\tmasterLanguageDocument?: MigrationContentRelationship\n\n\t/**\n\t * Original Prismic document when the migration document came from another\n\t * Prismic repository.\n\t *\n\t * @remarks\n\t * When migrating a document from another repository, one might want to alter\n\t * it with migration specific types, hence accepting an\n\t * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.\n\t */\n\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\n\t/**\n\t * Creates a Prismic migration document instance.\n\t *\n\t * @param document - The document to be sent to the Migration API.\n\t * @param title - The name of the document displayed in the editor.\n\t * @param params - Parameters to create/update the document with on the\n\t * Migration API.\n\t *\n\t * @returns A Prismic migration document instance.\n\t */\n\tconstructor(\n\t\tdocument: MigrationDocument<TDocument>,\n\t\ttitle?: string,\n\t\tparams?: {\n\t\t\tmasterLanguageDocument?: MigrationContentRelationship\n\t\t\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\t\t},\n\t) {\n\t\tthis.document = document\n\t\tthis.title = title\n\t\tthis.masterLanguageDocument = params?.masterLanguageDocument\n\t\tthis.originalPrismicDocument = params?.originalPrismicDocument\n\t}\n}\n"],"names":[],"mappings":";;MAwGa,yBAAwB;AAAA;AAAA;AAAA;AAAA,EAMpC;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,YACC,UACA,OACA,QAGC;AAED,SAAK,WAAW;AAChB,SAAK,QAAQ;AACb,SAAK,yBAAyB,QAAQ;AACtC,SAAK,0BAA0B,QAAQ;AAAA,EACxC;AACA;;"}
@@ -1,12 +1,12 @@
1
- import type { FilledContentRelationshipField } from "../value/contentRelationship";
2
- import type { PrismicDocument, PrismicDocumentWithUID } from "../value/document";
3
- import type { AnyOEmbed, EmbedField, OEmbedExtra } from "../value/embed";
4
- import type { FilledImageFieldImage } from "../value/image";
5
- import type { FilledLinkToMediaField } from "../value/linkToMedia";
6
- import type { RTImageNode } from "../value/richText";
7
- import type { SharedSlice } from "../value/sharedSlice";
8
- import type { MigrationImage, MigrationLinkToMedia, MigrationRTImageNode } from "./Asset";
9
- import type { MigrationContentRelationship } from "./ContentRelationship";
1
+ import type { FilledContentRelationshipField } from "../value/contentRelationship.js";
2
+ import type { PrismicDocument, PrismicDocumentWithUID } from "../value/document.js";
3
+ import type { AnyOEmbed, EmbedField, OEmbedExtra } from "../value/embed.js";
4
+ import type { FilledImageFieldImage } from "../value/image.js";
5
+ import type { FilledLinkToMediaField } from "../value/linkToMedia.js";
6
+ import type { RTImageNode } from "../value/richText.js";
7
+ import type { SharedSlice } from "../value/sharedSlice.js";
8
+ import type { MigrationImage, MigrationLinkToMedia, MigrationRTImageNode } from "./Asset.js";
9
+ import type { MigrationContentRelationship } from "./ContentRelationship.js";
10
10
  /**
11
11
  * A utility type that extends any fields in a record with their migration
12
12
  * fields equivalent.
@@ -1,7 +1,26 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
1
  class PrismicMigrationDocument {
2
+ /**
3
+ * The document to be sent to the Migration API.
4
+ */
5
+ document;
6
+ /**
7
+ * The name of the document displayed in the editor.
8
+ */
9
+ title;
10
+ /**
11
+ * The link to the master language document to relate the document to if any.
12
+ */
13
+ masterLanguageDocument;
14
+ /**
15
+ * Original Prismic document when the migration document came from another
16
+ * Prismic repository.
17
+ *
18
+ * @remarks
19
+ * When migrating a document from another repository, one might want to alter
20
+ * it with migration specific types, hence accepting an
21
+ * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.
22
+ */
23
+ originalPrismicDocument;
5
24
  /**
6
25
  * Creates a Prismic migration document instance.
7
26
  *
@@ -13,32 +32,10 @@ class PrismicMigrationDocument {
13
32
  * @returns A Prismic migration document instance.
14
33
  */
15
34
  constructor(document, title, params) {
16
- /**
17
- * The document to be sent to the Migration API.
18
- */
19
- __publicField(this, "document");
20
- /**
21
- * The name of the document displayed in the editor.
22
- */
23
- __publicField(this, "title");
24
- /**
25
- * The link to the master language document to relate the document to if any.
26
- */
27
- __publicField(this, "masterLanguageDocument");
28
- /**
29
- * Original Prismic document when the migration document came from another
30
- * Prismic repository.
31
- *
32
- * @remarks
33
- * When migrating a document from another repository, one might want to alter
34
- * it with migration specific types, hence accepting an
35
- * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.
36
- */
37
- __publicField(this, "originalPrismicDocument");
38
35
  this.document = document;
39
36
  this.title = title;
40
- this.masterLanguageDocument = params == null ? void 0 : params.masterLanguageDocument;
41
- this.originalPrismicDocument = params == null ? void 0 : params.originalPrismicDocument;
37
+ this.masterLanguageDocument = params?.masterLanguageDocument;
38
+ this.originalPrismicDocument = params?.originalPrismicDocument;
42
39
  }
43
40
  }
44
41
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Document.js","sources":["../../../../src/types/migration/Document.ts"],"sourcesContent":["import type { FilledContentRelationshipField } from \"../value/contentRelationship\"\nimport type { PrismicDocument, PrismicDocumentWithUID } from \"../value/document\"\nimport type { AnyOEmbed, EmbedField, OEmbedExtra } from \"../value/embed\"\nimport type { FilledImageFieldImage } from \"../value/image\"\nimport type { FilledLinkToMediaField } from \"../value/linkToMedia\"\nimport type { RTImageNode } from \"../value/richText\"\nimport type { SharedSlice } from \"../value/sharedSlice\"\n\nimport type {\n\tMigrationImage,\n\tMigrationLinkToMedia,\n\tMigrationRTImageNode,\n} from \"./Asset\"\nimport type { MigrationContentRelationship } from \"./ContentRelationship\"\n\n/**\n * A utility type that extends any fields in a record with their migration\n * fields equivalent.\n *\n * @typeParam T - Type of the record to extend.\n */\nexport type InjectMigrationSpecificTypes<T> = T extends RTImageNode\n\t?\n\t\t\t| T\n\t\t\t| (Omit<T, \"linkTo\"> & InjectMigrationSpecificTypes<Pick<T, \"linkTo\">>)\n\t\t\t| MigrationRTImageNode\n\t\t\t| undefined\n\t: T extends FilledImageFieldImage\n\t\t? T | MigrationImage | undefined\n\t\t: T extends FilledLinkToMediaField\n\t\t\t? T | MigrationLinkToMedia | undefined\n\t\t\t: T extends FilledContentRelationshipField\n\t\t\t\t? T | MigrationContentRelationship\n\t\t\t\t: T extends EmbedField<AnyOEmbed & OEmbedExtra, \"filled\">\n\t\t\t\t\t? T | Pick<T, \"embed_url\">\n\t\t\t\t\t: T extends SharedSlice\n\t\t\t\t\t\t?\n\t\t\t\t\t\t\t\t| T\n\t\t\t\t\t\t\t\t| InjectMigrationSpecificTypes<\n\t\t\t\t\t\t\t\t\t\tOmit<T, \"id\" | \"slice_label\" | \"version\">\n\t\t\t\t\t\t\t\t >\n\t\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tT extends Record<any, any>\n\t\t\t\t\t\t\t? { [P in keyof T]: InjectMigrationSpecificTypes<T[P]> }\n\t\t\t\t\t\t\t: T extends Array<infer U>\n\t\t\t\t\t\t\t\t? Array<InjectMigrationSpecificTypes<U>>\n\t\t\t\t\t\t\t\t: T\n\n/**\n * A utility type that ties the type and data of a Prismic document, creating a\n * strict union.\n */\ntype TiedDocumentTypeAndData<TDocument extends PrismicDocument> =\n\tTDocument extends PrismicDocument<infer TData, infer TType>\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Type of the document.\n\t\t\t\t */\n\t\t\t\ttype: TType\n\n\t\t\t\t/**\n\t\t\t\t * Data contained in the document.\n\t\t\t\t */\n\t\t\t\tdata: InjectMigrationSpecificTypes<TData>\n\t\t\t} & (TDocument extends PrismicDocumentWithUID\n\t\t\t\t? Pick<TDocument, \"uid\">\n\t\t\t\t: Partial<Pick<TDocument, \"uid\">>)\n\t\t: never\n\n/**\n * A pending Prismic document to be created with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type PendingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Pick<TDocument, \"lang\"> &\n\tPartial<Pick<TDocument, \"tags\">> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * An existing Prismic document to be updated with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type ExistingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Omit<TDocument, \"uid\" | \"type\" | \"data\"> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * A Prismic document to be sent to the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type MigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = PendingPrismicDocument<TDocument> | ExistingPrismicDocument<TDocument>\n\n/**\n * A Prismic migration document instance.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport class PrismicMigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> {\n\t/**\n\t * The document to be sent to the Migration API.\n\t */\n\tdocument: MigrationDocument<TDocument> & Partial<Pick<TDocument, \"id\">>\n\n\t/**\n\t * The name of the document displayed in the editor.\n\t */\n\ttitle?: string\n\n\t/**\n\t * The link to the master language document to relate the document to if any.\n\t */\n\tmasterLanguageDocument?: MigrationContentRelationship\n\n\t/**\n\t * Original Prismic document when the migration document came from another\n\t * Prismic repository.\n\t *\n\t * @remarks\n\t * When migrating a document from another repository, one might want to alter\n\t * it with migration specific types, hence accepting an\n\t * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.\n\t */\n\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\n\t/**\n\t * Creates a Prismic migration document instance.\n\t *\n\t * @param document - The document to be sent to the Migration API.\n\t * @param title - The name of the document displayed in the editor.\n\t * @param params - Parameters to create/update the document with on the\n\t * Migration API.\n\t *\n\t * @returns A Prismic migration document instance.\n\t */\n\tconstructor(\n\t\tdocument: MigrationDocument<TDocument>,\n\t\ttitle?: string,\n\t\tparams?: {\n\t\t\tmasterLanguageDocument?: MigrationContentRelationship\n\t\t\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\t\t},\n\t) {\n\t\tthis.document = document\n\t\tthis.title = title\n\t\tthis.masterLanguageDocument = params?.masterLanguageDocument\n\t\tthis.originalPrismicDocument = params?.originalPrismicDocument\n\t}\n}\n"],"names":[],"mappings":";;;MAwGa,yBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuCpC,YACC,UACA,OACA,QAGC;AAvCF;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBC,SAAK,WAAW;AAChB,SAAK,QAAQ;AACb,SAAK,yBAAyB,iCAAQ;AACtC,SAAK,0BAA0B,iCAAQ;AAAA,EAAA;AAExC;"}
1
+ {"version":3,"file":"Document.js","sources":["../../../../src/types/migration/Document.ts"],"sourcesContent":["import type { FilledContentRelationshipField } from \"../value/contentRelationship\"\nimport type { PrismicDocument, PrismicDocumentWithUID } from \"../value/document\"\nimport type { AnyOEmbed, EmbedField, OEmbedExtra } from \"../value/embed\"\nimport type { FilledImageFieldImage } from \"../value/image\"\nimport type { FilledLinkToMediaField } from \"../value/linkToMedia\"\nimport type { RTImageNode } from \"../value/richText\"\nimport type { SharedSlice } from \"../value/sharedSlice\"\n\nimport type {\n\tMigrationImage,\n\tMigrationLinkToMedia,\n\tMigrationRTImageNode,\n} from \"./Asset\"\nimport type { MigrationContentRelationship } from \"./ContentRelationship\"\n\n/**\n * A utility type that extends any fields in a record with their migration\n * fields equivalent.\n *\n * @typeParam T - Type of the record to extend.\n */\nexport type InjectMigrationSpecificTypes<T> = T extends RTImageNode\n\t?\n\t\t\t| T\n\t\t\t| (Omit<T, \"linkTo\"> & InjectMigrationSpecificTypes<Pick<T, \"linkTo\">>)\n\t\t\t| MigrationRTImageNode\n\t\t\t| undefined\n\t: T extends FilledImageFieldImage\n\t\t? T | MigrationImage | undefined\n\t\t: T extends FilledLinkToMediaField\n\t\t\t? T | MigrationLinkToMedia | undefined\n\t\t\t: T extends FilledContentRelationshipField\n\t\t\t\t? T | MigrationContentRelationship\n\t\t\t\t: T extends EmbedField<AnyOEmbed & OEmbedExtra, \"filled\">\n\t\t\t\t\t? T | Pick<T, \"embed_url\">\n\t\t\t\t\t: T extends SharedSlice\n\t\t\t\t\t\t?\n\t\t\t\t\t\t\t\t| T\n\t\t\t\t\t\t\t\t| InjectMigrationSpecificTypes<\n\t\t\t\t\t\t\t\t\t\tOmit<T, \"id\" | \"slice_label\" | \"version\">\n\t\t\t\t\t\t\t\t >\n\t\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tT extends Record<any, any>\n\t\t\t\t\t\t\t? { [P in keyof T]: InjectMigrationSpecificTypes<T[P]> }\n\t\t\t\t\t\t\t: T extends Array<infer U>\n\t\t\t\t\t\t\t\t? Array<InjectMigrationSpecificTypes<U>>\n\t\t\t\t\t\t\t\t: T\n\n/**\n * A utility type that ties the type and data of a Prismic document, creating a\n * strict union.\n */\ntype TiedDocumentTypeAndData<TDocument extends PrismicDocument> =\n\tTDocument extends PrismicDocument<infer TData, infer TType>\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Type of the document.\n\t\t\t\t */\n\t\t\t\ttype: TType\n\n\t\t\t\t/**\n\t\t\t\t * Data contained in the document.\n\t\t\t\t */\n\t\t\t\tdata: InjectMigrationSpecificTypes<TData>\n\t\t\t} & (TDocument extends PrismicDocumentWithUID\n\t\t\t\t? Pick<TDocument, \"uid\">\n\t\t\t\t: Partial<Pick<TDocument, \"uid\">>)\n\t\t: never\n\n/**\n * A pending Prismic document to be created with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type PendingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Pick<TDocument, \"lang\"> &\n\tPartial<Pick<TDocument, \"tags\">> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * An existing Prismic document to be updated with the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type ExistingPrismicDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = Omit<TDocument, \"uid\" | \"type\" | \"data\"> &\n\tTiedDocumentTypeAndData<TDocument>\n\n/**\n * A Prismic document to be sent to the Migration API.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport type MigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> = PendingPrismicDocument<TDocument> | ExistingPrismicDocument<TDocument>\n\n/**\n * A Prismic migration document instance.\n *\n * @typeParam TDocument - Type of the Prismic document.\n */\nexport class PrismicMigrationDocument<\n\tTDocument extends PrismicDocument = PrismicDocument,\n> {\n\t/**\n\t * The document to be sent to the Migration API.\n\t */\n\tdocument: MigrationDocument<TDocument> & Partial<Pick<TDocument, \"id\">>\n\n\t/**\n\t * The name of the document displayed in the editor.\n\t */\n\ttitle?: string\n\n\t/**\n\t * The link to the master language document to relate the document to if any.\n\t */\n\tmasterLanguageDocument?: MigrationContentRelationship\n\n\t/**\n\t * Original Prismic document when the migration document came from another\n\t * Prismic repository.\n\t *\n\t * @remarks\n\t * When migrating a document from another repository, one might want to alter\n\t * it with migration specific types, hence accepting an\n\t * `ExistingPrismicDocument` instead of a regular `PrismicDocument`.\n\t */\n\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\n\t/**\n\t * Creates a Prismic migration document instance.\n\t *\n\t * @param document - The document to be sent to the Migration API.\n\t * @param title - The name of the document displayed in the editor.\n\t * @param params - Parameters to create/update the document with on the\n\t * Migration API.\n\t *\n\t * @returns A Prismic migration document instance.\n\t */\n\tconstructor(\n\t\tdocument: MigrationDocument<TDocument>,\n\t\ttitle?: string,\n\t\tparams?: {\n\t\t\tmasterLanguageDocument?: MigrationContentRelationship\n\t\t\toriginalPrismicDocument?: ExistingPrismicDocument<PrismicDocument>\n\t\t},\n\t) {\n\t\tthis.document = document\n\t\tthis.title = title\n\t\tthis.masterLanguageDocument = params?.masterLanguageDocument\n\t\tthis.originalPrismicDocument = params?.originalPrismicDocument\n\t}\n}\n"],"names":[],"mappings":"MAwGa,yBAAwB;AAAA;AAAA;AAAA;AAAA,EAMpC;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA,EAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,YACC,UACA,OACA,QAGC;AAED,SAAK,WAAW;AAChB,SAAK,QAAQ;AACb,SAAK,yBAAyB,QAAQ;AACtC,SAAK,0BAA0B,QAAQ;AAAA,EACxC;AACA;"}
@@ -1,4 +1,4 @@
1
- import type { LinkType, OptionalLinkProperties } from "../value/link";
1
+ import type { LinkType, OptionalLinkProperties } from "../value/link.js";
2
2
  /**
3
3
  * Adds `OptionalLinkProperties` to any type that looks like a link object (one
4
4
  * that includes a valid `link_type` property).
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A boolean custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A color custom type field.
4
4
  *
@@ -1,5 +1,5 @@
1
- import type { CustomTypeModelFieldType } from "./types";
2
- import type { CustomTypeModelLinkSelectType } from "./link";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
+ import type { CustomTypeModelLinkSelectType } from "./link.js";
3
3
  /**
4
4
  * @internal
5
5
  */
@@ -42,6 +42,7 @@ export type CustomTypeModelFetchCustomTypeLevel1 = {
42
42
  */
43
43
  export interface CustomTypeModelContentRelationshipField<CustomTypes extends string | CustomTypeModelFetchCustomTypeLevel1 = string | CustomTypeModelFetchCustomTypeLevel1, Tags extends string = string> {
44
44
  type: typeof CustomTypeModelFieldType.Link;
45
+ fieldset?: string | null;
45
46
  config?: {
46
47
  label?: string | null;
47
48
  placeholder?: string;
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelField } from "./types";
1
+ import type { CustomTypeModelField } from "./types.js";
2
2
  /**
3
3
  * A Prismic custom type model.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A date custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * An embed custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A geopoint custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldForGroup, CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A group custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * Dimension constraints for an image custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * An integration custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A key text custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A link custom type field.
4
4
  *
@@ -1,5 +1,5 @@
1
- import type { CustomTypeModelFieldType } from "./types";
2
- import type { CustomTypeModelLinkSelectType } from "./link";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
+ import type { CustomTypeModelLinkSelectType } from "./link.js";
3
3
  /**
4
4
  * A link to media custom type field.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A number custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * @deprecated - Legacy field. Use `CustomTypeModelNumberField` instead.
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A rich text custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A select custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * @deprecated - Legacy field. Do not use.
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { SharedSliceModelVariation } from "./sharedSliceVariation";
2
- import type { CustomTypeModelSliceType } from "./sliceZone";
1
+ import type { SharedSliceModelVariation } from "./sharedSliceVariation.js";
2
+ import type { CustomTypeModelSliceType } from "./sliceZone.js";
3
3
  /**
4
4
  * A Prismic shared Slice model.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary } from "./types";
1
+ import type { CustomTypeModelFieldForNestedGroup, CustomTypeModelFieldForSlicePrimary } from "./types.js";
2
2
  /**
3
3
  * A shared Slice variation.
4
4
  *
@@ -1,6 +1,6 @@
1
- import type { CustomTypeModelFieldForNestedGroup } from "./types";
2
- import type { CustomTypeModelNestedGroupField } from "./group";
3
- import type { CustomTypeModelSliceType } from "./sliceZone";
1
+ import type { CustomTypeModelFieldForNestedGroup } from "./types.js";
2
+ import type { CustomTypeModelNestedGroupField } from "./group.js";
3
+ import type { CustomTypeModelSliceType } from "./sliceZone.js";
4
4
  /**
5
5
  * A Slice for a custom type.
6
6
  *
@@ -1,5 +1,5 @@
1
- import type { CustomTypeModelFieldType } from "./types";
2
- import type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./slice";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
+ import type { CustomTypeModelLegacySlice, CustomTypeModelSlice } from "./slice.js";
3
3
  /**
4
4
  * A Slice Zone custom type field.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A table custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A timestamp custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelRichTextSingleField } from "./richText";
1
+ import type { CustomTypeModelRichTextSingleField } from "./richText.js";
2
2
  /**
3
3
  * A title custom type field.
4
4
  *
@@ -1,25 +1,25 @@
1
- import type { CustomTypeModelBooleanField } from "./boolean";
2
- import type { CustomTypeModelColorField } from "./color";
3
- import type { CustomTypeModelContentRelationshipField } from "./contentRelationship";
4
- import type { CustomTypeModelDateField } from "./date";
5
- import type { CustomTypeModelEmbedField } from "./embed";
6
- import type { CustomTypeModelGeoPointField } from "./geoPoint";
7
- import type { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group";
8
- import type { CustomTypeModelImageField } from "./image";
9
- import type { CustomTypeModelIntegrationField } from "./integration";
10
- import type { CustomTypeModelKeyTextField } from "./keyText";
11
- import type { CustomTypeModelLinkField } from "./link";
12
- import type { CustomTypeModelLinkToMediaField } from "./linkToMedia";
13
- import type { CustomTypeModelNumberField } from "./number";
14
- import type { CustomTypeModelRangeField } from "./range";
15
- import type { CustomTypeModelRichTextField } from "./richText";
16
- import type { CustomTypeModelSelectField } from "./select";
17
- import type { CustomTypeModelSeparatorField } from "./separator";
18
- import type { CustomTypeModelSliceZoneField } from "./sliceZone";
19
- import type { CustomTypeModelTableField } from "./table";
20
- import type { CustomTypeModelTimestampField } from "./timestamp";
21
- import type { CustomTypeModelTitleField } from "./title";
22
- import type { CustomTypeModelUIDField } from "./uid";
1
+ import type { CustomTypeModelBooleanField } from "./boolean.js";
2
+ import type { CustomTypeModelColorField } from "./color.js";
3
+ import type { CustomTypeModelContentRelationshipField } from "./contentRelationship.js";
4
+ import type { CustomTypeModelDateField } from "./date.js";
5
+ import type { CustomTypeModelEmbedField } from "./embed.js";
6
+ import type { CustomTypeModelGeoPointField } from "./geoPoint.js";
7
+ import type { CustomTypeModelGroupField, CustomTypeModelNestedGroupField } from "./group.js";
8
+ import type { CustomTypeModelImageField } from "./image.js";
9
+ import type { CustomTypeModelIntegrationField } from "./integration.js";
10
+ import type { CustomTypeModelKeyTextField } from "./keyText.js";
11
+ import type { CustomTypeModelLinkField } from "./link.js";
12
+ import type { CustomTypeModelLinkToMediaField } from "./linkToMedia.js";
13
+ import type { CustomTypeModelNumberField } from "./number.js";
14
+ import type { CustomTypeModelRangeField } from "./range.js";
15
+ import type { CustomTypeModelRichTextField } from "./richText.js";
16
+ import type { CustomTypeModelSelectField } from "./select.js";
17
+ import type { CustomTypeModelSeparatorField } from "./separator.js";
18
+ import type { CustomTypeModelSliceZoneField } from "./sliceZone.js";
19
+ import type { CustomTypeModelTableField } from "./table.js";
20
+ import type { CustomTypeModelTimestampField } from "./timestamp.js";
21
+ import type { CustomTypeModelTitleField } from "./title.js";
22
+ import type { CustomTypeModelUIDField } from "./uid.js";
23
23
  /**
24
24
  * Type identifier for a custom type field.
25
25
  */
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types.js";
2
2
  /**
3
3
  * A UID custom type field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types.js";
2
2
  /**
3
3
  * A color field.
4
4
  *
@@ -1,6 +1,6 @@
1
- import type { AnyRegularField, FieldState } from "./types";
2
- import type { GroupField } from "./group";
3
- import type { SliceZone } from "./sliceZone";
1
+ import type { AnyRegularField, FieldState } from "./types.js";
2
+ import type { GroupField } from "./group.js";
3
+ import type { SliceZone } from "./sliceZone.js";
4
4
  /**
5
5
  * Field for related documents
6
6
  *
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types.js";
2
2
  /**
3
3
  * A date field.
4
4
  *
@@ -1,7 +1,7 @@
1
- import type { AnyRegularField } from "./types";
2
- import type { GroupField } from "./group";
3
- import type { SliceZone } from "./sliceZone";
4
- import type { TimestampField } from "./timestamp";
1
+ import type { AnyRegularField } from "./types.js";
2
+ import type { GroupField } from "./group.js";
3
+ import type { SliceZone } from "./sliceZone.js";
4
+ import type { TimestampField } from "./timestamp.js";
5
5
  /**
6
6
  * Document metadata for a translation of a Prismic document.
7
7
  */
@@ -1,4 +1,4 @@
1
- import type { EmptyObjectField, FieldState } from "./types";
1
+ import type { EmptyObjectField, FieldState } from "./types.js";
2
2
  /**
3
3
  * oEmbed 1.0 possible types.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { EmptyObjectField, FieldState } from "./types";
1
+ import type { EmptyObjectField, FieldState } from "./types.js";
2
2
  /**
3
3
  * A geopoint field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { AnyRegularField, FieldState } from "./types";
1
+ import type { AnyRegularField, FieldState } from "./types.js";
2
2
  /**
3
3
  * A group field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { FieldState, Simplify } from "./types";
1
+ import type { FieldState, Simplify } from "./types.js";
2
2
  /**
3
3
  * An individual image within an image field. The base image and each thumbnail
4
4
  * uses this type.
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types.js";
2
2
  /**
3
3
  * An integration field.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types.js";
2
2
  /**
3
3
  * A key text field
4
4
  *
@@ -1,8 +1,8 @@
1
- import type { AnyRegularField, FieldState } from "./types";
2
- import type { FilledContentRelationshipField } from "./contentRelationship";
3
- import type { GroupField } from "./group";
4
- import type { FilledLinkToMediaField } from "./linkToMedia";
5
- import type { SliceZone } from "./sliceZone";
1
+ import type { AnyRegularField, FieldState } from "./types.js";
2
+ import type { FilledContentRelationshipField } from "./contentRelationship.js";
3
+ import type { GroupField } from "./group.js";
4
+ import type { FilledLinkToMediaField } from "./linkToMedia.js";
5
+ import type { SliceZone } from "./sliceZone.js";
6
6
  /**
7
7
  * Link types
8
8
  */
@@ -1,5 +1,5 @@
1
- import type { FieldState } from "./types";
2
- import type { OptionalLinkProperties } from "./link";
1
+ import type { FieldState } from "./types.js";
2
+ import type { OptionalLinkProperties } from "./link.js";
3
3
  /**
4
4
  * A link field that points to media.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types.js";
2
2
  /**
3
3
  * A number field.
4
4
  *
@@ -1,6 +1,6 @@
1
- import type { FieldState } from "./types";
2
- import type { EmbedField } from "./embed";
3
- import type { FilledLinkField } from "./link";
1
+ import type { FieldState } from "./types.js";
2
+ import type { EmbedField } from "./embed.js";
3
+ import type { FilledLinkField } from "./link.js";
4
4
  /**
5
5
  * Types enum for RichTextNodes
6
6
  *
@@ -1,4 +1,4 @@
1
- import type { FieldState } from "./types";
1
+ import type { FieldState } from "./types.js";
2
2
  /**
3
3
  * A select field.
4
4
  *