@prismicio/client 7.21.0-alpha.1 → 7.21.0-pr.414.2f27ec1

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 (810) hide show
  1. package/dist/Client.cjs +1212 -1268
  2. package/dist/Client.cjs.map +1 -1
  3. package/dist/Client.d.cts +976 -0
  4. package/dist/Client.d.cts.map +1 -0
  5. package/dist/Client.d.ts +921 -926
  6. package/dist/Client.d.ts.map +1 -0
  7. package/dist/Client.js +1188 -1244
  8. package/dist/Client.js.map +1 -1
  9. package/dist/Migration.cjs +281 -312
  10. package/dist/Migration.cjs.map +1 -1
  11. package/dist/Migration.d.cts +216 -0
  12. package/dist/Migration.d.cts.map +1 -0
  13. package/dist/Migration.d.ts +197 -194
  14. package/dist/Migration.d.ts.map +1 -0
  15. package/dist/Migration.js +280 -311
  16. package/dist/Migration.js.map +1 -1
  17. package/dist/WriteClient.cjs +486 -558
  18. package/dist/WriteClient.cjs.map +1 -1
  19. package/dist/WriteClient.d.cts +262 -0
  20. package/dist/WriteClient.d.cts.map +1 -0
  21. package/dist/WriteClient.d.ts +226 -245
  22. package/dist/WriteClient.d.ts.map +1 -0
  23. package/dist/WriteClient.js +480 -552
  24. package/dist/WriteClient.js.map +1 -1
  25. package/dist/_virtual/rolldown_runtime.cjs +14 -0
  26. package/dist/_virtual/rolldown_runtime.js +13 -0
  27. package/dist/buildQueryURL.cjs +89 -59
  28. package/dist/buildQueryURL.cjs.map +1 -1
  29. package/dist/buildQueryURL.d.cts +220 -0
  30. package/dist/buildQueryURL.d.cts.map +1 -0
  31. package/dist/buildQueryURL.d.ts +169 -158
  32. package/dist/buildQueryURL.d.ts.map +1 -0
  33. package/dist/buildQueryURL.js +88 -58
  34. package/dist/buildQueryURL.js.map +1 -1
  35. package/dist/cookie.cjs +17 -3
  36. package/dist/cookie.cjs.map +1 -1
  37. package/dist/cookie.d.cts +11 -0
  38. package/dist/cookie.d.cts.map +1 -0
  39. package/dist/cookie.d.ts +7 -1
  40. package/dist/cookie.d.ts.map +1 -0
  41. package/dist/cookie.js +12 -4
  42. package/dist/cookie.js.map +1 -1
  43. package/dist/createClient.cjs +32 -5
  44. package/dist/createClient.cjs.map +1 -1
  45. package/dist/createClient.d.cts +41 -0
  46. package/dist/createClient.d.cts.map +1 -0
  47. package/dist/createClient.d.ts +22 -13
  48. package/dist/createClient.d.ts.map +1 -0
  49. package/dist/createClient.js +31 -4
  50. package/dist/createClient.js.map +1 -1
  51. package/dist/createMigration.cjs +21 -5
  52. package/dist/createMigration.cjs.map +1 -1
  53. package/dist/createMigration.d.cts +30 -0
  54. package/dist/createMigration.d.cts.map +1 -0
  55. package/dist/createMigration.d.ts +11 -5
  56. package/dist/createMigration.d.ts.map +1 -0
  57. package/dist/createMigration.js +20 -4
  58. package/dist/createMigration.js.map +1 -1
  59. package/dist/createWriteClient.cjs +29 -5
  60. package/dist/createWriteClient.cjs.map +1 -1
  61. package/dist/createWriteClient.d.cts +38 -0
  62. package/dist/createWriteClient.d.cts.map +1 -0
  63. package/dist/createWriteClient.d.ts +11 -5
  64. package/dist/createWriteClient.d.ts.map +1 -0
  65. package/dist/createWriteClient.js +28 -4
  66. package/dist/createWriteClient.js.map +1 -1
  67. package/dist/errors/ForbiddenError.cjs +7 -6
  68. package/dist/errors/ForbiddenError.cjs.map +1 -1
  69. package/dist/errors/ForbiddenError.d.cts +14 -0
  70. package/dist/errors/ForbiddenError.d.cts.map +1 -0
  71. package/dist/errors/ForbiddenError.d.ts +10 -7
  72. package/dist/errors/ForbiddenError.d.ts.map +1 -0
  73. package/dist/errors/ForbiddenError.js +7 -6
  74. package/dist/errors/ForbiddenError.js.map +1 -1
  75. package/dist/errors/InvalidDataError.cjs +7 -6
  76. package/dist/errors/InvalidDataError.cjs.map +1 -1
  77. package/dist/errors/InvalidDataError.d.cts +7 -0
  78. package/dist/errors/InvalidDataError.d.cts.map +1 -0
  79. package/dist/errors/InvalidDataError.d.ts +7 -3
  80. package/dist/errors/InvalidDataError.d.ts.map +1 -0
  81. package/dist/errors/InvalidDataError.js +7 -6
  82. package/dist/errors/InvalidDataError.js.map +1 -1
  83. package/dist/errors/NotFoundError.cjs +7 -6
  84. package/dist/errors/NotFoundError.cjs.map +1 -1
  85. package/dist/errors/NotFoundError.d.cts +7 -0
  86. package/dist/errors/NotFoundError.d.cts.map +1 -0
  87. package/dist/errors/NotFoundError.d.ts +7 -3
  88. package/dist/errors/NotFoundError.d.ts.map +1 -0
  89. package/dist/errors/NotFoundError.js +7 -6
  90. package/dist/errors/NotFoundError.js.map +1 -1
  91. package/dist/errors/ParsingError.cjs +7 -6
  92. package/dist/errors/ParsingError.cjs.map +1 -1
  93. package/dist/errors/ParsingError.d.cts +17 -0
  94. package/dist/errors/ParsingError.d.cts.map +1 -0
  95. package/dist/errors/ParsingError.d.ts +15 -12
  96. package/dist/errors/ParsingError.d.ts.map +1 -0
  97. package/dist/errors/ParsingError.js +7 -6
  98. package/dist/errors/ParsingError.js.map +1 -1
  99. package/dist/errors/PreviewTokenExpired.cjs +7 -6
  100. package/dist/errors/PreviewTokenExpired.cjs.map +1 -1
  101. package/dist/errors/PreviewTokenExpired.d.cts +11 -0
  102. package/dist/errors/PreviewTokenExpired.d.cts.map +1 -0
  103. package/dist/errors/PreviewTokenExpired.d.ts +9 -6
  104. package/dist/errors/PreviewTokenExpired.d.ts.map +1 -0
  105. package/dist/errors/PreviewTokenExpired.js +7 -6
  106. package/dist/errors/PreviewTokenExpired.js.map +1 -1
  107. package/dist/errors/PrismicError.cjs +14 -15
  108. package/dist/errors/PrismicError.cjs.map +1 -1
  109. package/dist/errors/PrismicError.d.cts +9 -0
  110. package/dist/errors/PrismicError.d.cts.map +1 -0
  111. package/dist/errors/PrismicError.d.ts +8 -4
  112. package/dist/errors/PrismicError.d.ts.map +1 -0
  113. package/dist/errors/PrismicError.js +13 -15
  114. package/dist/errors/PrismicError.js.map +1 -1
  115. package/dist/errors/RefExpiredError.cjs +7 -6
  116. package/dist/errors/RefExpiredError.cjs.map +1 -1
  117. package/dist/errors/RefExpiredError.d.cts +11 -0
  118. package/dist/errors/RefExpiredError.d.cts.map +1 -0
  119. package/dist/errors/RefExpiredError.d.ts +9 -6
  120. package/dist/errors/RefExpiredError.d.ts.map +1 -0
  121. package/dist/errors/RefExpiredError.js +7 -6
  122. package/dist/errors/RefExpiredError.js.map +1 -1
  123. package/dist/errors/RefNotFoundError.cjs +7 -6
  124. package/dist/errors/RefNotFoundError.cjs.map +1 -1
  125. package/dist/errors/RefNotFoundError.d.cts +11 -0
  126. package/dist/errors/RefNotFoundError.d.cts.map +1 -0
  127. package/dist/errors/RefNotFoundError.d.ts +9 -6
  128. package/dist/errors/RefNotFoundError.d.ts.map +1 -0
  129. package/dist/errors/RefNotFoundError.js +7 -6
  130. package/dist/errors/RefNotFoundError.js.map +1 -1
  131. package/dist/errors/RepositoryNotFoundError.cjs +7 -6
  132. package/dist/errors/RepositoryNotFoundError.cjs.map +1 -1
  133. package/dist/errors/RepositoryNotFoundError.d.cts +7 -0
  134. package/dist/errors/RepositoryNotFoundError.d.cts.map +1 -0
  135. package/dist/errors/RepositoryNotFoundError.d.ts +7 -3
  136. package/dist/errors/RepositoryNotFoundError.d.ts.map +1 -0
  137. package/dist/errors/RepositoryNotFoundError.js +7 -6
  138. package/dist/errors/RepositoryNotFoundError.js.map +1 -1
  139. package/dist/filter.cjs +93 -236
  140. package/dist/filter.cjs.map +1 -1
  141. package/dist/filter.d.cts +213 -0
  142. package/dist/filter.d.cts.map +1 -0
  143. package/dist/filter.d.ts +212 -208
  144. package/dist/filter.d.ts.map +1 -0
  145. package/dist/filter.js +93 -237
  146. package/dist/filter.js.map +1 -1
  147. package/dist/getGraphQLEndpoint.cjs +18 -10
  148. package/dist/getGraphQLEndpoint.cjs.map +1 -1
  149. package/dist/getGraphQLEndpoint.d.cts +14 -0
  150. package/dist/getGraphQLEndpoint.d.cts.map +1 -0
  151. package/dist/getGraphQLEndpoint.d.ts +5 -1
  152. package/dist/getGraphQLEndpoint.d.ts.map +1 -0
  153. package/dist/getGraphQLEndpoint.js +17 -9
  154. package/dist/getGraphQLEndpoint.js.map +1 -1
  155. package/dist/getRepositoryEndpoint.cjs +27 -10
  156. package/dist/getRepositoryEndpoint.cjs.map +1 -1
  157. package/dist/getRepositoryEndpoint.d.cts +23 -0
  158. package/dist/getRepositoryEndpoint.d.cts.map +1 -0
  159. package/dist/getRepositoryEndpoint.d.ts +14 -3
  160. package/dist/getRepositoryEndpoint.d.ts.map +1 -0
  161. package/dist/getRepositoryEndpoint.js +26 -9
  162. package/dist/getRepositoryEndpoint.js.map +1 -1
  163. package/dist/getRepositoryName.cjs +22 -14
  164. package/dist/getRepositoryName.cjs.map +1 -1
  165. package/dist/getRepositoryName.d.cts +16 -0
  166. package/dist/getRepositoryName.d.cts.map +1 -0
  167. package/dist/getRepositoryName.d.ts +5 -1
  168. package/dist/getRepositoryName.d.ts.map +1 -0
  169. package/dist/getRepositoryName.js +22 -14
  170. package/dist/getRepositoryName.js.map +1 -1
  171. package/dist/getToolbarSrc.cjs +42 -10
  172. package/dist/getToolbarSrc.cjs.map +1 -1
  173. package/dist/getToolbarSrc.d.cts +38 -0
  174. package/dist/getToolbarSrc.d.cts.map +1 -0
  175. package/dist/getToolbarSrc.d.ts +5 -1
  176. package/dist/getToolbarSrc.d.ts.map +1 -0
  177. package/dist/getToolbarSrc.js +41 -9
  178. package/dist/getToolbarSrc.js.map +1 -1
  179. package/dist/helpers/asDate.cjs +36 -11
  180. package/dist/helpers/asDate.cjs.map +1 -1
  181. package/dist/helpers/asDate.d.cts +29 -0
  182. package/dist/helpers/asDate.d.cts.map +1 -0
  183. package/dist/helpers/asDate.d.ts +20 -8
  184. package/dist/helpers/asDate.d.ts.map +1 -0
  185. package/dist/helpers/asDate.js +36 -12
  186. package/dist/helpers/asDate.js.map +1 -1
  187. package/dist/helpers/asHTML.cjs +76 -79
  188. package/dist/helpers/asHTML.cjs.map +1 -1
  189. package/dist/helpers/asHTML.d.cts +147 -0
  190. package/dist/helpers/asHTML.d.cts.map +1 -0
  191. package/dist/helpers/asHTML.d.ts +84 -78
  192. package/dist/helpers/asHTML.d.ts.map +1 -0
  193. package/dist/helpers/asHTML.js +74 -77
  194. package/dist/helpers/asHTML.js.map +1 -1
  195. package/dist/helpers/asImagePixelDensitySrcSet.cjs +57 -18
  196. package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
  197. package/dist/helpers/asImagePixelDensitySrcSet.d.cts +59 -0
  198. package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -0
  199. package/dist/helpers/asImagePixelDensitySrcSet.d.ts +31 -25
  200. package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -0
  201. package/dist/helpers/asImagePixelDensitySrcSet.js +57 -18
  202. package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
  203. package/dist/helpers/asImageSrc.cjs +30 -10
  204. package/dist/helpers/asImageSrc.cjs.map +1 -1
  205. package/dist/helpers/asImageSrc.d.cts +34 -0
  206. package/dist/helpers/asImageSrc.d.cts.map +1 -0
  207. package/dist/helpers/asImageSrc.d.ts +20 -14
  208. package/dist/helpers/asImageSrc.d.ts.map +1 -0
  209. package/dist/helpers/asImageSrc.js +30 -10
  210. package/dist/helpers/asImageSrc.js.map +1 -1
  211. package/dist/helpers/asImageWidthSrcSet.cjs +76 -42
  212. package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
  213. package/dist/helpers/asImageWidthSrcSet.d.cts +67 -0
  214. package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -0
  215. package/dist/helpers/asImageWidthSrcSet.d.ts +34 -28
  216. package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -0
  217. package/dist/helpers/asImageWidthSrcSet.js +76 -42
  218. package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
  219. package/dist/helpers/asLink.cjs +26 -44
  220. package/dist/helpers/asLink.cjs.map +1 -1
  221. package/dist/helpers/asLink.d.cts +83 -0
  222. package/dist/helpers/asLink.d.cts.map +1 -0
  223. package/dist/helpers/asLink.d.ts +64 -58
  224. package/dist/helpers/asLink.d.ts.map +1 -0
  225. package/dist/helpers/asLink.js +25 -43
  226. package/dist/helpers/asLink.js.map +1 -1
  227. package/dist/helpers/asLinkAttrs.cjs +44 -25
  228. package/dist/helpers/asLinkAttrs.cjs.map +1 -1
  229. package/dist/helpers/asLinkAttrs.d.cts +51 -0
  230. package/dist/helpers/asLinkAttrs.d.cts.map +1 -0
  231. package/dist/helpers/asLinkAttrs.d.ts +29 -28
  232. package/dist/helpers/asLinkAttrs.d.ts.map +1 -0
  233. package/dist/helpers/asLinkAttrs.js +43 -24
  234. package/dist/helpers/asLinkAttrs.js.map +1 -1
  235. package/dist/helpers/asText.cjs +15 -20
  236. package/dist/helpers/asText.cjs.map +1 -1
  237. package/dist/helpers/asText.d.cts +62 -0
  238. package/dist/helpers/asText.d.cts.map +1 -0
  239. package/dist/helpers/asText.d.ts +48 -33
  240. package/dist/helpers/asText.d.ts.map +1 -0
  241. package/dist/helpers/asText.js +15 -20
  242. package/dist/helpers/asText.js.map +1 -1
  243. package/dist/helpers/documentToLinkField.cjs +30 -24
  244. package/dist/helpers/documentToLinkField.cjs.map +1 -1
  245. package/dist/helpers/documentToLinkField.d.cts +21 -0
  246. package/dist/helpers/documentToLinkField.d.cts.map +1 -0
  247. package/dist/helpers/documentToLinkField.d.ts +8 -4
  248. package/dist/helpers/documentToLinkField.d.ts.map +1 -0
  249. package/dist/helpers/documentToLinkField.js +30 -24
  250. package/dist/helpers/documentToLinkField.js.map +1 -1
  251. package/dist/helpers/isFilled.cjs +215 -42
  252. package/dist/helpers/isFilled.cjs.map +1 -1
  253. package/dist/helpers/isFilled.d.cts +199 -0
  254. package/dist/helpers/isFilled.d.cts.map +1 -0
  255. package/dist/helpers/isFilled.d.ts +65 -56
  256. package/dist/helpers/isFilled.d.ts.map +1 -0
  257. package/dist/helpers/isFilled.js +210 -44
  258. package/dist/helpers/isFilled.js.map +1 -1
  259. package/dist/helpers/mapSliceZone.cjs +50 -39
  260. package/dist/helpers/mapSliceZone.cjs.map +1 -1
  261. package/dist/helpers/mapSliceZone.d.cts +139 -0
  262. package/dist/helpers/mapSliceZone.d.cts.map +1 -0
  263. package/dist/helpers/mapSliceZone.d.ts +47 -44
  264. package/dist/helpers/mapSliceZone.d.ts.map +1 -0
  265. package/dist/helpers/mapSliceZone.js +50 -40
  266. package/dist/helpers/mapSliceZone.js.map +1 -1
  267. package/dist/index.cjs +117 -94
  268. package/dist/index.cjs.map +1 -1
  269. package/dist/index.d.cts +181 -0
  270. package/dist/index.d.cts.map +1 -0
  271. package/dist/index.d.ts +151 -173
  272. package/dist/index.d.ts.map +1 -0
  273. package/dist/index.js +39 -73
  274. package/dist/index.js.map +1 -1
  275. package/dist/isRepositoryEndpoint.cjs +20 -9
  276. package/dist/isRepositoryEndpoint.cjs.map +1 -1
  277. package/dist/isRepositoryEndpoint.d.cts +14 -0
  278. package/dist/isRepositoryEndpoint.d.cts.map +1 -0
  279. package/dist/isRepositoryEndpoint.d.ts +7 -3
  280. package/dist/isRepositoryEndpoint.d.ts.map +1 -0
  281. package/dist/isRepositoryEndpoint.js +20 -10
  282. package/dist/isRepositoryEndpoint.js.map +1 -1
  283. package/dist/isRepositoryName.cjs +14 -4
  284. package/dist/isRepositoryName.cjs.map +1 -1
  285. package/dist/isRepositoryName.d.cts +13 -0
  286. package/dist/isRepositoryName.d.cts.map +1 -0
  287. package/dist/isRepositoryName.d.ts +5 -1
  288. package/dist/isRepositoryName.d.ts.map +1 -0
  289. package/dist/isRepositoryName.js +14 -5
  290. package/dist/isRepositoryName.js.map +1 -1
  291. package/dist/lib/appendFilters.cjs +21 -8
  292. package/dist/lib/appendFilters.cjs.map +1 -1
  293. package/dist/lib/appendFilters.js +21 -8
  294. package/dist/lib/appendFilters.js.map +1 -1
  295. package/dist/lib/castArray.cjs +17 -4
  296. package/dist/lib/castArray.cjs.map +1 -1
  297. package/dist/lib/castArray.js +17 -5
  298. package/dist/lib/castArray.js.map +1 -1
  299. package/dist/lib/castThunk.cjs +16 -4
  300. package/dist/lib/castThunk.cjs.map +1 -1
  301. package/dist/lib/castThunk.js +16 -5
  302. package/dist/lib/castThunk.js.map +1 -1
  303. package/dist/lib/devMsg.cjs +22 -5
  304. package/dist/lib/devMsg.cjs.map +1 -1
  305. package/dist/lib/devMsg.js +23 -6
  306. package/dist/lib/devMsg.js.map +1 -1
  307. package/dist/lib/escapeHTML.cjs +36 -39
  308. package/dist/lib/escapeHTML.cjs.map +1 -1
  309. package/dist/lib/escapeHTML.js +36 -40
  310. package/dist/lib/escapeHTML.js.map +1 -1
  311. package/dist/lib/everyTagFilter.cjs +16 -6
  312. package/dist/lib/everyTagFilter.cjs.map +1 -1
  313. package/dist/lib/everyTagFilter.js +15 -5
  314. package/dist/lib/everyTagFilter.js.map +1 -1
  315. package/dist/lib/findMasterRef.cjs +16 -5
  316. package/dist/lib/findMasterRef.cjs.map +1 -1
  317. package/dist/lib/findMasterRef.js +16 -5
  318. package/dist/lib/findMasterRef.js.map +1 -1
  319. package/dist/lib/findRef.cjs +21 -9
  320. package/dist/lib/findRef.cjs.map +1 -1
  321. package/dist/lib/findRef.js +21 -9
  322. package/dist/lib/findRef.js.map +1 -1
  323. package/dist/lib/findRefByID.cjs +17 -5
  324. package/dist/lib/findRefByID.cjs.map +1 -1
  325. package/dist/lib/findRefByID.js +17 -5
  326. package/dist/lib/findRefByID.js.map +1 -1
  327. package/dist/lib/findRefByLabel.cjs +17 -5
  328. package/dist/lib/findRefByLabel.cjs.map +1 -1
  329. package/dist/lib/findRefByLabel.js +17 -5
  330. package/dist/lib/findRefByLabel.js.map +1 -1
  331. package/dist/lib/getOptionalLinkProperties.cjs +19 -11
  332. package/dist/lib/getOptionalLinkProperties.cjs.map +1 -1
  333. package/dist/lib/getOptionalLinkProperties.js +19 -12
  334. package/dist/lib/getOptionalLinkProperties.js.map +1 -1
  335. package/dist/lib/getPreviewCookie.cjs +25 -16
  336. package/dist/lib/getPreviewCookie.cjs.map +1 -1
  337. package/dist/lib/getPreviewCookie.js +25 -16
  338. package/dist/lib/getPreviewCookie.js.map +1 -1
  339. package/dist/lib/isInternalURL.cjs +15 -6
  340. package/dist/lib/isInternalURL.cjs.map +1 -1
  341. package/dist/lib/isInternalURL.js +15 -7
  342. package/dist/lib/isInternalURL.js.map +1 -1
  343. package/dist/lib/isMigrationValue.cjs +65 -12
  344. package/dist/lib/isMigrationValue.cjs.map +1 -1
  345. package/dist/lib/isMigrationValue.js +63 -13
  346. package/dist/lib/isMigrationValue.js.map +1 -1
  347. package/dist/lib/isValue.cjs +93 -36
  348. package/dist/lib/isValue.cjs.map +1 -1
  349. package/dist/lib/isValue.js +93 -40
  350. package/dist/lib/isValue.js.map +1 -1
  351. package/dist/lib/minifyGraphQLQuery.cjs +13 -4
  352. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
  353. package/dist/lib/minifyGraphQLQuery.js +13 -5
  354. package/dist/lib/minifyGraphQLQuery.js.map +1 -1
  355. package/dist/lib/pLimit.cjs +51 -45
  356. package/dist/lib/pLimit.cjs.map +1 -1
  357. package/dist/lib/pLimit.js +51 -46
  358. package/dist/lib/pLimit.js.map +1 -1
  359. package/dist/lib/request.cjs +54 -37
  360. package/dist/lib/request.cjs.map +1 -1
  361. package/dist/lib/request.d.cts +61 -0
  362. package/dist/lib/request.d.cts.map +1 -0
  363. package/dist/lib/request.d.ts +38 -50
  364. package/dist/lib/request.d.ts.map +1 -0
  365. package/dist/lib/request.js +54 -37
  366. package/dist/lib/request.js.map +1 -1
  367. package/dist/lib/resolveMigrationDocumentData.cjs +147 -125
  368. package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -1
  369. package/dist/lib/resolveMigrationDocumentData.js +143 -122
  370. package/dist/lib/resolveMigrationDocumentData.js.map +1 -1
  371. package/dist/lib/serializerHelpers.cjs +73 -91
  372. package/dist/lib/serializerHelpers.cjs.map +1 -1
  373. package/dist/lib/serializerHelpers.js +71 -94
  374. package/dist/lib/serializerHelpers.js.map +1 -1
  375. package/dist/lib/someTagsFilter.cjs +16 -6
  376. package/dist/lib/someTagsFilter.cjs.map +1 -1
  377. package/dist/lib/someTagsFilter.js +15 -5
  378. package/dist/lib/someTagsFilter.js.map +1 -1
  379. package/dist/lib/throttledLog.cjs +22 -11
  380. package/dist/lib/throttledLog.cjs.map +1 -1
  381. package/dist/lib/throttledLog.js +22 -12
  382. package/dist/lib/throttledLog.js.map +1 -1
  383. package/dist/lib/typeFilter.cjs +14 -5
  384. package/dist/lib/typeFilter.cjs.map +1 -1
  385. package/dist/lib/typeFilter.js +14 -5
  386. package/dist/lib/typeFilter.js.map +1 -1
  387. package/dist/lib/validateAssetMetadata.cjs +40 -20
  388. package/dist/lib/validateAssetMetadata.cjs.map +1 -1
  389. package/dist/lib/validateAssetMetadata.js +40 -20
  390. package/dist/lib/validateAssetMetadata.js.map +1 -1
  391. package/dist/package.cjs +19 -0
  392. package/dist/package.cjs.map +1 -0
  393. package/dist/package.js +7 -0
  394. package/dist/package.js.map +1 -0
  395. package/dist/richtext/asText.cjs +18 -10
  396. package/dist/richtext/asText.cjs.map +1 -1
  397. package/dist/richtext/asText.d.cts +18 -0
  398. package/dist/richtext/asText.d.cts.map +1 -0
  399. package/dist/richtext/asText.d.ts +13 -7
  400. package/dist/richtext/asText.d.ts.map +1 -0
  401. package/dist/richtext/asText.js +18 -11
  402. package/dist/richtext/asText.js.map +1 -1
  403. package/dist/richtext/asTree.cjs +106 -107
  404. package/dist/richtext/asTree.cjs.map +1 -1
  405. package/dist/richtext/asTree.d.cts +20 -0
  406. package/dist/richtext/asTree.d.cts.map +1 -0
  407. package/dist/richtext/asTree.d.ts +9 -3
  408. package/dist/richtext/asTree.d.ts.map +1 -0
  409. package/dist/richtext/asTree.js +106 -107
  410. package/dist/richtext/asTree.js.map +1 -1
  411. package/dist/richtext/composeSerializers.cjs +28 -14
  412. package/dist/richtext/composeSerializers.cjs.map +1 -1
  413. package/dist/richtext/composeSerializers.d.cts +22 -0
  414. package/dist/richtext/composeSerializers.d.cts.map +1 -0
  415. package/dist/richtext/composeSerializers.d.ts +8 -2
  416. package/dist/richtext/composeSerializers.d.ts.map +1 -0
  417. package/dist/richtext/composeSerializers.js +28 -15
  418. package/dist/richtext/composeSerializers.js.map +1 -1
  419. package/dist/richtext/serialize.cjs +30 -14
  420. package/dist/richtext/serialize.cjs.map +1 -1
  421. package/dist/richtext/serialize.d.cts +25 -0
  422. package/dist/richtext/serialize.d.cts.map +1 -0
  423. package/dist/richtext/serialize.d.ts +17 -11
  424. package/dist/richtext/serialize.d.ts.map +1 -0
  425. package/dist/richtext/serialize.js +30 -14
  426. package/dist/richtext/serialize.js.map +1 -1
  427. package/dist/richtext/types.cjs +10 -8
  428. package/dist/richtext/types.cjs.map +1 -1
  429. package/dist/richtext/types.d.cts +71 -0
  430. package/dist/richtext/types.d.cts.map +1 -0
  431. package/dist/richtext/types.d.ts +49 -49
  432. package/dist/richtext/types.d.ts.map +1 -0
  433. package/dist/richtext/types.js +10 -8
  434. package/dist/richtext/types.js.map +1 -1
  435. package/dist/richtext/wrapMapSerializer.cjs +29 -21
  436. package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
  437. package/dist/richtext/wrapMapSerializer.d.cts +21 -0
  438. package/dist/richtext/wrapMapSerializer.d.cts.map +1 -0
  439. package/dist/richtext/wrapMapSerializer.d.ts +8 -2
  440. package/dist/richtext/wrapMapSerializer.d.ts.map +1 -0
  441. package/dist/richtext/wrapMapSerializer.js +29 -21
  442. package/dist/richtext/wrapMapSerializer.js.map +1 -1
  443. package/dist/richtext.cjs +13 -15
  444. package/dist/richtext.d.cts +8 -0
  445. package/dist/richtext.d.ts +8 -0
  446. package/dist/richtext.js +4 -11
  447. package/dist/types/api/asset/asset.d.cts +97 -0
  448. package/dist/types/api/asset/asset.d.cts.map +1 -0
  449. package/dist/types/api/asset/asset.d.ts +87 -167
  450. package/dist/types/api/asset/asset.d.ts.map +1 -0
  451. package/dist/types/api/asset/tag.d.cts +35 -0
  452. package/dist/types/api/asset/tag.d.cts.map +1 -0
  453. package/dist/types/api/asset/tag.d.ts +29 -47
  454. package/dist/types/api/asset/tag.d.ts.map +1 -0
  455. package/dist/types/api/integration.d.cts +34 -0
  456. package/dist/types/api/integration.d.cts.map +1 -0
  457. package/dist/types/api/integration.d.ts +17 -11
  458. package/dist/types/api/integration.d.ts.map +1 -0
  459. package/dist/types/api/query.d.cts +49 -0
  460. package/dist/types/api/query.d.cts.map +1 -0
  461. package/dist/types/api/query.d.ts +40 -34
  462. package/dist/types/api/query.d.ts.map +1 -0
  463. package/dist/types/api/ref.d.cts +36 -0
  464. package/dist/types/api/ref.d.cts.map +1 -0
  465. package/dist/types/api/ref.d.ts +30 -26
  466. package/dist/types/api/ref.d.ts.map +1 -0
  467. package/dist/types/api/release.d.cts +17 -0
  468. package/dist/types/api/release.d.cts.map +1 -0
  469. package/dist/types/api/release.d.ts +8 -2
  470. package/dist/types/api/release.d.ts.map +1 -0
  471. package/dist/types/api/repository.d.cts +115 -0
  472. package/dist/types/api/repository.d.cts.map +1 -0
  473. package/dist/types/api/repository.d.ts +90 -84
  474. package/dist/types/api/repository.d.ts.map +1 -0
  475. package/dist/types/api/tags.d.cts +13 -0
  476. package/dist/types/api/tags.d.cts.map +1 -0
  477. package/dist/types/api/tags.d.ts +5 -1
  478. package/dist/types/api/tags.d.ts.map +1 -0
  479. package/dist/types/migration/Asset.cjs +34 -32
  480. package/dist/types/migration/Asset.cjs.map +1 -1
  481. package/dist/types/migration/Asset.d.cts +109 -0
  482. package/dist/types/migration/Asset.d.cts.map +1 -0
  483. package/dist/types/migration/Asset.d.ts +89 -88
  484. package/dist/types/migration/Asset.d.ts.map +1 -0
  485. package/dist/types/migration/Asset.js +33 -32
  486. package/dist/types/migration/Asset.js.map +1 -1
  487. package/dist/types/migration/ContentRelationship.d.cts +15 -0
  488. package/dist/types/migration/ContentRelationship.d.cts.map +1 -0
  489. package/dist/types/migration/ContentRelationship.d.ts +10 -11
  490. package/dist/types/migration/ContentRelationship.d.ts.map +1 -0
  491. package/dist/types/migration/Document.cjs +50 -46
  492. package/dist/types/migration/Document.cjs.map +1 -1
  493. package/dist/types/migration/Document.d.cts +97 -0
  494. package/dist/types/migration/Document.d.cts.map +1 -0
  495. package/dist/types/migration/Document.d.ts +62 -59
  496. package/dist/types/migration/Document.d.ts.map +1 -0
  497. package/dist/types/migration/Document.js +49 -46
  498. package/dist/types/migration/Document.js.map +1 -1
  499. package/dist/types/model/boolean.d.cts +21 -0
  500. package/dist/types/model/boolean.d.cts.map +1 -0
  501. package/dist/types/model/boolean.d.ts +15 -9
  502. package/dist/types/model/boolean.d.ts.map +1 -0
  503. package/dist/types/model/color.d.cts +19 -0
  504. package/dist/types/model/color.d.cts.map +1 -0
  505. package/dist/types/model/color.d.ts +13 -7
  506. package/dist/types/model/color.d.ts.map +1 -0
  507. package/dist/types/model/contentRelationship.d.cts +59 -0
  508. package/dist/types/model/contentRelationship.d.cts.map +1 -0
  509. package/dist/types/model/contentRelationship.d.ts +33 -26
  510. package/dist/types/model/contentRelationship.d.ts.map +1 -0
  511. package/dist/types/model/customType.d.cts +54 -0
  512. package/dist/types/model/customType.d.cts.map +1 -0
  513. package/dist/types/model/customType.d.ts +36 -30
  514. package/dist/types/model/customType.d.ts.map +1 -0
  515. package/dist/types/model/date.d.cts +20 -0
  516. package/dist/types/model/date.d.cts.map +1 -0
  517. package/dist/types/model/date.d.ts +14 -8
  518. package/dist/types/model/date.d.ts.map +1 -0
  519. package/dist/types/model/embed.d.cts +19 -0
  520. package/dist/types/model/embed.d.cts.map +1 -0
  521. package/dist/types/model/embed.d.ts +13 -7
  522. package/dist/types/model/embed.d.ts.map +1 -0
  523. package/dist/types/model/geoPoint.d.cts +18 -0
  524. package/dist/types/model/geoPoint.d.cts.map +1 -0
  525. package/dist/types/model/geoPoint.d.ts +12 -6
  526. package/dist/types/model/geoPoint.d.ts.map +1 -0
  527. package/dist/types/model/group.d.cts +29 -0
  528. package/dist/types/model/group.d.cts.map +1 -0
  529. package/dist/types/model/group.d.ts +14 -8
  530. package/dist/types/model/group.d.ts.map +1 -0
  531. package/dist/types/model/image.d.cts +37 -0
  532. package/dist/types/model/image.d.cts.map +1 -0
  533. package/dist/types/model/image.d.ts +19 -13
  534. package/dist/types/model/image.d.ts.map +1 -0
  535. package/dist/types/model/integration.d.cts +20 -0
  536. package/dist/types/model/integration.d.cts.map +1 -0
  537. package/dist/types/model/integration.d.ts +14 -8
  538. package/dist/types/model/integration.d.ts.map +1 -0
  539. package/dist/types/model/keyText.d.cts +19 -0
  540. package/dist/types/model/keyText.d.cts.map +1 -0
  541. package/dist/types/model/keyText.d.ts +13 -7
  542. package/dist/types/model/keyText.d.ts.map +1 -0
  543. package/dist/types/model/link.cjs +13 -6
  544. package/dist/types/model/link.cjs.map +1 -1
  545. package/dist/types/model/link.d.cts +34 -0
  546. package/dist/types/model/link.d.cts.map +1 -0
  547. package/dist/types/model/link.d.ts +22 -16
  548. package/dist/types/model/link.d.ts.map +1 -0
  549. package/dist/types/model/link.js +13 -7
  550. package/dist/types/model/link.js.map +1 -1
  551. package/dist/types/model/linkToMedia.d.cts +23 -0
  552. package/dist/types/model/linkToMedia.d.cts.map +1 -0
  553. package/dist/types/model/linkToMedia.d.ts +17 -11
  554. package/dist/types/model/linkToMedia.d.ts.map +1 -0
  555. package/dist/types/model/number.d.cts +21 -0
  556. package/dist/types/model/number.d.cts.map +1 -0
  557. package/dist/types/model/number.d.ts +15 -9
  558. package/dist/types/model/number.d.ts.map +1 -0
  559. package/dist/types/model/range.d.cts +20 -0
  560. package/dist/types/model/range.d.cts.map +1 -0
  561. package/dist/types/model/range.d.ts +16 -10
  562. package/dist/types/model/range.d.ts.map +1 -0
  563. package/dist/types/model/richText.d.cts +43 -0
  564. package/dist/types/model/richText.d.cts.map +1 -0
  565. package/dist/types/model/richText.d.ts +26 -20
  566. package/dist/types/model/richText.d.ts.map +1 -0
  567. package/dist/types/model/select.d.cts +24 -0
  568. package/dist/types/model/select.d.cts.map +1 -0
  569. package/dist/types/model/select.d.ts +15 -9
  570. package/dist/types/model/select.d.ts.map +1 -0
  571. package/dist/types/model/separator.d.cts +16 -0
  572. package/dist/types/model/separator.d.cts.map +1 -0
  573. package/dist/types/model/separator.d.ts +12 -6
  574. package/dist/types/model/separator.d.ts.map +1 -0
  575. package/dist/types/model/sharedSlice.d.cts +22 -0
  576. package/dist/types/model/sharedSlice.d.cts.map +1 -0
  577. package/dist/types/model/sharedSlice.d.ts +14 -8
  578. package/dist/types/model/sharedSlice.d.ts.map +1 -0
  579. package/dist/types/model/sharedSliceVariation.d.cts +25 -0
  580. package/dist/types/model/sharedSliceVariation.d.cts.map +1 -0
  581. package/dist/types/model/sharedSliceVariation.d.ts +16 -10
  582. package/dist/types/model/sharedSliceVariation.d.ts.map +1 -0
  583. package/dist/types/model/slice.cjs +12 -5
  584. package/dist/types/model/slice.cjs.map +1 -1
  585. package/dist/types/model/slice.d.cts +39 -0
  586. package/dist/types/model/slice.d.cts.map +1 -0
  587. package/dist/types/model/slice.d.ts +21 -15
  588. package/dist/types/model/slice.d.ts.map +1 -0
  589. package/dist/types/model/slice.js +12 -6
  590. package/dist/types/model/slice.js.map +1 -1
  591. package/dist/types/model/sliceZone.cjs +12 -5
  592. package/dist/types/model/sliceZone.cjs.map +1 -1
  593. package/dist/types/model/sliceZone.d.cts +47 -0
  594. package/dist/types/model/sliceZone.d.cts.map +1 -0
  595. package/dist/types/model/sliceZone.d.ts +23 -17
  596. package/dist/types/model/sliceZone.d.ts.map +1 -0
  597. package/dist/types/model/sliceZone.js +12 -6
  598. package/dist/types/model/sliceZone.js.map +1 -1
  599. package/dist/types/model/table.d.cts +18 -0
  600. package/dist/types/model/table.d.cts.map +1 -0
  601. package/dist/types/model/table.d.ts +12 -6
  602. package/dist/types/model/table.d.ts.map +1 -0
  603. package/dist/types/model/timestamp.d.cts +20 -0
  604. package/dist/types/model/timestamp.d.cts.map +1 -0
  605. package/dist/types/model/timestamp.d.ts +14 -8
  606. package/dist/types/model/timestamp.d.ts.map +1 -0
  607. package/dist/types/model/title.d.cts +13 -0
  608. package/dist/types/model/title.d.cts.map +1 -0
  609. package/dist/types/model/title.d.ts +8 -2
  610. package/dist/types/model/title.d.ts.map +1 -0
  611. package/dist/types/model/types.cjs +29 -36
  612. package/dist/types/model/types.cjs.map +1 -1
  613. package/dist/types/model/types.d.cts +82 -0
  614. package/dist/types/model/types.d.cts.map +1 -0
  615. package/dist/types/model/types.d.ts +66 -61
  616. package/dist/types/model/types.d.ts.map +1 -0
  617. package/dist/types/model/types.js +29 -37
  618. package/dist/types/model/types.js.map +1 -1
  619. package/dist/types/model/uid.d.cts +19 -0
  620. package/dist/types/model/uid.d.cts.map +1 -0
  621. package/dist/types/model/uid.d.ts +13 -7
  622. package/dist/types/model/uid.d.ts.map +1 -0
  623. package/dist/types/value/boolean.d.cts +10 -0
  624. package/dist/types/value/boolean.d.cts.map +1 -0
  625. package/dist/types/value/boolean.d.ts +5 -1
  626. package/dist/types/value/boolean.d.ts.map +1 -0
  627. package/dist/types/value/color.d.cts +15 -0
  628. package/dist/types/value/color.d.cts.map +1 -0
  629. package/dist/types/value/color.d.ts +8 -2
  630. package/dist/types/value/color.d.ts.map +1 -0
  631. package/dist/types/value/contentRelationship.d.cts +37 -0
  632. package/dist/types/value/contentRelationship.d.cts.map +1 -0
  633. package/dist/types/value/contentRelationship.d.ts +23 -17
  634. package/dist/types/value/contentRelationship.d.ts.map +1 -0
  635. package/dist/types/value/date.d.cts +15 -0
  636. package/dist/types/value/date.d.cts.map +1 -0
  637. package/dist/types/value/date.d.ts +8 -2
  638. package/dist/types/value/date.d.ts.map +1 -0
  639. package/dist/types/value/document.d.cts +120 -0
  640. package/dist/types/value/document.d.cts.map +1 -0
  641. package/dist/types/value/document.d.ts +90 -84
  642. package/dist/types/value/document.d.ts.map +1 -0
  643. package/dist/types/value/embed.cjs +14 -7
  644. package/dist/types/value/embed.cjs.map +1 -1
  645. package/dist/types/value/embed.d.cts +173 -0
  646. package/dist/types/value/embed.d.cts.map +1 -0
  647. package/dist/types/value/embed.d.ts +110 -105
  648. package/dist/types/value/embed.d.ts.map +1 -0
  649. package/dist/types/value/embed.js +14 -8
  650. package/dist/types/value/embed.js.map +1 -1
  651. package/dist/types/value/geoPoint.d.cts +18 -0
  652. package/dist/types/value/geoPoint.d.cts.map +1 -0
  653. package/dist/types/value/geoPoint.d.ts +10 -4
  654. package/dist/types/value/geoPoint.d.ts.map +1 -0
  655. package/dist/types/value/group.d.cts +19 -0
  656. package/dist/types/value/group.d.cts.map +1 -0
  657. package/dist/types/value/group.d.ts +9 -3
  658. package/dist/types/value/group.d.ts.map +1 -0
  659. package/dist/types/value/image.d.cts +53 -0
  660. package/dist/types/value/image.d.cts.map +1 -0
  661. package/dist/types/value/image.d.ts +31 -25
  662. package/dist/types/value/image.d.ts.map +1 -0
  663. package/dist/types/value/integration.d.cts +22 -0
  664. package/dist/types/value/integration.d.cts.map +1 -0
  665. package/dist/types/value/integration.d.ts +9 -3
  666. package/dist/types/value/integration.d.ts.map +1 -0
  667. package/dist/types/value/keyText.d.cts +15 -0
  668. package/dist/types/value/keyText.d.cts.map +1 -0
  669. package/dist/types/value/keyText.d.ts +8 -2
  670. package/dist/types/value/keyText.d.ts.map +1 -0
  671. package/dist/types/value/link.cjs +12 -7
  672. package/dist/types/value/link.cjs.map +1 -1
  673. package/dist/types/value/link.d.cts +74 -0
  674. package/dist/types/value/link.d.cts.map +1 -0
  675. package/dist/types/value/link.d.ts +27 -21
  676. package/dist/types/value/link.d.ts.map +1 -0
  677. package/dist/types/value/link.js +12 -8
  678. package/dist/types/value/link.js.map +1 -1
  679. package/dist/types/value/linkToMedia.d.cts +33 -0
  680. package/dist/types/value/linkToMedia.d.cts.map +1 -0
  681. package/dist/types/value/linkToMedia.d.ts +19 -14
  682. package/dist/types/value/linkToMedia.d.ts.map +1 -0
  683. package/dist/types/value/number.d.cts +15 -0
  684. package/dist/types/value/number.d.cts.map +1 -0
  685. package/dist/types/value/number.d.ts +8 -2
  686. package/dist/types/value/number.d.ts.map +1 -0
  687. package/dist/types/value/richText.cjs +29 -22
  688. package/dist/types/value/richText.cjs.map +1 -1
  689. package/dist/types/value/richText.d.cts +221 -0
  690. package/dist/types/value/richText.d.cts.map +1 -0
  691. package/dist/types/value/richText.d.ts +103 -97
  692. package/dist/types/value/richText.d.ts.map +1 -0
  693. package/dist/types/value/richText.js +29 -23
  694. package/dist/types/value/richText.js.map +1 -1
  695. package/dist/types/value/select.d.cts +16 -0
  696. package/dist/types/value/select.d.cts.map +1 -0
  697. package/dist/types/value/select.d.ts +8 -2
  698. package/dist/types/value/select.d.ts.map +1 -0
  699. package/dist/types/value/sharedSlice.d.cts +17 -0
  700. package/dist/types/value/sharedSlice.d.cts.map +1 -0
  701. package/dist/types/value/sharedSlice.d.ts +11 -5
  702. package/dist/types/value/sharedSlice.d.ts.map +1 -0
  703. package/dist/types/value/sharedSliceVariation.d.cts +16 -0
  704. package/dist/types/value/sharedSliceVariation.d.cts.map +1 -0
  705. package/dist/types/value/sharedSliceVariation.d.ts +12 -6
  706. package/dist/types/value/sharedSliceVariation.d.ts.map +1 -0
  707. package/dist/types/value/slice.d.cts +19 -0
  708. package/dist/types/value/slice.d.cts.map +1 -0
  709. package/dist/types/value/slice.d.ts +13 -7
  710. package/dist/types/value/slice.d.ts.map +1 -0
  711. package/dist/types/value/sliceZone.d.cts +18 -0
  712. package/dist/types/value/sliceZone.d.cts.map +1 -0
  713. package/dist/types/value/sliceZone.d.ts +10 -4
  714. package/dist/types/value/sliceZone.d.ts.map +1 -0
  715. package/dist/types/value/table.d.cts +97 -0
  716. package/dist/types/value/table.d.cts.map +1 -0
  717. package/dist/types/value/table.d.ts +65 -59
  718. package/dist/types/value/table.d.ts.map +1 -0
  719. package/dist/types/value/timestamp.d.cts +13 -0
  720. package/dist/types/value/timestamp.d.cts.map +1 -0
  721. package/dist/types/value/timestamp.d.ts +8 -3
  722. package/dist/types/value/timestamp.d.ts.map +1 -0
  723. package/dist/types/value/title.d.cts +16 -0
  724. package/dist/types/value/title.d.cts.map +1 -0
  725. package/dist/types/value/title.d.ts +11 -7
  726. package/dist/types/value/title.d.ts.map +1 -0
  727. package/dist/types/value/types.d.cts +61 -0
  728. package/dist/types/value/types.d.cts.map +1 -0
  729. package/dist/types/value/types.d.ts +31 -28
  730. package/dist/types/value/types.d.ts.map +1 -0
  731. package/dist/types/webhook/apiUpdate.d.cts +57 -0
  732. package/dist/types/webhook/apiUpdate.d.cts.map +1 -0
  733. package/dist/types/webhook/apiUpdate.d.ts +28 -23
  734. package/dist/types/webhook/apiUpdate.d.ts.map +1 -0
  735. package/dist/types/webhook/testTrigger.d.cts +15 -0
  736. package/dist/types/webhook/testTrigger.d.cts.map +1 -0
  737. package/dist/types/webhook/testTrigger.d.ts +9 -3
  738. package/dist/types/webhook/testTrigger.d.ts.map +1 -0
  739. package/dist/types/webhook/types.cjs +12 -5
  740. package/dist/types/webhook/types.cjs.map +1 -1
  741. package/dist/types/webhook/types.d.cts +23 -0
  742. package/dist/types/webhook/types.d.cts.map +1 -0
  743. package/dist/types/webhook/types.d.ts +16 -11
  744. package/dist/types/webhook/types.d.ts.map +1 -0
  745. package/dist/types/webhook/types.js +12 -6
  746. package/dist/types/webhook/types.js.map +1 -1
  747. package/package.json +20 -49
  748. package/src/Client.ts +26 -9
  749. package/src/WriteClient.ts +28 -36
  750. package/src/buildQueryURL.ts +33 -22
  751. package/src/createClient.ts +11 -8
  752. package/src/getRepositoryEndpoint.ts +9 -2
  753. package/src/helpers/asDate.ts +11 -4
  754. package/src/helpers/asHTML.ts +38 -30
  755. package/src/helpers/asImagePixelDensitySrcSet.ts +16 -15
  756. package/src/helpers/asImageSrc.ts +11 -10
  757. package/src/helpers/asImageWidthSrcSet.ts +19 -22
  758. package/src/helpers/asLink.ts +33 -35
  759. package/src/helpers/asLinkAttrs.ts +6 -13
  760. package/src/helpers/asText.ts +20 -10
  761. package/src/helpers/isFilled.ts +15 -14
  762. package/src/helpers/mapSliceZone.ts +15 -15
  763. package/src/index.ts +3 -2
  764. package/src/isRepositoryEndpoint.ts +2 -2
  765. package/src/lib/isValue.ts +0 -6
  766. package/src/lib/pLimit.ts +1 -1
  767. package/src/lib/request.ts +3 -3
  768. package/src/lib/throttledLog.ts +0 -1
  769. package/src/richtext/asText.ts +5 -5
  770. package/src/richtext/serialize.ts +8 -8
  771. package/src/richtext/types.ts +6 -6
  772. package/src/types/migration/Asset.ts +10 -2
  773. package/src/types/migration/Document.ts +1 -1
  774. package/src/types/model/contentRelationship.ts +1 -0
  775. package/src/types/model/types.ts +0 -2
  776. package/src/types/value/date.ts +1 -1
  777. package/src/types/value/document.ts +3 -3
  778. package/src/types/value/timestamp.ts +1 -5
  779. package/dist/lib/appendFilters.d.ts +0 -18
  780. package/dist/lib/castArray.d.ts +0 -12
  781. package/dist/lib/castThunk.d.ts +0 -11
  782. package/dist/lib/devMsg.d.ts +0 -16
  783. package/dist/lib/escapeHTML.d.ts +0 -1
  784. package/dist/lib/everyTagFilter.d.ts +0 -9
  785. package/dist/lib/findMasterRef.d.ts +0 -11
  786. package/dist/lib/findRef.d.ts +0 -14
  787. package/dist/lib/findRefByID.d.ts +0 -12
  788. package/dist/lib/findRefByLabel.d.ts +0 -12
  789. package/dist/lib/getOptionalLinkProperties.d.ts +0 -12
  790. package/dist/lib/getPreviewCookie.d.ts +0 -9
  791. package/dist/lib/isInternalURL.d.ts +0 -8
  792. package/dist/lib/isMigrationValue.d.ts +0 -71
  793. package/dist/lib/isValue.d.ts +0 -78
  794. package/dist/lib/minifyGraphQLQuery.d.ts +0 -8
  795. package/dist/lib/pLimit.d.ts +0 -22
  796. package/dist/lib/resolveMigrationDocumentData.d.ts +0 -54
  797. package/dist/lib/serializerHelpers.d.ts +0 -9
  798. package/dist/lib/someTagsFilter.d.ts +0 -9
  799. package/dist/lib/throttledLog.d.ts +0 -15
  800. package/dist/lib/typeFilter.d.ts +0 -8
  801. package/dist/lib/validateAssetMetadata.d.ts +0 -10
  802. package/dist/package.json.cjs +0 -7
  803. package/dist/package.json.cjs.map +0 -1
  804. package/dist/package.json.js +0 -7
  805. package/dist/package.json.js.map +0 -1
  806. package/dist/richtext/index.d.ts +0 -7
  807. package/dist/richtext.cjs.map +0 -1
  808. package/dist/richtext.js.map +0 -1
  809. package/dist/types/api/migration/document.d.ts +0 -60
  810. package/dist/types/migration/Link.d.ts +0 -19
