@prismicio/client 6.7.1 → 7.0.0-alpha.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 (343) hide show
  1. package/dist/ForbiddenError.cjs +7 -0
  2. package/dist/ForbiddenError.cjs.map +1 -0
  3. package/dist/ForbiddenError.d.ts +11 -0
  4. package/dist/ForbiddenError.js +7 -0
  5. package/dist/ForbiddenError.js.map +1 -0
  6. package/dist/NotFoundError.cjs +7 -0
  7. package/dist/NotFoundError.cjs.map +1 -0
  8. package/dist/NotFoundError.d.ts +3 -0
  9. package/dist/NotFoundError.js +7 -0
  10. package/dist/NotFoundError.js.map +1 -0
  11. package/dist/ParsingError.cjs +7 -0
  12. package/dist/ParsingError.cjs.map +1 -0
  13. package/dist/ParsingError.d.ts +12 -0
  14. package/dist/ParsingError.js +7 -0
  15. package/dist/ParsingError.js.map +1 -0
  16. package/dist/PrismicError.cjs +19 -0
  17. package/dist/PrismicError.cjs.map +1 -0
  18. package/dist/PrismicError.d.ts +5 -0
  19. package/dist/PrismicError.js +19 -0
  20. package/dist/PrismicError.js.map +1 -0
  21. package/dist/buildQueryURL.cjs +41 -0
  22. package/dist/buildQueryURL.cjs.map +1 -0
  23. package/dist/buildQueryURL.d.ts +130 -0
  24. package/dist/buildQueryURL.js +41 -0
  25. package/dist/buildQueryURL.js.map +1 -0
  26. package/dist/client.cjs +414 -0
  27. package/dist/client.cjs.map +1 -0
  28. package/dist/client.d.ts +908 -0
  29. package/dist/client.js +414 -0
  30. package/dist/client.js.map +1 -0
  31. package/dist/cookie.cjs +5 -0
  32. package/dist/cookie.cjs.map +1 -0
  33. package/dist/cookie.d.ts +5 -0
  34. package/dist/cookie.js +5 -0
  35. package/dist/cookie.js.map +1 -0
  36. package/dist/getGraphQLEndpoint.cjs +13 -0
  37. package/dist/getGraphQLEndpoint.cjs.map +1 -0
  38. package/dist/getGraphQLEndpoint.d.ts +9 -0
  39. package/dist/getGraphQLEndpoint.js +13 -0
  40. package/dist/getGraphQLEndpoint.js.map +1 -0
  41. package/dist/getRepositoryEndpoint.cjs +13 -0
  42. package/dist/getRepositoryEndpoint.cjs.map +1 -0
  43. package/dist/getRepositoryEndpoint.d.ts +10 -0
  44. package/dist/getRepositoryEndpoint.js +13 -0
  45. package/dist/getRepositoryEndpoint.js.map +1 -0
  46. package/dist/getRepositoryName.cjs +12 -0
  47. package/dist/getRepositoryName.cjs.map +1 -0
  48. package/dist/getRepositoryName.d.ts +13 -0
  49. package/dist/getRepositoryName.js +12 -0
  50. package/dist/getRepositoryName.js.map +1 -0
  51. package/dist/helpers/asDate.cjs +14 -0
  52. package/dist/helpers/asDate.cjs.map +1 -0
  53. package/dist/helpers/asDate.d.ts +16 -0
  54. package/dist/helpers/asDate.js +14 -0
  55. package/dist/helpers/asDate.js.map +1 -0
  56. package/dist/helpers/asHTML.cjs +79 -0
  57. package/dist/helpers/asHTML.cjs.map +1 -0
  58. package/dist/helpers/asHTML.d.ts +20 -0
  59. package/dist/helpers/asHTML.js +79 -0
  60. package/dist/helpers/asHTML.js.map +1 -0
  61. package/dist/helpers/asImagePixelDensitySrcSet.cjs +21 -0
  62. package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
  63. package/dist/helpers/asImagePixelDensitySrcSet.d.ts +52 -0
  64. package/dist/helpers/asImagePixelDensitySrcSet.js +21 -0
  65. package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
  66. package/dist/helpers/asImageSrc.cjs +13 -0
  67. package/dist/helpers/asImageSrc.cjs.map +1 -0
  68. package/dist/helpers/asImageSrc.d.ts +27 -0
  69. package/dist/helpers/asImageSrc.js +13 -0
  70. package/dist/helpers/asImageSrc.js.map +1 -0
  71. package/dist/helpers/asImageWidthSrcSet.cjs +40 -0
  72. package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
  73. package/dist/helpers/asImageWidthSrcSet.d.ts +60 -0
  74. package/dist/helpers/asImageWidthSrcSet.js +40 -0
  75. package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
  76. package/dist/helpers/asLink.cjs +32 -0
  77. package/dist/helpers/asLink.cjs.map +1 -0
  78. package/dist/helpers/asLink.d.ts +24 -0
  79. package/dist/helpers/asLink.js +32 -0
  80. package/dist/helpers/asLink.js.map +1 -0
  81. package/dist/helpers/asText.cjs +12 -0
  82. package/dist/helpers/asText.cjs.map +1 -0
  83. package/dist/helpers/asText.d.ts +16 -0
  84. package/dist/helpers/asText.js +12 -0
  85. package/dist/helpers/asText.js.map +1 -0
  86. package/dist/helpers/documentToLinkField.cjs +19 -0
  87. package/dist/helpers/documentToLinkField.cjs.map +1 -0
  88. package/dist/helpers/documentToLinkField.d.ts +15 -0
  89. package/dist/helpers/documentToLinkField.js +19 -0
  90. package/dist/helpers/documentToLinkField.js.map +1 -0
  91. package/dist/helpers/isFilled.cjs +67 -0
  92. package/dist/helpers/isFilled.cjs.map +1 -0
  93. package/dist/helpers/isFilled.d.ts +175 -0
  94. package/dist/helpers/isFilled.js +67 -0
  95. package/dist/helpers/isFilled.js.map +1 -0
  96. package/dist/index.cjs +67 -721
  97. package/dist/index.cjs.map +1 -1
  98. package/dist/index.d.ts +92 -1526
  99. package/dist/index.js +64 -681
  100. package/dist/index.js.map +1 -1
  101. package/dist/isRepositoryEndpoint.cjs +12 -0
  102. package/dist/isRepositoryEndpoint.cjs.map +1 -0
  103. package/dist/isRepositoryEndpoint.d.ts +10 -0
  104. package/dist/isRepositoryEndpoint.js +12 -0
  105. package/dist/isRepositoryEndpoint.js.map +1 -0
  106. package/dist/isRepositoryName.cjs +7 -0
  107. package/dist/isRepositoryName.cjs.map +1 -0
  108. package/dist/isRepositoryName.d.ts +9 -0
  109. package/dist/isRepositoryName.js +7 -0
  110. package/dist/isRepositoryName.js.map +1 -0
  111. package/dist/lib/appendPredicates.cjs +14 -0
  112. package/dist/lib/appendPredicates.cjs.map +1 -0
  113. package/dist/lib/appendPredicates.d.ts +18 -0
  114. package/dist/lib/appendPredicates.js +14 -0
  115. package/dist/lib/appendPredicates.js.map +1 -0
  116. package/dist/lib/castArray.cjs +5 -0
  117. package/dist/lib/castArray.cjs.map +1 -0
  118. package/dist/lib/castArray.d.ts +11 -0
  119. package/dist/lib/castArray.js +5 -0
  120. package/dist/lib/castArray.js.map +1 -0
  121. package/dist/lib/castThunk.cjs +5 -0
  122. package/dist/lib/castThunk.cjs.map +1 -0
  123. package/dist/lib/castThunk.d.ts +10 -0
  124. package/dist/lib/castThunk.js +5 -0
  125. package/dist/lib/castThunk.js.map +1 -0
  126. package/dist/lib/findMasterRef.cjs +8 -0
  127. package/dist/lib/findMasterRef.cjs.map +1 -0
  128. package/dist/lib/findMasterRef.d.ts +10 -0
  129. package/dist/lib/findMasterRef.js +8 -0
  130. package/dist/lib/findMasterRef.js.map +1 -0
  131. package/dist/lib/findRef.cjs +12 -0
  132. package/dist/lib/findRef.cjs.map +1 -0
  133. package/dist/lib/findRef.d.ts +13 -0
  134. package/dist/lib/findRef.js +12 -0
  135. package/dist/lib/findRef.js.map +1 -0
  136. package/dist/lib/findRefByID.cjs +8 -0
  137. package/dist/lib/findRefByID.cjs.map +1 -0
  138. package/dist/lib/findRefByID.d.ts +11 -0
  139. package/dist/lib/findRefByID.js +8 -0
  140. package/dist/lib/findRefByID.js.map +1 -0
  141. package/dist/lib/findRefByLabel.cjs +8 -0
  142. package/dist/lib/findRefByLabel.cjs.map +1 -0
  143. package/dist/lib/findRefByLabel.d.ts +11 -0
  144. package/dist/lib/findRefByLabel.js +8 -0
  145. package/dist/lib/findRefByLabel.js.map +1 -0
  146. package/dist/lib/getPreviewCookie.cjs +21 -0
  147. package/dist/lib/getPreviewCookie.cjs.map +1 -0
  148. package/dist/lib/getPreviewCookie.d.ts +9 -0
  149. package/dist/lib/getPreviewCookie.js +21 -0
  150. package/dist/lib/getPreviewCookie.js.map +1 -0
  151. package/dist/lib/minifyGraphQLQuery.cjs +7 -0
  152. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
  153. package/dist/lib/minifyGraphQLQuery.d.ts +8 -0
  154. package/dist/lib/minifyGraphQLQuery.js +7 -0
  155. package/dist/lib/minifyGraphQLQuery.js.map +1 -0
  156. package/dist/lib/serializerHelpers.cjs +56 -0
  157. package/dist/lib/serializerHelpers.cjs.map +1 -0
  158. package/dist/lib/serializerHelpers.d.ts +9 -0
  159. package/dist/lib/serializerHelpers.js +54 -0
  160. package/dist/lib/serializerHelpers.js.map +1 -0
  161. package/dist/predicate.cjs +68 -0
  162. package/dist/predicate.cjs.map +1 -0
  163. package/dist/predicate.d.ts +209 -0
  164. package/dist/predicate.js +68 -0
  165. package/dist/predicate.js.map +1 -0
  166. package/dist/types/api/query.d.ts +42 -0
  167. package/dist/types/api/ref.d.ts +32 -0
  168. package/dist/types/api/release.d.ts +10 -0
  169. package/dist/types/api/repository.d.ts +100 -0
  170. package/dist/types/api/tags.d.ts +8 -0
  171. package/dist/types/client.d.ts +128 -0
  172. package/dist/types/helpers.d.ts +63 -0
  173. package/dist/types/model/boolean.d.ts +15 -0
  174. package/dist/types/model/color.d.ts +13 -0
  175. package/dist/types/model/contentRelationship.d.ts +18 -0
  176. package/dist/types/model/customType.d.ts +42 -0
  177. package/dist/types/model/date.d.ts +14 -0
  178. package/dist/types/model/embed.d.ts +13 -0
  179. package/dist/types/model/geoPoint.d.ts +12 -0
  180. package/dist/types/model/group.d.ts +15 -0
  181. package/dist/types/model/image.d.ts +31 -0
  182. package/dist/types/model/integrationFields.d.ts +14 -0
  183. package/dist/types/model/keyText.d.ts +13 -0
  184. package/dist/types/model/link.cjs +9 -0
  185. package/dist/types/model/link.cjs.map +1 -0
  186. package/dist/types/model/link.d.ts +27 -0
  187. package/dist/types/model/link.js +9 -0
  188. package/dist/types/model/link.js.map +1 -0
  189. package/dist/types/model/linkToMedia.d.ts +16 -0
  190. package/dist/types/model/number.d.ts +15 -0
  191. package/dist/types/model/range.d.ts +14 -0
  192. package/dist/types/model/richText.d.ts +35 -0
  193. package/dist/types/model/select.d.ts +18 -0
  194. package/dist/types/model/separator.d.ts +10 -0
  195. package/dist/types/model/sharedSlice.d.ts +19 -0
  196. package/dist/types/model/sharedSliceVariation.d.ts +22 -0
  197. package/dist/types/model/slice.cjs +8 -0
  198. package/dist/types/model/slice.cjs.map +1 -0
  199. package/dist/types/model/slice.d.ts +33 -0
  200. package/dist/types/model/slice.js +8 -0
  201. package/dist/types/model/slice.js.map +1 -0
  202. package/dist/types/model/sliceZone.cjs +8 -0
  203. package/dist/types/model/sliceZone.cjs.map +1 -0
  204. package/dist/types/model/sliceZone.d.ts +44 -0
  205. package/dist/types/model/sliceZone.js +8 -0
  206. package/dist/types/model/sliceZone.js.map +1 -0
  207. package/dist/types/model/timestamp.d.ts +14 -0
  208. package/dist/types/model/title.d.ts +7 -0
  209. package/dist/types/model/types.cjs +25 -0
  210. package/dist/types/model/types.cjs.map +1 -0
  211. package/dist/types/model/types.d.ts +62 -0
  212. package/dist/types/model/types.js +25 -0
  213. package/dist/types/model/types.js.map +1 -0
  214. package/dist/types/model/uid.d.ts +13 -0
  215. package/dist/types/utils.d.ts +28 -0
  216. package/dist/types/value/boolean.d.ts +6 -0
  217. package/dist/types/value/color.d.ts +8 -0
  218. package/dist/types/value/contentRelationship.d.ts +29 -0
  219. package/dist/types/value/date.d.ts +8 -0
  220. package/dist/types/value/document.d.ts +113 -0
  221. package/dist/types/value/embed.cjs +10 -0
  222. package/dist/types/value/embed.cjs.map +1 -0
  223. package/dist/types/value/embed.d.ts +167 -0
  224. package/dist/types/value/embed.js +10 -0
  225. package/dist/types/value/embed.js.map +1 -0
  226. package/dist/types/value/geoPoint.d.ts +11 -0
  227. package/dist/types/value/group.d.ts +7 -0
  228. package/dist/types/value/image.d.ts +36 -0
  229. package/dist/types/value/integrationFields.d.ts +9 -0
  230. package/dist/types/value/keyText.d.ts +8 -0
  231. package/dist/types/value/link.cjs +10 -0
  232. package/dist/types/value/link.cjs.map +1 -0
  233. package/dist/types/value/link.d.ts +40 -0
  234. package/dist/types/value/link.js +10 -0
  235. package/dist/types/value/link.js.map +1 -0
  236. package/dist/types/value/linkToMedia.d.ts +20 -0
  237. package/dist/types/value/number.d.ts +8 -0
  238. package/dist/types/value/richText.cjs +25 -0
  239. package/dist/types/value/richText.cjs.map +1 -0
  240. package/dist/types/value/richText.d.ts +203 -0
  241. package/dist/types/value/richText.js +25 -0
  242. package/dist/types/value/richText.js.map +1 -0
  243. package/dist/types/value/select.d.ts +9 -0
  244. package/dist/types/value/sharedSlice.d.ts +11 -0
  245. package/dist/types/value/sharedSliceVariation.d.ts +7 -0
  246. package/dist/types/value/slice.d.ts +13 -0
  247. package/dist/types/value/sliceZone.d.ts +12 -0
  248. package/dist/types/value/timestamp.d.ts +8 -0
  249. package/dist/types/value/title.d.ts +12 -0
  250. package/dist/types/value/types.d.ts +40 -0
  251. package/dist/types/webhook/apiUpdate.d.ts +52 -0
  252. package/dist/types/webhook/testTrigger.d.ts +9 -0
  253. package/dist/types/webhook/types.cjs +8 -0
  254. package/dist/types/webhook/types.cjs.map +1 -0
  255. package/dist/types/webhook/types.d.ts +18 -0
  256. package/dist/types/webhook/types.js +8 -0
  257. package/dist/types/webhook/types.js.map +1 -0
  258. package/package.json +40 -33
  259. package/src/buildQueryURL.ts +8 -4
  260. package/src/client.ts +111 -118
  261. package/src/cookie.ts +2 -1
  262. package/src/getRepositoryName.ts +4 -2
  263. package/src/helpers/asDate.ts +48 -0
  264. package/src/helpers/asHTML.ts +154 -0
  265. package/src/helpers/asImagePixelDensitySrcSet.ts +96 -0
  266. package/src/helpers/asImageSrc.ts +41 -0
  267. package/src/helpers/asImageWidthSrcSet.ts +139 -0
  268. package/src/helpers/asLink.ts +99 -0
  269. package/src/helpers/asText.ts +29 -0
  270. package/src/helpers/documentToLinkField.ts +47 -0
  271. package/src/helpers/isFilled.ts +290 -0
  272. package/src/index.ts +237 -21
  273. package/src/isRepositoryEndpoint.ts +2 -1
  274. package/src/isRepositoryName.ts +2 -1
  275. package/src/lib/appendPredicates.ts +2 -1
  276. package/src/lib/findMasterRef.ts +2 -2
  277. package/src/lib/findRef.ts +2 -5
  278. package/src/lib/findRefByID.ts +2 -2
  279. package/src/lib/findRefByLabel.ts +2 -5
  280. package/src/lib/getPreviewCookie.ts +3 -2
  281. package/src/lib/serializerHelpers.ts +96 -0
  282. package/src/predicate.ts +4 -2
  283. package/src/types/api/query.ts +50 -0
  284. package/src/types/api/ref.ts +36 -0
  285. package/src/types/api/release.ts +11 -0
  286. package/src/types/api/repository.ts +117 -0
  287. package/src/types/api/tags.ts +8 -0
  288. package/src/{types.ts → types/client.ts} +3 -37
  289. package/src/types/helpers.ts +103 -0
  290. package/src/types/model/boolean.ts +16 -0
  291. package/src/types/model/color.ts +14 -0
  292. package/src/types/model/contentRelationship.ts +22 -0
  293. package/src/types/model/customType.ts +61 -0
  294. package/src/types/model/date.ts +15 -0
  295. package/src/types/model/embed.ts +14 -0
  296. package/src/types/model/geoPoint.ts +13 -0
  297. package/src/types/model/group.ts +24 -0
  298. package/src/types/model/image.ts +37 -0
  299. package/src/types/model/integrationFields.ts +15 -0
  300. package/src/types/model/keyText.ts +14 -0
  301. package/src/types/model/link.ts +31 -0
  302. package/src/types/model/linkToMedia.ts +17 -0
  303. package/src/types/model/number.ts +16 -0
  304. package/src/types/model/range.ts +15 -0
  305. package/src/types/model/richText.ts +40 -0
  306. package/src/types/model/select.ts +22 -0
  307. package/src/types/model/separator.ts +11 -0
  308. package/src/types/model/sharedSlice.ts +23 -0
  309. package/src/types/model/sharedSliceVariation.ts +33 -0
  310. package/src/types/model/slice.ts +49 -0
  311. package/src/types/model/sliceZone.ts +62 -0
  312. package/src/types/model/timestamp.ts +15 -0
  313. package/src/types/model/title.ts +8 -0
  314. package/src/types/model/types.ts +91 -0
  315. package/src/types/model/uid.ts +14 -0
  316. package/src/types/utils.ts +34 -0
  317. package/src/types/value/boolean.ts +6 -0
  318. package/src/types/value/color.ts +10 -0
  319. package/src/types/value/contentRelationship.ts +48 -0
  320. package/src/types/value/date.ts +10 -0
  321. package/src/types/value/document.ts +142 -0
  322. package/src/types/value/embed.ts +196 -0
  323. package/src/types/value/geoPoint.ts +15 -0
  324. package/src/types/value/group.ts +14 -0
  325. package/src/types/value/image.ts +67 -0
  326. package/src/types/value/integrationFields.ts +13 -0
  327. package/src/types/value/keyText.ts +10 -0
  328. package/src/types/value/link.ts +59 -0
  329. package/src/types/value/linkToMedia.ts +25 -0
  330. package/src/types/value/number.ts +10 -0
  331. package/src/types/value/richText.ts +286 -0
  332. package/src/types/value/select.ts +13 -0
  333. package/src/types/value/sharedSlice.ts +15 -0
  334. package/src/types/value/sharedSliceVariation.ts +18 -0
  335. package/src/types/value/slice.ts +24 -0
  336. package/src/types/value/sliceZone.ts +16 -0
  337. package/src/types/value/timestamp.ts +12 -0
  338. package/src/types/value/title.ts +31 -0
  339. package/src/types/value/types.ts +60 -0
  340. package/src/types/webhook/apiUpdate.ts +56 -0
  341. package/src/types/webhook/testTrigger.ts +10 -0
  342. package/src/types/webhook/types.ts +21 -0
  343. package/src/lib/orElseThrow.ts +0 -17
