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