package/dist/filter.js CHANGED
@@ -1,247 +1,103 @@
1
+ //#region src/filter.ts
2
+ /**
3
+ * Formats the value of a filter element to a stringified version accepted by
4
+ * the Prismic REST API.
5
+ *
6
+ * @param value - Value to format.
7
+ *
8
+ * @returns `value` formatted for the Prismic REST API.
9
+ */
1
10
  const formatValue = (value) => {
2
- if (Array.isArray(value)) {
3
- return `[${value.map(formatValue).join(", ")}]`;
4
- }
5
- if (typeof value === "string") {
6
- return `"${value}"`;
7
- }
8
- if (value instanceof Date) {
9
- return `${value.getTime()}`;
10
- }
11
- return `${value}`;
11
+ if (Array.isArray(value)) return `[${value.map(formatValue).join(", ")}]`;
12
+ if (typeof value === "string") return `"${value}"`;
13
+ if (value instanceof Date) return `${value.getTime()}`;
14
+ return `${value}`;
12
15
  };
16
+ /**
17
+ * Creates a filter builder function for filters with a path and arguments.
18
+ *
19
+ * @typeParam Args - Arguments for the filter.
20
+ *
21
+ * @param name - Name of the filter used in the resulting string.
22
+ *
23
+ * @returns Filter builder function for the given name.
24
+ */
13
25
  const pathWithArgsFilter = (name) => {
14
- const fn = (path, ...args) => {
15
- const formattedArgs = args.map(formatValue).join(", ");
16
- const joiner = path && args.length ? ", " : "";
17
- return `[${name}(${path}${joiner}${formattedArgs})]`;
18
- };
19
- return fn;
26
+ /**
27
+ * @param path - Path to the value to be compared.
28
+ */
29
+ const fn = (path, ...args) => {
30
+ const formattedArgs = args.map(formatValue).join(", ");
31
+ return `[${name}(${path}${path && args.length ? ", " : ""}${formattedArgs})]`;
32
+ };
33
+ return fn;
20
34
  };