package/src/client.ts CHANGED
@@ -1,6 +1,3 @@
1
- import * as prismicT from "@prismicio/types";
2
- import * as prismicH from "@prismicio/helpers";
3
-
4
1
  import { appendPredicates } from "./lib/appendPredicates";
5
2
  import { castArray } from "./lib/castArray";
6
3
  import { castThunk } from "./lib/castThunk";
@@ -10,12 +7,20 @@ import { findRefByLabel } from "./lib/findRefByLabel";
10
7
  import { getPreviewCookie } from "./lib/getPreviewCookie";
11
8
  import { minifyGraphQLQuery } from "./lib/minifyGraphQLQuery";
12
9
 
13
- import {
10
+ import type {
14
11
  AbortSignalLike,
15
12
  FetchLike,
16
13
  HttpRequestLike,
17
14
  ExtractDocumentType,
18
- } from "./types";
15
+ } from "./types/client";
16
+ import type { LinkResolverFunction } from "./types/helpers";
17
+ import type { PrismicDocument } from "./types/value/document";
18
+ import type { Form, Repository } from "./types/api/repository";
19
+ import type { Query } from "./types/api/query";
20
+ import type { Ref } from "./types/api/ref";
21
+
22
+ import { asLink } from "./helpers/asLink";
23
+
19
24
  import { ForbiddenError } from "./ForbiddenError";
