@prismicio/client 7.0.0-alpha.0 → 7.0.0-alpha.1

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 (396) hide show
  1. package/README.md +4 -4
  2. package/dist/buildQueryURL.cjs +26 -8
  3. package/dist/buildQueryURL.cjs.map +1 -1
  4. package/dist/buildQueryURL.d.ts +207 -130
  5. package/dist/buildQueryURL.js +25 -7
  6. package/dist/buildQueryURL.js.map +1 -1
  7. package/dist/cookie.cjs +1 -1
  8. package/dist/cookie.cjs.map +1 -1
  9. package/dist/cookie.d.ts +5 -5
  10. package/dist/cookie.js.map +1 -1
  11. package/dist/createClient.cjs +1142 -0
  12. package/dist/createClient.cjs.map +1 -0
  13. package/dist/{client.d.ts → createClient.d.ts} +980 -908
  14. package/dist/createClient.js +1142 -0
  15. package/dist/createClient.js.map +1 -0
  16. package/dist/{ForbiddenError.cjs → errors/ForbiddenError.cjs} +1 -1
  17. package/dist/errors/ForbiddenError.cjs.map +1 -0
  18. package/dist/{ForbiddenError.d.ts → errors/ForbiddenError.d.ts} +11 -11
  19. package/dist/errors/ForbiddenError.js.map +1 -0
  20. package/dist/{NotFoundError.cjs → errors/NotFoundError.cjs} +1 -1
  21. package/dist/errors/NotFoundError.cjs.map +1 -0
  22. package/dist/{NotFoundError.d.ts → errors/NotFoundError.d.ts} +3 -3
  23. package/dist/errors/NotFoundError.js.map +1 -0
  24. package/dist/{ParsingError.cjs → errors/ParsingError.cjs} +1 -1
  25. package/dist/errors/ParsingError.cjs.map +1 -0
  26. package/dist/{ParsingError.d.ts → errors/ParsingError.d.ts} +12 -12
  27. package/dist/errors/ParsingError.js.map +1 -0
  28. package/dist/{PrismicError.cjs → errors/PrismicError.cjs} +1 -1
  29. package/dist/errors/PrismicError.cjs.map +1 -0
  30. package/dist/{PrismicError.d.ts → errors/PrismicError.d.ts} +5 -5
  31. package/dist/errors/PrismicError.js.map +1 -0
  32. package/dist/filter.cjs +247 -0
  33. package/dist/filter.cjs.map +1 -0
  34. package/dist/filter.d.ts +209 -0
  35. package/dist/filter.js +247 -0
  36. package/dist/filter.js.map +1 -0
  37. package/dist/getGraphQLEndpoint.cjs +2 -2
  38. package/dist/getGraphQLEndpoint.cjs.map +1 -1
  39. package/dist/getGraphQLEndpoint.d.ts +9 -9
  40. package/dist/getGraphQLEndpoint.js +1 -1
  41. package/dist/getGraphQLEndpoint.js.map +1 -1
  42. package/dist/getRepositoryEndpoint.cjs +2 -2
  43. package/dist/getRepositoryEndpoint.cjs.map +1 -1
  44. package/dist/getRepositoryEndpoint.d.ts +10 -10
  45. package/dist/getRepositoryEndpoint.js +1 -1
  46. package/dist/getRepositoryEndpoint.js.map +1 -1
  47. package/dist/getRepositoryName.cjs +2 -2
  48. package/dist/getRepositoryName.cjs.map +1 -1
  49. package/dist/getRepositoryName.d.ts +13 -13
  50. package/dist/getRepositoryName.js +1 -1
  51. package/dist/getRepositoryName.js.map +1 -1
  52. package/dist/getToolbarSrc.cjs +13 -0
  53. package/dist/getToolbarSrc.cjs.map +1 -0
  54. package/dist/getToolbarSrc.d.ts +34 -0
  55. package/dist/getToolbarSrc.js +13 -0
  56. package/dist/getToolbarSrc.js.map +1 -0
  57. package/dist/helpers/asDate.cjs +1 -1
  58. package/dist/helpers/asDate.cjs.map +1 -1
  59. package/dist/helpers/asDate.d.ts +16 -16
  60. package/dist/helpers/asDate.js.map +1 -1
  61. package/dist/helpers/asHTML.cjs +7 -6
  62. package/dist/helpers/asHTML.cjs.map +1 -1
  63. package/dist/helpers/asHTML.d.ts +77 -20
  64. package/dist/helpers/asHTML.js +6 -5
  65. package/dist/helpers/asHTML.js.map +1 -1
  66. package/dist/helpers/asImagePixelDensitySrcSet.cjs +1 -1
  67. package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
  68. package/dist/helpers/asImagePixelDensitySrcSet.d.ts +52 -52
  69. package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
  70. package/dist/helpers/asImageSrc.cjs +1 -1
  71. package/dist/helpers/asImageSrc.cjs.map +1 -1
  72. package/dist/helpers/asImageSrc.d.ts +27 -27
  73. package/dist/helpers/asImageSrc.js.map +1 -1
  74. package/dist/helpers/asImageWidthSrcSet.cjs +19 -14
  75. package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
  76. package/dist/helpers/asImageWidthSrcSet.d.ts +60 -60
  77. package/dist/helpers/asImageWidthSrcSet.js +18 -13
  78. package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
  79. package/dist/helpers/asLink.cjs +8 -2
  80. package/dist/helpers/asLink.cjs.map +1 -1
  81. package/dist/helpers/asLink.d.ts +34 -24
  82. package/dist/helpers/asLink.js +7 -1
  83. package/dist/helpers/asLink.js.map +1 -1
  84. package/dist/helpers/asLinkAttrs.cjs +28 -0
  85. package/dist/helpers/asLinkAttrs.cjs.map +1 -0
  86. package/dist/helpers/asLinkAttrs.d.ts +63 -0
  87. package/dist/helpers/asLinkAttrs.js +28 -0
  88. package/dist/helpers/asLinkAttrs.js.map +1 -0
  89. package/dist/helpers/asText.cjs +1 -1
  90. package/dist/helpers/asText.cjs.map +1 -1
  91. package/dist/helpers/asText.d.ts +16 -16
  92. package/dist/helpers/asText.js.map +1 -1
  93. package/dist/helpers/documentToLinkField.cjs +12 -5
  94. package/dist/helpers/documentToLinkField.cjs.map +1 -1
  95. package/dist/helpers/documentToLinkField.d.ts +15 -15
  96. package/dist/helpers/documentToLinkField.js +11 -4
  97. package/dist/helpers/documentToLinkField.js.map +1 -1
  98. package/dist/helpers/isFilled.cjs +1 -1
  99. package/dist/helpers/isFilled.cjs.map +1 -1
  100. package/dist/helpers/isFilled.d.ts +172 -175
  101. package/dist/helpers/isFilled.js.map +1 -1
  102. package/dist/index.cjs +20 -14
  103. package/dist/index.cjs.map +1 -1
  104. package/dist/index.d.ts +138 -92
  105. package/dist/index.js +12 -6
  106. package/dist/index.js.map +1 -1
  107. package/dist/isRepositoryEndpoint.cjs +1 -1
  108. package/dist/isRepositoryEndpoint.cjs.map +1 -1
  109. package/dist/isRepositoryEndpoint.d.ts +10 -10
  110. package/dist/isRepositoryEndpoint.js.map +1 -1
  111. package/dist/isRepositoryName.cjs +1 -1
  112. package/dist/isRepositoryName.cjs.map +1 -1
  113. package/dist/isRepositoryName.d.ts +9 -9
  114. package/dist/isRepositoryName.js.map +1 -1
  115. package/dist/lib/appendFilters.cjs +11 -0
  116. package/dist/lib/appendFilters.cjs.map +1 -0
  117. package/dist/lib/appendFilters.d.ts +18 -0
  118. package/dist/lib/appendFilters.js +11 -0
  119. package/dist/lib/appendFilters.js.map +1 -0
  120. package/dist/lib/castArray.cjs +4 -2
  121. package/dist/lib/castArray.cjs.map +1 -1
  122. package/dist/lib/castArray.d.ts +11 -11
  123. package/dist/lib/castArray.js +3 -1
  124. package/dist/lib/castArray.js.map +1 -1
  125. package/dist/lib/castThunk.cjs +4 -2
  126. package/dist/lib/castThunk.cjs.map +1 -1
  127. package/dist/lib/castThunk.d.ts +10 -10
  128. package/dist/lib/castThunk.js +3 -1
  129. package/dist/lib/castThunk.js.map +1 -1
  130. package/dist/lib/devMsg.cjs +8 -0
  131. package/dist/lib/devMsg.cjs.map +1 -0
  132. package/dist/lib/devMsg.d.ts +16 -0
  133. package/dist/lib/devMsg.js +8 -0
  134. package/dist/lib/devMsg.js.map +1 -0
  135. package/dist/lib/escapeHTML.cjs +43 -0
  136. package/dist/lib/escapeHTML.cjs.map +1 -0
  137. package/dist/lib/escapeHTML.d.ts +1 -0
  138. package/dist/lib/escapeHTML.js +43 -0
  139. package/dist/lib/escapeHTML.js.map +1 -0
  140. package/dist/lib/everyTagFilter.cjs +9 -0
  141. package/dist/lib/everyTagFilter.cjs.map +1 -0
  142. package/dist/lib/everyTagFilter.d.ts +9 -0
  143. package/dist/lib/everyTagFilter.js +9 -0
  144. package/dist/lib/everyTagFilter.js.map +1 -0
  145. package/dist/lib/findMasterRef.cjs +1 -1
  146. package/dist/lib/findMasterRef.cjs.map +1 -1
  147. package/dist/lib/findMasterRef.d.ts +10 -10
  148. package/dist/lib/findMasterRef.js.map +1 -1
  149. package/dist/lib/findRef.cjs +4 -4
  150. package/dist/lib/findRef.cjs.map +1 -1
  151. package/dist/lib/findRef.d.ts +13 -13
  152. package/dist/lib/findRef.js +3 -3
  153. package/dist/lib/findRef.js.map +1 -1
  154. package/dist/lib/findRefByID.cjs +1 -1
  155. package/dist/lib/findRefByID.cjs.map +1 -1
  156. package/dist/lib/findRefByID.d.ts +11 -11
  157. package/dist/lib/findRefByID.js.map +1 -1
  158. package/dist/lib/findRefByLabel.cjs +1 -1
  159. package/dist/lib/findRefByLabel.cjs.map +1 -1
  160. package/dist/lib/findRefByLabel.d.ts +11 -11
  161. package/dist/lib/findRefByLabel.js.map +1 -1
  162. package/dist/lib/getPreviewCookie.cjs +1 -1
  163. package/dist/lib/getPreviewCookie.cjs.map +1 -1
  164. package/dist/lib/getPreviewCookie.d.ts +9 -9
  165. package/dist/lib/getPreviewCookie.js.map +1 -1
  166. package/dist/lib/isInternalURL.cjs +9 -0
  167. package/dist/lib/isInternalURL.cjs.map +1 -0
  168. package/dist/lib/isInternalURL.d.ts +8 -0
  169. package/dist/lib/isInternalURL.js +9 -0
  170. package/dist/lib/isInternalURL.js.map +1 -0
  171. package/dist/lib/minifyGraphQLQuery.cjs +1 -1
  172. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
  173. package/dist/lib/minifyGraphQLQuery.d.ts +8 -8
  174. package/dist/lib/minifyGraphQLQuery.js.map +1 -1
  175. package/dist/lib/serializerHelpers.cjs +7 -9
  176. package/dist/lib/serializerHelpers.cjs.map +1 -1
  177. package/dist/lib/serializerHelpers.d.ts +9 -9
  178. package/dist/lib/serializerHelpers.js +6 -6
  179. package/dist/lib/serializerHelpers.js.map +1 -1
  180. package/dist/lib/someTagsFilter.cjs +9 -0
  181. package/dist/lib/someTagsFilter.cjs.map +1 -0
  182. package/dist/lib/someTagsFilter.d.ts +9 -0
  183. package/dist/lib/someTagsFilter.js +9 -0
  184. package/dist/lib/someTagsFilter.js.map +1 -0
  185. package/dist/lib/typeFilter.cjs +8 -0
  186. package/dist/lib/typeFilter.cjs.map +1 -0
  187. package/dist/lib/typeFilter.d.ts +8 -0
  188. package/dist/lib/typeFilter.js +8 -0
  189. package/dist/lib/typeFilter.js.map +1 -0
  190. package/dist/package.json.cjs +5 -0
  191. package/dist/package.json.cjs.map +1 -0
  192. package/dist/package.json.js +5 -0
  193. package/dist/package.json.js.map +1 -0
  194. package/dist/types/api/query.d.ts +42 -42
  195. package/dist/types/api/ref.d.ts +32 -32
  196. package/dist/types/api/release.d.ts +10 -10
  197. package/dist/types/api/repository.d.ts +100 -100
  198. package/dist/types/api/tags.d.ts +8 -8
  199. package/dist/types/model/boolean.d.ts +15 -15
  200. package/dist/types/model/color.d.ts +13 -13
  201. package/dist/types/model/contentRelationship.d.ts +18 -18
  202. package/dist/types/model/customType.d.ts +42 -42
  203. package/dist/types/model/date.d.ts +14 -14
  204. package/dist/types/model/embed.d.ts +13 -13
  205. package/dist/types/model/geoPoint.d.ts +12 -12
  206. package/dist/types/model/group.d.ts +15 -15
  207. package/dist/types/model/image.d.ts +31 -31
  208. package/dist/types/model/integrationFields.d.ts +14 -14
  209. package/dist/types/model/keyText.d.ts +13 -13
  210. package/dist/types/model/link.cjs +1 -1
  211. package/dist/types/model/link.cjs.map +1 -1
  212. package/dist/types/model/link.d.ts +27 -27
  213. package/dist/types/model/link.js.map +1 -1
  214. package/dist/types/model/linkToMedia.d.ts +16 -16
  215. package/dist/types/model/number.d.ts +15 -15
  216. package/dist/types/model/range.d.ts +14 -14
  217. package/dist/types/model/richText.d.ts +35 -35
  218. package/dist/types/model/select.d.ts +18 -18
  219. package/dist/types/model/separator.d.ts +10 -10
  220. package/dist/types/model/sharedSlice.d.ts +16 -19
  221. package/dist/types/model/sharedSliceVariation.d.ts +19 -22
  222. package/dist/types/model/slice.cjs +1 -1
  223. package/dist/types/model/slice.cjs.map +1 -1
  224. package/dist/types/model/slice.d.ts +33 -33
  225. package/dist/types/model/slice.js.map +1 -1
  226. package/dist/types/model/sliceZone.cjs +1 -1
  227. package/dist/types/model/sliceZone.cjs.map +1 -1
  228. package/dist/types/model/sliceZone.d.ts +41 -44
  229. package/dist/types/model/sliceZone.js.map +1 -1
  230. package/dist/types/model/timestamp.d.ts +14 -14
  231. package/dist/types/model/title.d.ts +7 -7
  232. package/dist/types/model/types.cjs +10 -1
  233. package/dist/types/model/types.cjs.map +1 -1
  234. package/dist/types/model/types.d.ts +62 -62
  235. package/dist/types/model/types.js +9 -0
  236. package/dist/types/model/types.js.map +1 -1
  237. package/dist/types/model/uid.d.ts +13 -13
  238. package/dist/types/value/boolean.d.ts +6 -6
  239. package/dist/types/value/color.d.ts +8 -8
  240. package/dist/types/value/contentRelationship.d.ts +29 -29
  241. package/dist/types/value/date.d.ts +8 -8
  242. package/dist/types/value/document.d.ts +113 -113
  243. package/dist/types/value/embed.cjs +1 -1
  244. package/dist/types/value/embed.cjs.map +1 -1
  245. package/dist/types/value/embed.d.ts +167 -167
  246. package/dist/types/value/embed.js.map +1 -1
  247. package/dist/types/value/geoPoint.d.ts +11 -11
  248. package/dist/types/value/group.d.ts +7 -7
  249. package/dist/types/value/image.d.ts +36 -36
  250. package/dist/types/value/integrationFields.d.ts +9 -9
  251. package/dist/types/value/keyText.d.ts +8 -8
  252. package/dist/types/value/link.cjs +1 -1
  253. package/dist/types/value/link.cjs.map +1 -1
  254. package/dist/types/value/link.d.ts +40 -40
  255. package/dist/types/value/link.js.map +1 -1
  256. package/dist/types/value/linkToMedia.d.ts +20 -20
  257. package/dist/types/value/number.d.ts +8 -8
  258. package/dist/types/value/richText.cjs +1 -1
  259. package/dist/types/value/richText.cjs.map +1 -1
  260. package/dist/types/value/richText.d.ts +203 -203
  261. package/dist/types/value/richText.js.map +1 -1
  262. package/dist/types/value/select.d.ts +9 -9
  263. package/dist/types/value/sharedSlice.d.ts +11 -11
  264. package/dist/types/value/sharedSliceVariation.d.ts +7 -7
  265. package/dist/types/value/slice.d.ts +13 -13
  266. package/dist/types/value/sliceZone.d.ts +12 -12
  267. package/dist/types/value/timestamp.d.ts +8 -8
  268. package/dist/types/value/title.d.ts +12 -12
  269. package/dist/types/value/types.d.ts +40 -40
  270. package/dist/types/webhook/apiUpdate.d.ts +52 -52
  271. package/dist/types/webhook/testTrigger.d.ts +9 -9
  272. package/dist/types/webhook/types.cjs +1 -1
  273. package/dist/types/webhook/types.cjs.map +1 -1
  274. package/dist/types/webhook/types.d.ts +18 -18
  275. package/dist/types/webhook/types.js.map +1 -1
  276. package/package.json +23 -24
  277. package/src/buildQueryURL.ts +179 -33
  278. package/src/{client.ts → createClient.ts} +214 -110
  279. package/src/filter.ts +356 -0
  280. package/src/getGraphQLEndpoint.ts +2 -1
  281. package/src/getRepositoryEndpoint.ts +2 -1
  282. package/src/getRepositoryName.ts +1 -1
  283. package/src/getToolbarSrc.ts +50 -0
  284. package/src/helpers/asDate.ts +3 -3
  285. package/src/helpers/asHTML.ts +122 -27
  286. package/src/helpers/asImagePixelDensitySrcSet.ts +1 -1
  287. package/src/helpers/asImageSrc.ts +1 -1
  288. package/src/helpers/asImageWidthSrcSet.ts +1 -1
  289. package/src/helpers/asLink.ts +37 -18
  290. package/src/helpers/asLinkAttrs.ts +127 -0
  291. package/src/helpers/asText.ts +4 -4
  292. package/src/helpers/documentToLinkField.ts +3 -3
  293. package/src/helpers/isFilled.ts +9 -11
  294. package/src/index.ts +59 -29
  295. package/src/lib/appendFilters.ts +26 -0
  296. package/src/lib/castArray.ts +3 -1
  297. package/src/lib/castThunk.ts +3 -2
  298. package/src/lib/devMsg.ts +20 -0
  299. package/src/lib/escapeHTML.ts +51 -0
  300. package/src/lib/everyTagFilter.ts +15 -0
  301. package/src/lib/findRef.ts +5 -5
  302. package/src/lib/isInternalURL.ts +14 -0
  303. package/src/lib/serializerHelpers.ts +20 -15
  304. package/src/lib/someTagsFilter.ts +15 -0
  305. package/src/lib/typeFilter.ts +12 -0
  306. package/src/types/api/query.ts +1 -1
  307. package/src/types/api/ref.ts +2 -2
  308. package/src/types/api/release.ts +1 -1
  309. package/src/types/api/repository.ts +1 -1
  310. package/src/types/api/tags.ts +1 -1
  311. package/src/types/model/boolean.ts +1 -1
  312. package/src/types/model/color.ts +1 -1
  313. package/src/types/model/contentRelationship.ts +2 -1
  314. package/src/types/model/date.ts +1 -1
  315. package/src/types/model/embed.ts +1 -1
  316. package/src/types/model/geoPoint.ts +1 -1
  317. package/src/types/model/group.ts +2 -2
  318. package/src/types/model/image.ts +3 -3
  319. package/src/types/model/integrationFields.ts +1 -1
  320. package/src/types/model/keyText.ts +1 -1
  321. package/src/types/model/link.ts +3 -3
  322. package/src/types/model/linkToMedia.ts +2 -1
  323. package/src/types/model/number.ts +1 -1
  324. package/src/types/model/richText.ts +3 -3
  325. package/src/types/model/select.ts +1 -1
  326. package/src/types/model/sharedSlice.ts +2 -5
  327. package/src/types/model/sharedSliceVariation.ts +1 -4
  328. package/src/types/model/slice.ts +5 -4
  329. package/src/types/model/sliceZone.ts +5 -7
  330. package/src/types/model/timestamp.ts +1 -1
  331. package/src/types/model/title.ts +1 -1
  332. package/src/types/model/types.ts +12 -16
  333. package/src/types/model/uid.ts +1 -1
  334. package/src/types/value/boolean.ts +1 -1
  335. package/src/types/value/color.ts +1 -1
  336. package/src/types/value/contentRelationship.ts +8 -9
  337. package/src/types/value/date.ts +1 -1
  338. package/src/types/value/document.ts +6 -5
  339. package/src/types/value/embed.ts +2 -2
  340. package/src/types/value/geoPoint.ts +1 -1
  341. package/src/types/value/group.ts +2 -2
  342. package/src/types/value/image.ts +1 -1
  343. package/src/types/value/integrationFields.ts +1 -1
  344. package/src/types/value/keyText.ts +1 -1
  345. package/src/types/value/link.ts +8 -8
  346. package/src/types/value/linkToMedia.ts +2 -1
  347. package/src/types/value/number.ts +1 -1
  348. package/src/types/value/richText.ts +6 -5
  349. package/src/types/value/select.ts +1 -1
  350. package/src/types/value/sharedSlice.ts +1 -1
  351. package/src/types/value/slice.ts +1 -1
  352. package/src/types/value/sliceZone.ts +2 -1
  353. package/src/types/value/timestamp.ts +1 -0
  354. package/src/types/value/title.ts +2 -1
  355. package/src/types/value/types.ts +9 -11
  356. package/src/types/webhook/apiUpdate.ts +4 -4
  357. package/src/types/webhook/testTrigger.ts +1 -1
  358. package/src/types/webhook/types.ts +2 -2
  359. package/dist/ForbiddenError.cjs.map +0 -1
  360. package/dist/ForbiddenError.js.map +0 -1
  361. package/dist/NotFoundError.cjs.map +0 -1
  362. package/dist/NotFoundError.js.map +0 -1
  363. package/dist/ParsingError.cjs.map +0 -1
  364. package/dist/ParsingError.js.map +0 -1
  365. package/dist/PrismicError.cjs.map +0 -1
  366. package/dist/PrismicError.js.map +0 -1
  367. package/dist/client.cjs +0 -414
  368. package/dist/client.cjs.map +0 -1
  369. package/dist/client.js +0 -414
  370. package/dist/client.js.map +0 -1
  371. package/dist/lib/appendPredicates.cjs +0 -14
  372. package/dist/lib/appendPredicates.cjs.map +0 -1
  373. package/dist/lib/appendPredicates.d.ts +0 -18
  374. package/dist/lib/appendPredicates.js +0 -14
  375. package/dist/lib/appendPredicates.js.map +0 -1
  376. package/dist/predicate.cjs +0 -68
  377. package/dist/predicate.cjs.map +0 -1
  378. package/dist/predicate.d.ts +0 -209
  379. package/dist/predicate.js +0 -68
  380. package/dist/predicate.js.map +0 -1
  381. package/dist/types/client.d.ts +0 -128
  382. package/dist/types/helpers.d.ts +0 -63
  383. package/dist/types/utils.d.ts +0 -28
  384. package/src/lib/appendPredicates.ts +0 -29
  385. package/src/predicate.ts +0 -359
  386. package/src/types/client.ts +0 -157
  387. package/src/types/helpers.ts +0 -103
  388. package/src/types/utils.ts +0 -34
  389. /package/dist/{ForbiddenError.js → errors/ForbiddenError.js} +0 -0
  390. /package/dist/{NotFoundError.js → errors/NotFoundError.js} +0 -0
  391. /package/dist/{ParsingError.js → errors/ParsingError.js} +0 -0
  392. /package/dist/{PrismicError.js → errors/PrismicError.js} +0 -0
  393. /package/src/{ForbiddenError.ts → errors/ForbiddenError.ts} +0 -0
  394. /package/src/{NotFoundError.ts → errors/NotFoundError.ts} +0 -0
  395. /package/src/{ParsingError.ts → errors/ParsingError.ts} +0 -0
  396. /package/src/{PrismicError.ts → errors/PrismicError.ts} +0 -0
