prismic-ts-codegen 0.1.28 → 0.1.29

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 (811) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/cli/configSchema.cjs +29 -36
  3. package/dist/cli/configSchema.cjs.map +1 -1
  4. package/dist/cli/configSchema.d.cts +39 -0
  5. package/dist/cli/configSchema.d.cts.map +1 -0
  6. package/dist/cli/configSchema.d.ts +39 -3
  7. package/dist/cli/configSchema.d.ts.map +1 -0
  8. package/dist/cli/configSchema.js +29 -37
  9. package/dist/cli/configSchema.js.map +1 -1
  10. package/dist/cli/constants.cjs +4 -3
  11. package/dist/cli/constants.cjs.map +1 -1
  12. package/dist/cli/constants.d.cts +5 -0
  13. package/dist/cli/constants.d.cts.map +1 -0
  14. package/dist/cli/constants.d.ts +5 -1
  15. package/dist/cli/constants.d.ts.map +1 -0
  16. package/dist/cli/constants.js +5 -4
  17. package/dist/cli/constants.js.map +1 -1
  18. package/dist/cli/loadConfig.cjs +17 -27
  19. package/dist/cli/loadConfig.cjs.map +1 -1
  20. package/dist/cli/loadConfig.js +13 -25
  21. package/dist/cli/loadConfig.js.map +1 -1
  22. package/dist/cli/loadLocaleIDs.cjs +18 -17
  23. package/dist/cli/loadLocaleIDs.cjs.map +1 -1
  24. package/dist/cli/loadLocaleIDs.js +16 -18
  25. package/dist/cli/loadLocaleIDs.js.map +1 -1
  26. package/dist/cli/loadModels.cjs +45 -70
  27. package/dist/cli/loadModels.cjs.map +1 -1
  28. package/dist/cli/loadModels.js +40 -52
  29. package/dist/cli/loadModels.js.map +1 -1
  30. package/dist/cli.cjs +78 -91
  31. package/dist/cli.cjs.map +1 -1
  32. package/dist/cli.d.cts +1 -0
  33. package/dist/cli.d.ts +1 -0
  34. package/dist/cli.js +68 -81
  35. package/dist/cli.js.map +1 -1
  36. package/dist/constants.cjs +26 -25
  37. package/dist/constants.cjs.map +1 -1
  38. package/dist/constants.js +27 -28
  39. package/dist/constants.js.map +1 -1
  40. package/dist/detectTypesProvider.cjs +22 -17
  41. package/dist/detectTypesProvider.cjs.map +1 -1
  42. package/dist/detectTypesProvider.d.cts +17 -0
  43. package/dist/detectTypesProvider.d.cts.map +1 -0
  44. package/dist/detectTypesProvider.d.ts +10 -6
  45. package/dist/detectTypesProvider.d.ts.map +1 -0
  46. package/dist/detectTypesProvider.js +21 -17
  47. package/dist/detectTypesProvider.js.map +1 -1
  48. package/dist/generateTypes.cjs +76 -85
  49. package/dist/generateTypes.cjs.map +1 -1
  50. package/dist/generateTypes.d.cts +21 -0
  51. package/dist/generateTypes.d.cts.map +1 -0
  52. package/dist/generateTypes.d.ts +20 -15
  53. package/dist/generateTypes.d.ts.map +1 -0
  54. package/dist/generateTypes.js +70 -81
  55. package/dist/generateTypes.js.map +1 -1
  56. package/dist/index.cjs +6 -8
  57. package/dist/index.d.cts +5 -0
  58. package/dist/index.d.ts +5 -6
  59. package/dist/index.js +1 -6
  60. package/dist/lib/addBlankLine.cjs +7 -9
  61. package/dist/lib/addBlankLine.cjs.map +1 -1
  62. package/dist/lib/addBlankLine.js +7 -9
  63. package/dist/lib/addBlankLine.js.map +1 -1
  64. package/dist/lib/addLine.cjs +6 -5
  65. package/dist/lib/addLine.cjs.map +1 -1
  66. package/dist/lib/addLine.js +6 -5
  67. package/dist/lib/addLine.js.map +1 -1
  68. package/dist/lib/addSection.cjs +6 -5
  69. package/dist/lib/addSection.cjs.map +1 -1
  70. package/dist/lib/addSection.js +6 -5
  71. package/dist/lib/addSection.js.map +1 -1
  72. package/dist/lib/addTrailingNewLine.cjs +6 -8
  73. package/dist/lib/addTrailingNewLine.cjs.map +1 -1
  74. package/dist/lib/addTrailingNewLine.js +7 -9
  75. package/dist/lib/addTrailingNewLine.js.map +1 -1
  76. package/dist/lib/buildCustomTypeDataType.cjs +41 -44
  77. package/dist/lib/buildCustomTypeDataType.cjs.map +1 -1
  78. package/dist/lib/buildCustomTypeDataType.js +39 -43
  79. package/dist/lib/buildCustomTypeDataType.js.map +1 -1
  80. package/dist/lib/buildCustomTypeType.cjs +50 -50
  81. package/dist/lib/buildCustomTypeType.cjs.map +1 -1
  82. package/dist/lib/buildCustomTypeType.js +44 -45
  83. package/dist/lib/buildCustomTypeType.js.map +1 -1
  84. package/dist/lib/buildFieldDocs.cjs +59 -92
  85. package/dist/lib/buildFieldDocs.cjs.map +1 -1
  86. package/dist/lib/buildFieldDocs.js +56 -89
  87. package/dist/lib/buildFieldDocs.js.map +1 -1
  88. package/dist/lib/buildFieldProperties.cjs +255 -309
  89. package/dist/lib/buildFieldProperties.cjs.map +1 -1
  90. package/dist/lib/buildFieldProperties.js +249 -304
  91. package/dist/lib/buildFieldProperties.js.map +1 -1
  92. package/dist/lib/buildSharedSliceType.cjs +106 -109
  93. package/dist/lib/buildSharedSliceType.cjs.map +1 -1
  94. package/dist/lib/buildSharedSliceType.js +98 -102
  95. package/dist/lib/buildSharedSliceType.js.map +1 -1
  96. package/dist/lib/buildTypeName.cjs +9 -11
  97. package/dist/lib/buildTypeName.cjs.map +1 -1
  98. package/dist/lib/buildTypeName.js +8 -11
  99. package/dist/lib/buildTypeName.js.map +1 -1
  100. package/dist/lib/buildUnion.cjs +5 -4
  101. package/dist/lib/buildUnion.cjs.map +1 -1
  102. package/dist/lib/buildUnion.js +6 -5
  103. package/dist/lib/buildUnion.js.map +1 -1
  104. package/dist/lib/checkHasUIDFIeld.cjs +5 -4
  105. package/dist/lib/checkHasUIDFIeld.cjs.map +1 -1
  106. package/dist/lib/checkHasUIDFIeld.js +6 -5
  107. package/dist/lib/checkHasUIDFIeld.js.map +1 -1
  108. package/dist/lib/getAPIIDPath.cjs +21 -23
  109. package/dist/lib/getAPIIDPath.cjs.map +1 -1
  110. package/dist/lib/getAPIIDPath.js +22 -24
  111. package/dist/lib/getAPIIDPath.js.map +1 -1
  112. package/dist/lib/getCacheKey.cjs +14 -22
  113. package/dist/lib/getCacheKey.cjs.map +1 -1
  114. package/dist/lib/getCacheKey.js +12 -5
  115. package/dist/lib/getCacheKey.js.map +1 -1
  116. package/dist/lib/getHumanReadableModelName.cjs +12 -17
  117. package/dist/lib/getHumanReadableModelName.cjs.map +1 -1
  118. package/dist/lib/getHumanReadableModelName.js +13 -18
  119. package/dist/lib/getHumanReadableModelName.js.map +1 -1
  120. package/dist/lib/getHumanReadablePath.cjs +13 -16
  121. package/dist/lib/getHumanReadablePath.cjs.map +1 -1
  122. package/dist/lib/getHumanReadablePath.js +13 -16
  123. package/dist/lib/getHumanReadablePath.js.map +1 -1
  124. package/dist/types.d.cts +14 -0
  125. package/dist/types.d.cts.map +1 -0
  126. package/dist/types.d.ts +13 -21
  127. package/dist/types.d.ts.map +1 -0
  128. package/package.json +35 -49
  129. package/src/cli/configSchema.ts +181 -50
  130. package/src/cli/constants.ts +1 -2
  131. package/src/cli/index.ts +14 -24
  132. package/src/cli/loadConfig.ts +5 -9
  133. package/src/cli/loadLocaleIDs.ts +1 -3
  134. package/src/cli/loadModels.ts +8 -10
  135. package/src/constants.ts +1 -2
  136. package/src/detectTypesProvider.ts +3 -8
  137. package/src/generateTypes.ts +3 -10
  138. package/src/index.ts +1 -2
  139. package/src/lib/addBlankLine.ts +1 -1
  140. package/src/lib/addLine.ts +1 -1
  141. package/src/lib/addSection.ts +1 -1
  142. package/src/lib/addTrailingNewLine.ts +1 -4
  143. package/src/lib/buildCustomTypeDataType.ts +1 -3
  144. package/src/lib/buildCustomTypeType.ts +4 -6
  145. package/src/lib/buildFieldDocs.ts +7 -23
  146. package/src/lib/buildFieldProperties.ts +25 -66
  147. package/src/lib/buildSharedSliceType.ts +8 -10
  148. package/src/lib/buildTypeName.ts +1 -1
  149. package/src/lib/buildUnion.ts +1 -1
  150. package/src/lib/getAPIIDPath.ts +2 -2
  151. package/src/lib/getCacheKey.ts +1 -3
  152. package/src/lib/getHumanReadableModelName.ts +2 -8
  153. package/src/lib/getHumanReadablePath.ts +2 -3
  154. package/src/types.ts +1 -5
  155. package/dist/_node_modules/@babel/code-frame/lib/index.cjs +0 -217
  156. package/dist/_node_modules/@babel/code-frame/lib/index.cjs.map +0 -1
  157. package/dist/_node_modules/@babel/code-frame/lib/index.js +0 -216
  158. package/dist/_node_modules/@babel/code-frame/lib/index.js.map +0 -1
  159. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs +0 -82
  160. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs.map +0 -1
  161. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js +0 -83
  162. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +0 -1
  163. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +0 -62
  164. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs.map +0 -1
  165. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +0 -61
  166. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js.map +0 -1
  167. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs +0 -35
  168. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs.map +0 -1
  169. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js +0 -36
  170. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +0 -1
  171. package/dist/_node_modules/@prismicio/client/dist/Client.cjs +0 -1231
  172. package/dist/_node_modules/@prismicio/client/dist/Client.cjs.map +0 -1
  173. package/dist/_node_modules/@prismicio/client/dist/Client.js +0 -1231
  174. package/dist/_node_modules/@prismicio/client/dist/Client.js.map +0 -1
  175. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs +0 -66
  176. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.cjs.map +0 -1
  177. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js +0 -66
  178. package/dist/_node_modules/@prismicio/client/dist/buildQueryURL.js.map +0 -1
  179. package/dist/_node_modules/@prismicio/client/dist/cookie.cjs +0 -5
  180. package/dist/_node_modules/@prismicio/client/dist/cookie.cjs.map +0 -1
  181. package/dist/_node_modules/@prismicio/client/dist/cookie.js +0 -5
  182. package/dist/_node_modules/@prismicio/client/dist/cookie.js.map +0 -1
  183. package/dist/_node_modules/@prismicio/client/dist/createClient.cjs +0 -6
  184. package/dist/_node_modules/@prismicio/client/dist/createClient.cjs.map +0 -1
  185. package/dist/_node_modules/@prismicio/client/dist/createClient.js +0 -6
  186. package/dist/_node_modules/@prismicio/client/dist/createClient.js.map +0 -1
  187. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs +0 -7
  188. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.cjs.map +0 -1
  189. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js +0 -7
  190. package/dist/_node_modules/@prismicio/client/dist/errors/ForbiddenError.js.map +0 -1
  191. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs +0 -7
  192. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.cjs.map +0 -1
  193. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js +0 -7
  194. package/dist/_node_modules/@prismicio/client/dist/errors/NotFoundError.js.map +0 -1
  195. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs +0 -7
  196. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.cjs.map +0 -1
  197. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js +0 -7
  198. package/dist/_node_modules/@prismicio/client/dist/errors/ParsingError.js.map +0 -1
  199. package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.cjs +0 -7
  200. package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.cjs.map +0 -1
  201. package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.js +0 -7
  202. package/dist/_node_modules/@prismicio/client/dist/errors/PreviewTokenExpired.js.map +0 -1
  203. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs +0 -16
  204. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.cjs.map +0 -1
  205. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js +0 -16
  206. package/dist/_node_modules/@prismicio/client/dist/errors/PrismicError.js.map +0 -1
  207. package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.cjs +0 -7
  208. package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.cjs.map +0 -1
  209. package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.js +0 -7
  210. package/dist/_node_modules/@prismicio/client/dist/errors/RefExpiredError.js.map +0 -1
  211. package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.cjs +0 -7
  212. package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.cjs.map +0 -1
  213. package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.js +0 -7
  214. package/dist/_node_modules/@prismicio/client/dist/errors/RefNotFoundError.js.map +0 -1
  215. package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.cjs +0 -7
  216. package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.cjs.map +0 -1
  217. package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.js +0 -7
  218. package/dist/_node_modules/@prismicio/client/dist/errors/RepositoryNotFoundError.js.map +0 -1
  219. package/dist/_node_modules/@prismicio/client/dist/filter.cjs +0 -247
  220. package/dist/_node_modules/@prismicio/client/dist/filter.cjs.map +0 -1
  221. package/dist/_node_modules/@prismicio/client/dist/filter.js +0 -247
  222. package/dist/_node_modules/@prismicio/client/dist/filter.js.map +0 -1
  223. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs +0 -13
  224. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.cjs.map +0 -1
  225. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js +0 -13
  226. package/dist/_node_modules/@prismicio/client/dist/getRepositoryEndpoint.js.map +0 -1
  227. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs +0 -17
  228. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.cjs.map +0 -1
  229. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js +0 -17
  230. package/dist/_node_modules/@prismicio/client/dist/getRepositoryName.js.map +0 -1
  231. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +0 -47
  232. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +0 -1
  233. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +0 -47
  234. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +0 -1
  235. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +0 -27
  236. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +0 -1
  237. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +0 -27
  238. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +0 -1
  239. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs +0 -12
  240. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.cjs.map +0 -1
  241. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js +0 -12
  242. package/dist/_node_modules/@prismicio/client/dist/isRepositoryEndpoint.js.map +0 -1
  243. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs +0 -7
  244. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.cjs.map +0 -1
  245. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js +0 -7
  246. package/dist/_node_modules/@prismicio/client/dist/isRepositoryName.js.map +0 -1
  247. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs +0 -11
  248. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.cjs.map +0 -1
  249. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js +0 -11
  250. package/dist/_node_modules/@prismicio/client/dist/lib/appendFilters.js.map +0 -1
  251. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs +0 -7
  252. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.cjs.map +0 -1
  253. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js +0 -7
  254. package/dist/_node_modules/@prismicio/client/dist/lib/castArray.js.map +0 -1
  255. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs +0 -7
  256. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.cjs.map +0 -1
  257. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js +0 -7
  258. package/dist/_node_modules/@prismicio/client/dist/lib/castThunk.js.map +0 -1
  259. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs +0 -8
  260. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.cjs.map +0 -1
  261. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js +0 -8
  262. package/dist/_node_modules/@prismicio/client/dist/lib/devMsg.js.map +0 -1
  263. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs +0 -9
  264. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.cjs.map +0 -1
  265. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js +0 -9
  266. package/dist/_node_modules/@prismicio/client/dist/lib/everyTagFilter.js.map +0 -1
  267. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs +0 -8
  268. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.cjs.map +0 -1
  269. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js +0 -8
  270. package/dist/_node_modules/@prismicio/client/dist/lib/findMasterRef.js.map +0 -1
  271. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs +0 -12
  272. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.cjs.map +0 -1
  273. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js +0 -12
  274. package/dist/_node_modules/@prismicio/client/dist/lib/findRef.js.map +0 -1
  275. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs +0 -8
  276. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.cjs.map +0 -1
  277. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js +0 -8
  278. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByID.js.map +0 -1
  279. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs +0 -8
  280. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.cjs.map +0 -1
  281. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js +0 -8
  282. package/dist/_node_modules/@prismicio/client/dist/lib/findRefByLabel.js.map +0 -1
  283. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs +0 -21
  284. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.cjs.map +0 -1
  285. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js +0 -21
  286. package/dist/_node_modules/@prismicio/client/dist/lib/getPreviewCookie.js.map +0 -1
  287. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs +0 -7
  288. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.cjs.map +0 -1
  289. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js +0 -7
  290. package/dist/_node_modules/@prismicio/client/dist/lib/minifyGraphQLQuery.js.map +0 -1
  291. package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.cjs +0 -49
  292. package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.cjs.map +0 -1
  293. package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.js +0 -49
  294. package/dist/_node_modules/@prismicio/client/dist/lib/pLimit.js.map +0 -1
  295. package/dist/_node_modules/@prismicio/client/dist/lib/request.cjs +0 -43
  296. package/dist/_node_modules/@prismicio/client/dist/lib/request.cjs.map +0 -1
  297. package/dist/_node_modules/@prismicio/client/dist/lib/request.js +0 -43
  298. package/dist/_node_modules/@prismicio/client/dist/lib/request.js.map +0 -1
  299. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs +0 -9
  300. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.cjs.map +0 -1
  301. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js +0 -9
  302. package/dist/_node_modules/@prismicio/client/dist/lib/someTagsFilter.js.map +0 -1
  303. package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.cjs +0 -17
  304. package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.cjs.map +0 -1
  305. package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.js +0 -17
  306. package/dist/_node_modules/@prismicio/client/dist/lib/throttledLog.js.map +0 -1
  307. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs +0 -8
  308. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.cjs.map +0 -1
  309. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js +0 -8
  310. package/dist/_node_modules/@prismicio/client/dist/lib/typeFilter.js.map +0 -1
  311. package/dist/_node_modules/@prismicio/client/dist/package.json.cjs +0 -5
  312. package/dist/_node_modules/@prismicio/client/dist/package.json.cjs.map +0 -1
  313. package/dist/_node_modules/@prismicio/client/dist/package.json.js +0 -5
  314. package/dist/_node_modules/@prismicio/client/dist/package.json.js.map +0 -1
  315. package/dist/_node_modules/@prismicio/client/dist/types/model/types.cjs +0 -39
  316. package/dist/_node_modules/@prismicio/client/dist/types/model/types.cjs.map +0 -1
  317. package/dist/_node_modules/@prismicio/client/dist/types/model/types.js +0 -39
  318. package/dist/_node_modules/@prismicio/client/dist/types/model/types.js.map +0 -1
  319. package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs +0 -10
  320. package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs.map +0 -1
  321. package/dist/_node_modules/@prismicio/client/dist/types/value/link.js +0 -10
  322. package/dist/_node_modules/@prismicio/client/dist/types/value/link.js.map +0 -1
  323. package/dist/_node_modules/arrify/index.cjs +0 -10
  324. package/dist/_node_modules/arrify/index.cjs.map +0 -1
  325. package/dist/_node_modules/arrify/index.js +0 -10
  326. package/dist/_node_modules/arrify/index.js.map +0 -1
  327. package/dist/_node_modules/camelcase/index.cjs +0 -83
  328. package/dist/_node_modules/camelcase/index.cjs.map +0 -1
  329. package/dist/_node_modules/camelcase/index.js +0 -84
  330. package/dist/_node_modules/camelcase/index.js.map +0 -1
  331. package/dist/_node_modules/camelcase-keys/index.cjs +0 -55
  332. package/dist/_node_modules/camelcase-keys/index.cjs.map +0 -1
  333. package/dist/_node_modules/camelcase-keys/index.js +0 -56
  334. package/dist/_node_modules/camelcase-keys/index.js.map +0 -1
  335. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +0 -41
  336. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +0 -1
  337. package/dist/_node_modules/data-uri-to-buffer/dist/index.js +0 -41
  338. package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
  339. package/dist/_node_modules/decamelize/index.cjs +0 -38
  340. package/dist/_node_modules/decamelize/index.cjs.map +0 -1
  341. package/dist/_node_modules/decamelize/index.js +0 -39
  342. package/dist/_node_modules/decamelize/index.js.map +0 -1
  343. package/dist/_node_modules/decamelize-keys/index.cjs +0 -50
  344. package/dist/_node_modules/decamelize-keys/index.cjs.map +0 -1
  345. package/dist/_node_modules/decamelize-keys/index.js +0 -51
  346. package/dist/_node_modules/decamelize-keys/index.js.map +0 -1
  347. package/dist/_node_modules/error-ex/index.cjs +0 -109
  348. package/dist/_node_modules/error-ex/index.cjs.map +0 -1
  349. package/dist/_node_modules/error-ex/index.js +0 -109
  350. package/dist/_node_modules/error-ex/index.js.map +0 -1
  351. package/dist/_node_modules/fetch-blob/file.cjs +0 -61
  352. package/dist/_node_modules/fetch-blob/file.cjs.map +0 -1
  353. package/dist/_node_modules/fetch-blob/file.js +0 -61
  354. package/dist/_node_modules/fetch-blob/file.js.map +0 -1
  355. package/dist/_node_modules/fetch-blob/index.cjs +0 -223
  356. package/dist/_node_modules/fetch-blob/index.cjs.map +0 -1
  357. package/dist/_node_modules/fetch-blob/index.js +0 -223
  358. package/dist/_node_modules/fetch-blob/index.js.map +0 -1
  359. package/dist/_node_modules/fetch-blob/streams.cjs +0 -43
  360. package/dist/_node_modules/fetch-blob/streams.cjs.map +0 -1
  361. package/dist/_node_modules/fetch-blob/streams.js +0 -42
  362. package/dist/_node_modules/fetch-blob/streams.js.map +0 -1
  363. package/dist/_node_modules/formdata-polyfill/esm.min.cjs +0 -116
  364. package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +0 -1
  365. package/dist/_node_modules/formdata-polyfill/esm.min.js +0 -116
  366. package/dist/_node_modules/formdata-polyfill/esm.min.js.map +0 -1
  367. package/dist/_node_modules/function-bind/implementation.cjs +0 -47
  368. package/dist/_node_modules/function-bind/implementation.cjs.map +0 -1
  369. package/dist/_node_modules/function-bind/implementation.js +0 -47
  370. package/dist/_node_modules/function-bind/implementation.js.map +0 -1
  371. package/dist/_node_modules/function-bind/index.cjs +0 -7
  372. package/dist/_node_modules/function-bind/index.cjs.map +0 -1
  373. package/dist/_node_modules/function-bind/index.js +0 -7
  374. package/dist/_node_modules/function-bind/index.js.map +0 -1
  375. package/dist/_node_modules/hard-rejection/index.cjs +0 -25
  376. package/dist/_node_modules/hard-rejection/index.cjs.map +0 -1
  377. package/dist/_node_modules/hard-rejection/index.js +0 -26
  378. package/dist/_node_modules/hard-rejection/index.js.map +0 -1
  379. package/dist/_node_modules/has/src/index.cjs +0 -7
  380. package/dist/_node_modules/has/src/index.cjs.map +0 -1
  381. package/dist/_node_modules/has/src/index.js +0 -7
  382. package/dist/_node_modules/has/src/index.js.map +0 -1
  383. package/dist/_node_modules/hosted-git-info/lib/from-url.cjs +0 -93
  384. package/dist/_node_modules/hosted-git-info/lib/from-url.cjs.map +0 -1
  385. package/dist/_node_modules/hosted-git-info/lib/from-url.js +0 -93
  386. package/dist/_node_modules/hosted-git-info/lib/from-url.js.map +0 -1
  387. package/dist/_node_modules/hosted-git-info/lib/hosts.cjs +0 -164
  388. package/dist/_node_modules/hosted-git-info/lib/hosts.cjs.map +0 -1
  389. package/dist/_node_modules/hosted-git-info/lib/hosts.js +0 -164
  390. package/dist/_node_modules/hosted-git-info/lib/hosts.js.map +0 -1
  391. package/dist/_node_modules/hosted-git-info/lib/index.cjs +0 -168
  392. package/dist/_node_modules/hosted-git-info/lib/index.cjs.map +0 -1
  393. package/dist/_node_modules/hosted-git-info/lib/index.js +0 -168
  394. package/dist/_node_modules/hosted-git-info/lib/index.js.map +0 -1
  395. package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs +0 -51
  396. package/dist/_node_modules/hosted-git-info/lib/parse-url.cjs.map +0 -1
  397. package/dist/_node_modules/hosted-git-info/lib/parse-url.js +0 -51
  398. package/dist/_node_modules/hosted-git-info/lib/parse-url.js.map +0 -1
  399. package/dist/_node_modules/indent-string/index.cjs +0 -34
  400. package/dist/_node_modules/indent-string/index.cjs.map +0 -1
  401. package/dist/_node_modules/indent-string/index.js +0 -35
  402. package/dist/_node_modules/indent-string/index.js.map +0 -1
  403. package/dist/_node_modules/is-arrayish/index.cjs +0 -10
  404. package/dist/_node_modules/is-arrayish/index.cjs.map +0 -1
  405. package/dist/_node_modules/is-arrayish/index.js +0 -10
  406. package/dist/_node_modules/is-arrayish/index.js.map +0 -1
  407. package/dist/_node_modules/is-core-module/core.json.cjs +0 -496
  408. package/dist/_node_modules/is-core-module/core.json.cjs.map +0 -1
  409. package/dist/_node_modules/is-core-module/core.json.js +0 -496
  410. package/dist/_node_modules/is-core-module/core.json.js.map +0 -1
  411. package/dist/_node_modules/is-core-module/index.cjs +0 -62
  412. package/dist/_node_modules/is-core-module/index.cjs.map +0 -1
  413. package/dist/_node_modules/is-core-module/index.js +0 -62
  414. package/dist/_node_modules/is-core-module/index.js.map +0 -1
  415. package/dist/_node_modules/is-plain-obj/index.cjs +0 -9
  416. package/dist/_node_modules/is-plain-obj/index.cjs.map +0 -1
  417. package/dist/_node_modules/is-plain-obj/index.js +0 -9
  418. package/dist/_node_modules/is-plain-obj/index.js.map +0 -1
  419. package/dist/_node_modules/js-tokens/index.cjs +0 -27
  420. package/dist/_node_modules/js-tokens/index.cjs.map +0 -1
  421. package/dist/_node_modules/js-tokens/index.js +0 -26
  422. package/dist/_node_modules/js-tokens/index.js.map +0 -1
  423. package/dist/_node_modules/json-parse-even-better-errors/index.cjs +0 -90
  424. package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +0 -1
  425. package/dist/_node_modules/json-parse-even-better-errors/index.js +0 -90
  426. package/dist/_node_modules/json-parse-even-better-errors/index.js.map +0 -1
  427. package/dist/_node_modules/kind-of/index.cjs +0 -129
  428. package/dist/_node_modules/kind-of/index.cjs.map +0 -1
  429. package/dist/_node_modules/kind-of/index.js +0 -129
  430. package/dist/_node_modules/kind-of/index.js.map +0 -1
  431. package/dist/_node_modules/lines-and-columns/build/index.cjs +0 -67
  432. package/dist/_node_modules/lines-and-columns/build/index.cjs.map +0 -1
  433. package/dist/_node_modules/lines-and-columns/build/index.js +0 -66
  434. package/dist/_node_modules/lines-and-columns/build/index.js.map +0 -1
  435. package/dist/_node_modules/lru-cache/index.cjs +0 -1015
  436. package/dist/_node_modules/lru-cache/index.cjs.map +0 -1
  437. package/dist/_node_modules/lru-cache/index.js +0 -1015
  438. package/dist/_node_modules/lru-cache/index.js.map +0 -1
  439. package/dist/_node_modules/map-obj/index.cjs +0 -49
  440. package/dist/_node_modules/map-obj/index.cjs.map +0 -1
  441. package/dist/_node_modules/map-obj/index.js +0 -50
  442. package/dist/_node_modules/map-obj/index.js.map +0 -1
  443. package/dist/_node_modules/meow/source/index.cjs +0 -88
  444. package/dist/_node_modules/meow/source/index.cjs.map +0 -1
  445. package/dist/_node_modules/meow/source/index.js +0 -89
  446. package/dist/_node_modules/meow/source/index.js.map +0 -1
  447. package/dist/_node_modules/meow/source/options.cjs +0 -83
  448. package/dist/_node_modules/meow/source/options.cjs.map +0 -1
  449. package/dist/_node_modules/meow/source/options.js +0 -83
  450. package/dist/_node_modules/meow/source/options.js.map +0 -1
  451. package/dist/_node_modules/meow/source/parser.cjs +0 -61
  452. package/dist/_node_modules/meow/source/parser.cjs.map +0 -1
  453. package/dist/_node_modules/meow/source/parser.js +0 -61
  454. package/dist/_node_modules/meow/source/parser.js.map +0 -1
  455. package/dist/_node_modules/meow/source/utils.cjs +0 -8
  456. package/dist/_node_modules/meow/source/utils.cjs.map +0 -1
  457. package/dist/_node_modules/meow/source/utils.js +0 -8
  458. package/dist/_node_modules/meow/source/utils.js.map +0 -1
  459. package/dist/_node_modules/meow/source/validate.cjs +0 -102
  460. package/dist/_node_modules/meow/source/validate.cjs.map +0 -1
  461. package/dist/_node_modules/meow/source/validate.js +0 -102
  462. package/dist/_node_modules/meow/source/validate.js.map +0 -1
  463. package/dist/_node_modules/min-indent/index.cjs +0 -12
  464. package/dist/_node_modules/min-indent/index.cjs.map +0 -1
  465. package/dist/_node_modules/min-indent/index.js +0 -13
  466. package/dist/_node_modules/min-indent/index.js.map +0 -1
  467. package/dist/_node_modules/minimist-options/index.cjs +0 -94
  468. package/dist/_node_modules/minimist-options/index.cjs.map +0 -1
  469. package/dist/_node_modules/minimist-options/index.js +0 -95
  470. package/dist/_node_modules/minimist-options/index.js.map +0 -1
  471. package/dist/_node_modules/node-domexception/index.cjs +0 -11
  472. package/dist/_node_modules/node-domexception/index.cjs.map +0 -1
  473. package/dist/_node_modules/node-domexception/index.js +0 -10
  474. package/dist/_node_modules/node-domexception/index.js.map +0 -1
  475. package/dist/_node_modules/node-fetch/src/body.cjs +0 -262
  476. package/dist/_node_modules/node-fetch/src/body.cjs.map +0 -1
  477. package/dist/_node_modules/node-fetch/src/body.js +0 -262
  478. package/dist/_node_modules/node-fetch/src/body.js.map +0 -1
  479. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +0 -10
  480. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +0 -1
  481. package/dist/_node_modules/node-fetch/src/errors/abort-error.js +0 -10
  482. package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +0 -1
  483. package/dist/_node_modules/node-fetch/src/errors/base.cjs +0 -17
  484. package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +0 -1
  485. package/dist/_node_modules/node-fetch/src/errors/base.js +0 -17
  486. package/dist/_node_modules/node-fetch/src/errors/base.js.map +0 -1
  487. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +0 -19
  488. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +0 -1
  489. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +0 -19
  490. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +0 -1
  491. package/dist/_node_modules/node-fetch/src/headers.cjs +0 -190
  492. package/dist/_node_modules/node-fetch/src/headers.cjs.map +0 -1
  493. package/dist/_node_modules/node-fetch/src/headers.js +0 -190
  494. package/dist/_node_modules/node-fetch/src/headers.js.map +0 -1
  495. package/dist/_node_modules/node-fetch/src/index.cjs +0 -292
  496. package/dist/_node_modules/node-fetch/src/index.cjs.map +0 -1
  497. package/dist/_node_modules/node-fetch/src/index.js +0 -292
  498. package/dist/_node_modules/node-fetch/src/index.js.map +0 -1
  499. package/dist/_node_modules/node-fetch/src/request.cjs +0 -203
  500. package/dist/_node_modules/node-fetch/src/request.cjs.map +0 -1
  501. package/dist/_node_modules/node-fetch/src/request.js +0 -203
  502. package/dist/_node_modules/node-fetch/src/request.js.map +0 -1
  503. package/dist/_node_modules/node-fetch/src/response.cjs +0 -122
  504. package/dist/_node_modules/node-fetch/src/response.cjs.map +0 -1
  505. package/dist/_node_modules/node-fetch/src/response.js +0 -123
  506. package/dist/_node_modules/node-fetch/src/response.js.map +0 -1
  507. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +0 -12
  508. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +0 -1
  509. package/dist/_node_modules/node-fetch/src/utils/get-search.js +0 -12
  510. package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +0 -1
  511. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +0 -8
  512. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +0 -1
  513. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +0 -8
  514. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +0 -1
  515. package/dist/_node_modules/node-fetch/src/utils/is.cjs +0 -28
  516. package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +0 -1
  517. package/dist/_node_modules/node-fetch/src/utils/is.js +0 -28
  518. package/dist/_node_modules/node-fetch/src/utils/is.js.map +0 -1
  519. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +0 -356
  520. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +0 -1
  521. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +0 -356
  522. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +0 -1
  523. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +0 -149
  524. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +0 -1
  525. package/dist/_node_modules/node-fetch/src/utils/referrer.js +0 -149
  526. package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +0 -1
  527. package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs +0 -24
  528. package/dist/_node_modules/normalize-package-data/lib/extract_description.cjs.map +0 -1
  529. package/dist/_node_modules/normalize-package-data/lib/extract_description.js +0 -24
  530. package/dist/_node_modules/normalize-package-data/lib/extract_description.js.map +0 -1
  531. package/dist/_node_modules/normalize-package-data/lib/fixer.cjs +0 -438
  532. package/dist/_node_modules/normalize-package-data/lib/fixer.cjs.map +0 -1
  533. package/dist/_node_modules/normalize-package-data/lib/fixer.js +0 -438
  534. package/dist/_node_modules/normalize-package-data/lib/fixer.js.map +0 -1
  535. package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs +0 -26
  536. package/dist/_node_modules/normalize-package-data/lib/make_warning.cjs.map +0 -1
  537. package/dist/_node_modules/normalize-package-data/lib/make_warning.js +0 -26
  538. package/dist/_node_modules/normalize-package-data/lib/make_warning.js.map +0 -1
  539. package/dist/_node_modules/normalize-package-data/lib/normalize.cjs +0 -58
  540. package/dist/_node_modules/normalize-package-data/lib/normalize.cjs.map +0 -1
  541. package/dist/_node_modules/normalize-package-data/lib/normalize.js +0 -59
  542. package/dist/_node_modules/normalize-package-data/lib/normalize.js.map +0 -1
  543. package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs +0 -41
  544. package/dist/_node_modules/normalize-package-data/lib/typos.json.cjs.map +0 -1
  545. package/dist/_node_modules/normalize-package-data/lib/typos.json.js +0 -41
  546. package/dist/_node_modules/normalize-package-data/lib/typos.json.js.map +0 -1
  547. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +0 -90
  548. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +0 -1
  549. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js +0 -90
  550. package/dist/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +0 -1
  551. package/dist/_node_modules/parse-json/index.cjs +0 -54
  552. package/dist/_node_modules/parse-json/index.cjs.map +0 -1
  553. package/dist/_node_modules/parse-json/index.js +0 -55
  554. package/dist/_node_modules/parse-json/index.js.map +0 -1
  555. package/dist/_node_modules/picocolors/picocolors.browser.cjs +0 -12
  556. package/dist/_node_modules/picocolors/picocolors.browser.cjs.map +0 -1
  557. package/dist/_node_modules/picocolors/picocolors.browser.js +0 -12
  558. package/dist/_node_modules/picocolors/picocolors.browser.js.map +0 -1
  559. package/dist/_node_modules/quick-lru/index.cjs +0 -235
  560. package/dist/_node_modules/quick-lru/index.cjs.map +0 -1
  561. package/dist/_node_modules/quick-lru/index.js +0 -236
  562. package/dist/_node_modules/quick-lru/index.js.map +0 -1
  563. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs +0 -159
  564. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +0 -1
  565. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js +0 -159
  566. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +0 -1
  567. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs +0 -88
  568. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +0 -1
  569. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js +0 -88
  570. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +0 -1
  571. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +0 -180
  572. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +0 -1
  573. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +0 -180
  574. package/dist/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +0 -1
  575. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs +0 -268
  576. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs.map +0 -1
  577. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js +0 -268
  578. package/dist/_node_modules/read-pkg/_node_modules/lru-cache/index.js.map +0 -1
  579. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs +0 -20
  580. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs.map +0 -1
  581. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js +0 -20
  582. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js.map +0 -1
  583. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs +0 -438
  584. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs.map +0 -1
  585. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js +0 -438
  586. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js.map +0 -1
  587. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs +0 -26
  588. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs.map +0 -1
  589. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js +0 -26
  590. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js.map +0 -1
  591. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs +0 -58
  592. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs.map +0 -1
  593. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js +0 -59
  594. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js.map +0 -1
  595. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs +0 -41
  596. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs.map +0 -1
  597. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js +0 -41
  598. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js.map +0 -1
  599. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +0 -90
  600. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +0 -1
  601. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js +0 -90
  602. package/dist/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +0 -1
  603. package/dist/_node_modules/read-pkg/index.cjs +0 -20
  604. package/dist/_node_modules/read-pkg/index.cjs.map +0 -1
  605. package/dist/_node_modules/read-pkg/index.js +0 -20
  606. package/dist/_node_modules/read-pkg/index.js.map +0 -1
  607. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs +0 -48
  608. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.cjs.map +0 -1
  609. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js +0 -48
  610. package/dist/_node_modules/read-pkg-up/_node_modules/find-up/index.js.map +0 -1
  611. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs +0 -43
  612. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.cjs.map +0 -1
  613. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js +0 -43
  614. package/dist/_node_modules/read-pkg-up/_node_modules/locate-path/index.js.map +0 -1
  615. package/dist/_node_modules/read-pkg-up/index.cjs +0 -17
  616. package/dist/_node_modules/read-pkg-up/index.cjs.map +0 -1
  617. package/dist/_node_modules/read-pkg-up/index.js +0 -17
  618. package/dist/_node_modules/read-pkg-up/index.js.map +0 -1
  619. package/dist/_node_modules/redent/index.cjs +0 -8
  620. package/dist/_node_modules/redent/index.cjs.map +0 -1
  621. package/dist/_node_modules/redent/index.js +0 -9
  622. package/dist/_node_modules/redent/index.js.map +0 -1
  623. package/dist/_node_modules/semver/classes/semver.cjs +0 -245
  624. package/dist/_node_modules/semver/classes/semver.cjs.map +0 -1
  625. package/dist/_node_modules/semver/classes/semver.js +0 -245
  626. package/dist/_node_modules/semver/classes/semver.js.map +0 -1
  627. package/dist/_node_modules/semver/functions/clean.cjs +0 -11
  628. package/dist/_node_modules/semver/functions/clean.cjs.map +0 -1
  629. package/dist/_node_modules/semver/functions/clean.js +0 -11
  630. package/dist/_node_modules/semver/functions/clean.js.map +0 -1
  631. package/dist/_node_modules/semver/functions/parse.cjs +0 -20
  632. package/dist/_node_modules/semver/functions/parse.cjs.map +0 -1
  633. package/dist/_node_modules/semver/functions/parse.js +0 -20
  634. package/dist/_node_modules/semver/functions/parse.js.map +0 -1
  635. package/dist/_node_modules/semver/functions/valid.cjs +0 -11
  636. package/dist/_node_modules/semver/functions/valid.cjs.map +0 -1
  637. package/dist/_node_modules/semver/functions/valid.js +0 -11
  638. package/dist/_node_modules/semver/functions/valid.js.map +0 -1
  639. package/dist/_node_modules/semver/internal/constants.cjs +0 -29
  640. package/dist/_node_modules/semver/internal/constants.cjs.map +0 -1
  641. package/dist/_node_modules/semver/internal/constants.js +0 -29
  642. package/dist/_node_modules/semver/internal/constants.js.map +0 -1
  643. package/dist/_node_modules/semver/internal/debug.cjs +0 -7
  644. package/dist/_node_modules/semver/internal/debug.cjs.map +0 -1
  645. package/dist/_node_modules/semver/internal/debug.js +0 -7
  646. package/dist/_node_modules/semver/internal/debug.js.map +0 -1
  647. package/dist/_node_modules/semver/internal/identifiers.cjs +0 -19
  648. package/dist/_node_modules/semver/internal/identifiers.cjs.map +0 -1
  649. package/dist/_node_modules/semver/internal/identifiers.js +0 -19
  650. package/dist/_node_modules/semver/internal/identifiers.js.map +0 -1
  651. package/dist/_node_modules/semver/internal/parse-options.cjs +0 -16
  652. package/dist/_node_modules/semver/internal/parse-options.cjs.map +0 -1
  653. package/dist/_node_modules/semver/internal/parse-options.js +0 -16
  654. package/dist/_node_modules/semver/internal/parse-options.js.map +0 -1
  655. package/dist/_node_modules/semver/internal/re.cjs +0 -82
  656. package/dist/_node_modules/semver/internal/re.cjs.map +0 -1
  657. package/dist/_node_modules/semver/internal/re.js +0 -82
  658. package/dist/_node_modules/semver/internal/re.js.map +0 -1
  659. package/dist/_node_modules/spdx-correct/index.cjs +0 -334
  660. package/dist/_node_modules/spdx-correct/index.cjs.map +0 -1
  661. package/dist/_node_modules/spdx-correct/index.js +0 -334
  662. package/dist/_node_modules/spdx-correct/index.js.map +0 -1
  663. package/dist/_node_modules/spdx-exceptions/index.json.cjs +0 -43
  664. package/dist/_node_modules/spdx-exceptions/index.json.cjs.map +0 -1
  665. package/dist/_node_modules/spdx-exceptions/index.json.js +0 -44
  666. package/dist/_node_modules/spdx-exceptions/index.json.js.map +0 -1
  667. package/dist/_node_modules/spdx-expression-parse/index.cjs +0 -11
  668. package/dist/_node_modules/spdx-expression-parse/index.cjs.map +0 -1
  669. package/dist/_node_modules/spdx-expression-parse/index.js +0 -11
  670. package/dist/_node_modules/spdx-expression-parse/index.js.map +0 -1
  671. package/dist/_node_modules/spdx-expression-parse/parse.cjs +0 -111
  672. package/dist/_node_modules/spdx-expression-parse/parse.cjs.map +0 -1
  673. package/dist/_node_modules/spdx-expression-parse/parse.js +0 -111
  674. package/dist/_node_modules/spdx-expression-parse/parse.js.map +0 -1
  675. package/dist/_node_modules/spdx-expression-parse/scan.cjs +0 -104
  676. package/dist/_node_modules/spdx-expression-parse/scan.cjs.map +0 -1
  677. package/dist/_node_modules/spdx-expression-parse/scan.js +0 -104
  678. package/dist/_node_modules/spdx-expression-parse/scan.js.map +0 -1
  679. package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs +0 -30
  680. package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs.map +0 -1
  681. package/dist/_node_modules/spdx-license-ids/deprecated.json.js +0 -31
  682. package/dist/_node_modules/spdx-license-ids/deprecated.json.js.map +0 -1
  683. package/dist/_node_modules/spdx-license-ids/index.json.cjs +0 -510
  684. package/dist/_node_modules/spdx-license-ids/index.json.cjs.map +0 -1
  685. package/dist/_node_modules/spdx-license-ids/index.json.js +0 -511
  686. package/dist/_node_modules/spdx-license-ids/index.json.js.map +0 -1
  687. package/dist/_node_modules/strip-indent/index.cjs +0 -12
  688. package/dist/_node_modules/strip-indent/index.cjs.map +0 -1
  689. package/dist/_node_modules/strip-indent/index.js +0 -13
  690. package/dist/_node_modules/strip-indent/index.js.map +0 -1
  691. package/dist/_node_modules/trim-newlines/index.cjs +0 -15
  692. package/dist/_node_modules/trim-newlines/index.cjs.map +0 -1
  693. package/dist/_node_modules/trim-newlines/index.js +0 -15
  694. package/dist/_node_modules/trim-newlines/index.js.map +0 -1
  695. package/dist/_node_modules/validate-npm-package-license/index.cjs +0 -71
  696. package/dist/_node_modules/validate-npm-package-license/index.cjs.map +0 -1
  697. package/dist/_node_modules/validate-npm-package-license/index.js +0 -71
  698. package/dist/_node_modules/validate-npm-package-license/index.js.map +0 -1
  699. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +0 -3822
  700. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +0 -1
  701. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +0 -3822
  702. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +0 -1
  703. package/dist/_node_modules/yallist/iterator.cjs +0 -19
  704. package/dist/_node_modules/yallist/iterator.cjs.map +0 -1
  705. package/dist/_node_modules/yallist/iterator.js +0 -19
  706. package/dist/_node_modules/yallist/iterator.js.map +0 -1
  707. package/dist/_node_modules/yallist/yallist.cjs +0 -367
  708. package/dist/_node_modules/yallist/yallist.cjs.map +0 -1
  709. package/dist/_node_modules/yallist/yallist.js +0 -367
  710. package/dist/_node_modules/yallist/yallist.js.map +0 -1
  711. package/dist/_node_modules/yargs-parser/build/lib/index.cjs +0 -56
  712. package/dist/_node_modules/yargs-parser/build/lib/index.cjs.map +0 -1
  713. package/dist/_node_modules/yargs-parser/build/lib/index.js +0 -57
  714. package/dist/_node_modules/yargs-parser/build/lib/index.js.map +0 -1
  715. package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs +0 -63
  716. package/dist/_node_modules/yargs-parser/build/lib/string-utils.cjs.map +0 -1
  717. package/dist/_node_modules/yargs-parser/build/lib/string-utils.js +0 -63
  718. package/dist/_node_modules/yargs-parser/build/lib/string-utils.js.map +0 -1
  719. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs +0 -39
  720. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.cjs.map +0 -1
  721. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js +0 -39
  722. package/dist/_node_modules/yargs-parser/build/lib/tokenize-arg-string.js.map +0 -1
  723. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs +0 -15
  724. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.cjs.map +0 -1
  725. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js +0 -16
  726. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser-types.js.map +0 -1
  727. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs +0 -847
  728. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.cjs.map +0 -1
  729. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js +0 -847
  730. package/dist/_node_modules/yargs-parser/build/lib/yargs-parser.js.map +0 -1
  731. package/dist/_virtual/_commonjsHelpers.cjs +0 -9
  732. package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
  733. package/dist/_virtual/_commonjsHelpers.js +0 -9
  734. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  735. package/dist/_virtual/identifier.cjs +0 -5
  736. package/dist/_virtual/identifier.cjs.map +0 -1
  737. package/dist/_virtual/identifier.js +0 -5
  738. package/dist/_virtual/identifier.js.map +0 -1
  739. package/dist/_virtual/index.cjs +0 -5
  740. package/dist/_virtual/index.cjs.map +0 -1
  741. package/dist/_virtual/index.js +0 -5
  742. package/dist/_virtual/index.js.map +0 -1
  743. package/dist/_virtual/index2.cjs +0 -5
  744. package/dist/_virtual/index2.cjs.map +0 -1
  745. package/dist/_virtual/index2.js +0 -5
  746. package/dist/_virtual/index2.js.map +0 -1
  747. package/dist/_virtual/index3.cjs +0 -5
  748. package/dist/_virtual/index3.cjs.map +0 -1
  749. package/dist/_virtual/index3.js +0 -5
  750. package/dist/_virtual/index3.js.map +0 -1
  751. package/dist/_virtual/index4.cjs +0 -5
  752. package/dist/_virtual/index4.cjs.map +0 -1
  753. package/dist/_virtual/index4.js +0 -5
  754. package/dist/_virtual/index4.js.map +0 -1
  755. package/dist/_virtual/index5.cjs +0 -5
  756. package/dist/_virtual/index5.cjs.map +0 -1
  757. package/dist/_virtual/index5.js +0 -5
  758. package/dist/_virtual/index5.js.map +0 -1
  759. package/dist/_virtual/index6.cjs +0 -5
  760. package/dist/_virtual/index6.cjs.map +0 -1
  761. package/dist/_virtual/index6.js +0 -5
  762. package/dist/_virtual/index6.js.map +0 -1
  763. package/dist/_virtual/index7.cjs +0 -5
  764. package/dist/_virtual/index7.cjs.map +0 -1
  765. package/dist/_virtual/index7.js +0 -5
  766. package/dist/_virtual/index7.js.map +0 -1
  767. package/dist/_virtual/index8.cjs +0 -5
  768. package/dist/_virtual/index8.cjs.map +0 -1
  769. package/dist/_virtual/index8.js +0 -5
  770. package/dist/_virtual/index8.js.map +0 -1
  771. package/dist/_virtual/keyword.cjs +0 -5
  772. package/dist/_virtual/keyword.cjs.map +0 -1
  773. package/dist/_virtual/keyword.js +0 -5
  774. package/dist/_virtual/keyword.js.map +0 -1
  775. package/dist/_virtual/picocolors.browser.cjs +0 -5
  776. package/dist/_virtual/picocolors.browser.cjs.map +0 -1
  777. package/dist/_virtual/picocolors.browser.js +0 -5
  778. package/dist/_virtual/picocolors.browser.js.map +0 -1
  779. package/dist/_virtual/ponyfill.es2018.cjs +0 -5
  780. package/dist/_virtual/ponyfill.es2018.cjs.map +0 -1
  781. package/dist/_virtual/ponyfill.es2018.js +0 -5
  782. package/dist/_virtual/ponyfill.es2018.js.map +0 -1
  783. package/dist/_virtual/re.cjs +0 -5
  784. package/dist/_virtual/re.cjs.map +0 -1
  785. package/dist/_virtual/re.js +0 -5
  786. package/dist/_virtual/re.js.map +0 -1
  787. package/dist/cli/index.d.ts +0 -1
  788. package/dist/cli/loadConfig.d.ts +0 -6
  789. package/dist/cli/loadLocaleIDs.d.ts +0 -10
  790. package/dist/cli/loadModels.d.ts +0 -15
  791. package/dist/cli/types.d.ts +0 -175
  792. package/dist/constants.d.ts +0 -26
  793. package/dist/index.cjs.map +0 -1
  794. package/dist/index.js.map +0 -1
  795. package/dist/lib/addBlankLine.d.ts +0 -5
  796. package/dist/lib/addLine.d.ts +0 -1
  797. package/dist/lib/addSection.d.ts +0 -1
  798. package/dist/lib/addTrailingNewLine.d.ts +0 -5
  799. package/dist/lib/buildCustomTypeDataType.d.ts +0 -14
  800. package/dist/lib/buildCustomTypeType.d.ts +0 -17
  801. package/dist/lib/buildFieldDocs.d.ts +0 -10
  802. package/dist/lib/buildFieldProperties.d.ts +0 -15
  803. package/dist/lib/buildSharedSliceType.d.ts +0 -17
  804. package/dist/lib/buildTypeName.d.ts +0 -1
  805. package/dist/lib/buildUnion.d.ts +0 -1
  806. package/dist/lib/checkHasUIDFIeld.d.ts +0 -2
  807. package/dist/lib/getAPIIDPath.d.ts +0 -6
  808. package/dist/lib/getCacheKey.d.ts +0 -9
  809. package/dist/lib/getHumanReadableModelName.d.ts +0 -7
  810. package/dist/lib/getHumanReadablePath.d.ts +0 -6
  811. package/src/cli/types.ts +0 -192