20
25
  import { NotFoundError } from "./NotFoundError";
21
26
  import { ParsingError } from "./ParsingError";
@@ -199,7 +204,7 @@ type ResolvePreviewArgs<LinkResolverReturnType> = {
199
204
  /**
200
205
  * A function that maps a Prismic document to a URL within your app.
201
206
  */
202
- linkResolver?: prismicH.LinkResolverFunction<LinkResolverReturnType>;
207
+ linkResolver?: LinkResolverFunction<LinkResolverReturnType>;
203
208
 
204
209
  /**
205
210
  * A fallback URL if the Link Resolver does not return a value.
@@ -255,7 +260,7 @@ const someTagsPredicate = (tags: string | string[]): string =>
255
260
  * third-party libraries.
256
261
  */
257
262
  export interface CreateClient {
258
- <TDocuments extends prismicT.PrismicDocument>(
263
+ <TDocuments extends PrismicDocument>(
259
264
  ...args: ConstructorParameters<typeof Client>
260
265
  ): Client<TDocuments>;
261
266
  }
@@ -282,9 +287,7 @@ export interface CreateClient {
282
287
  *
283
288
  * @returns A client that can query content from the repository.
284
289
  */
285
- export const createClient: CreateClient = <
286
- TDocuments extends prismicT.PrismicDocument,
287
- >(
290
+ export const createClient: CreateClient = <TDocuments extends PrismicDocument>(
288
291
  repositoryNameOrEndpoint: string,
289
292
  options?: ClientConfig,
290
293
  ) => new Client<TDocuments>(repositoryNameOrEndpoint, options);
@@ -299,9 +302,7 @@ export const createClient: CreateClient = <
299
302
  * @typeParam TDocuments - Document types that are registered for the Prismic
300
303
  * repository. Query methods will automatically be typed based on this type.
301
304
  */
302
- export class Client<
303
- TDocuments extends prismicT.PrismicDocument = prismicT.PrismicDocument,
304
- > {
305
+ export class Client<TDocuments extends PrismicDocument = PrismicDocument> {
305
306
  /**
306
307
  * The Prismic REST API V2 endpoint for the repository (use
307
308
  * `prismic.getRepositoryEndpoint` for the default endpoint).
@@ -351,7 +352,8 @@ export class Client<
351
352
  >;
352
353
 
353
354
  /**
354
- * The client's ref mode state. This determines which ref is used during queries.
355
+ * The client's ref mode state. This determines which ref is used during
356
+ * queries.
355
357
  */
356
358
  private refState: RefState = {
357
359
  mode: RefStateMode.Master,
@@ -361,7 +363,7 @@ export class Client<
361
363
  /**
362
364
  * Cached repository value.
363
365
  */
364
- private cachedRepository: prismicT.Repository | undefined;
366
+ private cachedRepository: Repository | undefined;
365
367
 
366
368
  /**
367
369
  * Timestamp at which the cached repository data is considered stale.
@@ -431,7 +433,8 @@ export class Client<
431
433
 
432
434
  /**
433
435
  * Enables the client to automatically query content from a preview session if
434
- * one is active in browser environments. This is enabled by default in the browser.
436
+ * one is active in browser environments. This is enabled by default in the
437
+ * browser.
435
438
  *
436
439
  * For server environments, use `enableAutoPreviewsFromReq`.
437
440
  *
@@ -449,7 +452,8 @@ export class Client<
449
452
 
450
453
  /**
451
454
  * Enables the client to automatically query content from a preview session if
452
- * one is active in server environments. This is disabled by default on the server.
455
+ * one is active in server environments. This is disabled by default on the
456
+ * server.
453
457
  *
454
458
  * For browser environments, use `enableAutoPreviews`.
455
459
  *
@@ -462,7 +466,8 @@ export class Client<
462
466
  * });
463
467
  * ```
464
468
  *
465
- * @param req - An HTTP server request object containing the request's cookies.
469
+ * @param req - An HTTP server request object containing the request's
470
+ * cookies.
466
471
  */
467
472
  enableAutoPreviewsFromReq<R extends HttpRequestLike>(req: R): void {
468
473
  this.refState.httpRequest = req;
@@ -486,32 +491,6 @@ export class Client<
486
491
  this.refState.autoPreviewsEnabled = false;
487
492
  }
488
493
 
489
- /**
490
- * Queries content from the Prismic repository.
491
- *
492
- * @deprecated Use `get` instead.
493
- * @example
494
- *
495
- * ```ts
496
- * const response = await client.query(
497
- * prismic.predicate.at("document.type", "page"),
498
- * );
499
- * ```
500
- *
501
- * @typeParam TDocument - Type of Prismic documents returned.
502
- * @param params - Parameters to filter, sort, and paginate results.
503
- *
504
- * @returns A paginated response containing the result of the query.
505
- */
506
- async query<TDocument extends TDocuments>(
507
- predicates: NonNullable<BuildQueryURLArgs["predicates"]>,
508
- params?: Partial<Omit<BuildQueryURLArgs, "predicates">> & FetchParams,
509
- ): Promise<prismicT.Query<TDocument>> {
510
- const url = await this.buildQueryURL({ ...params, predicates });
511
-
512
- return await this.fetch<prismicT.Query<TDocument>>(url, params);
513
- }
514
-
515
494
  /**
516
495
  * Queries content from the Prismic repository.
517
496
  *
@@ -528,10 +507,10 @@ export class Client<
528
507
  */
529
508
  async get<TDocument extends TDocuments>(
530
509
  params?: Partial<BuildQueryURLArgs> & FetchParams,
531
- ): Promise<prismicT.Query<TDocument>> {
510
+ ): Promise<Query<TDocument>> {
532
511
  const url = await this.buildQueryURL(params);
533
512
 
534
- return await this.fetch<prismicT.Query<TDocument>>(url, params);
513
+ return await this.fetch<Query<TDocument>>(url, params);
535
514
  }
536
515
 
537
516
  /**
@@ -556,7 +535,7 @@ export class Client<
556
535
  actualParams.pageSize = this.defaultParams?.pageSize ?? 1;
557
536
  }
558
537
  const url = await this.buildQueryURL(actualParams);
559
- const result = await this.fetch<prismicT.Query<TDocument>>(url, params);
538
+ const result = await this.fetch<Query<TDocument>>(url, params);
560
539
 
561
540
  const firstResult = result.results[0];
562
541
 
@@ -575,7 +554,8 @@ export class Client<
575
554
  * Queries content from the Prismic repository and returns all matching
576
555
  * content. If no predicates are provided, all documents will be fetched.
577
556
  *
578
- * This method may make multiple network requests to query all matching content.
557
+ * This method may make multiple network requests to query all matching
558
+ * content.
579
559
  *
580
560
  * @example
581
561
  *
@@ -603,7 +583,7 @@ export class Client<
603
583
  };
604
584
 
605
585
  const documents: TDocument[] = [];
606
- let latestResult: prismicT.Query<TDocument> | undefined;
586
+ let latestResult: Query<TDocument> | undefined;
607
587
 
608
588
  while (
609
589
  (!latestResult || latestResult.next_page) &&
@@ -628,7 +608,8 @@ export class Client<
628
608
  * @remarks
629
609
  * A document's UID is different from its ID. An ID is automatically generated
630
610
  * for all documents and is made available on its `id` property. A UID is
631
- * provided in the Prismic editor and is unique among all documents of its Custom Type.
611
+ * provided in the Prismic editor and is unique among all documents of its
612
+ * Custom Type.
632
613
  * @example
633
614
  *
634
615
  * ```ts
@@ -657,7 +638,8 @@ export class Client<
657
638
  * @remarks
658
639
  * A document's UID is different from its ID. An ID is automatically generated
659
640
  * for all documents and is made available on its `id` property. A UID is
660
- * provided in the Prismic editor and is unique among all documents of its Custom Type.
641
+ * provided in the Prismic editor and is unique among all documents of its
642
+ * Custom Type.
661
643
  * @example
662
644
  *
663
645
  * ```ts
@@ -677,7 +659,7 @@ export class Client<
677
659
  async getByIDs<TDocument extends TDocuments>(
678
660
  ids: string[],
679
661
  params?: Partial<BuildQueryURLArgs> & FetchParams,
680
- ): Promise<prismicT.Query<TDocument>> {
662
+ ): Promise<Query<TDocument>> {
681
663
  return await this.get<TDocument>(
682
664
  appendPredicates(params, predicate.in("document.id", ids)),
683
665
  );
@@ -686,12 +668,14 @@ export class Client<
686
668
  /**
687
669
  * Queries all documents from the Prismic repository with specific IDs.
688
670
  *
689
- * This method may make multiple network requests to query all matching content.
671
+ * This method may make multiple network requests to query all matching
672
+ * content.
690
673
  *
691
674
  * @remarks
692
675
  * A document's UID is different from its ID. An ID is automatically generated
693
676
  * for all documents and is made available on its `id` property. A UID is
694
- * provided in the Prismic editor and is unique among all documents of its Custom Type.
677
+ * provided in the Prismic editor and is unique among all documents of its
678
+ * Custom Type.
695
679
  * @example
696
680
  *
697
681
  * ```ts
@@ -717,12 +701,14 @@ export class Client<
717
701
  }
718
702
 
719
703
  /**
720
- * Queries a document from the Prismic repository with a specific UID and Custom Type.
704
+ * Queries a document from the Prismic repository with a specific UID and
705
+ * Custom Type.
721
706
  *
722
707
  * @remarks
723
708
  * A document's UID is different from its ID. An ID is automatically generated
724
709
  * for all documents and is made available on its `id` property. A UID is
725
- * provided in the Prismic editor and is unique among all documents of its Custom Type.
710
+ * provided in the Prismic editor and is unique among all documents of its
711
+ * Custom Type.
726
712
  * @example
727
713
  *
728
714
  * ```ts
@@ -754,12 +740,14 @@ export class Client<
754
740
  }
755
741
 
756
742
  /**
757
- * Queries document from the Prismic repository with specific UIDs and Custom Type.
743
+ * Queries document from the Prismic repository with specific UIDs and Custom
744
+ * Type.
758
745
  *
759
746
  * @remarks
760
747
  * A document's UID is different from its ID. An ID is automatically generated
761
748
  * for all documents and is made available on its `id` property. A UID is
762
- * provided in the Prismic editor and is unique among all documents of its Custom Type.
749
+ * provided in the Prismic editor and is unique among all documents of its
750
+ * Custom Type.
763
751
  * @example
764
752
  *
765
753
  * ```ts
@@ -784,7 +772,7 @@ export class Client<
784
772
  documentType: TDocumentType,
785
773
  uids: string[],
786
774
  params?: Partial<BuildQueryURLArgs> & FetchParams,
787
- ): Promise<prismicT.Query<ExtractDocumentType<TDocument, TDocumentType>>> {
775
+ ): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>> {
788
776
  return await this.get<ExtractDocumentType<TDocument, TDocumentType>>(
789
777
  appendPredicates(params, [
790
778
  typePredicate(documentType),
@@ -794,14 +782,17 @@ export class Client<
794
782
  }
795
783
 
796
784
  /**
797
- * Queries all documents from the Prismic repository with specific UIDs and Custom Type.
785
+ * Queries all documents from the Prismic repository with specific UIDs and
786
+ * Custom Type.
798
787
  *
799
- * This method may make multiple network requests to query all matching content.
788
+ * This method may make multiple network requests to query all matching
789
+ * content.
800
790
  *
801
791
  * @remarks
802
792
  * A document's UID is different from its ID. An ID is automatically generated
803
793
  * for all documents and is made available on its `id` property. A UID is
804
- * provided in the Prismic editor and is unique among all documents of its Custom Type.
794
+ * provided in the Prismic editor and is unique among all documents of its
795
+ * Custom Type.
805
796
  * @example
806
797
  *
807
798
  * ```ts
@@ -837,7 +828,8 @@ export class Client<
837
828
  }
838
829
 
839
830
  /**
840
- * Queries a singleton document from the Prismic repository for a specific Custom Type.
831
+ * Queries a singleton document from the Prismic repository for a specific
832
+ * Custom Type.
841
833
  *
842
834
  * @remarks
843
835
  * A singleton document is one that is configured in Prismic to only allow one
@@ -854,7 +846,8 @@ export class Client<
854
846
  * @param documentType - The API ID of the singleton Custom Type.
855
847
  * @param params - Parameters to filter, sort, and paginate the results.
856
848
  *
857
- * @returns The singleton document for the Custom Type, if a matching document exists.
849
+ * @returns The singleton document for the Custom Type, if a matching document
850
+ * exists.
858
851
  */
859
852
  async getSingle<
860
853
  TDocument extends TDocuments,
@@ -892,16 +885,18 @@ export class Client<
892
885
  >(
893
886
  documentType: TDocumentType,
894
887
  params?: Partial<BuildQueryURLArgs> & FetchParams,
895
- ): Promise<prismicT.Query<ExtractDocumentType<TDocument, TDocumentType>>> {
888
+ ): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>> {
896
889
  return await this.get<ExtractDocumentType<TDocument, TDocumentType>>(
897
890
  appendPredicates(params, typePredicate(documentType)),
898
891
  );
899
892
  }
900
893
 
901
894
  /**
902
- * Queries all documents from the Prismic repository for a specific Custom Type.
895
+ * Queries all documents from the Prismic repository for a specific Custom
896
+ * Type.
903
897
  *
904
- * This method may make multiple network requests to query all matching content.
898
+ * This method may make multiple network requests to query all matching
899
+ * content.
905
900
  *
906
901
  * @example
907
902
  *
@@ -932,7 +927,8 @@ export class Client<
932
927
  /**
933
928
  * Queries documents from the Prismic repository with a specific tag.
934
929
  *
935
- * Use `getAllByTag` instead if you need to query all documents with a specific tag.
930
+ * Use `getAllByTag` instead if you need to query all documents with a
931
+ * specific tag.
936
932
  *
937
933
  * @example
938
934
  *
@@ -949,7 +945,7 @@ export class Client<
949
945
  async getByTag<TDocument extends TDocuments>(
950
946
  tag: string,
951
947
  params?: Partial<BuildQueryURLArgs> & FetchParams,
952
- ): Promise<prismicT.Query<TDocument>> {
948
+ ): Promise<Query<TDocument>> {
953
949
  return await this.get<TDocument>(
954
950
  appendPredicates(params, someTagsPredicate(tag)),
955
951
  );
@@ -958,7 +954,8 @@ export class Client<
958
954
  /**
959
955
  * Queries all documents from the Prismic repository with a specific tag.
960
956
  *
961
- * This method may make multiple network requests to query all matching content.
957
+ * This method may make multiple network requests to query all matching
958
+ * content.
962
959
  *
963
960
  * @example
964
961
  *
@@ -1002,7 +999,7 @@ export class Client<
1002
999
  async getByEveryTag<TDocument extends TDocuments>(
1003
1000
  tags: string[],
1004
1001
  params?: Partial<BuildQueryURLArgs> & FetchParams,
1005
- ): Promise<prismicT.Query<TDocument>> {
1002
+ ): Promise<Query<TDocument>> {
1006
1003
  return await this.get<TDocument>(
1007
1004
  appendPredicates(params, everyTagPredicate(tags)),
1008
1005
  );
@@ -1012,7 +1009,8 @@ export class Client<
1012
1009
  * Queries documents from the Prismic repository with specific tags. A
1013
1010
  * document must be tagged with all of the queried tags to be included.
1014
1011
  *
1015
- * This method may make multiple network requests to query all matching content.
1012
+ * This method may make multiple network requests to query all matching
1013
+ * content.
1016
1014
  *
1017
1015
  * @example
1018
1016
  *
@@ -1039,7 +1037,8 @@ export class Client<
1039
1037
 
1040
1038
  /**
1041
1039
  * Queries documents from the Prismic repository with specific tags. A
1042
- * document must be tagged with at least one of the queried tags to be included.
1040
+ * document must be tagged with at least one of the queried tags to be
1041
+ * included.
1043
1042
  *
1044
1043
  * @example
1045
1044
  *
@@ -1051,12 +1050,13 @@ export class Client<
1051
1050
  * @param tags - A list of tags that must be included on a document.
1052
1051
  * @param params - Parameters to filter, sort, and paginate the results.
1053
1052
  *
1054
- * @returns A paginated response containing documents with at least one of the tags.
1053
+ * @returns A paginated response containing documents with at least one of the
1054
+ * tags.
1055
1055
  */
1056
1056
  async getBySomeTags<TDocument extends TDocuments>(
1057
1057
  tags: string[],
1058
1058
  params?: Partial<BuildQueryURLArgs> & FetchParams,
1059
- ): Promise<prismicT.Query<TDocument>> {
1059
+ ): Promise<Query<TDocument>> {
1060
1060
  return await this.get<TDocument>(
1061
1061
  appendPredicates(params, someTagsPredicate(tags)),
1062
1062
  );
@@ -1064,9 +1064,11 @@ export class Client<
1064
1064
 
1065
1065
  /**
1066
1066
  * Queries documents from the Prismic repository with specific tags. A
1067
- * document must be tagged with at least one of the queried tags to be included.
1067
+ * document must be tagged with at least one of the queried tags to be
1068
+ * included.
1068
1069
  *
1069
- * This method may make multiple network requests to query all matching content.
1070
+ * This method may make multiple network requests to query all matching
1071
+ * content.
1070
1072
  *
1071
1073
  * @example
1072
1074
  *
@@ -1097,9 +1099,9 @@ export class Client<
1097
1099
  *
1098
1100
  * @returns Repository metadata.
1099
1101
  */
1100
- async getRepository(params?: FetchParams): Promise<prismicT.Repository> {
1102
+ async getRepository(params?: FetchParams): Promise<Repository> {
1101
1103
  // TODO: Restore when Authorization header support works in browsers with CORS.
1102
- // return await this.fetch<prismicT.Repository>(this.endpoint);
1104
+ // return await this.fetch<Repository>(this.endpoint);
1103
1105
 
1104
1106
  const url = new URL(this.endpoint);
1105
1107
 
@@ -1107,7 +1109,7 @@ export class Client<
1107
1109
  url.searchParams.set("access_token", this.accessToken);
1108
1110
  }
1109
1111
 
1110
- return await this.fetch<prismicT.Repository>(url.toString(), params);
1112
+ return await this.fetch<Repository>(url.toString(), params);
1111
1113
  }
1112
1114
 
1113
1115
  /**
@@ -1119,7 +1121,7 @@ export class Client<
1119
1121
  *
1120
1122
  * @returns A list of all refs for the Prismic repository.
1121
1123
  */
1122
- async getRefs(params?: FetchParams): Promise<prismicT.Ref[]> {
1124
+ async getRefs(params?: FetchParams): Promise<Ref[]> {
1123
1125
  const repository = await this.getRepository(params);
1124
1126
 
1125
1127
  return repository.refs;
@@ -1132,7 +1134,7 @@ export class Client<
1132
1134
  *
1133
1135
  * @returns The ref with a matching ID, if it exists.
1134
1136
  */
1135
- async getRefByID(id: string, params?: FetchParams): Promise<prismicT.Ref> {
1137
+ async getRefByID(id: string, params?: FetchParams): Promise<Ref> {
1136
1138
  const refs = await this.getRefs(params);
1137
1139
 
1138
1140
  return findRefByID(refs, id);
@@ -1145,10 +1147,7 @@ export class Client<
1145
1147
  *
1146
1148
  * @returns The ref with a matching label, if it exists.
1147
1149
  */
1148
- async getRefByLabel(
1149
- label: string,
1150
- params?: FetchParams,
1151
- ): Promise<prismicT.Ref> {
1150
+ async getRefByLabel(label: string, params?: FetchParams): Promise<Ref> {
1152
1151
  const refs = await this.getRefs(params);
1153
1152
 
1154
1153
  return findRefByLabel(refs, label);
@@ -1160,7 +1159,7 @@ export class Client<
1160
1159
  *
1161
1160
  * @returns The repository's master ref.
1162
1161
  */
1163
- async getMasterRef(params?: FetchParams): Promise<prismicT.Ref> {
1162
+ async getMasterRef(params?: FetchParams): Promise<Ref> {
1164
1163
  const refs = await this.getRefs(params);
1165
1164
 
1166
1165
  return findMasterRef(refs);
@@ -1172,7 +1171,7 @@ export class Client<
1172
1171
  *
1173
1172
  * @returns A list of all Releases for the Prismic repository.
1174
1173
  */
1175
- async getReleases(params?: FetchParams): Promise<prismicT.Ref[]> {
1174
+ async getReleases(params?: FetchParams): Promise<Ref[]> {
1176
1175
  const refs = await this.getRefs(params);
1177
1176
 
1178
1177
  return refs.filter((ref) => !ref.isMasterRef);
@@ -1185,10 +1184,7 @@ export class Client<
1185
1184
  *
1186
1185
  * @returns The Release with a matching ID, if it exists.
1187
1186
  */
1188
- async getReleaseByID(
1189
- id: string,
1190
- params?: FetchParams,
1191
- ): Promise<prismicT.Ref> {
1187
+ async getReleaseByID(id: string, params?: FetchParams): Promise<Ref> {
1192
1188
  const releases = await this.getReleases(params);
1193
1189
 
1194
1190
  return findRefByID(releases, id);
@@ -1201,10 +1197,7 @@ export class Client<
1201
1197
  *
1202
1198
  * @returns The ref with a matching label, if it exists.
1203
1199
  */
1204
- async getReleaseByLabel(
1205
- label: string,
1206
- params?: FetchParams,
1207
- ): Promise<prismicT.Ref> {
1200
+ async getReleaseByLabel(label: string, params?: FetchParams): Promise<Ref> {
1208
1201
  const releases = await this.getReleases(params);
1209
1202
 
1210
1203
  return findRefByLabel(releases, label);
@@ -1316,7 +1309,7 @@ export class Client<
1316
1309
  lang: "*",
1317
1310
  });
1318
1311
 
1319
- const url = prismicH.asLink(document, args.linkResolver);
1312
+ const url = asLink(document, args.linkResolver);
1320
1313
 
1321
1314
  if (typeof url === "string") {
1322
1315
  return url;
@@ -1327,9 +1320,11 @@ export class Client<
1327
1320
  }
1328
1321
 
1329
1322
  /**
1330
- * Configures the client to query the latest published content for all future queries.
1323
+ * Configures the client to query the latest published content for all future
1324
+ * queries.
1331
1325
  *
1332
- * If the `ref` parameter is provided during a query, it takes priority for that query.
1326
+ * If the `ref` parameter is provided during a query, it takes priority for
1327
+ * that query.
1333
1328
  *
1334
1329
  * @example
1335
1330
  *
@@ -1346,7 +1341,8 @@ export class Client<
1346
1341
  * Configures the client to query content from a specific Release identified
1347
1342
  * by its ID for all future queries.
1348
1343
  *
1349
- * If the `ref` parameter is provided during a query, it takes priority for that query.
1344
+ * If the `ref` parameter is provided during a query, it takes priority for
1345
+ * that query.
1350
1346
  *
1351
1347
  * @example
1352
1348
  *
@@ -1369,7 +1365,8 @@ export class Client<
1369
1365
  * Configures the client to query content from a specific Release identified
1370
1366
  * by its label for all future queries.
1371
1367
  *
1372
- * If the `ref` parameter is provided during a query, it takes priority for that query.
1368
+ * If the `ref` parameter is provided during a query, it takes priority for
1369
+ * that query.
1373
1370
  *
1374
1371
  * @example
1375
1372
  *
@@ -1402,7 +1399,8 @@ export class Client<
1402
1399
  * const document = await client.getByID("WW4bKScAAMAqmluX");
1403
1400
  * ```
1404
1401
  *
1405
- * @param ref - The ref or a function that returns the ref from which to query content.
1402
+ * @param ref - The ref or a function that returns the ref from which to query
1403
+ * content.
1406
1404
  */
1407
1405
  queryContentFromRef(ref: RefStringOrThunk): void {
1408
1406
  this.refState = {
@@ -1412,12 +1410,6 @@ export class Client<
1412
1410
  };
1413
1411
  }
1414
1412
 
1415
- /**
1416
- * @deprecated Renamed to `graphQLFetch()` (note the capitalization of "QL").
1417
- */
1418
- // TODO: Remove in v7
1419
- graphqlFetch = this.graphQLFetch.bind(this);
1420
-
1421
1413
  /**
1422
1414
  * A `fetch()` function to be used with GraphQL clients configured for
1423
1415
  * Prismic's GraphQL API. It automatically applies the necessary `prismic-ref`
@@ -1427,11 +1419,11 @@ export class Client<
1427
1419
  * @example
1428
1420
  *
1429
1421
  * ```ts
1430
- * const graphqlClient = new ApolloClient({
1422
+ * const graphQLClient = new ApolloClient({
1431
1423
  * link: new HttpLink({
1432
1424
  * uri: prismic.getGraphQLEndpoint(repositoryName),
1433
- * // Provide `client.graphqlFetch` as the fetch implementation.
1434
- * fetch: client.graphqlFetch,
1425
+ * // Provide `client.graphQLFetch` as the fetch implementation.
1426
+ * fetch: client.graphQLFetch,
1435
1427
  * // Using GET is required.
1436
1428
  * useGETForQueries: true,
1437
1429
  * }),
@@ -1440,7 +1432,8 @@ export class Client<
1440
1432
  * ```
1441
1433
  *
1442
1434
  * @param input - The `fetch()` `input` parameter. Only strings are supported.
1443
- * @param init - The `fetch()` `init` parameter. Only plain objects are supported.
1435
+ * @param init - The `fetch()` `init` parameter. Only plain objects are
1436
+ * supported.
1444
1437
  *
1445
1438
  * @returns The `fetch()` Response for the request.
1446
1439
  * @experimental
@@ -1518,9 +1511,7 @@ export class Client<
1518
1511
  *
1519
1512
  * @returns Cached repository metadata.
1520
1513
  */
1521
- private async getCachedRepository(
1522
- params?: FetchParams,
1523
- ): Promise<prismicT.Repository> {
1514
+ private async getCachedRepository(params?: FetchParams): Promise<Repository> {
1524
1515
  if (
1525
1516
  !this.cachedRepository ||
1526
1517
  Date.now() >= this.cachedRepositoryExpiration
@@ -1544,7 +1535,7 @@ export class Client<
1544
1535
  private async getCachedRepositoryForm(
1545
1536
  name: string,
1546
1537
  params?: FetchParams,
1547
- ): Promise<prismicT.Form> {
1538
+ ): Promise<Form> {
1548
1539
  const cachedRepository = await this.getCachedRepository(params);
1549
1540
  const form = cachedRepository.forms[name];
1550
1541
 
@@ -1561,14 +1552,16 @@ export class Client<
1561
1552
 
1562
1553
  /**
1563
1554
  * Returns the ref needed to query based on the client's current state. This
1564
- * method may make a network request to fetch a ref or resolve the user's ref thunk.
1555
+ * method may make a network request to fetch a ref or resolve the user's ref
1556
+ * thunk.
1565
1557
  *
1566
1558
  * If auto previews are enabled, the preview ref takes priority if available.
1567
1559
  *
1568
1560
  * The following strategies are used depending on the client's state:
1569
1561
  *
1570
1562
  * - If the user called `queryLatestContent`: Use the repository's master ref.
1571
- * The ref is cached for 5 seconds. After 5 seconds, a new master ref is fetched.
1563
+ * The ref is cached for 5 seconds. After 5 seconds, a new master ref is
1564
+ * fetched.
1572
1565
  * - If the user called `queryContentFromReleaseByID`: Use the release's ref.
1573
1566
  * The ref is cached for 5 seconds. After 5 seconds, a new ref for the
1574
1567
  * release is fetched.
package/src/cookie.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /**
2
- * The well-known name of the cookie used to store a Prismic preview session's ref.
2
+ * The well-known name of the cookie used to store a Prismic preview session's
3
+ * ref.
3
4
  */
4
5
  export const preview = "io.prismic.preview";
@@ -4,11 +4,13 @@ import { PrismicError } from "./PrismicError";
4
4
  * Get a Prismic repository's name from its standard Prismic Rest API V2 or
5
5
  * GraphQL endpoint.
6
6
  *
7
- * @typeParam RepositoryEndpoint - Prismic Rest API V2 endpoint for the repository.
7
+ * @typeParam RepositoryEndpoint - Prismic Rest API V2 endpoint for the
8
+ * repository.
8
9
  * @param repositoryEndpoint - Prismic Rest API V2 endpoint for the repository.
9
10
  *
10
11
  * @returns The Prismic repository's name.
11
- * @throws {@link Error} Thrown if an invalid Prismic Rest API V2 endpoint is provided.
12
+ * @throws {@link Error} Thrown if an invalid Prismic Rest API V2 endpoint is
13
+ * provided.
12
14
  */
13
15
  export const getRepositoryName = (repositoryEndpoint: string): string => {
14
16
  try {