35
+ /**
36
+ * Creates a filter builder function for filters with only a path.
37
+ *
38
+ * @param name - Name of the filter used in the resulting string.
39
+ *
40
+ * @returns Filter builder function for the given name.
41
+ */
21
42
  const pathFilter = (name) => {
22
- const filterFn = pathWithArgsFilter(name);
23
- const fn = (path) => {
24
- return filterFn(path);
25
- };
26
- return fn;
43
+ const filterFn = pathWithArgsFilter(name);
44
+ /**
45
+ * @param path - Path for the filter.
46
+ */
47
+ const fn = (path) => {
48
+ return filterFn(path);
49
+ };
50
+ return fn;
27
51
  };
52
+ /**
53
+ * Creates a filter builder function for filters with only arguments and no
54
+ * path.
55
+ *
56
+ * @param name - Name of the filter used in the resulting string.
57
+ *
58
+ * @returns Filter builder function for the given name.
59
+ */
28
60
  const argsFilter = (name) => {
29
- const filterFn = pathWithArgsFilter(name);
30
- const fn = (...args) => {
31
- return filterFn("", ...args);
32
- };
33
- return fn;
61
+ const filterFn = pathWithArgsFilter(name);
62
+ /**
63
+ * @param args - Arguments for the filter.
64
+ */
65
+ const fn = (...args) => {
66
+ return filterFn("", ...args);
67
+ };
68
+ return fn;
34
69
  };