@@ -1,9 +1,9 @@
1
- import { RTBlockNode, RTInlineNode, RTPreformattedNode, RTImageNode, RTEmbedNode, RTLinkNode } from "../types/value/richText";
2
- import { LinkResolverFunction } from "../types/helpers";
3
- export declare const getLabel: (node: RTBlockNode | RTInlineNode) => string;
4
- export declare const serializeStandardTag: (tag: string, node: RTBlockNode | RTInlineNode, children: string[]) => string;
5
- export declare const serializePreFormatted: (node: RTPreformattedNode) => string;
6
- export declare const serializeImage: (linkResolver: LinkResolverFunction<string> | undefined | null, node: RTImageNode) => string;
7
- export declare const serializeEmbed: (node: RTEmbedNode) => string;
8
- export declare const serializeHyperlink: (linkResolver: LinkResolverFunction | undefined | null, node: RTLinkNode, children: string[]) => string;
9
- export declare const serializeSpan: (content?: string) => string;
1
+ import { RTBlockNode, RTEmbedNode, RTImageNode, RTInlineNode, RTLinkNode, RTPreformattedNode } from "../types/value/richText";
2
+ import { LinkResolverFunction } from "../helpers/asLink";
3
+ export declare const getLabel: (node: RTBlockNode | RTInlineNode) => string;
4
+ export declare const serializeStandardTag: (tag: string, node: RTBlockNode | RTInlineNode, children: string[]) => string;
5
+ export declare const serializePreFormatted: (node: RTPreformattedNode) => string;
6
+ export declare const serializeImage: (linkResolver: LinkResolverFunction<string | null | undefined> | undefined | null, node: RTImageNode) => string;
7
+ export declare const serializeEmbed: (node: RTEmbedNode) => string;
8
+ export declare const serializeHyperlink: (linkResolver: LinkResolverFunction<string | null | undefined> | undefined | null, node: RTLinkNode, children: string[]) => string;
9
+ export declare const serializeSpan: (content?: string) => string;
@@ -1,7 +1,7 @@
1
- import escapeHtml from "escape-html";
2
- import { RichTextNodeType } from "../types/value/richText.js";
3
1
  import { LinkType } from "../types/value/link.js";