@@ -1,1231 +0,0 @@
1
- import { appendFilters } from "./lib/appendFilters.js";
2
- import { castThunk } from "./lib/castThunk.js";
3
- import { devMsg } from "./lib/devMsg.js";
4
- import { everyTagFilter } from "./lib/everyTagFilter.js";
5
- import { findMasterRef } from "./lib/findMasterRef.js";
6
- import { findRefByID } from "./lib/findRefByID.js";
7
- import { findRefByLabel } from "./lib/findRefByLabel.js";
8
- import { getPreviewCookie } from "./lib/getPreviewCookie.js";
9
- import { minifyGraphQLQuery } from "./lib/minifyGraphQLQuery.js";
10
- import { request } from "./lib/request.js";
11
- import { someTagsFilter } from "./lib/someTagsFilter.js";
12
- import { throttledLog } from "./lib/throttledLog.js";
13
- import { typeFilter } from "./lib/typeFilter.js";
14
- import { ForbiddenError } from "./errors/ForbiddenError.js";
15
- import { NotFoundError } from "./errors/NotFoundError.js";
16
- import { ParsingError } from "./errors/ParsingError.js";
17
- import { PreviewTokenExpiredError } from "./errors/PreviewTokenExpired.js";
18
- import { PrismicError } from "./errors/PrismicError.js";
19
- import { RefExpiredError } from "./errors/RefExpiredError.js";
20
- import { RefNotFoundError } from "./errors/RefNotFoundError.js";
21
- import { RepositoryNotFoundError } from "./errors/RepositoryNotFoundError.js";
22
- import { asLink } from "./helpers/asLink.js";
23
- import { buildQueryURL } from "./buildQueryURL.js";
24
- import { filter } from "./filter.js";
25
- import { getRepositoryEndpoint } from "./getRepositoryEndpoint.js";
26
- import { getRepositoryName } from "./getRepositoryName.js";
27
- import { isRepositoryEndpoint } from "./isRepositoryEndpoint.js";
28
- var __defProp = Object.defineProperty;
29
- var __typeError = (msg) => {
30
- throw TypeError(msg);
31
- };
32
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
33
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
35
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
36
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
37
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
38
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
39
- var _repositoryName, _Client_instances, request_fn;
40
- const MAX_PAGE_SIZE = 100;
41
- const REPOSITORY_CACHE_TTL = 5e3;
42
- const GET_ALL_QUERY_DELAY = 500;
43
- const MAX_INVALID_REF_RETRY_ATTEMPTS = 3;
44
- var RefStateMode;
45
- (function(RefStateMode2) {
46
- RefStateMode2["Master"] = "Master";
47
- RefStateMode2["ReleaseID"] = "ReleaseID";
48
- RefStateMode2["ReleaseLabel"] = "ReleaseLabel";
49
- RefStateMode2["Manual"] = "Manual";
50
- })(RefStateMode || (RefStateMode = {}));
51
- class Client {
52
- /**
53
- * Creates a Prismic client that can be used to query a repository.
54
- *
55
- * If used in an environment where a global `fetch` function is unavailable,
56
- * such as in some Node.js versions, the `fetch` option must be provided as
57
- * part of the `options` parameter.
58
- *
59
- * @param repositoryNameOrEndpoint - The Prismic repository name or full Rest
60
- * API V2 endpoint for the repository.
61
- * @param options - Configuration that determines how content will be queried
62
- * from the Prismic repository.
63
- *
64
- * @returns A client that can query content from the repository.
65
- */
66
- constructor(repositoryNameOrEndpoint, options = {}) {
67
- __privateAdd(this, _Client_instances);
68
- __publicField(this, "fetchFn");
69
- __publicField(this, "fetchOptions");
70
- __privateAdd(this, _repositoryName);
71
- __publicField(this, "documentAPIEndpoint");
72
- __publicField(this, "accessToken");
73
- __publicField(this, "routes");
74
- __publicField(this, "brokenRoute");
75
- __publicField(this, "defaultParams");
76
- __publicField(this, "refState", {
77
- mode: RefStateMode.Master,
78
- autoPreviewsEnabled: true
79
- });
80
- __publicField(this, "cachedRepository");
81
- __publicField(this, "cachedRepositoryExpiration", 0);
82
- this.fetchOptions = options.fetchOptions;
83
- if (typeof options.fetch === "function") {
84
- this.fetchFn = options.fetch;
85
- } else if (typeof globalThis.fetch === "function") {
86
- this.fetchFn = globalThis.fetch;
87
- } else {
88
- throw new PrismicError("A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.", void 0, void 0);
89
- }
90
- if (this.fetchFn === globalThis.fetch) {
91
- this.fetchFn = this.fetchFn.bind(globalThis);
92
- }
93
- if ((options.documentAPIEndpoint || isRepositoryEndpoint(repositoryNameOrEndpoint)) && process.env.NODE_ENV === "development") {
94
- const documentAPIEndpoint = options.documentAPIEndpoint || repositoryNameOrEndpoint;
95
- if (/\.prismic\.io\/(?!api\/v2\/?)/i.test(documentAPIEndpoint)) {
96
- throw new PrismicError("@prismicio/client only supports Prismic Rest API V2. Please provide only the repository name to the first createClient() parameter or use the getRepositoryEndpoint() helper to generate a valid Rest API V2 endpoint URL.", void 0, void 0);
97
- }
98
- const hostname = new URL(documentAPIEndpoint).hostname.toLowerCase();
99
- if (hostname.endsWith(".prismic.io") && !hostname.endsWith(".cdn.prismic.io")) {
100
- console.warn(`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg("endpoint-must-use-cdn")}`);
101
- }
102
- if (options.documentAPIEndpoint && isRepositoryEndpoint(repositoryNameOrEndpoint) && repositoryNameOrEndpoint !== options.documentAPIEndpoint) {
103
- console.warn(`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${devMsg("prefer-repository-name")}`);
104
- }
105
- }
106
- if (isRepositoryEndpoint(repositoryNameOrEndpoint)) {
107
- this.documentAPIEndpoint = repositoryNameOrEndpoint;
108
- try {
109
- this.repositoryName = getRepositoryName(repositoryNameOrEndpoint);
110
- } catch (error) {
111
- console.warn(`[@prismicio/client] A repository name could not be inferred from the provided endpoint (\`${repositoryNameOrEndpoint}\`). Some methods will be disabled. Create the client using a repository name to prevent this warning. For more details, see ${devMsg("prefer-repository-name")}`);
112
- }
113
- } else {
114
- this.documentAPIEndpoint = options.documentAPIEndpoint || getRepositoryEndpoint(repositoryNameOrEndpoint);
115
- this.repositoryName = repositoryNameOrEndpoint;
116
- }
117
- this.accessToken = options.accessToken;
118
- this.routes = options.routes;
119
- this.brokenRoute = options.brokenRoute;
120
- this.defaultParams = options.defaultParams;
121
- if (options.ref) {
122
- this.queryContentFromRef(options.ref);
123
- }
124
- this.graphQLFetch = this.graphQLFetch.bind(this);
125
- }
126
- /**
127
- * The Prismic repository's name.
128
- */
129
- set repositoryName(value) {
130
- __privateSet(this, _repositoryName, value);
131
- }
132
- /**
133
- * The Prismic repository's name.
134
- */
135
- get repositoryName() {
136
- if (!__privateGet(this, _repositoryName)) {
137
- throw new PrismicError(`A repository name is required for this method but one could not be inferred from the provided API endpoint (\`${this.documentAPIEndpoint}\`). To fix this error, provide a repository name when creating the client. For more details, see ${devMsg("prefer-repository-name")}`, void 0, void 0);
138
- }
139
- return __privateGet(this, _repositoryName);
140
- }
141
- /**
142
- * The Prismic REST API V2 endpoint for the repository (use
143
- * `prismic.getRepositoryEndpoint` for the default endpoint).
144
- *
145
- * @deprecated Use `documentAPIEndpoint` instead.
146
- */
147
- // TODO: Remove in v8.
148
- set endpoint(value) {
149
- this.documentAPIEndpoint = value;
150
- }
151
- /**
152
- * The Prismic REST API V2 endpoint for the repository (use
153
- * `prismic.getRepositoryEndpoint` for the default endpoint).
154
- *
155
- * @deprecated Use `documentAPIEndpoint` instead.
156
- */
157
- // TODO: Remove in v8.
158
- get endpoint() {
159
- return this.documentAPIEndpoint;
160
- }
161
- /**
162
- * Enables the client to automatically query content from a preview session if
163
- * one is active in browser environments. This is enabled by default in the
164
- * browser.
165
- *
166
- * For server environments, use `enableAutoPreviewsFromReq`.
167
- *
168
- * @example
169
- *
170
- * ```ts
171
- * client.enableAutoPreviews()
172
- * ```
173
- *
174
- * @see enableAutoPreviewsFromReq
175
- */
176
- enableAutoPreviews() {
177
- this.refState.autoPreviewsEnabled = true;
178
- }
179
- /**
180
- * Enables the client to automatically query content from a preview session if
181
- * one is active in server environments. This is disabled by default on the
182
- * server.
183
- *
184
- * For browser environments, use `enableAutoPreviews`.
185
- *
186
- * @example
187
- *
188
- * ```ts
189
- * // In an express app
190
- * app.get("/", function (req, res) {
191
- * client.enableAutoPreviewsFromReq(req)
192
- * })
193
- * ```
194
- *
195
- * @param req - An HTTP server request object containing the request's
196
- * cookies.
197
- */
198
- enableAutoPreviewsFromReq(req) {
199
- this.refState.httpRequest = req;
200
- this.refState.autoPreviewsEnabled = true;
201
- }
202
- /**
203
- * Disables the client from automatically querying content from a preview
204
- * session if one is active.
205
- *
206
- * Automatic preview content querying is enabled by default unless this method
207
- * is called.
208
- *
209
- * @example
210
- *
211
- * ```ts
212
- * client.disableAutoPreviews()
213
- * ```
214
- */
215
- disableAutoPreviews() {
216
- this.refState.autoPreviewsEnabled = false;
217
- }
218
- /**
219
- * Queries content from the Prismic repository.
220
- *
221
- * @example
222
- *
223
- * ```ts
224
- * const response = await client.get()
225
- * ```
226
- *
227
- * @typeParam TDocument - Type of Prismic documents returned.
228
- *
229
- * @param params - Parameters to filter, sort, and paginate results.
230
- *
231
- * @returns A paginated response containing the result of the query.
232
- */
233
- async get(params) {
234
- const { data } = await this._get(params);
235
- return data;
236
- }
237
- /**
238
- * Queries content from the Prismic repository and returns only the first
239
- * result, if any.
240
- *
241
- * @example
242
- *
243
- * ```ts
244
- * const document = await client.getFirst()
245
- * ```
246
- *
247
- * @typeParam TDocument - Type of the Prismic document returned.
248
- *
249
- * @param params - Parameters to filter, sort, and paginate results.
250
- *
251
- * @returns The first result of the query, if any.
252
- */
253
- async getFirst(params) {
254
- var _a;
255
- const actualParams = { ...params };
256
- if (!(params && params.page) && !(params == null ? void 0 : params.pageSize)) {
257
- actualParams.pageSize = ((_a = this.defaultParams) == null ? void 0 : _a.pageSize) ?? 1;
258
- }
259
- const { data, url } = await this._get(actualParams);
260
- const firstResult = data.results[0];
261
- if (firstResult) {
262
- return firstResult;
263
- }
264
- throw new NotFoundError("No documents were returned", url, void 0);
265
- }
266
- /**
267
- * **IMPORTANT**: Avoid using `dangerouslyGetAll` as it may be slower and
268
- * require more resources than other methods. Prefer using other methods that
269
- * filter by filters such as `getAllByType`.
270
- *
271
- * Queries content from the Prismic repository and returns all matching
272
- * content. If no filters are provided, all documents will be fetched.
273
- *
274
- * This method may make multiple network requests to query all matching
275
- * content.
276
- *
277
- * @example
278
- *
279
- * ```ts
280
- * const response = await client.dangerouslyGetAll()
281
- * ```
282
- *
283
- * @typeParam TDocument - Type of Prismic documents returned.
284
- *
285
- * @param params - Parameters to filter, sort, and paginate results.
286
- *
287
- * @returns A list of documents matching the query.
288
- */
289
- async dangerouslyGetAll(params = {}) {
290
- var _a;
291
- const { limit = Infinity, ...actualParams } = params;
292
- const resolvedParams = {
293
- ...actualParams,
294
- pageSize: Math.min(limit, actualParams.pageSize || ((_a = this.defaultParams) == null ? void 0 : _a.pageSize) || MAX_PAGE_SIZE)
295
- };
296
- const documents = [];
297
- let latestResult;
298
- while ((!latestResult || latestResult.next_page) && documents.length < limit) {
299
- const page = latestResult ? latestResult.page + 1 : void 0;
300
- latestResult = await this.get({ ...resolvedParams, page });
301
- documents.push(...latestResult.results);
302
- if (latestResult.next_page) {
303
- await new Promise((res) => setTimeout(res, GET_ALL_QUERY_DELAY));
304
- }
305
- }
306
- return documents.slice(0, limit);
307
- }
308
- /**
309
- * Queries a document from the Prismic repository with a specific ID.
310
- *
311
- * @remarks
312
- * A document's UID is different from its ID. An ID is automatically generated
313
- * for all documents and is made available on its `id` property. A UID is
314
- * provided in the Prismic editor and is unique among all documents of its
315
- * custom type.
316
- *
317
- * @example
318
- *
319
- * ```ts
320
- * const document = await client.getByID("WW4bKScAAMAqmluX")
321
- * ```
322
- *
323
- * @typeParam TDocument- Type of the Prismic document returned.
324
- *
325
- * @param id - ID of the document.
326
- * @param params - Parameters to filter, sort, and paginate the results.
327
- *
328
- * @returns The document with an ID matching the `id` parameter, if a matching
329
- * document exists.
330
- */
331
- async getByID(id, params) {
332
- return await this.getFirst(appendFilters(params, filter.at("document.id", id)));
333
- }
334
- /**
335
- * Queries documents from the Prismic repository with specific IDs.
336
- *
337
- * @remarks
338
- * A document's UID is different from its ID. An ID is automatically generated
339
- * for all documents and is made available on its `id` property. A UID is
340
- * provided in the Prismic editor and is unique among all documents of its
341
- * custom type.
342
- *
343
- * @example
344
- *
345
- * ```ts
346
- * const response = await client.getByIDs([
347
- * "WW4bKScAAMAqmluX",
348
- * "U1kTRgEAAC8A5ldS",
349
- * ])
350
- * ```
351
- *
352
- * @typeParam TDocument - Type of Prismic documents returned.
353
- *
354
- * @param ids - A list of document IDs.
355
- * @param params - Parameters to filter, sort, and paginate the results.
356
- *
357
- * @returns A paginated response containing documents with IDs matching the
358
- * `ids` parameter.
359
- */
360
- async getByIDs(ids, params) {
361
- return await this.get(appendFilters(params, filter.in("document.id", ids)));
362
- }
363
- /**
364
- * Queries all documents from the Prismic repository with specific IDs.
365
- *
366
- * This method may make multiple network requests to query all matching
367
- * content.
368
- *
369
- * @remarks
370
- * A document's UID is different from its ID. An ID is automatically generated
371
- * for all documents and is made available on its `id` property. A UID is
372
- * provided in the Prismic editor and is unique among all documents of its
373
- * custom type.
374
- *
375
- * @example
376
- *
377
- * ```ts
378
- * const response = await client.getAllByIDs([
379
- * "WW4bKScAAMAqmluX",
380
- * "U1kTRgEAAC8A5ldS",
381
- * ])
382
- * ```
383
- *
384
- * @typeParam TDocument - Type of Prismic documents returned.
385
- *
386
- * @param ids - A list of document IDs.
387
- * @param params - Parameters to filter, sort, and paginate the results.
388
- *
389
- * @returns A list of documents with IDs matching the `ids` parameter.
390
- */
391
- async getAllByIDs(ids, params) {
392
- return await this.dangerouslyGetAll(appendFilters(params, filter.in("document.id", ids)));
393
- }
394
- /**
395
- * Queries a document from the Prismic repository with a specific UID and
396
- * custom type.
397
- *
398
- * @remarks
399
- * A document's UID is different from its ID. An ID is automatically generated
400
- * for all documents and is made available on its `id` property. A UID is
401
- * provided in the Prismic editor and is unique among all documents of its
402
- * custom type.
403
- *
404
- * @example
405
- *
406
- * ```ts
407
- * const document = await client.getByUID("blog_post", "my-first-post")
408
- * ```
409
- *
410
- * @typeParam TDocument - Type of the Prismic document returned.
411
- *
412
- * @param documentType - The API ID of the document's custom type.
413
- * @param uid - UID of the document.
414
- * @param params - Parameters to filter, sort, and paginate the results.
415
- *
416
- * @returns The document with a UID matching the `uid` parameter, if a
417
- * matching document exists.
418
- */
419
- async getByUID(documentType, uid, params) {
420
- return await this.getFirst(appendFilters(params, [
421
- typeFilter(documentType),
422
- filter.at(`my.${documentType}.uid`, uid)
423
- ]));
424
- }
425
- /**
426
- * Queries document from the Prismic repository with specific UIDs and Custom
427
- * Type.
428
- *
429
- * @remarks
430
- * A document's UID is different from its ID. An ID is automatically generated
431
- * for all documents and is made available on its `id` property. A UID is
432
- * provided in the Prismic editor and is unique among all documents of its
433
- * custom type.
434
- *
435
- * @example
436
- *
437
- * ```ts
438
- * const document = await client.getByUIDs("blog_post", [
439
- * "my-first-post",
440
- * "my-second-post",
441
- * ])
442
- * ```
443
- *
444
- * @typeParam TDocument - Type of the Prismic document returned.
445
- *
446
- * @param documentType - The API ID of the document's custom type.
447
- * @param uids - A list of document UIDs.
448
- * @param params - Parameters to filter, sort, and paginate the results.
449
- *
450
- * @returns A paginated response containing documents with UIDs matching the
451
- * `uids` parameter.
452
- */
453
- async getByUIDs(documentType, uids, params) {
454
- return await this.get(appendFilters(params, [
455
- typeFilter(documentType),
456
- filter.in(`my.${documentType}.uid`, uids)
457
- ]));
458
- }
459
- /**
460
- * Queries all documents from the Prismic repository with specific UIDs and
461
- * custom type.
462
- *
463
- * This method may make multiple network requests to query all matching
464
- * content.
465
- *
466
- * @remarks
467
- * A document's UID is different from its ID. An ID is automatically generated
468
- * for all documents and is made available on its `id` property. A UID is
469
- * provided in the Prismic editor and is unique among all documents of its
470
- * custom type.
471
- *
472
- * @example
473
- *
474
- * ```ts
475
- * const response = await client.getAllByUIDs([
476
- * "my-first-post",
477
- * "my-second-post",
478
- * ])
479
- * ```
480
- *
481
- * @typeParam TDocument - Type of Prismic documents returned.
482
- *
483
- * @param documentType - The API ID of the document's custom type.
484
- * @param uids - A list of document UIDs.
485
- * @param params - Parameters to filter, sort, and paginate the results.
486
- *
487
- * @returns A list of documents with UIDs matching the `uids` parameter.
488
- */
489
- async getAllByUIDs(documentType, uids, params) {
490
- return await this.dangerouslyGetAll(appendFilters(params, [
491
- typeFilter(documentType),
492
- filter.in(`my.${documentType}.uid`, uids)
493
- ]));
494
- }
495
- /**
496
- * Queries a singleton document from the Prismic repository for a specific
497
- * custom type.
498
- *
499
- * @remarks
500
- * A singleton document is one that is configured in Prismic to only allow one
501
- * instance. For example, a repository may be configured to contain just one
502
- * Settings document. This is in contrast to a repeatable custom type which
503
- * allows multiple instances of itself.
504
- *
505
- * @example
506
- *
507
- * ```ts
508
- * const document = await client.getSingle("settings")
509
- * ```
510
- *
511
- * @typeParam TDocument - Type of the Prismic document returned.
512
- *
513
- * @param documentType - The API ID of the singleton custom type.
514
- * @param params - Parameters to filter, sort, and paginate the results.
515
- *
516
- * @returns The singleton document for the custom type, if a matching document
517
- * exists.
518
- */
519
- async getSingle(documentType, params) {
520
- return await this.getFirst(appendFilters(params, typeFilter(documentType)));
521
- }
522
- /**
523
- * Queries documents from the Prismic repository for a specific custom type.
524
- *
525
- * Use `getAllByType` instead if you need to query all documents for a
526
- * specific custom type.
527
- *
528
- * @example
529
- *
530
- * ```ts
531
- * const response = await client.getByType("blog_post")
532
- * ```
533
- *
534
- * @typeParam TDocument - Type of Prismic documents returned.
535
- *
536
- * @param documentType - The API ID of the custom type.
537
- * @param params - Parameters to filter, sort, and paginate the results.
538
- *
539
- * @returns A paginated response containing documents of the custom type.
540
- */
541
- async getByType(documentType, params) {
542
- return await this.get(appendFilters(params, typeFilter(documentType)));
543
- }
544
- /**
545
- * Queries all documents from the Prismic repository for a specific Custom
546
- * Type.
547
- *
548
- * This method may make multiple network requests to query all matching
549
- * content.
550
- *
551
- * @example
552
- *
553
- * ```ts
554
- * const response = await client.getByType("blog_post")
555
- * ```
556
- *
557
- * @typeParam TDocument - Type of Prismic documents returned.
558
- *
559
- * @param documentType - The API ID of the custom type.
560
- * @param params - Parameters to filter, sort, and paginate the results.
561
- *
562
- * @returns A list of all documents of the custom type.
563
- */
564
- async getAllByType(documentType, params) {
565
- return await this.dangerouslyGetAll(appendFilters(params, typeFilter(documentType)));
566
- }
567
- /**
568
- * Queries documents from the Prismic repository with a specific tag.
569
- *
570
- * Use `getAllByTag` instead if you need to query all documents with a
571
- * specific tag.
572
- *
573
- * @example
574
- *
575
- * ```ts
576
- * const response = await client.getByTag("food")
577
- * ```
578
- *
579
- * @typeParam TDocument - Type of Prismic documents returned.
580
- *
581
- * @param tag - The tag that must be included on a document.
582
- * @param params - Parameters to filter, sort, and paginate the results.
583
- *
584
- * @returns A paginated response containing documents with the tag.
585
- */
586
- async getByTag(tag, params) {
587
- return await this.get(appendFilters(params, someTagsFilter(tag)));
588
- }
589
- /**
590
- * Queries all documents from the Prismic repository with a specific tag.
591
- *
592
- * This method may make multiple network requests to query all matching
593
- * content.
594
- *
595
- * @example
596
- *
597
- * ```ts
598
- * const response = await client.getAllByTag("food")
599
- * ```
600
- *
601
- * @typeParam TDocument - Type of Prismic documents returned.
602
- *
603
- * @param tag - The tag that must be included on a document.
604
- * @param params - Parameters to filter, sort, and paginate the results.
605
- *
606
- * @returns A list of all documents with the tag.
607
- */
608
- async getAllByTag(tag, params) {
609
- return await this.dangerouslyGetAll(appendFilters(params, someTagsFilter(tag)));
610
- }
611
- /**
612
- * Queries documents from the Prismic repository with specific tags. A
613
- * document must be tagged with all of the queried tags to be included.
614
- *
615
- * @example
616
- *
617
- * ```ts
618
- * const response = await client.getByEveryTag(["food", "fruit"])
619
- * ```
620
- *
621
- * @typeParam TDocument - Type of Prismic documents returned.
622
- *
623
- * @param tags - A list of tags that must be included on a document.
624
- * @param params - Parameters to filter, sort, and paginate the results.
625
- *
626
- * @returns A paginated response containing documents with the tags.
627
- */
628
- async getByEveryTag(tags, params) {
629
- return await this.get(appendFilters(params, everyTagFilter(tags)));
630
- }
631
- /**
632
- * Queries documents from the Prismic repository with specific tags. A
633
- * document must be tagged with all of the queried tags to be included.
634
- *
635
- * This method may make multiple network requests to query all matching
636
- * content.
637
- *
638
- * @example
639
- *
640
- * ```ts
641
- * const response = await client.getAllByEveryTag(["food", "fruit"])
642
- * ```
643
- *
644
- * @typeParam TDocument - Type of Prismic documents returned.
645
- *
646
- * @param tags - A list of tags that must be included on a document.
647
- * @param params - Parameters to filter, sort, and paginate the results.
648
- *
649
- * @returns A list of all documents with the tags.
650
- */
651
- async getAllByEveryTag(tags, params) {
652
- return await this.dangerouslyGetAll(appendFilters(params, everyTagFilter(tags)));
653
- }
654
- /**
655
- * Queries documents from the Prismic repository with specific tags. A
656
- * document must be tagged with at least one of the queried tags to be
657
- * included.
658
- *
659
- * @example
660
- *
661
- * ```ts
662
- * const response = await client.getByEveryTag(["food", "fruit"])
663
- * ```
664
- *
665
- * @typeParam TDocument - Type of Prismic documents returned.
666
- *
667
- * @param tags - A list of tags that must be included on a document.
668
- * @param params - Parameters to filter, sort, and paginate the results.
669
- *
670
- * @returns A paginated response containing documents with at least one of the
671
- * tags.
672
- */
673
- async getBySomeTags(tags, params) {
674
- return await this.get(appendFilters(params, someTagsFilter(tags)));
675
- }
676
- /**
677
- * Queries documents from the Prismic repository with specific tags. A
678
- * document must be tagged with at least one of the queried tags to be
679
- * included.
680
- *
681
- * This method may make multiple network requests to query all matching
682
- * content.
683
- *
684
- * @example
685
- *
686
- * ```ts
687
- * const response = await client.getAllBySomeTags(["food", "fruit"])
688
- * ```
689
- *
690
- * @typeParam TDocument - Type of Prismic documents returned.
691
- *
692
- * @param tags - A list of tags that must be included on a document.
693
- * @param params - Parameters to filter, sort, and paginate the results.
694
- *
695
- * @returns A list of all documents with at least one of the tags.
696
- */
697
- async getAllBySomeTags(tags, params) {
698
- return await this.dangerouslyGetAll(appendFilters(params, someTagsFilter(tags)));
699
- }
700
- /**
701
- * Returns metadata about the Prismic repository, such as its refs, releases,
702
- * and custom types.
703
- *
704
- * @returns Repository metadata.
705
- */
706
- async getRepository(params) {
707
- const url = new URL(this.documentAPIEndpoint);
708
- if (this.accessToken) {
709
- url.searchParams.set("access_token", this.accessToken);
710
- }
711
- const response = await __privateMethod(this, _Client_instances, request_fn).call(this, url, params);
712
- switch (response.status) {
713
- case 200: {
714
- return await response.json();
715
- }
716
- case 401: {
717
- const json = await response.json();
718
- throw new ForbiddenError(json.error, url.toString(), json);
719
- }
720
- case 404: {
721
- throw new RepositoryNotFoundError(`Prismic repository not found. Check that "${this.documentAPIEndpoint}" is pointing to the correct repository.`, url.toString(), void 0);
722
- }
723
- default: {
724
- throw new PrismicError(void 0, url.toString(), await response.text());
725
- }
726
- }
727
- }
728
- /**
729
- * Returns a list of all refs for the Prismic repository.
730
- *
731
- * Refs are used to identify which version of the repository's content should
732
- * be queried. All repositories will have at least one ref pointing to the
733
- * latest published content called the "master ref".
734
- *
735
- * @returns A list of all refs for the Prismic repository.
736
- */
737
- async getRefs(params) {
738
- const repository = await this.getRepository(params);
739
- return repository.refs;
740
- }
741
- /**
742
- * Returns a ref for the Prismic repository with a matching ID.
743
- *
744
- * @param id - ID of the ref.
745
- *
746
- * @returns The ref with a matching ID, if it exists.
747
- */
748
- async getRefByID(id, params) {
749
- const refs = await this.getRefs(params);
750
- return findRefByID(refs, id);
751
- }
752
- /**
753
- * Returns a ref for the Prismic repository with a matching label.
754
- *
755
- * @param label - Label of the ref.
756
- *
757
- * @returns The ref with a matching label, if it exists.
758
- */
759
- async getRefByLabel(label, params) {
760
- const refs = await this.getRefs(params);
761
- return findRefByLabel(refs, label);
762
- }
763
- /**
764
- * Returns the master ref for the Prismic repository. The master ref points to
765
- * the repository's latest published content.
766
- *
767
- * @returns The repository's master ref.
768
- */
769
- async getMasterRef(params) {
770
- const refs = await this.getRefs(params);
771
- return findMasterRef(refs);
772
- }
773
- /**
774
- * Returns a list of all Releases for the Prismic repository. Releases are
775
- * used to group content changes before publishing.
776
- *
777
- * @returns A list of all Releases for the Prismic repository.
778
- */
779
- async getReleases(params) {
780
- const refs = await this.getRefs(params);
781
- return refs.filter((ref) => !ref.isMasterRef);
782
- }
783
- /**
784
- * Returns a Release for the Prismic repository with a matching ID.
785
- *
786
- * @param id - ID of the Release.
787
- *
788
- * @returns The Release with a matching ID, if it exists.
789
- */
790
- async getReleaseByID(id, params) {
791
- const releases = await this.getReleases(params);
792
- return findRefByID(releases, id);
793
- }
794
- /**
795
- * Returns a Release for the Prismic repository with a matching label.
796
- *
797
- * @param label - Label of the ref.
798
- *
799
- * @returns The ref with a matching label, if it exists.
800
- */
801
- async getReleaseByLabel(label, params) {
802
- const releases = await this.getReleases(params);
803
- return findRefByLabel(releases, label);
804
- }
805
- /**
806
- * Returns a list of all tags used in the Prismic repository.
807
- *
808
- * @returns A list of all tags used in the repository.
809
- */
810
- async getTags(params) {
811
- const cachedRepository = await this.getCachedRepository(params);
812
- const form = cachedRepository.forms.tags;
813
- if (form) {
814
- const url = new URL(form.action);
815
- if (this.accessToken) {
816
- url.searchParams.set("access_token", this.accessToken);
817
- }
818
- const response = await __privateMethod(this, _Client_instances, request_fn).call(this, url, params);
819
- if (response.ok) {
820
- return await response.json();
821
- }
822
- }
823
- const repository = await this.getRepository(params);
824
- return repository.tags;
825
- }
826
- /**
827
- * Builds a URL used to query content from the Prismic repository.
828
- *
829
- * @param params - Parameters to filter, sort, and paginate the results.
830
- *
831
- * @returns A URL string that can be requested to query content.
832
- */
833
- async buildQueryURL({ signal, fetchOptions, ...params } = {}) {
834
- const ref = params.ref || await this.getResolvedRefString({ signal, fetchOptions });
835
- const integrationFieldsRef = params.integrationFieldsRef || (await this.getCachedRepository({ signal, fetchOptions })).integrationFieldsRef || void 0;
836
- return buildQueryURL(this.documentAPIEndpoint, {
837
- ...this.defaultParams,
838
- ...params,
839
- ref,
840
- integrationFieldsRef,
841
- routes: params.routes || this.routes,
842
- brokenRoute: params.brokenRoute || this.brokenRoute,
843
- accessToken: params.accessToken || this.accessToken
844
- });
845
- }
846
- /**
847
- * Determines the URL for a previewed document during an active preview
848
- * session. The result of this method should be used to redirect the user to
849
- * the document's URL.
850
- *
851
- * @example
852
- *
853
- * ```ts
854
- * const url = client.resolvePreviewURL({
855
- * linkResolver: (document) => `/${document.uid}`
856
- * defaultURL: '/'
857
- * })
858
- * ```
859
- *
860
- * @param args - Arguments to configure the URL resolving.
861
- *
862
- * @returns The URL for the previewed document during an active preview
863
- * session. The user should be redirected to this URL.
864
- */
865
- async resolvePreviewURL(args) {
866
- var _a, _b;
867
- let documentID = args.documentID;
868
- let previewToken = args.previewToken;
869
- if (typeof globalThis.location !== "undefined") {
870
- const searchParams = new URLSearchParams(globalThis.location.search);
871
- documentID = documentID || searchParams.get("documentId");
872
- previewToken = previewToken || searchParams.get("token");
873
- } else if (this.refState.httpRequest) {
874
- if ("query" in this.refState.httpRequest) {
875
- documentID = documentID || ((_a = this.refState.httpRequest.query) == null ? void 0 : _a.documentId);
876
- previewToken = previewToken || ((_b = this.refState.httpRequest.query) == null ? void 0 : _b.token);
877
- } else if ("url" in this.refState.httpRequest && this.refState.httpRequest.url) {
878
- const searchParams = new URL(this.refState.httpRequest.url, "missing-host://").searchParams;
879
- documentID = documentID || searchParams.get("documentId");
880
- previewToken = previewToken || searchParams.get("token");
881
- }
882
- }
883
- if (documentID != null && previewToken != null) {
884
- const document = await this.getByID(documentID, {
885
- ref: previewToken,
886
- lang: "*",
887
- signal: args.signal,
888
- fetchOptions: args.fetchOptions
889
- });
890
- const url = asLink(document, { linkResolver: args.linkResolver });
891
- if (typeof url === "string") {
892
- return url;
893
- }
894
- }
895
- return args.defaultURL;
896
- }
897
- /**
898
- * Configures the client to query the latest published content for all future
899
- * queries.
900
- *
901
- * If the `ref` parameter is provided during a query, it takes priority for
902
- * that query.
903
- *
904
- * @example
905
- *
906
- * ```ts
907
- * await client.queryLatestContent()
908
- * const document = await client.getByID("WW4bKScAAMAqmluX")
909
- * ```
910
- */
911
- queryLatestContent() {
912
- this.refState.mode = RefStateMode.Master;
913
- }
914
- /**
915
- * Configures the client to query content from a specific Release identified
916
- * by its ID for all future queries.
917
- *
918
- * If the `ref` parameter is provided during a query, it takes priority for
919
- * that query.
920
- *
921
- * @example
922
- *
923
- * ```ts
924
- * await client.queryContentFromReleaseByID("YLB7OBAAACMA7Cpa")
925
- * const document = await client.getByID("WW4bKScAAMAqmluX")
926
- * ```
927
- *
928
- * @param releaseID - The ID of the Release.
929
- */
930
- queryContentFromReleaseByID(releaseID) {
931
- this.refState = {
932
- ...this.refState,
933
- mode: RefStateMode.ReleaseID,
934
- releaseID
935
- };
936
- }
937
- /**
938
- * Configures the client to query content from a specific Release identified
939
- * by its label for all future queries.
940
- *
941
- * If the `ref` parameter is provided during a query, it takes priority for
942
- * that query.
943
- *
944
- * @example
945
- *
946
- * ```ts
947
- * await client.queryContentFromReleaseByLabel("My Release")
948
- * const document = await client.getByID("WW4bKScAAMAqmluX")
949
- * ```
950
- *
951
- * @param releaseLabel - The label of the Release.
952
- */
953
- queryContentFromReleaseByLabel(releaseLabel) {
954
- this.refState = {
955
- ...this.refState,
956
- mode: RefStateMode.ReleaseLabel,
957
- releaseLabel
958
- };
959
- }
960
- /**
961
- * Configures the client to query content from a specific ref. The ref can be
962
- * provided as a string or a function.
963
- *
964
- * If a function is provided, the ref is fetched lazily before each query. The
965
- * function may also be asynchronous.
966
- *
967
- * @example
968
- *
969
- * ```ts
970
- * await client.queryContentFromRef("my-ref")
971
- * const document = await client.getByID("WW4bKScAAMAqmluX")
972
- * ```
973
- *
974
- * @param ref - The ref or a function that returns the ref from which to query
975
- * content.
976
- */
977
- queryContentFromRef(ref) {
978
- this.refState = {
979
- ...this.refState,
980
- mode: RefStateMode.Manual,
981
- ref
982
- };
983
- }
984
- /**
985
- * A `fetch()` function to be used with GraphQL clients configured for
986
- * Prismic's GraphQL API. It automatically applies the necessary `prismic-ref`
987
- * and Authorization headers. Queries will automatically be minified by
988
- * removing whitespace where possible.
989
- *
990
- * @example
991
- *
992
- * ```ts
993
- * const graphQLClient = new ApolloClient({
994
- * link: new HttpLink({
995
- * uri: prismic.getGraphQLEndpoint(repositoryName),
996
- * // Provide `client.graphQLFetch` as the fetch implementation.
997
- * fetch: client.graphQLFetch,
998
- * // Using GET is required.
999
- * useGETForQueries: true,
1000
- * }),
1001
- * cache: new InMemoryCache(),
1002
- * })
1003
- * ```
1004
- *
1005
- * @param input - The `fetch()` `input` parameter. Only strings are supported.
1006
- * @param init - The `fetch()` `init` parameter. Only plain objects are
1007
- * supported.
1008
- *
1009
- * @returns The `fetch()` Response for the request.
1010
- *
1011
- * @experimental
1012
- */
1013
- async graphQLFetch(input, init) {
1014
- const cachedRepository = await this.getCachedRepository();
1015
- const ref = await this.getResolvedRefString();
1016
- const unsanitizedHeaders = {
1017
- "Prismic-ref": ref,
1018
- Authorization: this.accessToken ? `Token ${this.accessToken}` : "",
1019
- // Asserting `init.headers` is a Record since popular GraphQL
1020
- // libraries pass this as a Record. Header objects as input
1021
- // are unsupported.
1022
- ...init ? init.headers : {}
1023
- };
1024
- if (cachedRepository.integrationFieldsRef) {
1025
- unsanitizedHeaders["Prismic-integration-field-ref"] = cachedRepository.integrationFieldsRef;
1026
- }
1027
- const headers = {};
1028
- for (const key in unsanitizedHeaders) {
1029
- if (unsanitizedHeaders[key]) {
1030
- headers[key.toLowerCase()] = unsanitizedHeaders[key];
1031
- }
1032
- }
1033
- const url = new URL(
1034
- // Asserting `input` is a string since popular GraphQL
1035
- // libraries pass this as a string. Request objects as
1036
- // input are unsupported.
1037
- input
1038
- );
1039
- url.searchParams.set("ref", ref);
1040
- const query = url.searchParams.get("query");
1041
- if (query) {
1042
- url.searchParams.set(
1043
- "query",
1044
- // Compress the GraphQL query (if it exists) by
1045
- // removing whitespace. This is done to
1046
- // optimize the query size and avoid
1047
- // hitting the upper limit of GET requests
1048
- // (2048 characters).
1049
- minifyGraphQLQuery(query)
1050
- );
1051
- }
1052
- return await this.fetchFn(url.toString(), {
1053
- ...init,
1054
- headers
1055
- });
1056
- }
1057
- /**
1058
- * Returns a cached version of `getRepository` with a TTL.
1059
- *
1060
- * @returns Cached repository metadata.
1061
- */
1062
- async getCachedRepository(params) {
1063
- if (!this.cachedRepository || Date.now() >= this.cachedRepositoryExpiration) {
1064
- this.cachedRepository = await this.getRepository(params);
1065
- this.cachedRepositoryExpiration = Date.now() + REPOSITORY_CACHE_TTL;
1066
- }
1067
- return this.cachedRepository;
1068
- }
1069
- /**
1070
- * Returns the ref needed to query based on the client's current state. This
1071
- * method may make a network request to fetch a ref or resolve the user's ref
1072
- * thunk.
1073
- *
1074
- * If auto previews are enabled, the preview ref takes priority if available.
1075
- *
1076
- * The following strategies are used depending on the client's state:
1077
- *
1078
- * - If the user called `queryLatestContent`: Use the repository's master ref.
1079
- * The ref is cached for 5 seconds. After 5 seconds, a new master ref is
1080
- * fetched.
1081
- * - If the user called `queryContentFromReleaseByID`: Use the release's ref.
1082
- * The ref is cached for 5 seconds. After 5 seconds, a new ref for the
1083
- * release is fetched.
1084
- * - If the user called `queryContentFromReleaseByLabel`: Use the release's ref.
1085
- * The ref is cached for 5 seconds. After 5 seconds, a new ref for the
1086
- * release is fetched.
1087
- * - If the user called `queryContentFromRef`: Use the provided ref. Fall back
1088
- * to the master ref if the ref is not a string.
1089
- *
1090
- * @returns The ref to use during a query.
1091
- */
1092
- async getResolvedRefString(params) {
1093
- var _a, _b;
1094
- if (this.refState.autoPreviewsEnabled) {
1095
- let previewRef;
1096
- let cookieJar;
1097
- if ((_a = this.refState.httpRequest) == null ? void 0 : _a.headers) {
1098
- if ("get" in this.refState.httpRequest.headers && typeof this.refState.httpRequest.headers.get === "function") {
1099
- cookieJar = this.refState.httpRequest.headers.get("cookie");
1100
- } else if ("cookie" in this.refState.httpRequest.headers) {
1101
- cookieJar = this.refState.httpRequest.headers.cookie;
1102
- }
1103
- } else if ((_b = globalThis.document) == null ? void 0 : _b.cookie) {
1104
- cookieJar = globalThis.document.cookie;
1105
- }
1106
- if (cookieJar) {
1107
- previewRef = getPreviewCookie(cookieJar);
1108
- }
1109
- if (previewRef) {
1110
- return previewRef;
1111
- }
1112
- }
1113
- const cachedRepository = await this.getCachedRepository(params);
1114
- const refModeType = this.refState.mode;
1115
- if (refModeType === RefStateMode.ReleaseID) {
1116
- return findRefByID(cachedRepository.refs, this.refState.releaseID).ref;
1117
- } else if (refModeType === RefStateMode.ReleaseLabel) {
1118
- return findRefByLabel(cachedRepository.refs, this.refState.releaseLabel).ref;
1119
- } else if (refModeType === RefStateMode.Manual) {
1120
- const res = await castThunk(this.refState.ref)();
1121
- if (typeof res === "string") {
1122
- return res;
1123
- }
1124
- }
1125
- return findMasterRef(cachedRepository.refs).ref;
1126
- }
1127
- /**
1128
- * The private implementation of `this.get`. It returns the API response and
1129
- * the URL used to make the request. The URL is sometimes used in the public
1130
- * method to include in thrown errors.
1131
- *
1132
- * This method retries requests that throw `RefNotFoundError` or
1133
- * `RefExpiredError`. It contains special logic to retry with the latest
1134
- * master ref, provided in the API's error message.
1135
- *
1136
- * @typeParam TDocument - Type of Prismic documents returned.
1137
- *
1138
- * @param params - Parameters to filter, sort, and paginate results.
1139
- *
1140
- * @returns An object containing the paginated response containing the result
1141
- * of the query and the URL used to make the API request.
1142
- */
1143
- async _get(params, attemptCount = 0) {
1144
- var _a, _b;
1145
- const url = await this.buildQueryURL(params);
1146
- try {
1147
- const response = await __privateMethod(this, _Client_instances, request_fn).call(this, new URL(url), params);
1148
- switch (response.status) {
1149
- case 200: {
1150
- try {
1151
- return {
1152
- data: await response.clone().json(),
1153
- url
1154
- };
1155
- } catch {
1156
- throw new PrismicError(void 0, url, await response.text());
1157
- }
1158
- }
1159
- case 400: {
1160
- const json = await response.json();
1161
- throw new ParsingError(json.message, url, json);
1162
- }
1163
- case 401: {
1164
- const json = await response.json();
1165
- throw new ForbiddenError(json.message, url, json);
1166
- }
1167
- case 404: {
1168
- const json = await response.json();
1169
- switch (json.type) {
1170
- case "api_notfound_error": {
1171
- throw new RefNotFoundError(json.message, url, json);
1172
- }
1173
- case "api_security_error": {
1174
- if (/preview token.*expired/i.test(json.message)) {
1175
- throw new PreviewTokenExpiredError(json.message, url, json);
1176
- }
1177
- }
1178
- default: {
1179
- throw new NotFoundError(json.message, url, json);
1180
- }
1181
- }
1182
- }
1183
- case 410: {
1184
- const json = await response.json();
1185
- throw new RefExpiredError(json.message, url, json);
1186
- }
1187
- default: {
1188
- throw new PrismicError(void 0, url, await response.text());
1189
- }
1190
- }
1191
- } catch (error) {
1192
- if (!(error instanceof RefNotFoundError || error instanceof RefExpiredError) || attemptCount >= MAX_INVALID_REF_RETRY_ATTEMPTS - 1) {
1193
- throw error;
1194
- }
1195
- if (!(params == null ? void 0 : params.ref)) {
1196
- this.cachedRepository = void 0;
1197
- }
1198
- const masterRef = (_b = (_a = error.message.match(/Master ref is: (?<ref>.*)$/)) == null ? void 0 : _a.groups) == null ? void 0 : _b.ref;
1199
- if (!masterRef) {
1200
- throw error;
1201
- }
1202
- const badRef = new URL(url).searchParams.get("ref");
1203
- const issue = error instanceof RefNotFoundError ? "invalid" : "expired";
1204
- throttledLog(`[@prismicio/client] The ref (${badRef}) was ${issue}. Now retrying with the latest master ref (${masterRef}). If you were previewing content, the response will not include draft content.`, { level: "warn" });
1205
- return await this._get({ ...params, ref: masterRef }, attemptCount + 1);
1206
- }
1207
- }
1208
- _buildRequestInit(params) {
1209
- var _a, _b, _c, _d;
1210
- return {
1211
- ...this.fetchOptions,
1212
- ...params == null ? void 0 : params.fetchOptions,
1213
- headers: {
1214
- ...(_a = this.fetchOptions) == null ? void 0 : _a.headers,
1215
- ...(_b = params == null ? void 0 : params.fetchOptions) == null ? void 0 : _b.headers
1216
- },
1217
- signal: ((_c = params == null ? void 0 : params.fetchOptions) == null ? void 0 : _c.signal) || (params == null ? void 0 : params.signal) || ((_d = this.fetchOptions) == null ? void 0 : _d.signal)
1218
- };
1219
- }
1220
- }
1221
- _repositoryName = /* @__PURE__ */ new WeakMap();
1222
- _Client_instances = /* @__PURE__ */ new WeakSet();
1223
- request_fn = async function(url, params) {
1224
- return await request(url, this._buildRequestInit(params), this.fetchFn);
1225
- };
1226
- export {
1227
- Client,
1228
- GET_ALL_QUERY_DELAY,
1229
- REPOSITORY_CACHE_TTL
1230
- };
1231
- //# sourceMappingURL=Client.js.map