35
70
  const filter = {
36
- /**
37
- * The `at` filter checks that the path matches the described value exactly.
38
- * It takes a single value for a field or an array (only for tags).
39
- *
40
- * {@link https://prismic.io/docs/rest-api-technical-reference#at}
41
- */
42
- at: pathWithArgsFilter("at"),
43
- /**
44
- * The `not` filter checks that the path doesn't match the provided value
45
- * exactly. It takes a single value for a field or an array (only for tags).
46
- *
47
- * {@link https://prismic.io/docs/rest-api-technical-reference#not}
48
- */
49
- not: pathWithArgsFilter("not"),
50
- /**
51
- * The `any` filter takes an array of values. It works exactly the same way as
52
- * the `at` operator, but checks whether the fragment matches any of the
53
- * values in the array.
54
- *
55
- * {@link https://prismic.io/docs/rest-api-technical-reference#any}
56
- */
57
- any: pathWithArgsFilter("any"),
58
- /**
59
- * The `in` filter is used specifically to retrieve an array of documents by
60
- * their IDs or UIDs. This filter is much more efficient at this than the any
61
- * filter.
62
- *
63
- * {@link https://prismic.io/docs/rest-api-technical-reference#in}
64
- */
65
- in: pathWithArgsFilter("in"),
66
- /**
67
- * The `fulltext` filter provides two capabilities:
68
- *
69
- * 1. Checking if a certain string is anywhere inside a document (this is what
70
- * you should use to make your project's search engine feature)
71
- * 2. Checking if the string is contained inside a specific custom type’s Rich
72
- * Text or Key Text fragment.
73
- *
74
- * {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}
75
- */
76
- fulltext: pathWithArgsFilter("fulltext"),
77
- /**
78
- * The `has` filter checks whether a fragment has a value. It will return all
79
- * the documents of the specified type that contain a value for the specified
80
- * field.
81
- *
82
- * {@link https://prismic.io/docs/rest-api-technical-reference#has}
83
- */
84
- has: pathFilter("has"),
85
- /**
86
- * The `missing` filter checks if a fragment doesn't have a value. It will
87
- * return all the documents of the specified type that do not contain a value
88
- * for the specified field.
89
- *
90
- * {@link https://prismic.io/docs/rest-api-technical-reference#missing}
91
- */
92
- missing: pathFilter("missing"),
93
- /**
94
- * The `similar` filter takes the ID of a document, and returns a list of
95
- * documents with similar content. This allows you to build an automated
96
- * content discovery feature (for example, a "Related posts" section).
97
- *
98
- * {@link https://prismic.io/docs/rest-api-technical-reference#similar}
99
- */
100
- similar: argsFilter("similar"),
101
- /**
102
- * The `geopoint.near` filter checks that the value in the path is within the
103
- * radius of the given coordinates.
104
- *
105
- * This filter will only work for a geopoint field.
106
- *
107
- * {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}
108
- */
109
- geopointNear: pathWithArgsFilter("geopoint.near"),
110
- /**
111
- * The `number.lt` filter checks that the value in the number field is less
112
- * than the value passed into the filter.
113
- *
114
- * {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}
115
- */
116
- numberLessThan: pathWithArgsFilter("number.lt"),
117
- /**
118
- * The `number.gt` filter checks that the value in the number field is greater
119
- * than the value passed into the filter.
120
- *
121
- * {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}
122
- */
123
- numberGreaterThan: pathWithArgsFilter("number.gt"),
124
- /**
125
- * The `number.inRange` filter checks that the value in the path is within the
126
- * two values passed into the filter.
127
- *
128
- * {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}
129
- */
130
- numberInRange: pathWithArgsFilter("number.inRange"),
131
- /**
132
- * The `date.after` filter checks that the value in the path is after the date
133
- * value passed into the filter.
134
- *
135
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
136
- */
137
- dateAfter: pathWithArgsFilter("date.after"),
138
- /**
139
- * The `date.before` filter checks that the value in the path is before the
140
- * date value passed into the filter.
141
- *
142
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
143
- */
144
- dateBefore: pathWithArgsFilter("date.before"),
145
- /**
146
- * The `date.between` filter checks that the value in the path is within the
147
- * date values passed into the filter.
148
- *
149
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
150
- */
151
- dateBetween: pathWithArgsFilter("date.between"),
152
- /**
153
- * The `date.day-of-month` filter checks that the value in the path is equal
154
- * to the day of the month passed into the filter.
155
- *
156
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
157
- */
158
- dateDayOfMonth: pathWithArgsFilter("date.day-of-month"),
159
- /**
160
- * The `date.day-of-month-after` filter checks that the value in the path is
161
- * after the day of the month passed into the filter.
162
- *
163
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
164
- */
165
- dateDayOfMonthAfter: pathWithArgsFilter("date.day-of-month-after"),
166
- /**
167
- * The `date.day-of-month-before` filter checks that the value in the path is
168
- * before the day of the month passed into the filter.
169
- *
170
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
171
- */
172
- dateDayOfMonthBefore: pathWithArgsFilter("date.day-of-month-before"),
173
- /**
174
- * The `date.day-of-week` filter checks that the value in the path is equal to
175
- * the day of the week passed into the filter.
176
- *
177
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
178
- */
179
- dateDayOfWeek: pathWithArgsFilter("date.day-of-week"),
180
- /**
181
- * The `date.day-of-week-after` filter checks that the value in the path is
182
- * after the day of the week passed into the filter.
183
- *
184
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
185
- */
186
- dateDayOfWeekAfter: pathWithArgsFilter("date.day-of-week-after"),
187
- /**
188
- * The date.day-of-week-before filter checks that the value in the path is
189
- * before the day of the week passed into the filter.
190
- *
191
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
192
- */
193
- dateDayOfWeekBefore: pathWithArgsFilter("date.day-of-week-before"),
194
- /**
195
- * The `date.month` filter checks that the value in the path occurs in the
196
- * month value passed into the filter.
197
- *
198
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
199
- */
200
- dateMonth: pathWithArgsFilter("date.month"),
201
- /**
202
- * The `date.month-after` filter checks that the value in the path occurs in
203
- * any month after the value passed into the filter.
204
- *
205
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
206
- */
207
- dateMonthAfter: pathWithArgsFilter("date.month-after"),
208
- /**
209
- * The `date.month-before` filter checks that the value in the path occurs in
210
- * any month before the value passed into the filter.
211
- *
212
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
213
- */
214
- dateMonthBefore: pathWithArgsFilter("date.month-before"),
215
- /**
216
- * The `date.year` filter checks that the value in the path occurs in the year
217
- * value passed into the filter.
218
- *
219
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
220
- */
221
- dateYear: pathWithArgsFilter("date.year"),
222
- /**
223
- * The `date.hour` filter checks that the value in the path occurs within the
224
- * hour value passed into the filter.
225
- *
226
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
227
- */
228
- dateHour: pathWithArgsFilter("date.hour"),
229
- /**
230
- * The `date.hour-after` filter checks that the value in the path occurs after
231
- * the hour value passed into the filter.
232
- *
233
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
234
- */
235
- dateHourAfter: pathWithArgsFilter("date.hour-after"),
236
- /**
237
- * The `date.hour-before` filter checks that the value in the path occurs
238
- * before the hour value passed into the filter.
239
- *
240
- * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}
241
- */
242
- dateHourBefore: pathWithArgsFilter("date.hour-before")
71
+ at: pathWithArgsFilter("at"),
72
+ not: pathWithArgsFilter("not"),
73
+ any: pathWithArgsFilter("any"),
74
+ in: pathWithArgsFilter("in"),
75
+ fulltext: pathWithArgsFilter("fulltext"),
76
+ has: pathFilter("has"),
77
+ missing: pathFilter("missing"),
78
+ similar: argsFilter("similar"),
79
+ geopointNear: pathWithArgsFilter("geopoint.near"),
80
+ numberLessThan: pathWithArgsFilter("number.lt"),
81
+ numberGreaterThan: pathWithArgsFilter("number.gt"),
82
+ numberInRange: pathWithArgsFilter("number.inRange"),
83
+ dateAfter: pathWithArgsFilter("date.after"),
84
+ dateBefore: pathWithArgsFilter("date.before"),
85
+ dateBetween: pathWithArgsFilter("date.between"),
86
+ dateDayOfMonth: pathWithArgsFilter("date.day-of-month"),
87
+ dateDayOfMonthAfter: pathWithArgsFilter("date.day-of-month-after"),
88
+ dateDayOfMonthBefore: pathWithArgsFilter("date.day-of-month-before"),
89
+ dateDayOfWeek: pathWithArgsFilter("date.day-of-week"),
90
+ dateDayOfWeekAfter: pathWithArgsFilter("date.day-of-week-after"),
91
+ dateDayOfWeekBefore: pathWithArgsFilter("date.day-of-week-before"),
92
+ dateMonth: pathWithArgsFilter("date.month"),
93
+ dateMonthAfter: pathWithArgsFilter("date.month-after"),
94
+ dateMonthBefore: pathWithArgsFilter("date.month-before"),
95
+ dateYear: pathWithArgsFilter("date.year"),
96
+ dateHour: pathWithArgsFilter("date.hour"),
97
+ dateHourAfter: pathWithArgsFilter("date.hour-after"),
98
+ dateHourBefore: pathWithArgsFilter("date.hour-before")
243
99
  };