2
+ import { RichTextNodeType } from "../types/value/richText.js";
4
3
  import { asLink } from "../helpers/asLink.js";
4
+ import { escapeHTML } from "./escapeHTML.js";
5
5
  const getLabel = (node) => {
6
6
  return "data" in node && "label" in node.data ? ` class="${node.data.label}"` : "";
7
7
  };
@@ -9,10 +9,10 @@ const serializeStandardTag = (tag, node, children) => {
9
9
  return `<${tag}${getLabel(node)}>${children.join("")}</${tag}>`;
10
10
  };
11
11
  const serializePreFormatted = (node) => {
12
- return `<pre${getLabel(node)}>${escapeHtml(node.text)}</pre>`;
12
+ return `<pre${getLabel(node)}>${escapeHTML(node.text)}</pre>`;
13
13
  };
14
14
  const serializeImage = (linkResolver, node) => {
15
- let imageTag = `<img src="${node.url}" alt="${escapeHtml(node.alt)}"${node.copyright ? ` copyright="${escapeHtml(node.copyright)}"` : ""} />`;
15
+ let imageTag = `<img src="${node.url}" alt="${escapeHTML(node.alt)}"${node.copyright ? ` copyright="${escapeHTML(node.copyright)}"` : ""} />`;
16
16
  if (node.linkTo) {
17
17
  imageTag = serializeHyperlink(linkResolver, {
18
18
  type: RichTextNodeType.hyperlink,
@@ -29,7 +29,7 @@ const serializeEmbed = (node) => {
29
29
  const serializeHyperlink = (linkResolver, node, children) => {
30
30
  switch (node.data.link_type) {
31
31
  case LinkType.Web: {
32
- return `<a href="${escapeHtml(node.data.url)}" ${node.data.target ? `target="${node.data.target}" ` : ""}rel="noopener noreferrer"${getLabel(node)}>${children.join("")}</a>`;
32
+ return `<a href="${escapeHTML(node.data.url)}" ${node.data.target ? `target="${node.data.target}" ` : ""}rel="noopener noreferrer"${getLabel(node)}>${children.join("")}</a>`;
33
33
  }
34
34
  case LinkType.Document: {
35
35
  return `<a href="${asLink(node.data, linkResolver)}"${getLabel(node)}>${children.join("")}</a>`;
@@ -40,7 +40,7 @@ const serializeHyperlink = (linkResolver, node, children) => {
40
40
  }
41
41
  };
42
42
  const serializeSpan = (content) => {
43
- return content ? escapeHtml(content).replace(/\n/g, "<br />") : "";
43
+ return content ? escapeHTML(content).replace(/\n/g, "<br />") : "";
44
44
  };
45
45
  export {
46
46
  getLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"serializerHelpers.js","sources":["../../src/lib/serializerHelpers.ts"],"sourcesContent":["import escapeHtml from \"escape-html\";\n\nimport {\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTPreformattedNode,\n\tRTImageNode,\n\tRTEmbedNode,\n\tRTLinkNode,\n\tRichTextNodeType,\n} from \"../types/value/richText\";\nimport { LinkType } from \"../types/value/link\";\nimport { LinkResolverFunction } from \"../types/helpers\";\n\nimport { asLink } from \"../helpers/asLink\";\n\nexport const getLabel = (node: RTBlockNode | RTInlineNode): string => {\n\treturn \"data\" in node && \"label\" in node.data\n\t\t? ` class=\"${node.data.label}\"`\n\t\t: \"\";\n};\n\nexport const serializeStandardTag = (\n\ttag: string,\n\tnode: RTBlockNode | RTInlineNode,\n\tchildren: string[],\n): string => {\n\treturn `<${tag}${getLabel(node)}>${children.join(\"\")}</${tag}>`;\n};\n\nexport const serializePreFormatted = (node: RTPreformattedNode): string => {\n\treturn `<pre${getLabel(node)}>${escapeHtml(node.text)}</pre>`;\n};\n\nexport const serializeImage = (\n\tlinkResolver: LinkResolverFunction<string> | undefined | null,\n\tnode: RTImageNode,\n): string => {\n\tlet imageTag = `<img src=\"${node.url}\" alt=\"${escapeHtml(node.alt)}\"${\n\t\tnode.copyright ? ` copyright=\"${escapeHtml(node.copyright)}\"` : \"\"\n\t} />`;\n\n\t// If the image has a link, we wrap it with an anchor tag\n\tif (node.linkTo) {\n\t\timageTag = serializeHyperlink(\n\t\t\tlinkResolver,\n\t\t\t{\n\t\t\t\ttype: RichTextNodeType.hyperlink,\n\t\t\t\tdata: node.linkTo,\n\t\t\t\tstart: 0,\n\t\t\t\tend: 0,\n\t\t\t},\n\t\t\t[imageTag],\n\t\t);\n\t}\n\n\treturn `<p class=\"block-img\">${imageTag}</p>`;\n};\n\nexport const serializeEmbed = (node: RTEmbedNode): string => {\n\treturn `<div data-oembed=\"${node.oembed.embed_url}\" data-oembed-type=\"${\n\t\tnode.oembed.type\n\t}\" data-oembed-provider=\"${node.oembed.provider_name}\"${getLabel(node)}>${\n\t\tnode.oembed.html\n\t}</div>`;\n};\n\nexport const serializeHyperlink = (\n\tlinkResolver: LinkResolverFunction | undefined | null,\n\tnode: RTLinkNode,\n\tchildren: string[],\n): string => {\n\tswitch (node.data.link_type) {\n\t\tcase LinkType.Web: {\n\t\t\treturn `<a href=\"${escapeHtml(node.data.url)}\" ${\n\t\t\t\tnode.data.target ? `target=\"${node.data.target}\" ` : \"\"\n\t\t\t}rel=\"noopener noreferrer\"${getLabel(node)}>${children.join(\"\")}</a>`;\n\t\t}\n\n\t\tcase LinkType.Document: {\n\t\t\treturn `<a href=\"${asLink(node.data, linkResolver)}\"${getLabel(\n\t\t\t\tnode,\n\t\t\t)}>${children.join(\"\")}</a>`;\n\t\t}\n\n\t\tcase LinkType.Media: {\n\t\t\treturn `<a href=\"${node.data.url}\"${getLabel(node)}>${children.join(\n\t\t\t\t\"\",\n\t\t\t)}</a>`;\n\t\t}\n\t}\n};\n\nexport const serializeSpan = (content?: string): string => {\n\treturn content ? escapeHtml(content).replace(/\\n/g, \"<br />\") : \"\";\n};\n"],"names":[],"mappings":";;;;AAgBa,MAAA,WAAW,CAAC,SAA4C;AAC7D,SAAA,UAAU,QAAQ,WAAW,KAAK,OACtC,WAAW,KAAK,KAAK,WACrB;AACJ;AAEO,MAAM,uBAAuB,CACnC,KACA,MACA,aACW;AACJ,SAAA,IAAI,MAAM,SAAS,IAAI,KAAK,SAAS,KAAK,EAAE,MAAM;AAC1D;AAEa,MAAA,wBAAwB,CAAC,SAAoC;AACzE,SAAO,OAAO,SAAS,IAAI,KAAK,WAAW,KAAK,IAAI;AACrD;AAEa,MAAA,iBAAiB,CAC7B,cACA,SACW;AACX,MAAI,WAAW,aAAa,KAAK,aAAa,WAAW,KAAK,GAAG,KAChE,KAAK,YAAY,eAAe,WAAW,KAAK,SAAS,OAAO;AAIjE,MAAI,KAAK,QAAQ;AAChB,eAAW,mBACV,cACA;AAAA,MACC,MAAM,iBAAiB;AAAA,MACvB,MAAM,KAAK;AAAA,MACX,OAAO;AAAA,MACP,KAAK;AAAA,IAAA,GAEN,CAAC,QAAQ,CAAC;AAAA,EAEX;AAED,SAAO,wBAAwB;AAChC;AAEa,MAAA,iBAAiB,CAAC,SAA6B;AAC3D,SAAO,qBAAqB,KAAK,OAAO,gCACvC,KAAK,OAAO,+BACc,KAAK,OAAO,iBAAiB,SAAS,IAAI,KACpE,KAAK,OAAO;AAEd;AAEO,MAAM,qBAAqB,CACjC,cACA,MACA,aACW;AACH,UAAA,KAAK,KAAK,WAAW;AAAA,IAC5B,KAAK,SAAS,KAAK;AAClB,aAAO,YAAY,WAAW,KAAK,KAAK,GAAG,MAC1C,KAAK,KAAK,SAAS,WAAW,KAAK,KAAK,aAAa,8BAC1B,SAAS,IAAI,KAAK,SAAS,KAAK,EAAE;AAAA,IAC9D;AAAA,IAED,KAAK,SAAS,UAAU;AAChB,aAAA,YAAY,OAAO,KAAK,MAAM,YAAY,KAAK,SACrD,IAAI,KACA,SAAS,KAAK,EAAE;AAAA,IACrB;AAAA,IAED,KAAK,SAAS,OAAO;AACb,aAAA,YAAY,KAAK,KAAK,OAAO,SAAS,IAAI,KAAK,SAAS,KAC9D,EAAE;AAAA,IAEH;AAAA,EACD;AACF;AAEa,MAAA,gBAAgB,CAAC,YAA4B;AACzD,SAAO,UAAU,WAAW,OAAO,EAAE,QAAQ,OAAO,QAAQ,IAAI;AACjE;"}
1
+ {"version":3,"file":"serializerHelpers.js","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import { LinkType } from \"../types/value/link\";\nimport {\n\tRTBlockNode,\n\tRTEmbedNode,\n\tRTImageNode,\n\tRTInlineNode,\n\tRTLinkNode,\n\tRTPreformattedNode,\n\tRichTextNodeType,\n} from \"../types/value/richText\";\n\nimport { LinkResolverFunction, asLink } from \"../helpers/asLink\";\n\nimport { escapeHTML } from \"./escapeHTML\";\n\nexport const getLabel = (node: RTBlockNode | RTInlineNode): string => {\n\treturn \"data\" in node && \"label\" in node.data\n\t\t? ` class=\"${node.data.label}\"`\n\t\t: \"\";\n};\n\nexport const serializeStandardTag = (\n\ttag: string,\n\tnode: RTBlockNode | RTInlineNode,\n\tchildren: string[],\n): string => {\n\treturn `<${tag}${getLabel(node)}>${children.join(\"\")}</${tag}>`;\n};\n\nexport const serializePreFormatted = (node: RTPreformattedNode): string => {\n\treturn `<pre${getLabel(node)}>${escapeHTML(node.text)}</pre>`;\n};\n\nexport const serializeImage = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tnode: RTImageNode,\n): string => {\n\tlet imageTag = `<img src=\"${node.url}\" alt=\"${escapeHTML(node.alt)}\"${\n\t\tnode.copyright ? ` copyright=\"${escapeHTML(node.copyright)}\"` : \"\"\n\t} />`;\n\n\t// If the image has a link, we wrap it with an anchor tag\n\tif (node.linkTo) {\n\t\timageTag = serializeHyperlink(\n\t\t\tlinkResolver,\n\t\t\t{\n\t\t\t\ttype: RichTextNodeType.hyperlink,\n\t\t\t\tdata: node.linkTo,\n\t\t\t\tstart: 0,\n\t\t\t\tend: 0,\n\t\t\t},\n\t\t\t[imageTag],\n\t\t);\n\t}\n\n\treturn `<p class=\"block-img\">${imageTag}</p>`;\n};\n\nexport const serializeEmbed = (node: RTEmbedNode): string => {\n\treturn `<div data-oembed=\"${node.oembed.embed_url}\" data-oembed-type=\"${\n\t\tnode.oembed.type\n\t}\" data-oembed-provider=\"${node.oembed.provider_name}\"${getLabel(node)}>${\n\t\tnode.oembed.html\n\t}</div>`;\n};\n\nexport const serializeHyperlink = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tnode: RTLinkNode,\n\tchildren: string[],\n): string => {\n\tswitch (node.data.link_type) {\n\t\tcase LinkType.Web: {\n\t\t\treturn `<a href=\"${escapeHTML(node.data.url)}\" ${\n\t\t\t\tnode.data.target ? `target=\"${node.data.target}\" ` : \"\"\n\t\t\t}rel=\"noopener noreferrer\"${getLabel(node)}>${children.join(\"\")}</a>`;\n\t\t}\n\n\t\tcase LinkType.Document: {\n\t\t\treturn `<a href=\"${asLink(node.data, linkResolver)}\"${getLabel(\n\t\t\t\tnode,\n\t\t\t)}>${children.join(\"\")}</a>`;\n\t\t}\n\n\t\tcase LinkType.Media: {\n\t\t\treturn `<a href=\"${node.data.url}\"${getLabel(node)}>${children.join(\n\t\t\t\t\"\",\n\t\t\t)}</a>`;\n\t\t}\n\t}\n};\n\nexport const serializeSpan = (content?: string): string => {\n\treturn content ? escapeHTML(content).replace(/\\n/g, \"<br />\") : \"\";\n};\n"],"names":[],"mappings":";;;;AAea,MAAA,WAAW,CAAC,SAA4C;AAC7D,SAAA,UAAU,QAAQ,WAAW,KAAK,OACtC,WAAW,KAAK,KAAK,WACrB;AACJ;AAEO,MAAM,uBAAuB,CACnC,KACA,MACA,aACW;AACJ,SAAA,IAAI,MAAM,SAAS,IAAI,KAAK,SAAS,KAAK,EAAE,MAAM;AAC1D;AAEa,MAAA,wBAAwB,CAAC,SAAoC;AACzE,SAAO,OAAO,SAAS,IAAI,KAAK,WAAW,KAAK,IAAI;AACrD;AAEa,MAAA,iBAAiB,CAC7B,cAIA,SACW;AACX,MAAI,WAAW,aAAa,KAAK,aAAa,WAAW,KAAK,GAAG,KAChE,KAAK,YAAY,eAAe,WAAW,KAAK,SAAS,OAAO;AAIjE,MAAI,KAAK,QAAQ;AAChB,eAAW,mBACV,cACA;AAAA,MACC,MAAM,iBAAiB;AAAA,MACvB,MAAM,KAAK;AAAA,MACX,OAAO;AAAA,MACP,KAAK;AAAA,IAAA,GAEN,CAAC,QAAQ,CAAC;AAAA,EAEX;AAED,SAAO,wBAAwB;AAChC;AAEa,MAAA,iBAAiB,CAAC,SAA6B;AAC3D,SAAO,qBAAqB,KAAK,OAAO,gCACvC,KAAK,OAAO,+BACc,KAAK,OAAO,iBAAiB,SAAS,IAAI,KACpE,KAAK,OAAO;AAEd;AAEO,MAAM,qBAAqB,CACjC,cAIA,MACA,aACW;AACH,UAAA,KAAK,KAAK,WAAW;AAAA,IAC5B,KAAK,SAAS,KAAK;AAClB,aAAO,YAAY,WAAW,KAAK,KAAK,GAAG,MAC1C,KAAK,KAAK,SAAS,WAAW,KAAK,KAAK,aAAa,8BAC1B,SAAS,IAAI,KAAK,SAAS,KAAK,EAAE;AAAA,IAC9D;AAAA,IAED,KAAK,SAAS,UAAU;AAChB,aAAA,YAAY,OAAO,KAAK,MAAM,YAAY,KAAK,SACrD,IAAI,KACA,SAAS,KAAK,EAAE;AAAA,IACrB;AAAA,IAED,KAAK,SAAS,OAAO;AACb,aAAA,YAAY,KAAK,KAAK,OAAO,SAAS,IAAI,KAAK,SAAS,KAC9D,EAAE;AAAA,IAEH;AAAA,EACD;AACF;AAEa,MAAA,gBAAgB,CAAC,YAA4B;AACzD,SAAO,UAAU,WAAW,OAAO,EAAE,QAAQ,OAAO,QAAQ,IAAI;AACjE;"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const filter = require("../filter.cjs");
4
+ const castArray = require("./castArray.cjs");
5
+ const someTagsFilter = (tags) => {
6
+ return filter.filter.any("document.tags", castArray.castArray(tags));
7
+ };
8
+ exports.someTagsFilter = someTagsFilter;
9
+ //# sourceMappingURL=someTagsFilter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"someTagsFilter.cjs","sources":["../../../src/lib/someTagsFilter.ts"],"sourcesContent":["import { filter } from \"../filter\";\n\nimport { castArray } from \"./castArray\";\n\n/**\n * Creates a filter to filter content by document tags. At least one matching\n * tag is required on the document.\n *\n * @param tags - Document tags to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const someTagsFilter = (tags: string | string[]): string => {\n\treturn filter.any(\"document.tags\", castArray(tags));\n};\n"],"names":["filter","castArray"],"mappings":";;;;AAYa,MAAA,iBAAiB,CAAC,SAAmC;AACjE,SAAOA,OAAAA,OAAO,IAAI,iBAAiBC,UAAAA,UAAU,IAAI,CAAC;AACnD;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Creates a filter to filter content by document tags. At least one matching
3
+ * tag is required on the document.
4
+ *
5
+ * @param tags - Document tags to filter queried content.
6
+ *
7
+ * @returns A filter that can be used in a Prismic REST API V2 request.
8
+ */
9
+ export declare const someTagsFilter: (tags: string | string[]) => string;
@@ -0,0 +1,9 @@
1
+ import { filter } from "../filter.js";
2
+ import { castArray } from "./castArray.js";
3
+ const someTagsFilter = (tags) => {
4
+ return filter.any("document.tags", castArray(tags));
5
+ };
6
+ export {
7
+ someTagsFilter
8
+ };
9
+ //# sourceMappingURL=someTagsFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"someTagsFilter.js","sources":["../../../src/lib/someTagsFilter.ts"],"sourcesContent":["import { filter } from \"../filter\";\n\nimport { castArray } from \"./castArray\";\n\n/**\n * Creates a filter to filter content by document tags. At least one matching\n * tag is required on the document.\n *\n * @param tags - Document tags to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const someTagsFilter = (tags: string | string[]): string => {\n\treturn filter.any(\"document.tags\", castArray(tags));\n};\n"],"names":[],"mappings":";;AAYa,MAAA,iBAAiB,CAAC,SAAmC;AACjE,SAAO,OAAO,IAAI,iBAAiB,UAAU,IAAI,CAAC;AACnD;"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const filter = require("../filter.cjs");
4
+ const typeFilter = (documentType) => {
5
+ return filter.filter.at("document.type", documentType);
6
+ };
7
+ exports.typeFilter = typeFilter;
8
+ //# sourceMappingURL=typeFilter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeFilter.cjs","sources":["../../../src/lib/typeFilter.ts"],"sourcesContent":["import { filter } from \"../filter\";\n\n/**\n * Creates a filter to filter content by document type.\n *\n * @param documentType - The document type to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const typeFilter = (documentType: string): string => {\n\treturn filter.at(\"document.type\", documentType);\n};\n"],"names":["filter"],"mappings":";;;AASa,MAAA,aAAa,CAAC,iBAAgC;AACnD,SAAAA,cAAO,GAAG,iBAAiB,YAAY;AAC/C;;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Creates a filter to filter content by document type.
3
+ *
4
+ * @param documentType - The document type to filter queried content.
5
+ *
6
+ * @returns A filter that can be used in a Prismic REST API V2 request.
7
+ */
8
+ export declare const typeFilter: (documentType: string) => string;
@@ -0,0 +1,8 @@
1
+ import { filter } from "../filter.js";
2
+ const typeFilter = (documentType) => {
3
+ return filter.at("document.type", documentType);
4
+ };
5
+ export {
6
+ typeFilter
7
+ };
8
+ //# sourceMappingURL=typeFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeFilter.js","sources":["../../../src/lib/typeFilter.ts"],"sourcesContent":["import { filter } from \"../filter\";\n\n/**\n * Creates a filter to filter content by document type.\n *\n * @param documentType - The document type to filter queried content.\n *\n * @returns A filter that can be used in a Prismic REST API V2 request.\n */\nexport const typeFilter = (documentType: string): string => {\n\treturn filter.at(\"document.type\", documentType);\n};\n"],"names":[],"mappings":";AASa,MAAA,aAAa,CAAC,iBAAgC;AACnD,SAAA,OAAO,GAAG,iBAAiB,YAAY;AAC/C;"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const version = "7.0.0-alpha.1";
4
+ exports.version = version;
5
+ //# sourceMappingURL=package.json.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,5 @@
1
+ const version = "7.0.0-alpha.1";
2
+ export {
3
+ version
4
+ };
5
+ //# sourceMappingURL=package.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,42 +1,42 @@
1
- import { PrismicDocument } from "../value/document";
2
- /**
3
- * A query response from the Prismic REST API V2. The response contains
4
- * paginated metadata and a list of matching results for the query.
5
- *
6
- * @typeParam Document - The type(s) of Prismic document that can be returned.
7
- * @see More details on querying: {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api}
8
- */
9
- export interface Query<Document extends PrismicDocument = PrismicDocument> {
10
- /**
11
- * The page number for this page of results.
12
- */
13
- page: number;
14
- /**
15
- * Maximum number of results per page.
16
- */
17
- results_per_page: number;
18
- /**
19
- * Number of results in this page.
20
- */
21
- results_size: number;
22
- /**
23
- * Total number of results within all pages.
24
- */
25
- total_results_size: number;
26
- /**
27
- * Total number of pages.
28
- */
29
- total_pages: number;
30
- /**
31
- * The Prismic REST API V2 URL to the next page, if one exists.
32
- */
33
- next_page: string | null;
34
- /**
35
- * The Prismic REST API V2 URL to the previous page, if one exists.
36
- */
37
- prev_page: string | null;
38
- /**
39
- * A paginated list of documents matching the query.
40
- */
41
- results: Document[];
42
- }
1
+ import { PrismicDocument } from "../value/document";
2
+ /**
3
+ * A query response from the Prismic REST API V2. The response contains
4
+ * paginated metadata and a list of matching results for the query.
5
+ *
6
+ * @typeParam Document - The type(s) of Prismic document that can be returned.
7
+ * @see More details on querying: {@link https://prismic.io/docs/api}
8
+ */
9
+ export interface Query<Document extends PrismicDocument = PrismicDocument> {
10
+ /**
11
+ * The page number for this page of results.
12
+ */
13
+ page: number;
14
+ /**
15
+ * Maximum number of results per page.
16
+ */
17
+ results_per_page: number;
18
+ /**
19
+ * Number of results in this page.
20
+ */
21
+ results_size: number;
22
+ /**
23
+ * Total number of results within all pages.
24
+ */
25
+ total_results_size: number;
26
+ /**
27
+ * Total number of pages.
28
+ */
29
+ total_pages: number;
30
+ /**
31
+ * The Prismic REST API V2 URL to the next page, if one exists.
32
+ */
33
+ next_page: string | null;
34
+ /**
35
+ * The Prismic REST API V2 URL to the previous page, if one exists.
36
+ */
37
+ prev_page: string | null;
38
+ /**
39
+ * A paginated list of documents matching the query.
40
+ */
41
+ results: Document[];
42
+ }
@@ -1,32 +1,32 @@
1
- /**
2
- * Metadata for a reference to a version of a repository's content.
3
- *
4
- * @see More details on refs: {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#prismic-api-ref}
5
- */
6
- export interface Ref {
7
- /**
8
- * The unique identifier for the ref.
9
- */
10
- id: string;
11
- /**
12
- * The identifier that should be provided to the API to select a content
13
- * version.
14
- */
15
- ref: string;
16
- /**
17
- * A human-readable name for the ref. The master ref is always named "Master".
18
- */
19
- label: string;
20
- /**
21
- * Determines if the ref is the master ref. The master ref contains the latest
22
- * published content.
23
- */
24
- isMasterRef: boolean;
25
- /**
26
- * If the ref is associated with a Release, this field contains the timestamp
27
- * at which the Release will be automatically published, if set.
28
- *
29
- * @see More details on Releases: {@link https://prismic.io/docs/core-concepts/draft-plan-and-schedule-content#releases}
30
- */
31
- scheduledAt?: string;
32
- }
1
+ /**
2
+ * Metadata for a reference to a version of a repository's content.
3
+ *
4
+ * @see More details on refs: {@link https://prismic.io/docs/api#refs-and-the-entry-api}
5
+ */
6
+ export interface Ref {
7
+ /**
8
+ * The unique identifier for the ref.
9
+ */
10
+ id: string;
11
+ /**
12
+ * The identifier that should be provided to the API to select a content
13
+ * version.
14
+ */
15
+ ref: string;
16
+ /**
17
+ * A human-readable name for the ref. The master ref is always named "Master".
18
+ */
19
+ label: string;
20
+ /**
21
+ * Determines if the ref is the master ref. The master ref contains the latest
22
+ * published content.
23
+ */
24
+ isMasterRef: boolean;
25
+ /**
26
+ * If the ref is associated with a Release, this field contains the timestamp
27
+ * at which the Release will be automatically published, if set.
28
+ *
29
+ * @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
30
+ */
31
+ scheduledAt?: string;
32
+ }
@@ -1,10 +1,10 @@
1
- import { Ref } from "./ref";
2
- /**
3
- * Metadata for a Release.
4
- *
5
- * @remarks
6
- * This is an alias for `Ref`.
7
- * @see {@link Ref}
8
- * @see More details on Releases: {@link https://prismic.io/docs/core-concepts/draft-plan-and-schedule-content#releases}
9
- */
10
- export declare type Release = Ref;
1
+ import { Ref } from "./ref";
2
+ /**
3
+ * Metadata for a Release.
4
+ *
5
+ * @remarks
6
+ * This is an alias for `Ref`.
7
+ * @see {@link Ref}
8
+ * @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
9
+ */
10
+ export type Release = Ref;
@@ -1,100 +1,100 @@
1
- import { Ref } from "./ref";
2
- /**
3
- * Repository metadata returned from the Prismic REST API V2. This data can be
4
- * fetched by sending a `GET` a request to a repository's `/api/v2` endpoint.
5
- *
6
- * @see More details on the `/api/v2` endpoint: {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#the-api-endpoint-2}
7
- */
8
- export interface Repository {
9
- /**
10
- * A list of refs for the repository.
11
- *
12
- * @see {@link Ref}
13
- */
14
- refs: Ref[];
15
- /**
16
- * An identifier used to query content with the latest Integration Fields
17
- * data.
18
- */
19
- integrationFieldsRef: string | null;
20
- /**
21
- * A list of languages for the repository.
22
- *
23
- * @see {@link Language}
24
- */
25
- languages: Language[];
26
- /**
27
- * A list of the repository's Custom Type API IDs mapped to their
28
- * human-readable name.
29
- */
30
- types: Record<string, string>;
31
- /**
32
- * A list of tags for the repository.
33
- */
34
- tags: string[];
35
- /**
36
- * An internally-used list of REST API features for the repository.
37
- *
38
- * @internal
39
- */
40
- forms: Record<string, Form>;
41
- /**
42
- * The URL used to begin the OAuth process for the repository.
43
- */
44
- oauth_initiate: string;
45
- oauth_token: string;
46
- /**
47
- * The version of the API.
48
- */
49
- version: string;
50
- /**
51
- * Licensing information for the repository content.
52
- */
53
- license: string;
54
- /**
55
- * @deprecated Experiments are no longer part of Prismic.
56
- */
57
- experiments: unknown;
58
- /**
59
- * @deprecated Bookmarks are not longer part of Prismic.
60
- */
61
- bookmarks: Record<string, string>;
62
- }
63
- /**
64
- * Metadata for a language that has been configured for a repository.
65
- */
66
- export interface Language {
67
- /**
68
- * A unique identifier for the language.
69
- */
70
- id: string;
71
- /**
72
- * The name of the language.
73
- */
74
- name: string;
75
- }
76
- /**
77
- * A Prismic REST API V2 feature supported by the repository. It contains
78
- * metadata about the feature and how to interact with it via the API.
79
- *
80
- * @internal
81
- */
82
- export interface Form {
83
- method: "GET";
84
- enctype: string;
85
- action: string;
86
- name?: string;
87
- rel?: string;
88
- fields: Record<string, FormField>;
89
- }
90
- /**
91
- * A field for a feature of the Prismic REST API V2. It contains metadata about
92
- * the feature's field and how to interact with it via the API.
93
- *
94
- * @internal
95
- */
96
- export interface FormField {
97
- type: "String" | "Integer";
98
- multiple: boolean;
99
- default?: string;
100
- }
1
+ import { Ref } from "./ref";
2
+ /**
3
+ * Repository metadata returned from the Prismic REST API V2. This data can be
4
+ * fetched by sending a `GET` a request to a repository's `/api/v2` endpoint.
5
+ *
6
+ * @see More details on the `/api/v2` endpoint: {@link https://prismic.io/docs/api#refs-and-the-entry-api}
7
+ */
8
+ export interface Repository {
9
+ /**
10
+ * A list of refs for the repository.
11
+ *
12
+ * @see {@link Ref}
13
+ */
14
+ refs: Ref[];
15
+ /**
16
+ * An identifier used to query content with the latest Integration Fields
17
+ * data.
18
+ */
19
+ integrationFieldsRef: string | null;
20
+ /**
21
+ * A list of languages for the repository.
22
+ *
23
+ * @see {@link Language}
24
+ */
25
+ languages: Language[];
26
+ /**
27
+ * A list of the repository's Custom Type API IDs mapped to their
28
+ * human-readable name.
29
+ */
30
+ types: Record<string, string>;
31
+ /**
32
+ * A list of tags for the repository.
33
+ */
34
+ tags: string[];
35
+ /**
36
+ * An internally-used list of REST API features for the repository.
37
+ *
38
+ * @internal
39
+ */
40
+ forms: Record<string, Form>;
41
+ /**
42
+ * The URL used to begin the OAuth process for the repository.
43
+ */
44
+ oauth_initiate: string;
45
+ oauth_token: string;
46
+ /**
47
+ * The version of the API.
48
+ */
49
+ version: string;
50
+ /**
51
+ * Licensing information for the repository content.
52
+ */
53
+ license: string;
54
+ /**
55
+ * @deprecated Experiments are no longer part of Prismic.
56
+ */
57
+ experiments: unknown;
58
+ /**
59
+ * @deprecated Bookmarks are not longer part of Prismic.
60
+ */
61
+ bookmarks: Record<string, string>;
62
+ }
63
+ /**
64
+ * Metadata for a language that has been configured for a repository.
65
+ */
66
+ export interface Language {
67
+ /**
68
+ * A unique identifier for the language.
69
+ */
70
+ id: string;
71
+ /**
72
+ * The name of the language.
73
+ */
74
+ name: string;
75
+ }
76
+ /**
77
+ * A Prismic REST API V2 feature supported by the repository. It contains
78
+ * metadata about the feature and how to interact with it via the API.
79
+ *
80
+ * @internal
81
+ */
82
+ export interface Form {
83
+ method: "GET";
84
+ enctype: string;
85
+ action: string;
86
+ name?: string;
87
+ rel?: string;
88
+ fields: Record<string, FormField>;
89
+ }
90
+ /**
91
+ * A field for a feature of the Prismic REST API V2. It contains metadata about
92
+ * the feature's field and how to interact with it via the API.
93
+ *
94
+ * @internal
95
+ */
96
+ export interface FormField {
97
+ type: "String" | "Integer";
98
+ multiple: boolean;
99
+ default?: string;
100
+ }
@@ -1,8 +1,8 @@
1
- /**
2
- * List of tags returned from the Prismic Tags API. This data can be fetched by
3
- * sending a `GET` request to a repository's `/api/tags` endpoint.
4
- *
5
- * @typeParam Tag - Tags that are returned by the Tags API.
6
- * @see More details on the Tags API: {@link https://prismic.io/docs/technologies/tags-api-technical-reference}
7
- */
8
- export declare type Tags<Tag extends string = string> = Tag[];
1
+ /**
2
+ * List of tags returned from the Prismic Tags API. This data can be fetched by
3
+ * sending a `GET` request to a repository's `/api/tags` endpoint.
4
+ *
5
+ * @typeParam Tag - Tags that are returned by the Tags API.
6
+ * @see More details on the Tags API: {@link https://prismic.io/docs/tags-api-technical-reference}
7
+ */
8
+ export type Tags<Tag extends string = string> = Tag[];
@@ -1,15 +1,15 @@
1
- import type { CustomTypeModelFieldType } from "./types";
2
- /**
3
- * A Boolean Custom Type field.
4
- *
5
- * More details: {@link https://prismic.io/docs/core-concepts/boolean}
6
- */
7
- export interface CustomTypeModelBooleanField {
8
- type: typeof CustomTypeModelFieldType.Boolean;
9
- config?: {
10
- label?: string | null;
11
- default_value?: boolean;
12
- placeholder_true?: string;
13
- placeholder_false?: string;
14
- };
15
- }
1
+ import type { CustomTypeModelFieldType } from "./types";
2
+ /**
3
+ * A Boolean Custom Type field.
4
+ *
5
+ * More details: {@link https://prismic.io/docs/boolean}
6
+ */
7
+ export interface CustomTypeModelBooleanField {
8
+ type: typeof CustomTypeModelFieldType.Boolean;
9
+ config?: {
10
+ label?: string | null;
11
+ default_value?: boolean;
12
+ placeholder_true?: string;
13
+ placeholder_false?: string;
14
+ };
15
+ }
@@ -1,13 +1,13 @@
1
- import type { CustomTypeModelFieldType } from "./types";
2
- /**
3
- * A Color Custom Type field.
4
- *
5
- * More details: {@link https://prismic.io/docs/core-concepts/color}
6
- */
7
- export interface CustomTypeModelColorField {
8
- type: typeof CustomTypeModelFieldType.Color;
9
- config?: {
10
- label?: string | null;
11
- placeholder?: string;
12
- };
13
- }
1
+ import type { CustomTypeModelFieldType } from "./types";
2
+ /**
3
+ * A Color Custom Type field.
4
+ *
5
+ * More details: {@link https://prismic.io/docs/color}
6
+ */
7
+ export interface CustomTypeModelColorField {
8
+ type: typeof CustomTypeModelFieldType.Color;
9
+ config?: {
10
+ label?: string | null;
11
+ placeholder?: string;
12
+ };
13
+ }