@prismicio/client 7.14.0-alpha.1 → 7.14.0

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 (52) hide show
  1. package/dist/Migration.cjs +9 -6
  2. package/dist/Migration.cjs.map +1 -1
  3. package/dist/Migration.js +9 -6
  4. package/dist/Migration.js.map +1 -1
  5. package/dist/lib/getOptionalLinkProperties.cjs +14 -0
  6. package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
  7. package/dist/lib/getOptionalLinkProperties.d.ts +12 -0
  8. package/dist/lib/getOptionalLinkProperties.js +14 -0
  9. package/dist/lib/getOptionalLinkProperties.js.map +1 -0
  10. package/dist/lib/isMigrationValue.cjs.map +1 -1
  11. package/dist/lib/isMigrationValue.d.ts +11 -2
  12. package/dist/lib/isMigrationValue.js.map +1 -1
  13. package/dist/lib/isValue.cjs.map +1 -1
  14. package/dist/lib/isValue.d.ts +7 -1
  15. package/dist/lib/isValue.js.map +1 -1
  16. package/dist/lib/resolveMigrationDocumentData.cjs +22 -11
  17. package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -1
  18. package/dist/lib/resolveMigrationDocumentData.d.ts +4 -2
  19. package/dist/lib/resolveMigrationDocumentData.js +22 -11
  20. package/dist/lib/resolveMigrationDocumentData.js.map +1 -1
  21. package/dist/package.json.cjs +1 -1
  22. package/dist/package.json.js +1 -1
  23. package/dist/types/migration/Asset.cjs.map +1 -1
  24. package/dist/types/migration/Asset.d.ts +2 -3
  25. package/dist/types/migration/Asset.js.map +1 -1
  26. package/dist/types/migration/ContentRelationship.d.ts +3 -4
  27. package/dist/types/migration/Link.d.ts +19 -0
  28. package/dist/types/model/contentRelationship.d.ts +0 -1
  29. package/dist/types/model/linkToMedia.d.ts +1 -0
  30. package/dist/types/value/contentRelationship.d.ts +5 -5
  31. package/dist/types/value/link.cjs.map +1 -1
  32. package/dist/types/value/link.d.ts +39 -22
  33. package/dist/types/value/link.js.map +1 -1
  34. package/dist/types/value/linkToMedia.d.ts +9 -7
  35. package/dist/types/value/richText.cjs.map +1 -1
  36. package/dist/types/value/richText.d.ts +3 -5
  37. package/dist/types/value/richText.js.map +1 -1
  38. package/package.json +2 -2
  39. package/src/Migration.ts +8 -3
  40. package/src/lib/getOptionalLinkProperties.ts +27 -0
  41. package/src/lib/isMigrationValue.ts +11 -2
  42. package/src/lib/isValue.ts +7 -1
  43. package/src/lib/resolveMigrationDocumentData.ts +32 -13
  44. package/src/types/migration/Asset.ts +9 -11
  45. package/src/types/migration/ContentRelationship.ts +11 -9
  46. package/src/types/migration/Link.ts +19 -0
  47. package/src/types/model/contentRelationship.ts +0 -1
  48. package/src/types/model/linkToMedia.ts +1 -0
  49. package/src/types/value/contentRelationship.ts +6 -5
  50. package/src/types/value/link.ts +63 -33
  51. package/src/types/value/linkToMedia.ts +9 -9
  52. package/src/types/value/richText.ts +3 -11
@@ -1,6 +1,6 @@
1
1
  import type { FieldState } from "./types"
2
2
 
3
- import type { EmptyLinkField, LinkType } from "./link"
3
+ import type { OptionalLinkProperties } from "./link"
4
4
 
5
5
  /**
6
6
  * A link field that points to media.
@@ -8,22 +8,22 @@ import type { EmptyLinkField, LinkType } from "./link"
8
8
  * @typeParam State - State of the field which determines its shape.
9
9
  */
10
10
  export type LinkToMediaField<State extends FieldState = FieldState> =
11
- State extends "empty"
12
- ? EmptyLinkField<typeof LinkType.Media>
13
- : FilledLinkToMediaField
11
+ State extends "empty" ? EmptyLinkToMediaField : FilledLinkToMediaField
12
+
13
+ type EmptyLinkToMediaField = {
14
+ link_type: "Any"
15
+ } & OptionalLinkProperties
14
16
 
15
17
  /**
16
18
  * A link that points to media.
17
19
  */
18
- export interface FilledLinkToMediaField {
20
+ export type FilledLinkToMediaField = {
19
21
  id: string
20
- link_type: typeof LinkType.Media
22
+ link_type: "Media"
21
23
  name: string
22
24
  kind: string
23
25
  url: string
24
26
  size: string
25
27
  height?: string | null
26
28
  width?: string | null
27
- text?: string
28
- variant?: string
29
- }
29
+ } & OptionalLinkProperties
@@ -1,9 +1,7 @@
1
1
  import type { FieldState } from "./types"
2
2
 
3
- import type { FilledContentRelationshipField } from "./contentRelationship"
4
3
  import type { EmbedField } from "./embed"
5
- import type { FilledLinkToWebField } from "./link"
6
- import type { FilledLinkToMediaField } from "./linkToMedia"
4
+ import type { FilledLinkField } from "./link"
7
5
 
8
6
  /**
9
7
  * Types enum for RichTextNodes
@@ -176,10 +174,7 @@ export type RTImageNode = {
176
174
  zoom: number
177
175
  background: string
178
176
  }
179
- linkTo?:
180
- | FilledContentRelationshipField
181
- | FilledLinkToWebField
182
- | FilledLinkToMediaField
177
+ linkTo?: FilledLinkField
183
178
  }
184
179
 
185
180
  /**
@@ -199,10 +194,7 @@ export type RTEmbedNode = {
199
194
  */
200
195
  export interface RTLinkNode extends RTSpanNodeBase {
201
196
  type: typeof RichTextNodeType.hyperlink
202
- data:
203
- | FilledContentRelationshipField
204
- | FilledLinkToWebField
205
- | FilledLinkToMediaField
197
+ data: FilledLinkField
206
198
  }
207
199
 
208
200
  // Serialization related nodes