244
- export {
245
- filter
246
- };
247
- //# sourceMappingURL=filter.js.map
100
+
101
+ //#endregion
102
+ export { filter };
103
+ //# sourceMappingURL=filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.js","sources":["../../src/filter.ts"],"sourcesContent":["/**\n * Formats the value of a filter element to a stringified version accepted by\n * the Prismic REST API.\n *\n * @param value - Value to format.\n *\n * @returns `value` formatted for the Prismic REST API.\n */\nconst formatValue = (\n\tvalue:\n\t\t| string\n\t\t| number\n\t\t| Date\n\t\t| unknown\n\t\t| (string | number | Date | unknown)[],\n): string => {\n\tif (Array.isArray(value)) {\n\t\treturn `[${value.map(formatValue).join(\", \")}]`\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn `\"${value}\"`\n\t}\n\n\tif (value instanceof Date) {\n\t\treturn `${value.getTime()}`\n\t}\n\n\treturn `${value}`\n}\n\n/**\n * Creates a filter builder function for filters with a path and arguments.\n *\n * @typeParam Args - Arguments for the filter.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst pathWithArgsFilter = <Args extends unknown[]>(name: string) => {\n\t/**\n\t * @param path - Path to the value to be compared.\n\t */\n\tconst fn = (path: string, ...args: Args): string => {\n\t\tconst formattedArgs = args.map(formatValue).join(\", \")\n\t\tconst joiner = path && args.length ? \", \" : \"\"\n\n\t\treturn `[${name}(${path}${joiner}${formattedArgs})]`\n\t}\n\n\treturn fn\n}\n\n/**\n * Creates a filter builder function for filters with only a path.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst pathFilter = (name: string) => {\n\tconst filterFn = pathWithArgsFilter(name)\n\n\t/**\n\t * @param path - Path for the filter.\n\t */\n\tconst fn = (path: string): string => {\n\t\treturn filterFn(path)\n\t}\n\n\treturn fn\n}\n\n/**\n * Creates a filter builder function for filters with only arguments and no\n * path.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst argsFilter = <Args extends unknown[]>(name: string) => {\n\tconst filterFn = pathWithArgsFilter<Args>(name)\n\n\t/**\n\t * @param args - Arguments for the filter.\n\t */\n\tconst fn = (...args: Args): string => {\n\t\treturn filterFn(\"\", ...args)\n\t}\n\n\treturn fn\n}\n\nexport const filter = {\n\t/**\n\t * The `at` filter checks that the path matches the described value exactly.\n\t * It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#at}\n\t */\n\tat: pathWithArgsFilter<[value: string | number | boolean | Date | string[]]>(\n\t\t\"at\",\n\t),\n\n\t/**\n\t * The `not` filter checks that the path doesn't match the provided value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#not}\n\t */\n\tnot: pathWithArgsFilter<[value: string | number | boolean | Date | string[]]>(\n\t\t\"not\",\n\t),\n\n\t/**\n\t * The `any` filter takes an array of values. It works exactly the same way as\n\t * the `at` operator, but checks whether the fragment matches any of the\n\t * values in the array.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#any}\n\t */\n\tany: pathWithArgsFilter<[values: (string | number | boolean | Date)[]]>(\n\t\t\"any\",\n\t),\n\n\t/**\n\t * The `in` filter is used specifically to retrieve an array of documents by\n\t * their IDs or UIDs. This filter is much more efficient at this than the any\n\t * filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#in}\n\t */\n\tin: pathWithArgsFilter<[values: string[]]>(\"in\"),\n\n\t/**\n\t * The `fulltext` filter provides two capabilities:\n\t *\n\t * 1. Checking if a certain string is anywhere inside a document (this is what\n\t * you should use to make your project's search engine feature)\n\t * 2. Checking if the string is contained inside a specific custom type’s Rich\n\t * Text or Key Text fragment.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}\n\t */\n\tfulltext: pathWithArgsFilter<[searchTerms: string]>(\"fulltext\"),\n\n\t/**\n\t * The `has` filter checks whether a fragment has a value. It will return all\n\t * the documents of the specified type that contain a value for the specified\n\t * field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#has}\n\t */\n\thas: pathFilter(\"has\"),\n\n\t/**\n\t * The `missing` filter checks if a fragment doesn't have a value. It will\n\t * return all the documents of the specified type that do not contain a value\n\t * for the specified field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#missing}\n\t */\n\tmissing: pathFilter(\"missing\"),\n\n\t/**\n\t * The `similar` filter takes the ID of a document, and returns a list of\n\t * documents with similar content. This allows you to build an automated\n\t * content discovery feature (for example, a \"Related posts\" section).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#similar}\n\t */\n\tsimilar: argsFilter<[id: string, value: number]>(\"similar\"),\n\n\t/**\n\t * The `geopoint.near` filter checks that the value in the path is within the\n\t * radius of the given coordinates.\n\t *\n\t * This filter will only work for a geopoint field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}\n\t */\n\tgeopointNear:\n\t\tpathWithArgsFilter<[latitude: number, longitude: number, radius: number]>(\n\t\t\t\"geopoint.near\",\n\t\t),\n\n\t/**\n\t * The `number.lt` filter checks that the value in the number field is less\n\t * than the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}\n\t */\n\tnumberLessThan: pathWithArgsFilter<[value: number]>(\"number.lt\"),\n\n\t/**\n\t * The `number.gt` filter checks that the value in the number field is greater\n\t * than the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}\n\t */\n\tnumberGreaterThan: pathWithArgsFilter<[value: number]>(\"number.gt\"),\n\n\t/**\n\t * The `number.inRange` filter checks that the value in the path is within the\n\t * two values passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}\n\t */\n\tnumberInRange:\n\t\tpathWithArgsFilter<[lowerLimit: number, upperLimit: number]>(\n\t\t\t\"number.inRange\",\n\t\t),\n\n\t/**\n\t * The `date.after` filter checks that the value in the path is after the date\n\t * value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateAfter: pathWithArgsFilter<[date: string | number | Date]>(\"date.after\"),\n\n\t/**\n\t * The `date.before` filter checks that the value in the path is before the\n\t * date value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateBefore: pathWithArgsFilter<[date: string | number | Date]>(\"date.before\"),\n\n\t/**\n\t * The `date.between` filter checks that the value in the path is within the\n\t * date values passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateBetween:\n\t\tpathWithArgsFilter<\n\t\t\t[startDate: string | number | Date, endDate: string | number | Date]\n\t\t>(\"date.between\"),\n\n\t/**\n\t * The `date.day-of-month` filter checks that the value in the path is equal\n\t * to the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonth: pathWithArgsFilter<[day: number]>(\"date.day-of-month\"),\n\n\t/**\n\t * The `date.day-of-month-after` filter checks that the value in the path is\n\t * after the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonthAfter: pathWithArgsFilter<[day: number]>(\n\t\t\"date.day-of-month-after\",\n\t),\n\n\t/**\n\t * The `date.day-of-month-before` filter checks that the value in the path is\n\t * before the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonthBefore: pathWithArgsFilter<[day: number]>(\n\t\t\"date.day-of-month-before\",\n\t),\n\n\t/**\n\t * The `date.day-of-week` filter checks that the value in the path is equal to\n\t * the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeek: pathWithArgsFilter<[day: string | number]>(\"date.day-of-week\"),\n\n\t/**\n\t * The `date.day-of-week-after` filter checks that the value in the path is\n\t * after the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeekAfter: pathWithArgsFilter<[day: string | number]>(\n\t\t\"date.day-of-week-after\",\n\t),\n\n\t/**\n\t * The date.day-of-week-before filter checks that the value in the path is\n\t * before the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeekBefore: pathWithArgsFilter<[day: string | number]>(\n\t\t\"date.day-of-week-before\",\n\t),\n\n\t/**\n\t * The `date.month` filter checks that the value in the path occurs in the\n\t * month value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonth: pathWithArgsFilter<[month: string | number]>(\"date.month\"),\n\n\t/**\n\t * The `date.month-after` filter checks that the value in the path occurs in\n\t * any month after the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonthAfter:\n\t\tpathWithArgsFilter<[month: string | number]>(\"date.month-after\"),\n\n\t/**\n\t * The `date.month-before` filter checks that the value in the path occurs in\n\t * any month before the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonthBefore:\n\t\tpathWithArgsFilter<[month: string | number]>(\"date.month-before\"),\n\n\t/**\n\t * The `date.year` filter checks that the value in the path occurs in the year\n\t * value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateYear: pathWithArgsFilter<[year: number]>(\"date.year\"),\n\n\t/**\n\t * The `date.hour` filter checks that the value in the path occurs within the\n\t * hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHour: pathWithArgsFilter<[hour: number]>(\"date.hour\"),\n\n\t/**\n\t * The `date.hour-after` filter checks that the value in the path occurs after\n\t * the hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHourAfter: pathWithArgsFilter<[hour: number]>(\"date.hour-after\"),\n\n\t/**\n\t * The `date.hour-before` filter checks that the value in the path occurs\n\t * before the hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHourBefore: pathWithArgsFilter<[hour: number]>(\"date.hour-before\"),\n}\n"],"names":[],"mappings":"AAQA,MAAM,cAAc,CACnB,UAMW;AACP,MAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,IAAI,MAAM,IAAI,WAAW,EAAE,KAAK,IAAI,CAAC;AAAA,EAAA;AAGzC,MAAA,OAAO,UAAU,UAAU;AAC9B,WAAO,IAAI,KAAK;AAAA,EAAA;AAGjB,MAAI,iBAAiB,MAAM;AACnB,WAAA,GAAG,MAAM,QAAA,CAAS;AAAA,EAAA;AAG1B,SAAO,GAAG,KAAK;AAChB;AAWA,MAAM,qBAAqB,CAAyB,SAAgB;AAI7D,QAAA,KAAK,CAAC,SAAiB,SAAsB;AAClD,UAAM,gBAAgB,KAAK,IAAI,WAAW,EAAE,KAAK,IAAI;AACrD,UAAM,SAAS,QAAQ,KAAK,SAAS,OAAO;AAE5C,WAAO,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,GAAG,aAAa;AAAA,EACjD;AAEO,SAAA;AACR;AASA,MAAM,aAAa,CAAC,SAAgB;AAC7B,QAAA,WAAW,mBAAmB,IAAI;AAKlC,QAAA,KAAK,CAAC,SAAwB;AACnC,WAAO,SAAS,IAAI;AAAA,EACrB;AAEO,SAAA;AACR;AAUA,MAAM,aAAa,CAAyB,SAAgB;AACrD,QAAA,WAAW,mBAAyB,IAAI;AAKxC,QAAA,KAAK,IAAI,SAAsB;AAC7B,WAAA,SAAS,IAAI,GAAG,IAAI;AAAA,EAC5B;AAEO,SAAA;AACR;AAEO,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrB,IAAI,mBACH,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASL,KAAK,mBACJ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUN,KAAK,mBACJ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUN,IAAI,mBAAuC,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAY/C,UAAU,mBAA0C,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS9D,KAAK,WAAW,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASrB,SAAS,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS7B,SAAS,WAAwC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAU1D,cACC,mBACC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASjB,gBAAgB,mBAAoC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ/D,mBAAmB,mBAAoC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlE,eACC,mBACC,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlB,WAAW,mBAAmD,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ1E,YAAY,mBAAmD,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5E,aACC,mBAEE,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjB,gBAAgB,mBAAkC,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQrE,qBAAqB,mBACpB,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS1B,sBAAsB,mBACrB,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS3B,eAAe,mBAA2C,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5E,oBAAoB,mBACnB,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASzB,qBAAqB,mBACpB,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS1B,WAAW,mBAA6C,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpE,gBACC,mBAA6C,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhE,iBACC,mBAA6C,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjE,UAAU,mBAAmC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxD,UAAU,mBAAmC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQxD,eAAe,mBAAmC,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnE,gBAAgB,mBAAmC,kBAAkB;;"}
1
+ {"version":3,"file":"filter.js","names":[],"sources":["../src/filter.ts"],"sourcesContent":["/**\n * Formats the value of a filter element to a stringified version accepted by\n * the Prismic REST API.\n *\n * @param value - Value to format.\n *\n * @returns `value` formatted for the Prismic REST API.\n */\nconst formatValue = (\n\tvalue:\n\t\t| string\n\t\t| number\n\t\t| Date\n\t\t| unknown\n\t\t| (string | number | Date | unknown)[],\n): string => {\n\tif (Array.isArray(value)) {\n\t\treturn `[${value.map(formatValue).join(\", \")}]`\n\t}\n\n\tif (typeof value === \"string\") {\n\t\treturn `\"${value}\"`\n\t}\n\n\tif (value instanceof Date) {\n\t\treturn `${value.getTime()}`\n\t}\n\n\treturn `${value}`\n}\n\n/**\n * Creates a filter builder function for filters with a path and arguments.\n *\n * @typeParam Args - Arguments for the filter.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst pathWithArgsFilter = <Args extends unknown[]>(name: string) => {\n\t/**\n\t * @param path - Path to the value to be compared.\n\t */\n\tconst fn = (path: string, ...args: Args): string => {\n\t\tconst formattedArgs = args.map(formatValue).join(\", \")\n\t\tconst joiner = path && args.length ? \", \" : \"\"\n\n\t\treturn `[${name}(${path}${joiner}${formattedArgs})]`\n\t}\n\n\treturn fn\n}\n\n/**\n * Creates a filter builder function for filters with only a path.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst pathFilter = (name: string) => {\n\tconst filterFn = pathWithArgsFilter(name)\n\n\t/**\n\t * @param path - Path for the filter.\n\t */\n\tconst fn = (path: string): string => {\n\t\treturn filterFn(path)\n\t}\n\n\treturn fn\n}\n\n/**\n * Creates a filter builder function for filters with only arguments and no\n * path.\n *\n * @param name - Name of the filter used in the resulting string.\n *\n * @returns Filter builder function for the given name.\n */\nconst argsFilter = <Args extends unknown[]>(name: string) => {\n\tconst filterFn = pathWithArgsFilter<Args>(name)\n\n\t/**\n\t * @param args - Arguments for the filter.\n\t */\n\tconst fn = (...args: Args): string => {\n\t\treturn filterFn(\"\", ...args)\n\t}\n\n\treturn fn\n}\n\nexport const filter = {\n\t/**\n\t * The `at` filter checks that the path matches the described value exactly.\n\t * It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#at}\n\t */\n\tat: pathWithArgsFilter<[value: string | number | boolean | Date | string[]]>(\n\t\t\"at\",\n\t),\n\n\t/**\n\t * The `not` filter checks that the path doesn't match the provided value\n\t * exactly. It takes a single value for a field or an array (only for tags).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#not}\n\t */\n\tnot: pathWithArgsFilter<[value: string | number | boolean | Date | string[]]>(\n\t\t\"not\",\n\t),\n\n\t/**\n\t * The `any` filter takes an array of values. It works exactly the same way as\n\t * the `at` operator, but checks whether the fragment matches any of the\n\t * values in the array.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#any}\n\t */\n\tany: pathWithArgsFilter<[values: (string | number | boolean | Date)[]]>(\n\t\t\"any\",\n\t),\n\n\t/**\n\t * The `in` filter is used specifically to retrieve an array of documents by\n\t * their IDs or UIDs. This filter is much more efficient at this than the any\n\t * filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#in}\n\t */\n\tin: pathWithArgsFilter<[values: string[]]>(\"in\"),\n\n\t/**\n\t * The `fulltext` filter provides two capabilities:\n\t *\n\t * 1. Checking if a certain string is anywhere inside a document (this is what\n\t * you should use to make your project's search engine feature)\n\t * 2. Checking if the string is contained inside a specific custom type’s Rich\n\t * Text or Key Text fragment.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#fulltext}\n\t */\n\tfulltext: pathWithArgsFilter<[searchTerms: string]>(\"fulltext\"),\n\n\t/**\n\t * The `has` filter checks whether a fragment has a value. It will return all\n\t * the documents of the specified type that contain a value for the specified\n\t * field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#has}\n\t */\n\thas: pathFilter(\"has\"),\n\n\t/**\n\t * The `missing` filter checks if a fragment doesn't have a value. It will\n\t * return all the documents of the specified type that do not contain a value\n\t * for the specified field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#missing}\n\t */\n\tmissing: pathFilter(\"missing\"),\n\n\t/**\n\t * The `similar` filter takes the ID of a document, and returns a list of\n\t * documents with similar content. This allows you to build an automated\n\t * content discovery feature (for example, a \"Related posts\" section).\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#similar}\n\t */\n\tsimilar: argsFilter<[id: string, value: number]>(\"similar\"),\n\n\t/**\n\t * The `geopoint.near` filter checks that the value in the path is within the\n\t * radius of the given coordinates.\n\t *\n\t * This filter will only work for a geopoint field.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#geopointnear}\n\t */\n\tgeopointNear:\n\t\tpathWithArgsFilter<[latitude: number, longitude: number, radius: number]>(\n\t\t\t\"geopoint.near\",\n\t\t),\n\n\t/**\n\t * The `number.lt` filter checks that the value in the number field is less\n\t * than the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numberlessthan}\n\t */\n\tnumberLessThan: pathWithArgsFilter<[value: number]>(\"number.lt\"),\n\n\t/**\n\t * The `number.gt` filter checks that the value in the number field is greater\n\t * than the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numbergreaterthan}\n\t */\n\tnumberGreaterThan: pathWithArgsFilter<[value: number]>(\"number.gt\"),\n\n\t/**\n\t * The `number.inRange` filter checks that the value in the path is within the\n\t * two values passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#numberinrange}\n\t */\n\tnumberInRange:\n\t\tpathWithArgsFilter<[lowerLimit: number, upperLimit: number]>(\n\t\t\t\"number.inRange\",\n\t\t),\n\n\t/**\n\t * The `date.after` filter checks that the value in the path is after the date\n\t * value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateAfter: pathWithArgsFilter<[date: string | number | Date]>(\"date.after\"),\n\n\t/**\n\t * The `date.before` filter checks that the value in the path is before the\n\t * date value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateBefore: pathWithArgsFilter<[date: string | number | Date]>(\"date.before\"),\n\n\t/**\n\t * The `date.between` filter checks that the value in the path is within the\n\t * date values passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateBetween:\n\t\tpathWithArgsFilter<\n\t\t\t[startDate: string | number | Date, endDate: string | number | Date]\n\t\t>(\"date.between\"),\n\n\t/**\n\t * The `date.day-of-month` filter checks that the value in the path is equal\n\t * to the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonth: pathWithArgsFilter<[day: number]>(\"date.day-of-month\"),\n\n\t/**\n\t * The `date.day-of-month-after` filter checks that the value in the path is\n\t * after the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonthAfter: pathWithArgsFilter<[day: number]>(\n\t\t\"date.day-of-month-after\",\n\t),\n\n\t/**\n\t * The `date.day-of-month-before` filter checks that the value in the path is\n\t * before the day of the month passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfMonthBefore: pathWithArgsFilter<[day: number]>(\n\t\t\"date.day-of-month-before\",\n\t),\n\n\t/**\n\t * The `date.day-of-week` filter checks that the value in the path is equal to\n\t * the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeek: pathWithArgsFilter<[day: string | number]>(\"date.day-of-week\"),\n\n\t/**\n\t * The `date.day-of-week-after` filter checks that the value in the path is\n\t * after the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeekAfter: pathWithArgsFilter<[day: string | number]>(\n\t\t\"date.day-of-week-after\",\n\t),\n\n\t/**\n\t * The date.day-of-week-before filter checks that the value in the path is\n\t * before the day of the week passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateDayOfWeekBefore: pathWithArgsFilter<[day: string | number]>(\n\t\t\"date.day-of-week-before\",\n\t),\n\n\t/**\n\t * The `date.month` filter checks that the value in the path occurs in the\n\t * month value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonth: pathWithArgsFilter<[month: string | number]>(\"date.month\"),\n\n\t/**\n\t * The `date.month-after` filter checks that the value in the path occurs in\n\t * any month after the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonthAfter:\n\t\tpathWithArgsFilter<[month: string | number]>(\"date.month-after\"),\n\n\t/**\n\t * The `date.month-before` filter checks that the value in the path occurs in\n\t * any month before the value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateMonthBefore:\n\t\tpathWithArgsFilter<[month: string | number]>(\"date.month-before\"),\n\n\t/**\n\t * The `date.year` filter checks that the value in the path occurs in the year\n\t * value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateYear: pathWithArgsFilter<[year: number]>(\"date.year\"),\n\n\t/**\n\t * The `date.hour` filter checks that the value in the path occurs within the\n\t * hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHour: pathWithArgsFilter<[hour: number]>(\"date.hour\"),\n\n\t/**\n\t * The `date.hour-after` filter checks that the value in the path occurs after\n\t * the hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHourAfter: pathWithArgsFilter<[hour: number]>(\"date.hour-after\"),\n\n\t/**\n\t * The `date.hour-before` filter checks that the value in the path occurs\n\t * before the hour value passed into the filter.\n\t *\n\t * {@link https://prismic.io/docs/rest-api-technical-reference#date-filters}\n\t */\n\tdateHourBefore: pathWithArgsFilter<[hour: number]>(\"date.hour-before\"),\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,eACL,UAMY;AACZ,KAAI,MAAM,QAAQ,MAAM,CACvB,QAAO,IAAI,MAAM,IAAI,YAAY,CAAC,KAAK,KAAK,CAAC;AAG9C,KAAI,OAAO,UAAU,SACpB,QAAO,IAAI,MAAM;AAGlB,KAAI,iBAAiB,KACpB,QAAO,GAAG,MAAM,SAAS;AAG1B,QAAO,GAAG;;;;;;;;;;;AAYX,MAAM,sBAA8C,SAAiB;;;;CAIpE,MAAM,MAAM,MAAc,GAAG,SAAuB;EACnD,MAAM,gBAAgB,KAAK,IAAI,YAAY,CAAC,KAAK,KAAK;AAGtD,SAAO,IAAI,KAAK,GAAG,OAFJ,QAAQ,KAAK,SAAS,OAAO,KAET,cAAc;;AAGlD,QAAO;;;;;;;;;AAUR,MAAM,cAAc,SAAiB;CACpC,MAAM,WAAW,mBAAmB,KAAK;;;;CAKzC,MAAM,MAAM,SAAyB;AACpC,SAAO,SAAS,KAAK;;AAGtB,QAAO;;;;;;;;;;AAWR,MAAM,cAAsC,SAAiB;CAC5D,MAAM,WAAW,mBAAyB,KAAK;;;;CAK/C,MAAM,MAAM,GAAG,SAAuB;AACrC,SAAO,SAAS,IAAI,GAAG,KAAK;;AAG7B,QAAO;;AAGR,MAAa,SAAS;CAOrB,IAAI,mBACH,KACA;CAQD,KAAK,mBACJ,MACA;CASD,KAAK,mBACJ,MACA;CASD,IAAI,mBAAuC,KAAK;CAYhD,UAAU,mBAA0C,WAAW;CAS/D,KAAK,WAAW,MAAM;CAStB,SAAS,WAAW,UAAU;CAS9B,SAAS,WAAwC,UAAU;CAU3D,cACC,mBACC,gBACA;CAQF,gBAAgB,mBAAoC,YAAY;CAQhE,mBAAmB,mBAAoC,YAAY;CAQnE,eACC,mBACC,iBACA;CAQF,WAAW,mBAAmD,aAAa;CAQ3E,YAAY,mBAAmD,cAAc;CAQ7E,aACC,mBAEE,eAAe;CAQlB,gBAAgB,mBAAkC,oBAAoB;CAQtE,qBAAqB,mBACpB,0BACA;CAQD,sBAAsB,mBACrB,2BACA;CAQD,eAAe,mBAA2C,mBAAmB;CAQ7E,oBAAoB,mBACnB,yBACA;CAQD,qBAAqB,mBACpB,0BACA;CAQD,WAAW,mBAA6C,aAAa;CAQrE,gBACC,mBAA6C,mBAAmB;CAQjE,iBACC,mBAA6C,oBAAoB;CAQlE,UAAU,mBAAmC,YAAY;CAQzD,UAAU,mBAAmC,YAAY;CAQzD,eAAe,mBAAmC,kBAAkB;CAQpE,gBAAgB,mBAAmC,mBAAmB;CACtE"}
@@ -1,13 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const PrismicError = require("./errors/PrismicError.cjs");
4
- const isRepositoryName = require("./isRepositoryName.cjs");
1
+ const require_PrismicError = require('./errors/PrismicError.cjs');
2
+ const require_isRepositoryName = require('./isRepositoryName.cjs');
3
+
4
+ //#region src/getGraphQLEndpoint.ts
5
+ /**
6
+ * Get a repository's Prismic GraphQL endpoint.
7
+ *
8
+ * @typeParam RepositoryName - Name of the Prismic repository.
9
+ *
10
+ * @param repositoryName - Name of the repository.
11
+ *
12
+ * @returns The repository's Prismic REST API V2 endpoint
13
+ */
5
14
  const getGraphQLEndpoint = (repositoryName) => {
6
- if (isRepositoryName.isRepositoryName(repositoryName)) {
7
- return `https://${repositoryName}.cdn.prismic.io/graphql`;
8
- } else {
9
- throw new PrismicError.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
10
- }
15
+ if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/graphql`;
16
+ else throw new require_PrismicError.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
11
17
  };
18
+
19
+ //#endregion
12
20
  exports.getGraphQLEndpoint = getGraphQLEndpoint;
13
- //# sourceMappingURL=getGraphQLEndpoint.cjs.map
21
+ //# sourceMappingURL=getGraphQLEndpoint.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getGraphQLEndpoint.cjs","sources":["../../src/getGraphQLEndpoint.ts"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError\"\n\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Get a repository's Prismic GraphQL endpoint.\n *\n * @typeParam RepositoryName - Name of the Prismic repository.\n *\n * @param repositoryName - Name of the repository.\n *\n * @returns The repository's Prismic REST API V2 endpoint\n */\nexport const getGraphQLEndpoint = <RepositoryName extends string>(\n\trepositoryName: RepositoryName,\n): `https://${RepositoryName}.cdn.prismic.io/graphql` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://${repositoryName}.cdn.prismic.io/graphql` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"names":["isRepositoryName","PrismicError"],"mappings":";;;;AAaa,MAAA,qBAAqB,CACjC,mBACuD;AACnD,MAAAA,iBAAAA,iBAAiB,cAAc,GAAG;AACrC,WAAO,WAAW,cAAc;AAAA,EAAA,OAC1B;AACN,UAAM,IAAIC,aACT,aAAA,iDAAiD,cAAc,IAC/D,QACA,MAAS;AAAA,EAAA;AAGZ;;"}
1
+ {"version":3,"file":"getGraphQLEndpoint.cjs","names":["isRepositoryName","PrismicError"],"sources":["../src/getGraphQLEndpoint.ts"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError\"\n\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Get a repository's Prismic GraphQL endpoint.\n *\n * @typeParam RepositoryName - Name of the Prismic repository.\n *\n * @param repositoryName - Name of the repository.\n *\n * @returns The repository's Prismic REST API V2 endpoint\n */\nexport const getGraphQLEndpoint = <RepositoryName extends string>(\n\trepositoryName: RepositoryName,\n): `https://${RepositoryName}.cdn.prismic.io/graphql` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://${repositoryName}.cdn.prismic.io/graphql` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,sBACZ,mBACwD;AACxD,KAAIA,0CAAiB,eAAe,CACnC,QAAO,WAAW,eAAe;KAEjC,OAAM,IAAIC,kCACT,iDAAiD,kBACjD,QACA,OACA"}
@@ -0,0 +1,14 @@
1
+ //#region src/getGraphQLEndpoint.d.ts
2
+ /**
3
+ * Get a repository's Prismic GraphQL endpoint.
4
+ *
5
+ * @typeParam RepositoryName - Name of the Prismic repository.
6
+ *
7
+ * @param repositoryName - Name of the repository.
8
+ *
9
+ * @returns The repository's Prismic REST API V2 endpoint
10
+ */
11
+ declare const getGraphQLEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/graphql`;
12
+ //#endregion
13
+ export { getGraphQLEndpoint };
14
+ //# sourceMappingURL=getGraphQLEndpoint.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGraphQLEndpoint.d.cts","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"sourcesContent":[],"mappings":";;AAaA;;;;;;;;cAAa,oEACI,8BACH"}
@@ -1,3 +1,4 @@
1
+ //#region src/getGraphQLEndpoint.d.ts
1
2
  /**
2
3
  * Get a repository's Prismic GraphQL endpoint.
3
4
  *
@@ -7,4 +8,7 @@
7
8
  *
8
9
  * @returns The repository's Prismic REST API V2 endpoint
9
10
  */
10
- export declare const getGraphQLEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/graphql`;
11
+ declare const getGraphQLEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/graphql`;
12
+ //#endregion
13
+ export { getGraphQLEndpoint };
14
+ //# sourceMappingURL=getGraphQLEndpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGraphQLEndpoint.d.ts","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"sourcesContent":[],"mappings":";;AAaA;;;;;;;;cAAa,oEACI,8BACH"}
@@ -1,13 +1,21 @@
1
1
  import { PrismicError } from "./errors/PrismicError.js";
2
2
  import { isRepositoryName } from "./isRepositoryName.js";
3
+
4
+ //#region src/getGraphQLEndpoint.ts
5
+ /**
6
+ * Get a repository's Prismic GraphQL endpoint.
7
+ *
8
+ * @typeParam RepositoryName - Name of the Prismic repository.
9
+ *
10
+ * @param repositoryName - Name of the repository.
11
+ *
12
+ * @returns The repository's Prismic REST API V2 endpoint
13
+ */
3
14
  const getGraphQLEndpoint = (repositoryName) => {
4
- if (isRepositoryName(repositoryName)) {
5
- return `https://${repositoryName}.cdn.prismic.io/graphql`;
6
- } else {
7
- throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
8
- }
15
+ if (isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/graphql`;
16
+ else throw new PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
9
17
  };
10
- export {
11
- getGraphQLEndpoint
12
- };
13
- //# sourceMappingURL=getGraphQLEndpoint.js.map
18
+
19
+ //#endregion
20
+ export { getGraphQLEndpoint };
21
+ //# sourceMappingURL=getGraphQLEndpoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getGraphQLEndpoint.js","sources":["../../src/getGraphQLEndpoint.ts"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError\"\n\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Get a repository's Prismic GraphQL endpoint.\n *\n * @typeParam RepositoryName - Name of the Prismic repository.\n *\n * @param repositoryName - Name of the repository.\n *\n * @returns The repository's Prismic REST API V2 endpoint\n */\nexport const getGraphQLEndpoint = <RepositoryName extends string>(\n\trepositoryName: RepositoryName,\n): `https://${RepositoryName}.cdn.prismic.io/graphql` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://${repositoryName}.cdn.prismic.io/graphql` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";;AAaa,MAAA,qBAAqB,CACjC,mBACuD;AACnD,MAAA,iBAAiB,cAAc,GAAG;AACrC,WAAO,WAAW,cAAc;AAAA,EAAA,OAC1B;AACN,UAAM,IAAI,aACT,iDAAiD,cAAc,IAC/D,QACA,MAAS;AAAA,EAAA;AAGZ;"}
1
+ {"version":3,"file":"getGraphQLEndpoint.js","names":[],"sources":["../src/getGraphQLEndpoint.ts"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError\"\n\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Get a repository's Prismic GraphQL endpoint.\n *\n * @typeParam RepositoryName - Name of the Prismic repository.\n *\n * @param repositoryName - Name of the repository.\n *\n * @returns The repository's Prismic REST API V2 endpoint\n */\nexport const getGraphQLEndpoint = <RepositoryName extends string>(\n\trepositoryName: RepositoryName,\n): `https://${RepositoryName}.cdn.prismic.io/graphql` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://${repositoryName}.cdn.prismic.io/graphql` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,sBACZ,mBACwD;AACxD,KAAI,iBAAiB,eAAe,CACnC,QAAO,WAAW,eAAe;KAEjC,OAAM,IAAI,aACT,iDAAiD,kBACjD,QACA,OACA"}
@@ -1,13 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const PrismicError = require("./errors/PrismicError.cjs");
4
- const isRepositoryName = require("./isRepositoryName.cjs");
1
+ const require_PrismicError = require('./errors/PrismicError.cjs');
2
+ const require_isRepositoryName = require('./isRepositoryName.cjs');
3
+
4
+ //#region src/getRepositoryEndpoint.ts
5
+ /**
6
+ * Get a repository's Prismic Content API endpoint.
7
+ *
8
+ * @example
9
+ *
10
+ * ```ts
11
+ * getRepositoryEndpoint("my-repo")
12
+ * // => "https://my-repo.cdn.prismic.io/api/v2"
13
+ * ```
14
+ *
15
+ * @typeParam RepositoryName - Name of the Prismic repository.
16
+ *
17
+ * @param repositoryName - Name of the repository.
18
+ *
19
+ * @returns The repository's Prismic Content API endpoint.
20
+ *
21
+ * @throws {@link Error} Thrown if an invalid repository name is provided.
22
+ */
5
23
  const getRepositoryEndpoint = (repositoryName) => {
6
- if (isRepositoryName.isRepositoryName(repositoryName)) {
7
- return `https://${repositoryName}.cdn.prismic.io/api/v2`;
8
- } else {
9
- throw new PrismicError.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
10
- }
24
+ if (require_isRepositoryName.isRepositoryName(repositoryName)) return `https://${repositoryName}.cdn.prismic.io/api/v2`;
25
+ else throw new require_PrismicError.PrismicError(`An invalid Prismic repository name was given: ${repositoryName}`, void 0, void 0);
11
26
  };
27
+
28
+ //#endregion
12
29
  exports.getRepositoryEndpoint = getRepositoryEndpoint;
13
- //# sourceMappingURL=getRepositoryEndpoint.cjs.map
30
+ //# sourceMappingURL=getRepositoryEndpoint.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getRepositoryEndpoint.cjs","sources":["../../src/getRepositoryEndpoint.ts"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError\"\n\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Get a repository's Prismic Rest API V2 endpoint.\n *\n * @typeParam RepositoryName - Name of the Prismic repository.\n *\n * @param repositoryName - Name of the repository.\n *\n * @returns The repository's Prismic Rest API V2 endpoint\n *\n * @throws {@link Error} Thrown if an invalid repository name is provided.\n */\nexport const getRepositoryEndpoint = <RepositoryName extends string>(\n\trepositoryName: RepositoryName,\n): `https://${RepositoryName}.cdn.prismic.io/api/v2` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://${repositoryName}.cdn.prismic.io/api/v2` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"names":["isRepositoryName","PrismicError"],"mappings":";;;;AAea,MAAA,wBAAwB,CACpC,mBACsD;AAClD,MAAAA,iBAAAA,iBAAiB,cAAc,GAAG;AACrC,WAAO,WAAW,cAAc;AAAA,EAAA,OAC1B;AACN,UAAM,IAAIC,aACT,aAAA,iDAAiD,cAAc,IAC/D,QACA,MAAS;AAAA,EAAA;AAGZ;;"}
1
+ {"version":3,"file":"getRepositoryEndpoint.cjs","names":["isRepositoryName","PrismicError"],"sources":["../src/getRepositoryEndpoint.ts"],"sourcesContent":["import { PrismicError } from \"./errors/PrismicError\"\n\nimport { isRepositoryName } from \"./isRepositoryName\"\n\n/**\n * Get a repository's Prismic Content API endpoint.\n *\n * @example\n *\n * ```ts\n * getRepositoryEndpoint(\"my-repo\")\n * // => \"https://my-repo.cdn.prismic.io/api/v2\"\n * ```\n *\n * @typeParam RepositoryName - Name of the Prismic repository.\n *\n * @param repositoryName - Name of the repository.\n *\n * @returns The repository's Prismic Content API endpoint.\n *\n * @throws {@link Error} Thrown if an invalid repository name is provided.\n */\nexport const getRepositoryEndpoint = <RepositoryName extends string>(\n\trepositoryName: RepositoryName,\n): `https://${RepositoryName}.cdn.prismic.io/api/v2` => {\n\tif (isRepositoryName(repositoryName)) {\n\t\treturn `https://${repositoryName}.cdn.prismic.io/api/v2` as const\n\t} else {\n\t\tthrow new PrismicError(\n\t\t\t`An invalid Prismic repository name was given: ${repositoryName}`,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,yBACZ,mBACuD;AACvD,KAAIA,0CAAiB,eAAe,CACnC,QAAO,WAAW,eAAe;KAEjC,OAAM,IAAIC,kCACT,iDAAiD,kBACjD,QACA,OACA"}
@@ -0,0 +1,23 @@
1
+ //#region src/getRepositoryEndpoint.d.ts
2
+ /**
3
+ * Get a repository's Prismic Content API endpoint.
4
+ *
5
+ * @example
6
+ *
7
+ * ```ts
8
+ * getRepositoryEndpoint("my-repo")
9
+ * // => "https://my-repo.cdn.prismic.io/api/v2"
10
+ * ```
11
+ *
12
+ * @typeParam RepositoryName - Name of the Prismic repository.
13
+ *
14
+ * @param repositoryName - Name of the repository.
15
+ *
16
+ * @returns The repository's Prismic Content API endpoint.
17
+ *
18
+ * @throws {@link Error} Thrown if an invalid repository name is provided.
19
+ */
20
+ declare const getRepositoryEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
21
+ //#endregion
22
+ export { getRepositoryEndpoint };
23
+ //# sourceMappingURL=getRepositoryEndpoint.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRepositoryEndpoint.d.cts","names":[],"sources":["../src/getRepositoryEndpoint.ts"],"sourcesContent":[],"mappings":";;AAsBA;;;;;;;;;;;;;;;;;cAAa,uEACI,8BACH"}
@@ -1,12 +1,23 @@
1
+ //#region src/getRepositoryEndpoint.d.ts
1
2
  /**
2
- * Get a repository's Prismic Rest API V2 endpoint.
3
+ * Get a repository's Prismic Content API endpoint.
4
+ *
5
+ * @example
6
+ *
7
+ * ```ts
8
+ * getRepositoryEndpoint("my-repo")
9
+ * // => "https://my-repo.cdn.prismic.io/api/v2"
10
+ * ```
3
11
  *
4
12
  * @typeParam RepositoryName - Name of the Prismic repository.
5
13
  *
6
14
  * @param repositoryName - Name of the repository.
7
15
  *
8
- * @returns The repository's Prismic Rest API V2 endpoint
16
+ * @returns The repository's Prismic Content API endpoint.
9
17
  *
10
18
  * @throws {@link Error} Thrown if an invalid repository name is provided.
11
19
  */
12
- export declare const getRepositoryEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
20
+ declare const getRepositoryEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
21
+ //#endregion
22
+ export { getRepositoryEndpoint };
23
+ //# sourceMappingURL=getRepositoryEndpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRepositoryEndpoint.d.ts","names":[],"sources":["../src/getRepositoryEndpoint.ts"],"sourcesContent":[],"mappings":";;AAsBA;;;;;;;;;;;;;;;;;cAAa,uEACI,8BACH"}