@prismicio/client 7.23.1-canary.46cd720 → 7.23.1-canary.7a569a1
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.
- package/dist/Client.cjs +0 -72
- package/dist/Client.cjs.map +1 -1
- package/dist/Client.d.cts +0 -72
- package/dist/Client.d.cts.map +1 -1
- package/dist/Client.d.ts +0 -72
- package/dist/Client.d.ts.map +1 -1
- package/dist/Client.js +0 -72
- package/dist/Client.js.map +1 -1
- package/dist/Migration.cjs +0 -6
- package/dist/Migration.cjs.map +1 -1
- package/dist/Migration.d.cts +0 -6
- package/dist/Migration.d.cts.map +1 -1
- package/dist/Migration.d.ts +0 -6
- package/dist/Migration.d.ts.map +1 -1
- package/dist/Migration.js +0 -6
- package/dist/Migration.js.map +1 -1
- package/dist/buildQueryURL.cjs +0 -2
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.cts +0 -4
- package/dist/buildQueryURL.d.cts.map +1 -1
- package/dist/buildQueryURL.d.ts +0 -4
- package/dist/buildQueryURL.d.ts.map +1 -1
- package/dist/buildQueryURL.js +0 -2
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/createClient.cjs +0 -2
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.d.cts +0 -2
- package/dist/createClient.d.cts.map +1 -1
- package/dist/createClient.d.ts +0 -2
- package/dist/createClient.d.ts.map +1 -1
- package/dist/createClient.js +0 -2
- package/dist/createClient.js.map +1 -1
- package/dist/createMigration.cjs +0 -2
- package/dist/createMigration.cjs.map +1 -1
- package/dist/createMigration.d.cts +0 -2
- package/dist/createMigration.d.cts.map +1 -1
- package/dist/createMigration.d.ts +0 -2
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +0 -2
- package/dist/createMigration.js.map +1 -1
- package/dist/createWriteClient.cjs +0 -2
- package/dist/createWriteClient.cjs.map +1 -1
- package/dist/createWriteClient.d.cts +0 -2
- package/dist/createWriteClient.d.cts.map +1 -1
- package/dist/createWriteClient.d.ts +0 -2
- package/dist/createWriteClient.d.ts.map +1 -1
- package/dist/createWriteClient.js +0 -2
- package/dist/createWriteClient.js.map +1 -1
- package/dist/getRepositoryEndpoint.cjs +0 -2
- package/dist/getRepositoryEndpoint.cjs.map +1 -1
- package/dist/getRepositoryEndpoint.d.cts +0 -2
- package/dist/getRepositoryEndpoint.d.cts.map +1 -1
- package/dist/getRepositoryEndpoint.d.ts +0 -2
- package/dist/getRepositoryEndpoint.d.ts.map +1 -1
- package/dist/getRepositoryEndpoint.js +0 -2
- package/dist/getRepositoryEndpoint.js.map +1 -1
- package/dist/helpers/asDate.cjs +0 -2
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.d.cts +0 -2
- package/dist/helpers/asDate.d.cts.map +1 -1
- package/dist/helpers/asDate.d.ts +0 -2
- package/dist/helpers/asDate.d.ts.map +1 -1
- package/dist/helpers/asDate.js +0 -2
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.cts +0 -2
- package/dist/helpers/asHTML.d.cts.map +1 -1
- package/dist/helpers/asHTML.d.ts +0 -2
- package/dist/helpers/asHTML.d.ts.map +1 -1
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +0 -2
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +0 -2
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +0 -2
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.js +0 -2
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs +0 -2
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.cts +0 -2
- package/dist/helpers/asImageSrc.d.cts.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +0 -2
- package/dist/helpers/asImageSrc.d.ts.map +1 -1
- package/dist/helpers/asImageSrc.js +0 -2
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs +0 -2
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.cts +0 -2
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +0 -2
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.js +0 -2
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.cts +0 -2
- package/dist/helpers/asLink.d.cts.map +1 -1
- package/dist/helpers/asLink.d.ts +0 -2
- package/dist/helpers/asLink.d.ts.map +1 -1
- package/dist/helpers/asLink.js.map +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.cts +0 -2
- package/dist/helpers/asText.d.cts.map +1 -1
- package/dist/helpers/asText.d.ts +0 -2
- package/dist/helpers/asText.d.ts.map +1 -1
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/mapSliceZone.cjs +0 -2
- package/dist/helpers/mapSliceZone.cjs.map +1 -1
- package/dist/helpers/mapSliceZone.d.cts +0 -2
- package/dist/helpers/mapSliceZone.d.cts.map +1 -1
- package/dist/helpers/mapSliceZone.d.ts +0 -2
- package/dist/helpers/mapSliceZone.d.ts.map +1 -1
- package/dist/helpers/mapSliceZone.js +0 -2
- package/dist/helpers/mapSliceZone.js.map +1 -1
- package/dist/lib/devMsg.cjs +0 -2
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.js +0 -2
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/types/migration/Document.cjs.map +1 -1
- package/dist/types/migration/Document.d.cts.map +1 -1
- package/dist/types/migration/Document.d.ts.map +1 -1
- package/dist/types/migration/Document.js.map +1 -1
- package/package.json +3 -3
- package/src/Client.ts +0 -72
- package/src/Migration.ts +0 -6
- package/src/buildQueryURL.ts +0 -4
- package/src/createClient.ts +0 -2
- package/src/createMigration.ts +0 -2
- package/src/createWriteClient.ts +0 -2
- package/src/getRepositoryEndpoint.ts +0 -2
- package/src/helpers/asDate.ts +0 -2
- package/src/helpers/asHTML.ts +0 -2
- package/src/helpers/asImagePixelDensitySrcSet.ts +0 -2
- package/src/helpers/asImageSrc.ts +0 -2
- package/src/helpers/asImageWidthSrcSet.ts +0 -2
- package/src/helpers/asLink.ts +0 -2
- package/src/helpers/asText.ts +0 -2
- package/src/helpers/mapSliceZone.ts +0 -2
- package/src/lib/devMsg.ts +0 -2
- package/src/types/migration/Document.ts +4 -5
- package/src/types/migration/Link.ts +0 -2
package/dist/Client.cjs
CHANGED
|
@@ -128,9 +128,7 @@ var Client = class {
|
|
|
128
128
|
* Enables the client to automatically query content from a preview session.
|
|
129
129
|
*
|
|
130
130
|
* @example
|
|
131
|
-
* ;```ts
|
|
132
131
|
* client.enableAutoPreviews()
|
|
133
|
-
* ```
|
|
134
132
|
*
|
|
135
133
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviews}
|
|
136
134
|
*/
|
|
@@ -142,9 +140,7 @@ var Client = class {
|
|
|
142
140
|
* object.
|
|
143
141
|
*
|
|
144
142
|
* @example
|
|
145
|
-
* ;```ts
|
|
146
143
|
* client.enableAutoPreviewsFromReq(req)
|
|
147
|
-
* ```
|
|
148
144
|
*
|
|
149
145
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviewsfromreq}
|
|
150
146
|
*/
|
|
@@ -156,9 +152,7 @@ var Client = class {
|
|
|
156
152
|
* Disables the client from automatically querying content from a preview session.
|
|
157
153
|
*
|
|
158
154
|
* @example
|
|
159
|
-
* ;```ts
|
|
160
155
|
* client.disableAutoPreviews()
|
|
161
|
-
* ```
|
|
162
156
|
*
|
|
163
157
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#disableautopreviews}
|
|
164
158
|
*/
|
|
@@ -170,9 +164,7 @@ var Client = class {
|
|
|
170
164
|
* Fetches pages based on the `params` argument. Results are paginated.
|
|
171
165
|
*
|
|
172
166
|
* @example
|
|
173
|
-
* ;```ts
|
|
174
167
|
* const response = await client.get({ pageSize: 10 })
|
|
175
|
-
* ```
|
|
176
168
|
*
|
|
177
169
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#get}
|
|
178
170
|
*/
|
|
@@ -183,9 +175,7 @@ var Client = class {
|
|
|
183
175
|
* Fetches the first page returned based on the `params` argument.
|
|
184
176
|
*
|
|
185
177
|
* @example
|
|
186
|
-
* ;```ts
|
|
187
178
|
* const page = await client.getFirst()
|
|
188
|
-
* ```
|
|
189
179
|
*
|
|
190
180
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getfirst}
|
|
191
181
|
*/
|
|
@@ -204,9 +194,7 @@ var Client = class {
|
|
|
204
194
|
* requests to fetch all matching pages.
|
|
205
195
|
*
|
|
206
196
|
* @example
|
|
207
|
-
* ;```ts
|
|
208
197
|
* const pages = await client.dangerouslyGetAll()
|
|
209
|
-
* ```
|
|
210
198
|
*
|
|
211
199
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#dangerouslygetall}
|
|
212
200
|
*/
|
|
@@ -235,9 +223,7 @@ var Client = class {
|
|
|
235
223
|
* Fetches a page with a specific ID.
|
|
236
224
|
*
|
|
237
225
|
* @example
|
|
238
|
-
* ;```ts
|
|
239
226
|
* const page = await client.getByID("WW4bKScAAMAqmluX")
|
|
240
|
-
* ```
|
|
241
227
|
*
|
|
242
228
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyid}
|
|
243
229
|
*/
|
|
@@ -248,9 +234,7 @@ var Client = class {
|
|
|
248
234
|
* Fetches pages with specific IDs. Results are paginated.
|
|
249
235
|
*
|
|
250
236
|
* @example
|
|
251
|
-
* ;```ts
|
|
252
237
|
* const response = await client.getByIDs(["WW4bKScAAMAqmluX", "U1kTRgEAAC8A5ldS"])
|
|
253
|
-
* ```
|
|
254
238
|
*
|
|
255
239
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyids}
|
|
256
240
|
*/
|
|
@@ -262,9 +246,7 @@ var Client = class {
|
|
|
262
246
|
* matching pages.
|
|
263
247
|
*
|
|
264
248
|
* @example
|
|
265
|
-
* ;```ts
|
|
266
249
|
* const pages = await client.getAllByIDs(["WW4bKScAAMAqmluX", "U1kTRgEAAC8A5ldS"])
|
|
267
|
-
* ```
|
|
268
250
|
*
|
|
269
251
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyids}
|
|
270
252
|
*/
|
|
@@ -275,9 +257,7 @@ var Client = class {
|
|
|
275
257
|
* Fetches a page with a specific UID and type.
|
|
276
258
|
*
|
|
277
259
|
* @example
|
|
278
|
-
* ;```ts
|
|
279
260
|
* const page = await client.getByUID("blog_post", "my-first-post")
|
|
280
|
-
* ```
|
|
281
261
|
*
|
|
282
262
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuid}
|
|
283
263
|
*/
|
|
@@ -288,9 +268,7 @@ var Client = class {
|
|
|
288
268
|
* Fetches pages with specific UIDs and a specific type. Results are paginated.
|
|
289
269
|
*
|
|
290
270
|
* @example
|
|
291
|
-
* ;```ts
|
|
292
271
|
* const response = await client.getByUIDs("blog_post", ["my-first-post", "my-second-post"])
|
|
293
|
-
* ```
|
|
294
272
|
*
|
|
295
273
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuids}
|
|
296
274
|
*/
|
|
@@ -302,9 +280,7 @@ var Client = class {
|
|
|
302
280
|
* requests to fetch all matching pages.
|
|
303
281
|
*
|
|
304
282
|
* @example
|
|
305
|
-
* ;```ts
|
|
306
283
|
* const pages = await client.getAllByUIDs("blog_post", ["my-first-post", "my-second-post"])
|
|
307
|
-
* ```
|
|
308
284
|
*
|
|
309
285
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyuids}
|
|
310
286
|
*/
|
|
@@ -315,9 +291,7 @@ var Client = class {
|
|
|
315
291
|
* Fetches a specific single type page.
|
|
316
292
|
*
|
|
317
293
|
* @example
|
|
318
|
-
* ;```ts
|
|
319
294
|
* const page = await client.getSingle("settings")
|
|
320
|
-
* ```
|
|
321
295
|
*
|
|
322
296
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getsingle}
|
|
323
297
|
*/
|
|
@@ -328,9 +302,7 @@ var Client = class {
|
|
|
328
302
|
* Fetches pages with a specific type. Results are paginated.
|
|
329
303
|
*
|
|
330
304
|
* @example
|
|
331
|
-
* ;```ts
|
|
332
305
|
* const response = await client.getByType("blog_post")
|
|
333
|
-
* ```
|
|
334
306
|
*
|
|
335
307
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytype}
|
|
336
308
|
*/
|
|
@@ -342,9 +314,7 @@ var Client = class {
|
|
|
342
314
|
* matching documents.
|
|
343
315
|
*
|
|
344
316
|
* @example
|
|
345
|
-
* ;```ts
|
|
346
317
|
* const pages = await client.getAllByType("blog_post")
|
|
347
|
-
* ```
|
|
348
318
|
*
|
|
349
319
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytype}
|
|
350
320
|
*/
|
|
@@ -355,9 +325,7 @@ var Client = class {
|
|
|
355
325
|
* Fetches pages with a specific tag. Results are paginated.
|
|
356
326
|
*
|
|
357
327
|
* @example
|
|
358
|
-
* ;```ts
|
|
359
328
|
* const response = await client.getByTag("featured")
|
|
360
|
-
* ```
|
|
361
329
|
*
|
|
362
330
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytag}
|
|
363
331
|
*/
|
|
@@ -369,9 +337,7 @@ var Client = class {
|
|
|
369
337
|
* matching documents.
|
|
370
338
|
*
|
|
371
339
|
* @example
|
|
372
|
-
* ;```ts
|
|
373
340
|
* const pages = await client.getAllByTag("featured")
|
|
374
|
-
* ```
|
|
375
341
|
*
|
|
376
342
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytag}
|
|
377
343
|
*/
|
|
@@ -382,9 +348,7 @@ var Client = class {
|
|
|
382
348
|
* Fetches pages with every tag from a list of tags. Results are paginated.
|
|
383
349
|
*
|
|
384
350
|
* @example
|
|
385
|
-
* ;```ts
|
|
386
351
|
* const response = await client.getByEveryTag(["featured", "homepage"])
|
|
387
|
-
* ```
|
|
388
352
|
*
|
|
389
353
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyeverytag}
|
|
390
354
|
*/
|
|
@@ -396,9 +360,7 @@ var Client = class {
|
|
|
396
360
|
* requests to fetch all matching pages.
|
|
397
361
|
*
|
|
398
362
|
* @example
|
|
399
|
-
* ;```ts
|
|
400
363
|
* const pages = await client.getAllByEveryTag(["featured", "homepage"])
|
|
401
|
-
* ```
|
|
402
364
|
*
|
|
403
365
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyeverytag}
|
|
404
366
|
*/
|
|
@@ -409,9 +371,7 @@ var Client = class {
|
|
|
409
371
|
* Fetches pages with at least one tag from a list of tags. Results are paginated.
|
|
410
372
|
*
|
|
411
373
|
* @example
|
|
412
|
-
* ;```ts
|
|
413
374
|
* const response = await client.getBySomeTags(["featured", "homepage"])
|
|
414
|
-
* ```
|
|
415
375
|
*
|
|
416
376
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbysometags}
|
|
417
377
|
*/
|
|
@@ -423,9 +383,7 @@ var Client = class {
|
|
|
423
383
|
* requests to fetch all matching documents.
|
|
424
384
|
*
|
|
425
385
|
* @example
|
|
426
|
-
* ;```ts
|
|
427
386
|
* const pages = await client.getAllBySomeTags(["featured", "homepage"])
|
|
428
|
-
* ```
|
|
429
387
|
*
|
|
430
388
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbysometags}
|
|
431
389
|
*/
|
|
@@ -436,9 +394,7 @@ var Client = class {
|
|
|
436
394
|
* Fetches metadata about the client's Prismic repository.
|
|
437
395
|
*
|
|
438
396
|
* @example
|
|
439
|
-
* ;```ts
|
|
440
397
|
* const repository = await client.getRepository()
|
|
441
|
-
* ```
|
|
442
398
|
*
|
|
443
399
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrepository}
|
|
444
400
|
*/
|
|
@@ -460,9 +416,7 @@ var Client = class {
|
|
|
460
416
|
* Fetches the repository's active refs.
|
|
461
417
|
*
|
|
462
418
|
* @example
|
|
463
|
-
* ;```ts
|
|
464
419
|
* const refs = await client.getRefs()
|
|
465
|
-
* ```
|
|
466
420
|
*
|
|
467
421
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefs}
|
|
468
422
|
*/
|
|
@@ -473,9 +427,7 @@ var Client = class {
|
|
|
473
427
|
* Fetches a ref by its ID.
|
|
474
428
|
*
|
|
475
429
|
* @example
|
|
476
|
-
* ;```ts
|
|
477
430
|
* const ref = await client.getRefByID("YhE3YhEAACIA4321")
|
|
478
|
-
* ```
|
|
479
431
|
*
|
|
480
432
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbyid}
|
|
481
433
|
*/
|
|
@@ -488,9 +440,7 @@ var Client = class {
|
|
|
488
440
|
* Fetches a ref by its label. A release ref's label is its name shown in the Page Builder.
|
|
489
441
|
*
|
|
490
442
|
* @example
|
|
491
|
-
* ;```ts
|
|
492
443
|
* const ref = await client.getRefByLabel("My Release")
|
|
493
|
-
* ```
|
|
494
444
|
*
|
|
495
445
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbylabel}
|
|
496
446
|
*/
|
|
@@ -503,9 +453,7 @@ var Client = class {
|
|
|
503
453
|
* Fetches the repository's master ref.
|
|
504
454
|
*
|
|
505
455
|
* @example
|
|
506
|
-
* ;```ts
|
|
507
456
|
* const masterRef = await client.getMasterRef()
|
|
508
|
-
* ```
|
|
509
457
|
*
|
|
510
458
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getmasterref}
|
|
511
459
|
*/
|
|
@@ -518,9 +466,7 @@ var Client = class {
|
|
|
518
466
|
* Fetches the repository's active releases.
|
|
519
467
|
*
|
|
520
468
|
* @example
|
|
521
|
-
* ;```ts
|
|
522
469
|
* const releases = await client.getReleases()
|
|
523
|
-
* ```
|
|
524
470
|
*
|
|
525
471
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleases}
|
|
526
472
|
*/
|
|
@@ -531,9 +477,7 @@ var Client = class {
|
|
|
531
477
|
* Fetches a release with a specific ID.
|
|
532
478
|
*
|
|
533
479
|
* @example
|
|
534
|
-
* ;```ts
|
|
535
480
|
* const release = await client.getReleaseByID("YhE3YhEAACIA4321")
|
|
536
|
-
* ```
|
|
537
481
|
*
|
|
538
482
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebyid}
|
|
539
483
|
*/
|
|
@@ -546,9 +490,7 @@ var Client = class {
|
|
|
546
490
|
* Fetches a release by its label. A release ref's label is its name shown in the Page Builder.
|
|
547
491
|
*
|
|
548
492
|
* @example
|
|
549
|
-
* ;```ts
|
|
550
493
|
* const release = await client.getReleaseByLabel("My Release")
|
|
551
|
-
* ```
|
|
552
494
|
*
|
|
553
495
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebylabel}
|
|
554
496
|
*/
|
|
@@ -561,9 +503,7 @@ var Client = class {
|
|
|
561
503
|
* Fetches the repository's page tags.
|
|
562
504
|
*
|
|
563
505
|
* @example
|
|
564
|
-
* ;```ts
|
|
565
506
|
* const tags = await client.getTags()
|
|
566
|
-
* ```
|
|
567
507
|
*
|
|
568
508
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#gettags}
|
|
569
509
|
*/
|
|
@@ -582,11 +522,9 @@ var Client = class {
|
|
|
582
522
|
* Builds a Content API query URL with a set of parameters.
|
|
583
523
|
*
|
|
584
524
|
* @example
|
|
585
|
-
* ;```ts
|
|
586
525
|
* const url = await client.buildQueryURL({
|
|
587
526
|
* filters: [filter.at("document.type", "blog_post")],
|
|
588
527
|
* })
|
|
589
|
-
* ```
|
|
590
528
|
*
|
|
591
529
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#buildqueryurl}
|
|
592
530
|
*/
|
|
@@ -615,12 +553,10 @@ var Client = class {
|
|
|
615
553
|
* Fetches a previewed page's URL using a preview token and page ID.
|
|
616
554
|
*
|
|
617
555
|
* @example
|
|
618
|
-
* ;```ts
|
|
619
556
|
* const url = await client.resolvePreviewURL({
|
|
620
557
|
* linkResolver,
|
|
621
558
|
* defaultURL: "/",
|
|
622
559
|
* })
|
|
623
|
-
* ```
|
|
624
560
|
*
|
|
625
561
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#resolvepreviewurl}
|
|
626
562
|
*/
|
|
@@ -657,9 +593,7 @@ var Client = class {
|
|
|
657
593
|
* Configures the client to query the latest published content. This is the client's default mode.
|
|
658
594
|
*
|
|
659
595
|
* @example
|
|
660
|
-
* ;```ts
|
|
661
596
|
* client.queryLatestContent()
|
|
662
|
-
* ```
|
|
663
597
|
*
|
|
664
598
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querylatestcontent}
|
|
665
599
|
*/
|
|
@@ -670,9 +604,7 @@ var Client = class {
|
|
|
670
604
|
* Configures the client to query content from a release with a specific ID.
|
|
671
605
|
*
|
|
672
606
|
* @example
|
|
673
|
-
* ;```ts
|
|
674
607
|
* client.queryContentFromReleaseByID("YhE3YhEAACIA4321")
|
|
675
|
-
* ```
|
|
676
608
|
*
|
|
677
609
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebyid}
|
|
678
610
|
*/
|
|
@@ -685,9 +617,7 @@ var Client = class {
|
|
|
685
617
|
* Configures the client to query content from a release with a specific label.
|
|
686
618
|
*
|
|
687
619
|
* @example
|
|
688
|
-
* ;```ts
|
|
689
620
|
* client.queryContentFromReleaseByLabel("My Release")
|
|
690
|
-
* ```
|
|
691
621
|
*
|
|
692
622
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebylabel}
|
|
693
623
|
*/
|
|
@@ -700,9 +630,7 @@ var Client = class {
|
|
|
700
630
|
* Configures the client to query content from a specific ref.
|
|
701
631
|
*
|
|
702
632
|
* @example
|
|
703
|
-
* ;```ts
|
|
704
633
|
* client.queryContentFromRef("my-ref")
|
|
705
|
-
* ```
|
|
706
634
|
*
|
|
707
635
|
* @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromref}
|
|
708
636
|
*/
|
package/dist/Client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.cjs","names":["isRepositoryEndpoint","getRepositoryName","devMsg","getRepositoryEndpoint","PrismicError","NotFoundError","filter","RepositoryNotFoundError","buildQueryURL","asLink","getPreviewCookie","RefNotFoundError","RefExpiredError","ParsingError","ForbiddenError","PreviewTokenExpiredError","request"],"sources":["../src/Client.ts"],"sourcesContent":["import { type BuildQueryURLArgs, buildQueryURL } from \"./buildQueryURL\"\nimport {\n\tForbiddenError,\n\tNotFoundError,\n\tParsingError,\n\tPreviewTokenExpiredError,\n\tPrismicError,\n\tRefExpiredError,\n\tRefNotFoundError,\n\tRepositoryNotFoundError,\n} from \"./errors\"\nimport { filter } from \"./filter\"\nimport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\"\nimport { getRepositoryName } from \"./getRepositoryName\"\nimport { type LinkResolverFunction, asLink } from \"./helpers/asLink\"\nimport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\"\nimport { devMsg } from \"./lib/devMsg\"\nimport { getPreviewCookie } from \"./lib/getPreviewCookie\"\nimport type { ResponseLike } from \"./lib/request\"\nimport { type AbortSignalLike, type FetchLike, type RequestInitLike, request } from \"./lib/request\"\nimport { throttledWarn } from \"./lib/throttledWarn\"\nimport type { Query } from \"./types/api/query\"\nimport type { Ref } from \"./types/api/ref\"\nimport type { Repository } from \"./types/api/repository\"\nimport type { PrismicDocument } from \"./types/value/document\"\n\nconst MAX_PAGE_SIZE = 100\nconst REPOSITORY_CACHE_TTL = 5000\nconst GET_ALL_QUERY_DELAY = 500\nconst MAX_INVALID_REF_RETRY_ATTEMPTS = 3\n\n/** Extracts a document type with a matching `type` property from a union of document types. */\ntype ExtractDocumentType<\n\tTDocuments extends PrismicDocument,\n\tTDocumentType extends TDocuments[\"type\"],\n> =\n\tExtract<TDocuments, { type: TDocumentType }> extends never\n\t\t? TDocuments\n\t\t: Extract<TDocuments, { type: TDocumentType }>\n\n/**\n * The minimum required properties to treat as an HTTP Request for automatic Prismic preview\n * support.\n */\nexport type HttpRequestLike =\n\t| // Web API Request\n\t {\n\t\t\theaders?: {\n\t\t\t\tget(name: string): string | null\n\t\t\t}\n\t\t\turl?: string\n\t }\n\t// Express-style request\n\t| {\n\t\t\theaders?: {\n\t\t\t\tcookie?: string\n\t\t\t}\n\t\t\tquery?: Record<string, unknown>\n\t }\n\n/**\n * A function that returns a ref string. Used to configure which ref the client queries content\n * from.\n */\ntype GetRef = (\n\tparams?: Pick<BuildQueryURLArgs, \"accessToken\"> & FetchParams,\n) => string | undefined | Promise<string | undefined>\n\n/** Parameters for client methods that use `fetch()`. */\nexport type FetchParams = {\n\t/**\n\t * Options provided to the client's `fetch()` on all network requests. These options will be\n\t * merged with internally required options. They can also be overriden on a per-query basis using\n\t * the query's `fetchOptions` parameter.\n\t */\n\tfetchOptions?: RequestInitLike\n\t/** @deprecated Move to `fetchOptions.signal`: */\n\t// TODO: Remove in v8.\n\tsignal?: AbortSignalLike\n}\n\n/** Prismic client configuration. */\nexport type ClientConfig = {\n\t/**\n\t * The client's Content API endpoint.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdocumentAPIEndpoint?: string\n\t/**\n\t * The secure token used for the Content API.\n\t *\n\t * @see {@link https://prismic.io/docs/fetch-content#content-visibility}\n\t */\n\taccessToken?: string\n\t/**\n\t * The version of the repository's content. It can optionally be a function that returns a ref.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tref?: string | GetRef\n\t/**\n\t * A list of route resolver objects that define how a document's `url` property is resolved.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\troutes?: NonNullable<BuildQueryURLArgs[\"routes\"]>\n\t/**\n\t * The URL used for link or content relationship fields that point to an archived or deleted page.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tbrokenRoute?: NonNullable<BuildQueryURLArgs[\"brokenRoute\"]>\n\t/**\n\t * Default parameters sent with each Content API request. These parameters can be overridden on\n\t * each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdefaultParams?: Omit<\n\t\tBuildQueryURLArgs,\n\t\t\"ref\" | \"integrationFieldsRef\" | \"accessToken\" | \"routes\" | \"brokenRoute\"\n\t>\n\t/**\n\t * The `fetch` function used to make network requests.\n\t *\n\t * @default The global `fetch` function.\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetch?: FetchLike\n\t/**\n\t * The default `fetch` options sent with each Content API request. These parameters can be\n\t * overriden on each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetchOptions?: RequestInitLike\n}\n\n/**\n * Parameters specific to client methods that fetch all documents. These methods start with `getAll`\n * (e.g. `getAllByType`).\n */\ntype GetAllParams = {\n\t/**\n\t * Limit the number of documents queried.\n\t *\n\t * @default No limit.\n\t */\n\tlimit?: number\n}\n\n/**\n * A client for fetching content from a Prismic repository.\n *\n * @see {@link https://prismic.io/docs/fetch-content}\n * @see {@link https://prismic.io/docs/technical-reference/prismicio-client}\n */\nexport class Client<TDocuments extends PrismicDocument = PrismicDocument> {\n\t/**\n\t * The client's Content API endpoint.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdocumentAPIEndpoint: string\n\t/**\n\t * The secure token used for the Content API.\n\t *\n\t * @see {@link https://prismic.io/docs/fetch-content#content-visibility}\n\t */\n\taccessToken?: string\n\t/**\n\t * A list of route resolver objects that define how a document's `url` property is resolved.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\troutes?: NonNullable<BuildQueryURLArgs[\"routes\"]>\n\t/**\n\t * The URL used for link or content relationship fields that point to an archived or deleted page.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tbrokenRoute?: NonNullable<BuildQueryURLArgs[\"brokenRoute\"]>\n\t/**\n\t * Default parameters sent with each Content API request. These parameters can be overridden on\n\t * each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdefaultParams?: Omit<BuildQueryURLArgs, \"ref\" | \"integrationFieldsRef\" | \"accessToken\" | \"routes\">\n\t/**\n\t * The `fetch` function used to make network requests.\n\t *\n\t * @default The global `fetch` function.\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetchFn: FetchLike\n\t/**\n\t * The default `fetch` options sent with each Content API request. These parameters can be\n\t * overriden on each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetchOptions: RequestInitLike\n\n\t#repositoryName: string | undefined\n\n\t#getRef?: GetRef\n\t#autoPreviews = true\n\t#autoPreviewsRequest?: HttpRequestLike\n\n\t#cachedRepository: Repository | undefined\n\t#cachedRepositoryExpiration = 0 // Timestamp\n\n\t/**\n\t * @param repositoryNameOrEndpoint - The Prismic repository name or full Content API endpoint for\n\t * the repository.\n\t * @param config - Client configuration.\n\t */\n\tconstructor(repositoryNameOrEndpoint: string, config: ClientConfig = {}) {\n\t\tconst {\n\t\t\tdocumentAPIEndpoint,\n\t\t\taccessToken,\n\t\t\tref,\n\t\t\troutes,\n\t\t\tbrokenRoute,\n\t\t\tdefaultParams,\n\t\t\tfetchOptions = {},\n\t\t\tfetch = globalThis.fetch?.bind(globalThis),\n\t\t} = config\n\n\t\tif (isRepositoryEndpoint(repositoryNameOrEndpoint)) {\n\t\t\ttry {\n\t\t\t\tthis.repositoryName = getRepositoryName(repositoryNameOrEndpoint)\n\t\t\t} catch {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[@prismicio/client] A repository name could not be inferred from the provided endpoint (\\`${repositoryNameOrEndpoint}\\`). Some methods will be disabled. Create the client using a repository name to prevent this warning. For more details, see ${devMsg(\"prefer-repository-name\")}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tthis.documentAPIEndpoint = documentAPIEndpoint || repositoryNameOrEndpoint\n\t\t} else {\n\t\t\tthis.repositoryName = repositoryNameOrEndpoint\n\t\t\tthis.documentAPIEndpoint =\n\t\t\t\tdocumentAPIEndpoint || getRepositoryEndpoint(repositoryNameOrEndpoint)\n\t\t}\n\n\t\tif (!fetch) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t\"A valid fetch implementation was not provided. In environments where fetch is not available, a fetch implementation must be provided via a polyfill or the `fetch` option.\",\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\t\tif (typeof fetch !== \"function\") {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`fetch must be a function, but received: ${typeof fetch}`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\tif (!isRepositoryEndpoint(this.documentAPIEndpoint)) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`documentAPIEndpoint is not a valid URL: ${documentAPIEndpoint}`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\t\tif (\n\t\t\tisRepositoryEndpoint(repositoryNameOrEndpoint) &&\n\t\t\tdocumentAPIEndpoint &&\n\t\t\trepositoryNameOrEndpoint !== documentAPIEndpoint\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${devMsg(\"prefer-repository-name\")}`,\n\t\t\t)\n\t\t}\n\t\tif (\n\t\t\tprocess.env.NODE_ENV === \"development\" &&\n\t\t\t/\\.prismic\\.io\\/(?!api\\/v2\\/?)/i.test(this.documentAPIEndpoint)\n\t\t) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t\"@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.\",\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\t\tif (\n\t\t\tprocess.env.NODE_ENV === \"development\" &&\n\t\t\t/\\.prismic\\.io$/i.test(new URL(this.documentAPIEndpoint).hostname) &&\n\t\t\t!/\\.cdn\\.prismic\\.io$/i.test(new URL(this.documentAPIEndpoint).hostname)\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg(\"endpoint-must-use-cdn\")}`,\n\t\t\t)\n\t\t}\n\n\t\tthis.accessToken = accessToken\n\t\tthis.routes = routes\n\t\tthis.brokenRoute = brokenRoute\n\t\tthis.defaultParams = defaultParams\n\t\tthis.fetchOptions = fetchOptions\n\t\tthis.fetchFn = fetch\n\n\t\tthis.graphQLFetch = this.graphQLFetch.bind(this)\n\n\t\tif (ref) {\n\t\t\tthis.queryContentFromRef(ref)\n\t\t}\n\t}\n\n\t/** The Prismic repository's name. */\n\tset repositoryName(value: string) {\n\t\tthis.#repositoryName = value\n\t}\n\t/** The Prismic repository's name. */\n\tget repositoryName(): string {\n\t\tif (!this.#repositoryName) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`A repository name is required for this method but one could not be inferred from the provided API endpoint (\\`${this.documentAPIEndpoint}\\`). To fix this error, provide a repository name when creating the client. For more details, see ${devMsg(\"prefer-repository-name\")}`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\treturn this.#repositoryName\n\t}\n\n\t/** @deprecated Replace with `documentAPIEndpoint`. */\n\t// TODO: Remove in v8.\n\tset endpoint(value: string) {\n\t\tthis.documentAPIEndpoint = value\n\t}\n\t/** @deprecated Replace with `documentAPIEndpoint`. */\n\t// TODO: Remove in v8.\n\tget endpoint(): string {\n\t\treturn this.documentAPIEndpoint\n\t}\n\n\t/**\n\t * Enables the client to automatically query content from a preview session.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.enableAutoPreviews()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviews}\n\t */\n\tenableAutoPreviews(): void {\n\t\tthis.#autoPreviews = true\n\t}\n\n\t/**\n\t * Enables the client to automatically query content from a preview session using an HTTP request\n\t * object.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.enableAutoPreviewsFromReq(req)\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviewsfromreq}\n\t */\n\tenableAutoPreviewsFromReq(request: HttpRequestLike): void {\n\t\tthis.enableAutoPreviews()\n\t\tthis.#autoPreviewsRequest = request\n\t}\n\n\t/**\n\t * Disables the client from automatically querying content from a preview session.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.disableAutoPreviews()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#disableautopreviews}\n\t */\n\tdisableAutoPreviews(): void {\n\t\tthis.#autoPreviews = false\n\t\tthis.#autoPreviewsRequest = undefined\n\t}\n\n\t/**\n\t * Fetches pages based on the `params` argument. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.get({ pageSize: 10 })\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#get}\n\t */\n\tasync get<TDocument extends TDocuments>(\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\tconst response = await this.#internalGet(params)\n\n\t\treturn await response.json()\n\t}\n\n\t/**\n\t * Fetches the first page returned based on the `params` argument.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst page = await client.getFirst()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getfirst}\n\t */\n\tasync getFirst<TDocument extends TDocuments>(\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<TDocument> {\n\t\tconst actualParams = params?.page || params?.pageSize ? params : { ...params, pageSize: 1 }\n\t\tconst response = await this.#internalGet(actualParams)\n\t\tconst { results }: Query<TDocument> = await response.clone().json()\n\n\t\tif (results[0]) {\n\t\t\treturn results[0]\n\t\t}\n\n\t\tthrow new NotFoundError(\"No documents were returned\", response.url, undefined)\n\t}\n\n\t/**\n\t * Fetches all pages based on the `params` argument. This method may make multiple network\n\t * requests to fetch all matching pages.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.dangerouslyGetAll()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#dangerouslygetall}\n\t */\n\tasync dangerouslyGetAll<TDocument extends TDocuments>(\n\t\tparams: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams = {},\n\t): Promise<TDocument[]> {\n\t\tconst { limit = Infinity, ...actualParams } = params\n\t\tconst resolvedParams = {\n\t\t\t...actualParams,\n\t\t\tpageSize: Math.min(\n\t\t\t\tlimit,\n\t\t\t\tactualParams.pageSize || this.defaultParams?.pageSize || MAX_PAGE_SIZE,\n\t\t\t),\n\t\t}\n\n\t\tconst documents: TDocument[] = []\n\t\tlet latestResult: Query<TDocument> | undefined\n\n\t\twhile ((!latestResult || latestResult.next_page) && documents.length < limit) {\n\t\t\tconst page = latestResult ? latestResult.page + 1 : undefined\n\n\t\t\tconst response = await this.#internalGet({ ...resolvedParams, page })\n\t\t\tlatestResult = (await response.json()) as Query<TDocument>\n\t\t\tdocuments.push(...latestResult.results)\n\n\t\t\t// Caches (CDN, Next.js Data Cache) replay the origin's `Date` header, even\n\t\t\t// when they also replay an `x-cache: Miss`. The margin covers clock skew.\n\t\t\t// Lazy, because Next.js forbids `Date.now()` during a prerender.\n\t\t\tconst isCached = () =>\n\t\t\t\tresponse.headers.get(\"x-cache\")?.startsWith(\"Hit\") ||\n\t\t\t\tDate.parse(response.headers.get(\"date\") ?? \"\") < Date.now() - 5000\n\t\t\tif (latestResult.next_page && !isCached()) {\n\t\t\t\tawait new Promise((res) => setTimeout(res, GET_ALL_QUERY_DELAY))\n\t\t\t}\n\t\t}\n\n\t\treturn documents.slice(0, limit)\n\t}\n\n\t/**\n\t * Fetches a page with a specific ID.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst page = await client.getByID(\"WW4bKScAAMAqmluX\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyid}\n\t */\n\tasync getByID<TDocument extends TDocuments>(\n\t\tid: string,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<TDocument> {\n\t\treturn await this.getFirst<TDocument>(appendFilters(params, filter.at(\"document.id\", id)))\n\t}\n\n\t/**\n\t * Fetches pages with specific IDs. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.getByIDs([\"WW4bKScAAMAqmluX\", \"U1kTRgEAAC8A5ldS\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyids}\n\t */\n\tasync getByIDs<TDocument extends TDocuments>(\n\t\tids: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.in(\"document.id\", ids)))\n\t}\n\n\t/**\n\t * Fetches pages with specific IDs. This method may make multiple network requests to fetch all\n\t * matching pages.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.getAllByIDs([\"WW4bKScAAMAqmluX\", \"U1kTRgEAAC8A5ldS\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyids}\n\t */\n\tasync getAllByIDs<TDocument extends TDocuments>(\n\t\tids: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.in(\"document.id\", ids)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches a page with a specific UID and type.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst page = await client.getByUID(\"blog_post\", \"my-first-post\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuid}\n\t */\n\tasync getByUID<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tuid: string,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>> {\n\t\treturn await this.getFirst<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(\n\t\t\t\tparams,\n\t\t\t\tfilter.at(\"document.type\", documentType),\n\t\t\t\tfilter.at(`my.${documentType}.uid`, uid),\n\t\t\t),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with specific UIDs and a specific type. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.getByUIDs(\"blog_post\", [\"my-first-post\", \"my-second-post\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuids}\n\t */\n\tasync getByUIDs<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tuids: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>> {\n\t\treturn await this.get<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(\n\t\t\t\tparams,\n\t\t\t\tfilter.at(\"document.type\", documentType),\n\t\t\t\tfilter.in(`my.${documentType}.uid`, uids),\n\t\t\t),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with specific UIDs and a specific type. This method may make multiple network\n\t * requests to fetch all matching pages.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.getAllByUIDs(\"blog_post\", [\"my-first-post\", \"my-second-post\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyuids}\n\t */\n\tasync getAllByUIDs<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tuids: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>[]> {\n\t\treturn await this.dangerouslyGetAll<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(\n\t\t\t\tparams,\n\t\t\t\tfilter.at(\"document.type\", documentType),\n\t\t\t\tfilter.in(`my.${documentType}.uid`, uids),\n\t\t\t),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches a specific single type page.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst page = await client.getSingle(\"settings\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getsingle}\n\t */\n\tasync getSingle<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>> {\n\t\treturn await this.getFirst<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(params, filter.at(\"document.type\", documentType)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with a specific type. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.getByType(\"blog_post\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytype}\n\t */\n\tasync getByType<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>> {\n\t\treturn await this.get<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(params, filter.at(\"document.type\", documentType)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with a specific type. This method may make multiple network requests to fetch all\n\t * matching documents.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.getAllByType(\"blog_post\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytype}\n\t */\n\tasync getAllByType<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>[]> {\n\t\treturn await this.dangerouslyGetAll<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(params, filter.at(\"document.type\", documentType)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with a specific tag. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.getByTag(\"featured\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytag}\n\t */\n\tasync getByTag<TDocument extends TDocuments>(\n\t\ttag: string,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.any(\"document.tags\", [tag])))\n\t}\n\n\t/**\n\t * Fetches pages with a specific tag. This method may make multiple network requests to fetch all\n\t * matching documents.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.getAllByTag(\"featured\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytag}\n\t */\n\tasync getAllByTag<TDocument extends TDocuments>(\n\t\ttag: string,\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.any(\"document.tags\", [tag])),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with every tag from a list of tags. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.getByEveryTag([\"featured\", \"homepage\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyeverytag}\n\t */\n\tasync getByEveryTag<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.at(\"document.tags\", tags)))\n\t}\n\n\t/**\n\t * Fetches pages with every tag from a list of tags. This method may make multiple network\n\t * requests to fetch all matching pages.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.getAllByEveryTag([\"featured\", \"homepage\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyeverytag}\n\t */\n\tasync getAllByEveryTag<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.at(\"document.tags\", tags)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with at least one tag from a list of tags. Results are paginated.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst response = await client.getBySomeTags([\"featured\", \"homepage\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbysometags}\n\t */\n\tasync getBySomeTags<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.any(\"document.tags\", tags)))\n\t}\n\n\t/**\n\t * Fetches pages with at least one tag from a list of tags. This method may make multiple network\n\t * requests to fetch all matching documents.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst pages = await client.getAllBySomeTags([\"featured\", \"homepage\"])\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbysometags}\n\t */\n\tasync getAllBySomeTags<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.any(\"document.tags\", tags)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches metadata about the client's Prismic repository.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst repository = await client.getRepository()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrepository}\n\t */\n\tasync getRepository(\n\t\tparams?: Pick<BuildQueryURLArgs, \"accessToken\"> & FetchParams,\n\t): Promise<Repository> {\n\t\tif (this.#cachedRepository && this.#cachedRepositoryExpiration > performance.now()) {\n\t\t\treturn this.#cachedRepository\n\t\t}\n\n\t\tconst url = new URL(this.documentAPIEndpoint)\n\n\t\tconst accessToken = params?.accessToken || this.accessToken\n\t\tif (accessToken) {\n\t\t\turl.searchParams.set(\"access_token\", accessToken)\n\t\t}\n\n\t\tconst response = await this.#request(url, params)\n\n\t\tif (response.ok) {\n\t\t\tthis.#cachedRepository = (await response.json()) as Repository\n\t\t\tthis.#cachedRepositoryExpiration = performance.now() + REPOSITORY_CACHE_TTL\n\n\t\t\treturn this.#cachedRepository\n\t\t}\n\n\t\tif (response.status === 404) {\n\t\t\tthrow new RepositoryNotFoundError(\n\t\t\t\t`Prismic repository not found. Check that \"${this.documentAPIEndpoint}\" is pointing to the correct repository.`,\n\t\t\t\turl.toString(),\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\treturn await this.#throwContentAPIError(response, url.toString())\n\t}\n\n\t/**\n\t * Fetches the repository's active refs.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst refs = await client.getRefs()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefs}\n\t */\n\tasync getRefs(params?: FetchParams): Promise<Ref[]> {\n\t\tconst repository = await this.getRepository(params)\n\n\t\treturn repository.refs\n\t}\n\n\t/**\n\t * Fetches a ref by its ID.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst ref = await client.getRefByID(\"YhE3YhEAACIA4321\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbyid}\n\t */\n\tasync getRefByID(id: string, params?: FetchParams): Promise<Ref> {\n\t\tconst refs = await this.getRefs(params)\n\t\tconst ref = refs.find((ref) => ref.id === id)\n\n\t\tif (!ref) {\n\t\t\tthrow new PrismicError(`Ref with ID \"${id}\" could not be found.`, undefined, undefined)\n\t\t}\n\n\t\treturn ref\n\t}\n\n\t/**\n\t * Fetches a ref by its label. A release ref's label is its name shown in the Page Builder.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst ref = await client.getRefByLabel(\"My Release\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbylabel}\n\t */\n\tasync getRefByLabel(label: string, params?: FetchParams): Promise<Ref> {\n\t\tconst refs = await this.getRefs(params)\n\t\tconst ref = refs.find((ref) => ref.label === label)\n\n\t\tif (!ref) {\n\t\t\tthrow new PrismicError(`Ref with label \"${label}\" could not be found.`, undefined, undefined)\n\t\t}\n\n\t\treturn ref\n\t}\n\n\t/**\n\t * Fetches the repository's master ref.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst masterRef = await client.getMasterRef()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getmasterref}\n\t */\n\tasync getMasterRef(params?: FetchParams): Promise<Ref> {\n\t\tconst refs = await this.getRefs(params)\n\t\tconst ref = refs.find((ref) => ref.isMasterRef)\n\n\t\tif (!ref) {\n\t\t\tthrow new PrismicError(\"Master ref could not be found.\", undefined, undefined)\n\t\t}\n\n\t\treturn ref\n\t}\n\n\t/**\n\t * Fetches the repository's active releases.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst releases = await client.getReleases()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleases}\n\t */\n\tasync getReleases(params?: FetchParams): Promise<Ref[]> {\n\t\tconst refs = await this.getRefs(params)\n\n\t\treturn refs.filter((ref) => !ref.isMasterRef)\n\t}\n\n\t/**\n\t * Fetches a release with a specific ID.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst release = await client.getReleaseByID(\"YhE3YhEAACIA4321\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebyid}\n\t */\n\tasync getReleaseByID(id: string, params?: FetchParams): Promise<Ref> {\n\t\tconst releases = await this.getReleases(params)\n\t\tconst release = releases.find((ref) => ref.id === id)\n\n\t\tif (!release) {\n\t\t\tthrow new PrismicError(`Release with ID \"${id}\" could not be found.`, undefined, undefined)\n\t\t}\n\n\t\treturn release\n\t}\n\n\t/**\n\t * Fetches a release by its label. A release ref's label is its name shown in the Page Builder.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst release = await client.getReleaseByLabel(\"My Release\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebylabel}\n\t */\n\tasync getReleaseByLabel(label: string, params?: FetchParams): Promise<Ref> {\n\t\tconst releases = await this.getReleases(params)\n\t\tconst release = releases.find((ref) => ref.label === label)\n\n\t\tif (!release) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`Release with label \"${label}\" could not be found.`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\treturn release\n\t}\n\n\t/**\n\t * Fetches the repository's page tags.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst tags = await client.getTags()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#gettags}\n\t */\n\tasync getTags(params?: FetchParams): Promise<string[]> {\n\t\tconst repository = await this.getRepository(params)\n\t\tconst form = repository.forms.tags\n\t\tif (form) {\n\t\t\tconst url = new URL(form.action)\n\t\t\tif (this.accessToken) {\n\t\t\t\turl.searchParams.set(\"access_token\", this.accessToken)\n\t\t\t}\n\n\t\t\tconst response = await this.#request(url, params)\n\t\t\tif (response.ok) {\n\t\t\t\treturn (await response.json()) as string[]\n\t\t\t}\n\t\t}\n\n\t\treturn repository.tags\n\t}\n\n\t/**\n\t * Builds a Content API query URL with a set of parameters.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst url = await client.buildQueryURL({\n\t * \t\tfilters: [filter.at(\"document.type\", \"blog_post\")],\n\t * \t})\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#buildqueryurl}\n\t */\n\tasync buildQueryURL({\n\t\tsignal,\n\t\tfetchOptions,\n\t\t...params\n\t}: Partial<BuildQueryURLArgs> & FetchParams = {}): Promise<string> {\n\t\tconst ref =\n\t\t\tparams.ref ||\n\t\t\t(await this.#getResolvedRef({\n\t\t\t\taccessToken: params.accessToken,\n\t\t\t\tsignal,\n\t\t\t\tfetchOptions,\n\t\t\t}))\n\t\tconst integrationFieldsRef =\n\t\t\tparams.integrationFieldsRef ||\n\t\t\t(\n\t\t\t\tawait this.getRepository({\n\t\t\t\t\taccessToken: params.accessToken,\n\t\t\t\t\tsignal,\n\t\t\t\t\tfetchOptions,\n\t\t\t\t})\n\t\t\t).integrationFieldsRef ||\n\t\t\tundefined\n\n\t\treturn buildQueryURL(this.documentAPIEndpoint, {\n\t\t\t...this.defaultParams,\n\t\t\t...params,\n\t\t\tref,\n\t\t\tintegrationFieldsRef,\n\t\t\troutes: params.routes || this.routes,\n\t\t\tbrokenRoute: params.brokenRoute || this.brokenRoute,\n\t\t\taccessToken: params.accessToken || this.accessToken,\n\t\t})\n\t}\n\n\t/**\n\t * Fetches a previewed page's URL using a preview token and page ID.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tconst url = await client.resolvePreviewURL({\n\t * \t\tlinkResolver,\n\t * \t\tdefaultURL: \"/\",\n\t * \t})\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#resolvepreviewurl}\n\t */\n\tasync resolvePreviewURL<LinkResolverReturnType>(\n\t\targs: {\n\t\t\t/** A function converts a document to a URL in your website. */\n\t\t\tlinkResolver?: LinkResolverFunction<LinkResolverReturnType>\n\t\t\t/** A fallback URL used when the document does not have a URL. */\n\t\t\tdefaultURL: string\n\t\t\t/** The preview token for the preview session. */\n\t\t\tpreviewToken?: string\n\t\t\t/** The previewed document's ID. */\n\t\t\tdocumentID?: string\n\t\t} & FetchParams,\n\t): Promise<string> {\n\t\tlet documentID: string | undefined | null = args.documentID\n\t\tlet previewToken: string | undefined | null = args.previewToken\n\n\t\tif (typeof globalThis.location !== \"undefined\") {\n\t\t\tconst searchParams = new URLSearchParams(globalThis.location.search)\n\n\t\t\tdocumentID = documentID || searchParams.get(\"documentId\")\n\t\t\tpreviewToken = previewToken || searchParams.get(\"token\")\n\t\t} else if (this.#autoPreviewsRequest) {\n\t\t\tif (\"query\" in this.#autoPreviewsRequest) {\n\t\t\t\tdocumentID = documentID || (this.#autoPreviewsRequest.query?.documentId as string)\n\t\t\t\tpreviewToken = previewToken || (this.#autoPreviewsRequest.query?.token as string)\n\t\t\t} else if (\"url\" in this.#autoPreviewsRequest && this.#autoPreviewsRequest.url) {\n\t\t\t\t// Including \"missing-host://\" by default\n\t\t\t\t// handles a case where Next.js Route Handlers\n\t\t\t\t// only provide the pathname and search\n\t\t\t\t// parameters in the `url` property\n\t\t\t\t// (e.g. `/api/preview?foo=bar`).\n\t\t\t\tconst searchParams = new URL(this.#autoPreviewsRequest.url, \"missing-host://\").searchParams\n\n\t\t\t\tdocumentID = documentID || searchParams.get(\"documentId\")\n\t\t\t\tpreviewToken = previewToken || searchParams.get(\"token\")\n\t\t\t}\n\t\t}\n\n\t\tif (documentID != null && previewToken != null) {\n\t\t\tconst document = await this.getByID(documentID, {\n\t\t\t\tref: previewToken,\n\t\t\t\tlang: \"*\",\n\t\t\t\tsignal: args.signal,\n\t\t\t\tfetchOptions: args.fetchOptions,\n\t\t\t})\n\n\t\t\tconst url = asLink(document, { linkResolver: args.linkResolver })\n\n\t\t\tif (typeof url === \"string\") {\n\t\t\t\treturn url\n\t\t\t}\n\t\t}\n\n\t\treturn args.defaultURL\n\t}\n\n\t/**\n\t * Configures the client to query the latest published content. This is the client's default mode.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.queryLatestContent()\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querylatestcontent}\n\t */\n\tqueryLatestContent(): void {\n\t\tthis.#getRef = undefined\n\t}\n\n\t/**\n\t * Configures the client to query content from a release with a specific ID.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.queryContentFromReleaseByID(\"YhE3YhEAACIA4321\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebyid}\n\t */\n\tqueryContentFromReleaseByID(id: string): void {\n\t\tthis.#getRef = async (params) => {\n\t\t\tconst release = await this.getReleaseByID(id, params)\n\t\t\treturn release.ref\n\t\t}\n\t}\n\n\t/**\n\t * Configures the client to query content from a release with a specific label.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.queryContentFromReleaseByLabel(\"My Release\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebylabel}\n\t */\n\tqueryContentFromReleaseByLabel(label: string): void {\n\t\tthis.#getRef = async (params) => {\n\t\t\tconst release = await this.getReleaseByLabel(label, params)\n\t\t\treturn release.ref\n\t\t}\n\t}\n\n\t/**\n\t * Configures the client to query content from a specific ref.\n\t *\n\t * @example\n\t * \t;```ts\n\t * \tclient.queryContentFromRef(\"my-ref\")\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromref}\n\t */\n\tqueryContentFromRef(ref: string | GetRef): void {\n\t\tthis.#getRef = typeof ref === \"string\" ? () => ref : ref\n\t}\n\n\t/**\n\t * A preconfigured `fetch()` function for Prismic's GraphQL API that can be provided to GraphQL\n\t * clients.\n\t *\n\t * @example\n\t * \t```ts\n\t * \timport { createClient, getGraphQLEndpoint } from \"@prismicio/client\"\n\t *\n\t * \tconst client = createClient(\"example-prismic-repo\")\n\t * \tconst graphQLClient = new ApolloClient({\n\t * \tlink: new HttpLink({\n\t * \turi: getGraphQLEndpoint(client.repositoryName),\n\t * \t// Provide `client.graphQLFetch` as the fetch implementation.\n\t * \tfetch: client.graphQLFetch,\n\t * \t// Using GET is required.\n\t * \tuseGETForQueries: true,\n\t * \t}),\n\t * \tcache: new InMemoryCache(),\n\t * \t})\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#graphqlfetch}\n\t */\n\tasync graphQLFetch(\n\t\tinput: RequestInfo,\n\t\tinit?: Omit<RequestInit, \"signal\"> & { signal?: AbortSignalLike },\n\t): Promise<Response> {\n\t\tconst params = {\n\t\t\taccessToken: this.accessToken,\n\t\t\tfetchOptions: this.fetchOptions,\n\t\t}\n\t\tconst repository = await this.getRepository(params)\n\t\tconst ref = await this.#getResolvedRef(params)\n\n\t\tconst headers: NonNullable<RequestInitLike[\"headers\"]> = {}\n\t\theaders[\"prismic-ref\"] = ref\n\t\tif (this.accessToken) {\n\t\t\theaders[\"authorization\"] = `Token ${this.accessToken}`\n\t\t}\n\t\tif (repository.integrationFieldsRef) {\n\t\t\theaders[\"prismic-integration-field-ref\"] = repository.integrationFieldsRef\n\t\t}\n\t\tfor (const [key, value] of Object.entries(init?.headers ?? {})) {\n\t\t\theaders[key.toLowerCase()] = value\n\t\t}\n\n\t\tconst url = new URL(typeof input === \"string\" ? input : input.url)\n\t\tconst query = (url.searchParams.get(\"query\") ?? \"\").replace(\n\t\t\t// Minify the query\n\t\t\t/(\\n| )*( |{|})(\\n| )*/gm,\n\t\t\t(_chars, _spaces, brackets) => brackets,\n\t\t)\n\t\turl.searchParams.set(\"query\", query)\n\t\t// Only used to prevent caching; caches ignore header differences\n\t\turl.searchParams.set(\"ref\", ref)\n\n\t\treturn (await this.fetchFn(url.toString(), {\n\t\t\t...init,\n\t\t\theaders,\n\t\t})) as Response\n\t}\n\n\t/**\n\t * Returns the ref needed to query based on the client's current state. This method may make a\n\t * network request to fetch a ref or resolve the user's ref thunk.\n\t *\n\t * If auto previews are enabled, the preview ref takes priority.\n\t *\n\t * The following strategies are used depending on the client's state:\n\t *\n\t * - If the user called `queryLatestContent`: Use the repository's master ref. The ref is cached for\n\t * 5 seconds. After 5 seconds, a new master ref is fetched.\n\t * - If the user called `queryContentFromReleaseByID`: Use the release's ref. The ref is cached for\n\t * 5 seconds. After 5 seconds, a new ref for the release is fetched.\n\t * - If the user called `queryContentFromReleaseByLabel`: Use the release's ref. The ref is cached\n\t * for 5 seconds. After 5 seconds, a new ref for the release is fetched.\n\t * - If the user called `queryContentFromRef`: Use the provided ref. Fall back to the master ref if\n\t * the ref is not a string.\n\t */\n\tasync #getResolvedRef(params?: Pick<BuildQueryURLArgs, \"accessToken\"> & FetchParams) {\n\t\tif (this.#autoPreviews) {\n\t\t\tconst cookies = this.#autoPreviewsRequest?.headers\n\t\t\t\t? \"get\" in this.#autoPreviewsRequest.headers\n\t\t\t\t\t? this.#autoPreviewsRequest.headers.get(\"cookie\")\n\t\t\t\t\t: this.#autoPreviewsRequest.headers.cookie\n\t\t\t\t: globalThis.document?.cookie\n\t\t\tconst previewRef = getPreviewCookie(cookies ?? \"\")\n\t\t\tif (previewRef) {\n\t\t\t\treturn previewRef\n\t\t\t}\n\t\t}\n\n\t\tconst ref = await this.#getRef?.(params)\n\t\tif (ref) {\n\t\t\treturn ref\n\t\t}\n\n\t\tconst masterRef = await this.getMasterRef(params)\n\t\treturn masterRef.ref\n\t}\n\n\t/**\n\t * Performs a low-level Content API request with the given parameters. Automatically retries if an\n\t * invalid ref is used.\n\t */\n\tasync #internalGet(\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t\tattempt = 1,\n\t): Promise<ResponseLike> {\n\t\tconst url = await this.buildQueryURL(params)\n\t\tconst response = await this.#request(new URL(url), params)\n\n\t\tif (response.ok) {\n\t\t\treturn response\n\t\t}\n\n\t\ttry {\n\t\t\treturn await this.#throwContentAPIError(response, url)\n\t\t} catch (error) {\n\t\t\tif (\n\t\t\t\t(error instanceof RefNotFoundError || error instanceof RefExpiredError) &&\n\t\t\t\tattempt < MAX_INVALID_REF_RETRY_ATTEMPTS\n\t\t\t) {\n\t\t\t\t// If no explicit ref is given (i.e. the master ref from\n\t\t\t\t// /api/v2 is used), clear the cached repository value.\n\t\t\t\t// Clearing the cached value prevents other methods from\n\t\t\t\t// using a known-stale ref.\n\t\t\t\tif (!params?.ref) {\n\t\t\t\t\tthis.#cachedRepository = undefined\n\t\t\t\t}\n\n\t\t\t\tconst masterRef = error.message.match(/master ref is: (?<ref>.*)$/i)?.groups?.ref\n\t\t\t\tif (!masterRef) {\n\t\t\t\t\tthrow error\n\t\t\t\t}\n\n\t\t\t\tconst badRef = new URL(url).searchParams.get(\"ref\")\n\t\t\t\tconst issue = error instanceof RefNotFoundError ? \"invalid\" : \"expired\"\n\t\t\t\tthrottledWarn(\n\t\t\t\t\t`[@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.`,\n\t\t\t\t)\n\n\t\t\t\treturn await this.#internalGet({ ...params, ref: masterRef }, attempt + 1)\n\t\t\t}\n\n\t\t\tthrow error\n\t\t}\n\t}\n\n\t/** Throws an error based on a Content API response. Only call in known-errored states. */\n\tasync #throwContentAPIError(response: ResponseLike, url: string): Promise<never> {\n\t\tswitch (response.status) {\n\t\t\tcase 400: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tthrow new ParsingError(json.message, url, json)\n\t\t\t}\n\t\t\tcase 401: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tthrow new ForbiddenError(json.message, url, json)\n\t\t\t}\n\t\t\tcase 404: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tswitch (json.type) {\n\t\t\t\t\tcase \"api_notfound_error\": {\n\t\t\t\t\t\tthrow new RefNotFoundError(json.message, url, json)\n\t\t\t\t\t}\n\t\t\t\t\tcase \"api_security_error\": {\n\t\t\t\t\t\tif (/preview token.*expired/i.test(json.message)) {\n\t\t\t\t\t\t\tthrow new PreviewTokenExpiredError(json.message, url, json)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new NotFoundError(json.message, url, json)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 410: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tthrow new RefExpiredError(json.message, url, json)\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new PrismicError(undefined, url, await response.text())\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Performs a low-level network request with the client's fetch options. */\n\tasync #request(url: URL, params?: FetchParams): Promise<ResponseLike> {\n\t\treturn await request(\n\t\t\turl,\n\t\t\t{\n\t\t\t\t...this.fetchOptions,\n\t\t\t\t...params?.fetchOptions,\n\t\t\t\theaders: {\n\t\t\t\t\t...this.fetchOptions?.headers,\n\t\t\t\t\t...params?.fetchOptions?.headers,\n\t\t\t\t},\n\t\t\t\tsignal: params?.fetchOptions?.signal || params?.signal || this.fetchOptions?.signal,\n\t\t\t},\n\t\t\tthis.fetchFn,\n\t\t)\n\t}\n}\n\n/** Appends filters to a params object. */\nfunction appendFilters<T extends Pick<BuildQueryURLArgs, \"filters\">>(\n\tparams = {} as T,\n\t...filters: string[]\n): T & { filters: string[] } {\n\treturn { ...params, filters: [...(params.filters ?? []), ...filters] }\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,MAAM,gBAAgB;AACtB,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;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,SAAS,KAAK,IAAI;KAG5D,SACC,MAAM,IAAIV,eAAAA,cAAc,KAAK,SAAS,KAAK,IAAI;IAEjD;GACD;GACA,KAAK,KAAK;IACT,MAAM,OAAO,MAAM,SAAS,MAAM,CAAC,CAAC,KAAK;IACzC,MAAM,IAAIO,eAAAA,gBAAgB,KAAK,SAAS,KAAK,IAAI;GAClD;GACA,SACC,MAAM,IAAIR,eAAAA,aAAa,KAAA,GAAW,KAAK,MAAM,SAAS,KAAK,CAAC;EAE9D;CACD;;CAGA,MAAM,SAAS,KAAU,QAA6C;EACrE,OAAO,MAAMY,gBAAAA,QACZ,KACA;GACC,GAAG,KAAK;GACR,GAAG,QAAQ;GACX,SAAS;IACR,GAAG,KAAK,cAAc;IACtB,GAAG,QAAQ,cAAc;GAC1B;GACA,QAAQ,QAAQ,cAAc,UAAU,QAAQ,UAAU,KAAK,cAAc;EAC9E,GACA,KAAK,OACN;CACD;AACD;;AAGA,SAAS,cACR,SAAS,CAAC,GACV,GAAG,SACyB;CAC5B,OAAO;EAAE,GAAG;EAAQ,SAAS,CAAC,GAAI,OAAO,WAAW,CAAC,GAAI,GAAG,OAAO;CAAE;AACtE"}
|
|
1
|
+
{"version":3,"file":"Client.cjs","names":["isRepositoryEndpoint","getRepositoryName","devMsg","getRepositoryEndpoint","PrismicError","NotFoundError","filter","RepositoryNotFoundError","buildQueryURL","asLink","getPreviewCookie","RefNotFoundError","RefExpiredError","ParsingError","ForbiddenError","PreviewTokenExpiredError","request"],"sources":["../src/Client.ts"],"sourcesContent":["import { type BuildQueryURLArgs, buildQueryURL } from \"./buildQueryURL\"\nimport {\n\tForbiddenError,\n\tNotFoundError,\n\tParsingError,\n\tPreviewTokenExpiredError,\n\tPrismicError,\n\tRefExpiredError,\n\tRefNotFoundError,\n\tRepositoryNotFoundError,\n} from \"./errors\"\nimport { filter } from \"./filter\"\nimport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\"\nimport { getRepositoryName } from \"./getRepositoryName\"\nimport { type LinkResolverFunction, asLink } from \"./helpers/asLink\"\nimport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\"\nimport { devMsg } from \"./lib/devMsg\"\nimport { getPreviewCookie } from \"./lib/getPreviewCookie\"\nimport type { ResponseLike } from \"./lib/request\"\nimport { type AbortSignalLike, type FetchLike, type RequestInitLike, request } from \"./lib/request\"\nimport { throttledWarn } from \"./lib/throttledWarn\"\nimport type { Query } from \"./types/api/query\"\nimport type { Ref } from \"./types/api/ref\"\nimport type { Repository } from \"./types/api/repository\"\nimport type { PrismicDocument } from \"./types/value/document\"\n\nconst MAX_PAGE_SIZE = 100\nconst REPOSITORY_CACHE_TTL = 5000\nconst GET_ALL_QUERY_DELAY = 500\nconst MAX_INVALID_REF_RETRY_ATTEMPTS = 3\n\n/** Extracts a document type with a matching `type` property from a union of document types. */\ntype ExtractDocumentType<\n\tTDocuments extends PrismicDocument,\n\tTDocumentType extends TDocuments[\"type\"],\n> =\n\tExtract<TDocuments, { type: TDocumentType }> extends never\n\t\t? TDocuments\n\t\t: Extract<TDocuments, { type: TDocumentType }>\n\n/**\n * The minimum required properties to treat as an HTTP Request for automatic Prismic preview\n * support.\n */\nexport type HttpRequestLike =\n\t| // Web API Request\n\t {\n\t\t\theaders?: {\n\t\t\t\tget(name: string): string | null\n\t\t\t}\n\t\t\turl?: string\n\t }\n\t// Express-style request\n\t| {\n\t\t\theaders?: {\n\t\t\t\tcookie?: string\n\t\t\t}\n\t\t\tquery?: Record<string, unknown>\n\t }\n\n/**\n * A function that returns a ref string. Used to configure which ref the client queries content\n * from.\n */\ntype GetRef = (\n\tparams?: Pick<BuildQueryURLArgs, \"accessToken\"> & FetchParams,\n) => string | undefined | Promise<string | undefined>\n\n/** Parameters for client methods that use `fetch()`. */\nexport type FetchParams = {\n\t/**\n\t * Options provided to the client's `fetch()` on all network requests. These options will be\n\t * merged with internally required options. They can also be overriden on a per-query basis using\n\t * the query's `fetchOptions` parameter.\n\t */\n\tfetchOptions?: RequestInitLike\n\t/** @deprecated Move to `fetchOptions.signal`: */\n\t// TODO: Remove in v8.\n\tsignal?: AbortSignalLike\n}\n\n/** Prismic client configuration. */\nexport type ClientConfig = {\n\t/**\n\t * The client's Content API endpoint.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdocumentAPIEndpoint?: string\n\t/**\n\t * The secure token used for the Content API.\n\t *\n\t * @see {@link https://prismic.io/docs/fetch-content#content-visibility}\n\t */\n\taccessToken?: string\n\t/**\n\t * The version of the repository's content. It can optionally be a function that returns a ref.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tref?: string | GetRef\n\t/**\n\t * A list of route resolver objects that define how a document's `url` property is resolved.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\troutes?: NonNullable<BuildQueryURLArgs[\"routes\"]>\n\t/**\n\t * The URL used for link or content relationship fields that point to an archived or deleted page.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tbrokenRoute?: NonNullable<BuildQueryURLArgs[\"brokenRoute\"]>\n\t/**\n\t * Default parameters sent with each Content API request. These parameters can be overridden on\n\t * each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdefaultParams?: Omit<\n\t\tBuildQueryURLArgs,\n\t\t\"ref\" | \"integrationFieldsRef\" | \"accessToken\" | \"routes\" | \"brokenRoute\"\n\t>\n\t/**\n\t * The `fetch` function used to make network requests.\n\t *\n\t * @default The global `fetch` function.\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetch?: FetchLike\n\t/**\n\t * The default `fetch` options sent with each Content API request. These parameters can be\n\t * overriden on each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetchOptions?: RequestInitLike\n}\n\n/**\n * Parameters specific to client methods that fetch all documents. These methods start with `getAll`\n * (e.g. `getAllByType`).\n */\ntype GetAllParams = {\n\t/**\n\t * Limit the number of documents queried.\n\t *\n\t * @default No limit.\n\t */\n\tlimit?: number\n}\n\n/**\n * A client for fetching content from a Prismic repository.\n *\n * @see {@link https://prismic.io/docs/fetch-content}\n * @see {@link https://prismic.io/docs/technical-reference/prismicio-client}\n */\nexport class Client<TDocuments extends PrismicDocument = PrismicDocument> {\n\t/**\n\t * The client's Content API endpoint.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdocumentAPIEndpoint: string\n\t/**\n\t * The secure token used for the Content API.\n\t *\n\t * @see {@link https://prismic.io/docs/fetch-content#content-visibility}\n\t */\n\taccessToken?: string\n\t/**\n\t * A list of route resolver objects that define how a document's `url` property is resolved.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\troutes?: NonNullable<BuildQueryURLArgs[\"routes\"]>\n\t/**\n\t * The URL used for link or content relationship fields that point to an archived or deleted page.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tbrokenRoute?: NonNullable<BuildQueryURLArgs[\"brokenRoute\"]>\n\t/**\n\t * Default parameters sent with each Content API request. These parameters can be overridden on\n\t * each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tdefaultParams?: Omit<BuildQueryURLArgs, \"ref\" | \"integrationFieldsRef\" | \"accessToken\" | \"routes\">\n\t/**\n\t * The `fetch` function used to make network requests.\n\t *\n\t * @default The global `fetch` function.\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetchFn: FetchLike\n\t/**\n\t * The default `fetch` options sent with each Content API request. These parameters can be\n\t * overriden on each method.\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#config-options}\n\t */\n\tfetchOptions: RequestInitLike\n\n\t#repositoryName: string | undefined\n\n\t#getRef?: GetRef\n\t#autoPreviews = true\n\t#autoPreviewsRequest?: HttpRequestLike\n\n\t#cachedRepository: Repository | undefined\n\t#cachedRepositoryExpiration = 0 // Timestamp\n\n\t/**\n\t * @param repositoryNameOrEndpoint - The Prismic repository name or full Content API endpoint for\n\t * the repository.\n\t * @param config - Client configuration.\n\t */\n\tconstructor(repositoryNameOrEndpoint: string, config: ClientConfig = {}) {\n\t\tconst {\n\t\t\tdocumentAPIEndpoint,\n\t\t\taccessToken,\n\t\t\tref,\n\t\t\troutes,\n\t\t\tbrokenRoute,\n\t\t\tdefaultParams,\n\t\t\tfetchOptions = {},\n\t\t\tfetch = globalThis.fetch?.bind(globalThis),\n\t\t} = config\n\n\t\tif (isRepositoryEndpoint(repositoryNameOrEndpoint)) {\n\t\t\ttry {\n\t\t\t\tthis.repositoryName = getRepositoryName(repositoryNameOrEndpoint)\n\t\t\t} catch {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[@prismicio/client] A repository name could not be inferred from the provided endpoint (\\`${repositoryNameOrEndpoint}\\`). Some methods will be disabled. Create the client using a repository name to prevent this warning. For more details, see ${devMsg(\"prefer-repository-name\")}`,\n\t\t\t\t)\n\t\t\t}\n\t\t\tthis.documentAPIEndpoint = documentAPIEndpoint || repositoryNameOrEndpoint\n\t\t} else {\n\t\t\tthis.repositoryName = repositoryNameOrEndpoint\n\t\t\tthis.documentAPIEndpoint =\n\t\t\t\tdocumentAPIEndpoint || getRepositoryEndpoint(repositoryNameOrEndpoint)\n\t\t}\n\n\t\tif (!fetch) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t\"A valid fetch implementation was not provided. In environments where fetch is not available, a fetch implementation must be provided via a polyfill or the `fetch` option.\",\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\t\tif (typeof fetch !== \"function\") {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`fetch must be a function, but received: ${typeof fetch}`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\tif (!isRepositoryEndpoint(this.documentAPIEndpoint)) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`documentAPIEndpoint is not a valid URL: ${documentAPIEndpoint}`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\t\tif (\n\t\t\tisRepositoryEndpoint(repositoryNameOrEndpoint) &&\n\t\t\tdocumentAPIEndpoint &&\n\t\t\trepositoryNameOrEndpoint !== documentAPIEndpoint\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${devMsg(\"prefer-repository-name\")}`,\n\t\t\t)\n\t\t}\n\t\tif (\n\t\t\tprocess.env.NODE_ENV === \"development\" &&\n\t\t\t/\\.prismic\\.io\\/(?!api\\/v2\\/?)/i.test(this.documentAPIEndpoint)\n\t\t) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t\"@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.\",\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\t\tif (\n\t\t\tprocess.env.NODE_ENV === \"development\" &&\n\t\t\t/\\.prismic\\.io$/i.test(new URL(this.documentAPIEndpoint).hostname) &&\n\t\t\t!/\\.cdn\\.prismic\\.io$/i.test(new URL(this.documentAPIEndpoint).hostname)\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg(\"endpoint-must-use-cdn\")}`,\n\t\t\t)\n\t\t}\n\n\t\tthis.accessToken = accessToken\n\t\tthis.routes = routes\n\t\tthis.brokenRoute = brokenRoute\n\t\tthis.defaultParams = defaultParams\n\t\tthis.fetchOptions = fetchOptions\n\t\tthis.fetchFn = fetch\n\n\t\tthis.graphQLFetch = this.graphQLFetch.bind(this)\n\n\t\tif (ref) {\n\t\t\tthis.queryContentFromRef(ref)\n\t\t}\n\t}\n\n\t/** The Prismic repository's name. */\n\tset repositoryName(value: string) {\n\t\tthis.#repositoryName = value\n\t}\n\t/** The Prismic repository's name. */\n\tget repositoryName(): string {\n\t\tif (!this.#repositoryName) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`A repository name is required for this method but one could not be inferred from the provided API endpoint (\\`${this.documentAPIEndpoint}\\`). To fix this error, provide a repository name when creating the client. For more details, see ${devMsg(\"prefer-repository-name\")}`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\treturn this.#repositoryName\n\t}\n\n\t/** @deprecated Replace with `documentAPIEndpoint`. */\n\t// TODO: Remove in v8.\n\tset endpoint(value: string) {\n\t\tthis.documentAPIEndpoint = value\n\t}\n\t/** @deprecated Replace with `documentAPIEndpoint`. */\n\t// TODO: Remove in v8.\n\tget endpoint(): string {\n\t\treturn this.documentAPIEndpoint\n\t}\n\n\t/**\n\t * Enables the client to automatically query content from a preview session.\n\t *\n\t * @example\n\t * \tclient.enableAutoPreviews()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviews}\n\t */\n\tenableAutoPreviews(): void {\n\t\tthis.#autoPreviews = true\n\t}\n\n\t/**\n\t * Enables the client to automatically query content from a preview session using an HTTP request\n\t * object.\n\t *\n\t * @example\n\t * \tclient.enableAutoPreviewsFromReq(req)\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#enableautopreviewsfromreq}\n\t */\n\tenableAutoPreviewsFromReq(request: HttpRequestLike): void {\n\t\tthis.enableAutoPreviews()\n\t\tthis.#autoPreviewsRequest = request\n\t}\n\n\t/**\n\t * Disables the client from automatically querying content from a preview session.\n\t *\n\t * @example\n\t * \tclient.disableAutoPreviews()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#disableautopreviews}\n\t */\n\tdisableAutoPreviews(): void {\n\t\tthis.#autoPreviews = false\n\t\tthis.#autoPreviewsRequest = undefined\n\t}\n\n\t/**\n\t * Fetches pages based on the `params` argument. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.get({ pageSize: 10 })\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#get}\n\t */\n\tasync get<TDocument extends TDocuments>(\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\tconst response = await this.#internalGet(params)\n\n\t\treturn await response.json()\n\t}\n\n\t/**\n\t * Fetches the first page returned based on the `params` argument.\n\t *\n\t * @example\n\t * \tconst page = await client.getFirst()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getfirst}\n\t */\n\tasync getFirst<TDocument extends TDocuments>(\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<TDocument> {\n\t\tconst actualParams = params?.page || params?.pageSize ? params : { ...params, pageSize: 1 }\n\t\tconst response = await this.#internalGet(actualParams)\n\t\tconst { results }: Query<TDocument> = await response.clone().json()\n\n\t\tif (results[0]) {\n\t\t\treturn results[0]\n\t\t}\n\n\t\tthrow new NotFoundError(\"No documents were returned\", response.url, undefined)\n\t}\n\n\t/**\n\t * Fetches all pages based on the `params` argument. This method may make multiple network\n\t * requests to fetch all matching pages.\n\t *\n\t * @example\n\t * \tconst pages = await client.dangerouslyGetAll()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#dangerouslygetall}\n\t */\n\tasync dangerouslyGetAll<TDocument extends TDocuments>(\n\t\tparams: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams = {},\n\t): Promise<TDocument[]> {\n\t\tconst { limit = Infinity, ...actualParams } = params\n\t\tconst resolvedParams = {\n\t\t\t...actualParams,\n\t\t\tpageSize: Math.min(\n\t\t\t\tlimit,\n\t\t\t\tactualParams.pageSize || this.defaultParams?.pageSize || MAX_PAGE_SIZE,\n\t\t\t),\n\t\t}\n\n\t\tconst documents: TDocument[] = []\n\t\tlet latestResult: Query<TDocument> | undefined\n\n\t\twhile ((!latestResult || latestResult.next_page) && documents.length < limit) {\n\t\t\tconst page = latestResult ? latestResult.page + 1 : undefined\n\n\t\t\tconst response = await this.#internalGet({ ...resolvedParams, page })\n\t\t\tlatestResult = (await response.json()) as Query<TDocument>\n\t\t\tdocuments.push(...latestResult.results)\n\n\t\t\t// Caches (CDN, Next.js Data Cache) replay the origin's `Date` header, even\n\t\t\t// when they also replay an `x-cache: Miss`. The margin covers clock skew.\n\t\t\t// Lazy, because Next.js forbids `Date.now()` during a prerender.\n\t\t\tconst isCached = () =>\n\t\t\t\tresponse.headers.get(\"x-cache\")?.startsWith(\"Hit\") ||\n\t\t\t\tDate.parse(response.headers.get(\"date\") ?? \"\") < Date.now() - 5000\n\t\t\tif (latestResult.next_page && !isCached()) {\n\t\t\t\tawait new Promise((res) => setTimeout(res, GET_ALL_QUERY_DELAY))\n\t\t\t}\n\t\t}\n\n\t\treturn documents.slice(0, limit)\n\t}\n\n\t/**\n\t * Fetches a page with a specific ID.\n\t *\n\t * @example\n\t * \tconst page = await client.getByID(\"WW4bKScAAMAqmluX\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyid}\n\t */\n\tasync getByID<TDocument extends TDocuments>(\n\t\tid: string,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<TDocument> {\n\t\treturn await this.getFirst<TDocument>(appendFilters(params, filter.at(\"document.id\", id)))\n\t}\n\n\t/**\n\t * Fetches pages with specific IDs. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.getByIDs([\"WW4bKScAAMAqmluX\", \"U1kTRgEAAC8A5ldS\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyids}\n\t */\n\tasync getByIDs<TDocument extends TDocuments>(\n\t\tids: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.in(\"document.id\", ids)))\n\t}\n\n\t/**\n\t * Fetches pages with specific IDs. This method may make multiple network requests to fetch all\n\t * matching pages.\n\t *\n\t * @example\n\t * \tconst pages = await client.getAllByIDs([\"WW4bKScAAMAqmluX\", \"U1kTRgEAAC8A5ldS\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyids}\n\t */\n\tasync getAllByIDs<TDocument extends TDocuments>(\n\t\tids: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.in(\"document.id\", ids)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches a page with a specific UID and type.\n\t *\n\t * @example\n\t * \tconst page = await client.getByUID(\"blog_post\", \"my-first-post\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuid}\n\t */\n\tasync getByUID<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tuid: string,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>> {\n\t\treturn await this.getFirst<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(\n\t\t\t\tparams,\n\t\t\t\tfilter.at(\"document.type\", documentType),\n\t\t\t\tfilter.at(`my.${documentType}.uid`, uid),\n\t\t\t),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with specific UIDs and a specific type. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.getByUIDs(\"blog_post\", [\"my-first-post\", \"my-second-post\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyuids}\n\t */\n\tasync getByUIDs<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tuids: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>> {\n\t\treturn await this.get<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(\n\t\t\t\tparams,\n\t\t\t\tfilter.at(\"document.type\", documentType),\n\t\t\t\tfilter.in(`my.${documentType}.uid`, uids),\n\t\t\t),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with specific UIDs and a specific type. This method may make multiple network\n\t * requests to fetch all matching pages.\n\t *\n\t * @example\n\t * \tconst pages = await client.getAllByUIDs(\"blog_post\", [\"my-first-post\", \"my-second-post\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyuids}\n\t */\n\tasync getAllByUIDs<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tuids: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>[]> {\n\t\treturn await this.dangerouslyGetAll<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(\n\t\t\t\tparams,\n\t\t\t\tfilter.at(\"document.type\", documentType),\n\t\t\t\tfilter.in(`my.${documentType}.uid`, uids),\n\t\t\t),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches a specific single type page.\n\t *\n\t * @example\n\t * \tconst page = await client.getSingle(\"settings\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getsingle}\n\t */\n\tasync getSingle<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>> {\n\t\treturn await this.getFirst<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(params, filter.at(\"document.type\", documentType)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with a specific type. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.getByType(\"blog_post\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytype}\n\t */\n\tasync getByType<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<ExtractDocumentType<TDocument, TDocumentType>>> {\n\t\treturn await this.get<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(params, filter.at(\"document.type\", documentType)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with a specific type. This method may make multiple network requests to fetch all\n\t * matching documents.\n\t *\n\t * @example\n\t * \tconst pages = await client.getAllByType(\"blog_post\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytype}\n\t */\n\tasync getAllByType<\n\t\tTDocument extends TDocuments,\n\t\tTDocumentType extends TDocument[\"type\"] = TDocument[\"type\"],\n\t>(\n\t\tdocumentType: TDocumentType,\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<ExtractDocumentType<TDocument, TDocumentType>[]> {\n\t\treturn await this.dangerouslyGetAll<ExtractDocumentType<TDocument, TDocumentType>>(\n\t\t\tappendFilters(params, filter.at(\"document.type\", documentType)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with a specific tag. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.getByTag(\"featured\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbytag}\n\t */\n\tasync getByTag<TDocument extends TDocuments>(\n\t\ttag: string,\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.any(\"document.tags\", [tag])))\n\t}\n\n\t/**\n\t * Fetches pages with a specific tag. This method may make multiple network requests to fetch all\n\t * matching documents.\n\t *\n\t * @example\n\t * \tconst pages = await client.getAllByTag(\"featured\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbytag}\n\t */\n\tasync getAllByTag<TDocument extends TDocuments>(\n\t\ttag: string,\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.any(\"document.tags\", [tag])),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with every tag from a list of tags. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.getByEveryTag([\"featured\", \"homepage\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbyeverytag}\n\t */\n\tasync getByEveryTag<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.at(\"document.tags\", tags)))\n\t}\n\n\t/**\n\t * Fetches pages with every tag from a list of tags. This method may make multiple network\n\t * requests to fetch all matching pages.\n\t *\n\t * @example\n\t * \tconst pages = await client.getAllByEveryTag([\"featured\", \"homepage\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbyeverytag}\n\t */\n\tasync getAllByEveryTag<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.at(\"document.tags\", tags)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches pages with at least one tag from a list of tags. Results are paginated.\n\t *\n\t * @example\n\t * \tconst response = await client.getBySomeTags([\"featured\", \"homepage\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getbysometags}\n\t */\n\tasync getBySomeTags<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t): Promise<Query<TDocument>> {\n\t\treturn await this.get<TDocument>(appendFilters(params, filter.any(\"document.tags\", tags)))\n\t}\n\n\t/**\n\t * Fetches pages with at least one tag from a list of tags. This method may make multiple network\n\t * requests to fetch all matching documents.\n\t *\n\t * @example\n\t * \tconst pages = await client.getAllBySomeTags([\"featured\", \"homepage\"])\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getallbysometags}\n\t */\n\tasync getAllBySomeTags<TDocument extends TDocuments>(\n\t\ttags: string[],\n\t\tparams?: Partial<Omit<BuildQueryURLArgs, \"page\">> & GetAllParams & FetchParams,\n\t): Promise<TDocument[]> {\n\t\treturn await this.dangerouslyGetAll<TDocument>(\n\t\t\tappendFilters(params, filter.any(\"document.tags\", tags)),\n\t\t)\n\t}\n\n\t/**\n\t * Fetches metadata about the client's Prismic repository.\n\t *\n\t * @example\n\t * \tconst repository = await client.getRepository()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrepository}\n\t */\n\tasync getRepository(\n\t\tparams?: Pick<BuildQueryURLArgs, \"accessToken\"> & FetchParams,\n\t): Promise<Repository> {\n\t\tif (this.#cachedRepository && this.#cachedRepositoryExpiration > performance.now()) {\n\t\t\treturn this.#cachedRepository\n\t\t}\n\n\t\tconst url = new URL(this.documentAPIEndpoint)\n\n\t\tconst accessToken = params?.accessToken || this.accessToken\n\t\tif (accessToken) {\n\t\t\turl.searchParams.set(\"access_token\", accessToken)\n\t\t}\n\n\t\tconst response = await this.#request(url, params)\n\n\t\tif (response.ok) {\n\t\t\tthis.#cachedRepository = (await response.json()) as Repository\n\t\t\tthis.#cachedRepositoryExpiration = performance.now() + REPOSITORY_CACHE_TTL\n\n\t\t\treturn this.#cachedRepository\n\t\t}\n\n\t\tif (response.status === 404) {\n\t\t\tthrow new RepositoryNotFoundError(\n\t\t\t\t`Prismic repository not found. Check that \"${this.documentAPIEndpoint}\" is pointing to the correct repository.`,\n\t\t\t\turl.toString(),\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\treturn await this.#throwContentAPIError(response, url.toString())\n\t}\n\n\t/**\n\t * Fetches the repository's active refs.\n\t *\n\t * @example\n\t * \tconst refs = await client.getRefs()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefs}\n\t */\n\tasync getRefs(params?: FetchParams): Promise<Ref[]> {\n\t\tconst repository = await this.getRepository(params)\n\n\t\treturn repository.refs\n\t}\n\n\t/**\n\t * Fetches a ref by its ID.\n\t *\n\t * @example\n\t * \tconst ref = await client.getRefByID(\"YhE3YhEAACIA4321\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbyid}\n\t */\n\tasync getRefByID(id: string, params?: FetchParams): Promise<Ref> {\n\t\tconst refs = await this.getRefs(params)\n\t\tconst ref = refs.find((ref) => ref.id === id)\n\n\t\tif (!ref) {\n\t\t\tthrow new PrismicError(`Ref with ID \"${id}\" could not be found.`, undefined, undefined)\n\t\t}\n\n\t\treturn ref\n\t}\n\n\t/**\n\t * Fetches a ref by its label. A release ref's label is its name shown in the Page Builder.\n\t *\n\t * @example\n\t * \tconst ref = await client.getRefByLabel(\"My Release\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getrefbylabel}\n\t */\n\tasync getRefByLabel(label: string, params?: FetchParams): Promise<Ref> {\n\t\tconst refs = await this.getRefs(params)\n\t\tconst ref = refs.find((ref) => ref.label === label)\n\n\t\tif (!ref) {\n\t\t\tthrow new PrismicError(`Ref with label \"${label}\" could not be found.`, undefined, undefined)\n\t\t}\n\n\t\treturn ref\n\t}\n\n\t/**\n\t * Fetches the repository's master ref.\n\t *\n\t * @example\n\t * \tconst masterRef = await client.getMasterRef()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getmasterref}\n\t */\n\tasync getMasterRef(params?: FetchParams): Promise<Ref> {\n\t\tconst refs = await this.getRefs(params)\n\t\tconst ref = refs.find((ref) => ref.isMasterRef)\n\n\t\tif (!ref) {\n\t\t\tthrow new PrismicError(\"Master ref could not be found.\", undefined, undefined)\n\t\t}\n\n\t\treturn ref\n\t}\n\n\t/**\n\t * Fetches the repository's active releases.\n\t *\n\t * @example\n\t * \tconst releases = await client.getReleases()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleases}\n\t */\n\tasync getReleases(params?: FetchParams): Promise<Ref[]> {\n\t\tconst refs = await this.getRefs(params)\n\n\t\treturn refs.filter((ref) => !ref.isMasterRef)\n\t}\n\n\t/**\n\t * Fetches a release with a specific ID.\n\t *\n\t * @example\n\t * \tconst release = await client.getReleaseByID(\"YhE3YhEAACIA4321\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebyid}\n\t */\n\tasync getReleaseByID(id: string, params?: FetchParams): Promise<Ref> {\n\t\tconst releases = await this.getReleases(params)\n\t\tconst release = releases.find((ref) => ref.id === id)\n\n\t\tif (!release) {\n\t\t\tthrow new PrismicError(`Release with ID \"${id}\" could not be found.`, undefined, undefined)\n\t\t}\n\n\t\treturn release\n\t}\n\n\t/**\n\t * Fetches a release by its label. A release ref's label is its name shown in the Page Builder.\n\t *\n\t * @example\n\t * \tconst release = await client.getReleaseByLabel(\"My Release\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#getreleasebylabel}\n\t */\n\tasync getReleaseByLabel(label: string, params?: FetchParams): Promise<Ref> {\n\t\tconst releases = await this.getReleases(params)\n\t\tconst release = releases.find((ref) => ref.label === label)\n\n\t\tif (!release) {\n\t\t\tthrow new PrismicError(\n\t\t\t\t`Release with label \"${label}\" could not be found.`,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t)\n\t\t}\n\n\t\treturn release\n\t}\n\n\t/**\n\t * Fetches the repository's page tags.\n\t *\n\t * @example\n\t * \tconst tags = await client.getTags()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#gettags}\n\t */\n\tasync getTags(params?: FetchParams): Promise<string[]> {\n\t\tconst repository = await this.getRepository(params)\n\t\tconst form = repository.forms.tags\n\t\tif (form) {\n\t\t\tconst url = new URL(form.action)\n\t\t\tif (this.accessToken) {\n\t\t\t\turl.searchParams.set(\"access_token\", this.accessToken)\n\t\t\t}\n\n\t\t\tconst response = await this.#request(url, params)\n\t\t\tif (response.ok) {\n\t\t\t\treturn (await response.json()) as string[]\n\t\t\t}\n\t\t}\n\n\t\treturn repository.tags\n\t}\n\n\t/**\n\t * Builds a Content API query URL with a set of parameters.\n\t *\n\t * @example\n\t * \tconst url = await client.buildQueryURL({\n\t * \t\tfilters: [filter.at(\"document.type\", \"blog_post\")],\n\t * \t})\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#buildqueryurl}\n\t */\n\tasync buildQueryURL({\n\t\tsignal,\n\t\tfetchOptions,\n\t\t...params\n\t}: Partial<BuildQueryURLArgs> & FetchParams = {}): Promise<string> {\n\t\tconst ref =\n\t\t\tparams.ref ||\n\t\t\t(await this.#getResolvedRef({\n\t\t\t\taccessToken: params.accessToken,\n\t\t\t\tsignal,\n\t\t\t\tfetchOptions,\n\t\t\t}))\n\t\tconst integrationFieldsRef =\n\t\t\tparams.integrationFieldsRef ||\n\t\t\t(\n\t\t\t\tawait this.getRepository({\n\t\t\t\t\taccessToken: params.accessToken,\n\t\t\t\t\tsignal,\n\t\t\t\t\tfetchOptions,\n\t\t\t\t})\n\t\t\t).integrationFieldsRef ||\n\t\t\tundefined\n\n\t\treturn buildQueryURL(this.documentAPIEndpoint, {\n\t\t\t...this.defaultParams,\n\t\t\t...params,\n\t\t\tref,\n\t\t\tintegrationFieldsRef,\n\t\t\troutes: params.routes || this.routes,\n\t\t\tbrokenRoute: params.brokenRoute || this.brokenRoute,\n\t\t\taccessToken: params.accessToken || this.accessToken,\n\t\t})\n\t}\n\n\t/**\n\t * Fetches a previewed page's URL using a preview token and page ID.\n\t *\n\t * @example\n\t * \tconst url = await client.resolvePreviewURL({\n\t * \t\tlinkResolver,\n\t * \t\tdefaultURL: \"/\",\n\t * \t})\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#resolvepreviewurl}\n\t */\n\tasync resolvePreviewURL<LinkResolverReturnType>(\n\t\targs: {\n\t\t\t/** A function converts a document to a URL in your website. */\n\t\t\tlinkResolver?: LinkResolverFunction<LinkResolverReturnType>\n\t\t\t/** A fallback URL used when the document does not have a URL. */\n\t\t\tdefaultURL: string\n\t\t\t/** The preview token for the preview session. */\n\t\t\tpreviewToken?: string\n\t\t\t/** The previewed document's ID. */\n\t\t\tdocumentID?: string\n\t\t} & FetchParams,\n\t): Promise<string> {\n\t\tlet documentID: string | undefined | null = args.documentID\n\t\tlet previewToken: string | undefined | null = args.previewToken\n\n\t\tif (typeof globalThis.location !== \"undefined\") {\n\t\t\tconst searchParams = new URLSearchParams(globalThis.location.search)\n\n\t\t\tdocumentID = documentID || searchParams.get(\"documentId\")\n\t\t\tpreviewToken = previewToken || searchParams.get(\"token\")\n\t\t} else if (this.#autoPreviewsRequest) {\n\t\t\tif (\"query\" in this.#autoPreviewsRequest) {\n\t\t\t\tdocumentID = documentID || (this.#autoPreviewsRequest.query?.documentId as string)\n\t\t\t\tpreviewToken = previewToken || (this.#autoPreviewsRequest.query?.token as string)\n\t\t\t} else if (\"url\" in this.#autoPreviewsRequest && this.#autoPreviewsRequest.url) {\n\t\t\t\t// Including \"missing-host://\" by default\n\t\t\t\t// handles a case where Next.js Route Handlers\n\t\t\t\t// only provide the pathname and search\n\t\t\t\t// parameters in the `url` property\n\t\t\t\t// (e.g. `/api/preview?foo=bar`).\n\t\t\t\tconst searchParams = new URL(this.#autoPreviewsRequest.url, \"missing-host://\").searchParams\n\n\t\t\t\tdocumentID = documentID || searchParams.get(\"documentId\")\n\t\t\t\tpreviewToken = previewToken || searchParams.get(\"token\")\n\t\t\t}\n\t\t}\n\n\t\tif (documentID != null && previewToken != null) {\n\t\t\tconst document = await this.getByID(documentID, {\n\t\t\t\tref: previewToken,\n\t\t\t\tlang: \"*\",\n\t\t\t\tsignal: args.signal,\n\t\t\t\tfetchOptions: args.fetchOptions,\n\t\t\t})\n\n\t\t\tconst url = asLink(document, { linkResolver: args.linkResolver })\n\n\t\t\tif (typeof url === \"string\") {\n\t\t\t\treturn url\n\t\t\t}\n\t\t}\n\n\t\treturn args.defaultURL\n\t}\n\n\t/**\n\t * Configures the client to query the latest published content. This is the client's default mode.\n\t *\n\t * @example\n\t * \tclient.queryLatestContent()\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querylatestcontent}\n\t */\n\tqueryLatestContent(): void {\n\t\tthis.#getRef = undefined\n\t}\n\n\t/**\n\t * Configures the client to query content from a release with a specific ID.\n\t *\n\t * @example\n\t * \tclient.queryContentFromReleaseByID(\"YhE3YhEAACIA4321\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebyid}\n\t */\n\tqueryContentFromReleaseByID(id: string): void {\n\t\tthis.#getRef = async (params) => {\n\t\t\tconst release = await this.getReleaseByID(id, params)\n\t\t\treturn release.ref\n\t\t}\n\t}\n\n\t/**\n\t * Configures the client to query content from a release with a specific label.\n\t *\n\t * @example\n\t * \tclient.queryContentFromReleaseByLabel(\"My Release\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromreleasebylabel}\n\t */\n\tqueryContentFromReleaseByLabel(label: string): void {\n\t\tthis.#getRef = async (params) => {\n\t\t\tconst release = await this.getReleaseByLabel(label, params)\n\t\t\treturn release.ref\n\t\t}\n\t}\n\n\t/**\n\t * Configures the client to query content from a specific ref.\n\t *\n\t * @example\n\t * \tclient.queryContentFromRef(\"my-ref\")\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#querycontentfromref}\n\t */\n\tqueryContentFromRef(ref: string | GetRef): void {\n\t\tthis.#getRef = typeof ref === \"string\" ? () => ref : ref\n\t}\n\n\t/**\n\t * A preconfigured `fetch()` function for Prismic's GraphQL API that can be provided to GraphQL\n\t * clients.\n\t *\n\t * @example\n\t * \t```ts\n\t * \timport { createClient, getGraphQLEndpoint } from \"@prismicio/client\"\n\t *\n\t * \tconst client = createClient(\"example-prismic-repo\")\n\t * \tconst graphQLClient = new ApolloClient({\n\t * \tlink: new HttpLink({\n\t * \turi: getGraphQLEndpoint(client.repositoryName),\n\t * \t// Provide `client.graphQLFetch` as the fetch implementation.\n\t * \tfetch: client.graphQLFetch,\n\t * \t// Using GET is required.\n\t * \tuseGETForQueries: true,\n\t * \t}),\n\t * \tcache: new InMemoryCache(),\n\t * \t})\n\t * \t```\n\t *\n\t * @see {@link https://prismic.io/docs/technical-reference/prismicio-client/v7#graphqlfetch}\n\t */\n\tasync graphQLFetch(\n\t\tinput: RequestInfo,\n\t\tinit?: Omit<RequestInit, \"signal\"> & { signal?: AbortSignalLike },\n\t): Promise<Response> {\n\t\tconst params = {\n\t\t\taccessToken: this.accessToken,\n\t\t\tfetchOptions: this.fetchOptions,\n\t\t}\n\t\tconst repository = await this.getRepository(params)\n\t\tconst ref = await this.#getResolvedRef(params)\n\n\t\tconst headers: NonNullable<RequestInitLike[\"headers\"]> = {}\n\t\theaders[\"prismic-ref\"] = ref\n\t\tif (this.accessToken) {\n\t\t\theaders[\"authorization\"] = `Token ${this.accessToken}`\n\t\t}\n\t\tif (repository.integrationFieldsRef) {\n\t\t\theaders[\"prismic-integration-field-ref\"] = repository.integrationFieldsRef\n\t\t}\n\t\tfor (const [key, value] of Object.entries(init?.headers ?? {})) {\n\t\t\theaders[key.toLowerCase()] = value\n\t\t}\n\n\t\tconst url = new URL(typeof input === \"string\" ? input : input.url)\n\t\tconst query = (url.searchParams.get(\"query\") ?? \"\").replace(\n\t\t\t// Minify the query\n\t\t\t/(\\n| )*( |{|})(\\n| )*/gm,\n\t\t\t(_chars, _spaces, brackets) => brackets,\n\t\t)\n\t\turl.searchParams.set(\"query\", query)\n\t\t// Only used to prevent caching; caches ignore header differences\n\t\turl.searchParams.set(\"ref\", ref)\n\n\t\treturn (await this.fetchFn(url.toString(), {\n\t\t\t...init,\n\t\t\theaders,\n\t\t})) as Response\n\t}\n\n\t/**\n\t * Returns the ref needed to query based on the client's current state. This method may make a\n\t * network request to fetch a ref or resolve the user's ref thunk.\n\t *\n\t * If auto previews are enabled, the preview ref takes priority.\n\t *\n\t * The following strategies are used depending on the client's state:\n\t *\n\t * - If the user called `queryLatestContent`: Use the repository's master ref. The ref is cached for\n\t * 5 seconds. After 5 seconds, a new master ref is fetched.\n\t * - If the user called `queryContentFromReleaseByID`: Use the release's ref. The ref is cached for\n\t * 5 seconds. After 5 seconds, a new ref for the release is fetched.\n\t * - If the user called `queryContentFromReleaseByLabel`: Use the release's ref. The ref is cached\n\t * for 5 seconds. After 5 seconds, a new ref for the release is fetched.\n\t * - If the user called `queryContentFromRef`: Use the provided ref. Fall back to the master ref if\n\t * the ref is not a string.\n\t */\n\tasync #getResolvedRef(params?: Pick<BuildQueryURLArgs, \"accessToken\"> & FetchParams) {\n\t\tif (this.#autoPreviews) {\n\t\t\tconst cookies = this.#autoPreviewsRequest?.headers\n\t\t\t\t? \"get\" in this.#autoPreviewsRequest.headers\n\t\t\t\t\t? this.#autoPreviewsRequest.headers.get(\"cookie\")\n\t\t\t\t\t: this.#autoPreviewsRequest.headers.cookie\n\t\t\t\t: globalThis.document?.cookie\n\t\t\tconst previewRef = getPreviewCookie(cookies ?? \"\")\n\t\t\tif (previewRef) {\n\t\t\t\treturn previewRef\n\t\t\t}\n\t\t}\n\n\t\tconst ref = await this.#getRef?.(params)\n\t\tif (ref) {\n\t\t\treturn ref\n\t\t}\n\n\t\tconst masterRef = await this.getMasterRef(params)\n\t\treturn masterRef.ref\n\t}\n\n\t/**\n\t * Performs a low-level Content API request with the given parameters. Automatically retries if an\n\t * invalid ref is used.\n\t */\n\tasync #internalGet(\n\t\tparams?: Partial<BuildQueryURLArgs> & FetchParams,\n\t\tattempt = 1,\n\t): Promise<ResponseLike> {\n\t\tconst url = await this.buildQueryURL(params)\n\t\tconst response = await this.#request(new URL(url), params)\n\n\t\tif (response.ok) {\n\t\t\treturn response\n\t\t}\n\n\t\ttry {\n\t\t\treturn await this.#throwContentAPIError(response, url)\n\t\t} catch (error) {\n\t\t\tif (\n\t\t\t\t(error instanceof RefNotFoundError || error instanceof RefExpiredError) &&\n\t\t\t\tattempt < MAX_INVALID_REF_RETRY_ATTEMPTS\n\t\t\t) {\n\t\t\t\t// If no explicit ref is given (i.e. the master ref from\n\t\t\t\t// /api/v2 is used), clear the cached repository value.\n\t\t\t\t// Clearing the cached value prevents other methods from\n\t\t\t\t// using a known-stale ref.\n\t\t\t\tif (!params?.ref) {\n\t\t\t\t\tthis.#cachedRepository = undefined\n\t\t\t\t}\n\n\t\t\t\tconst masterRef = error.message.match(/master ref is: (?<ref>.*)$/i)?.groups?.ref\n\t\t\t\tif (!masterRef) {\n\t\t\t\t\tthrow error\n\t\t\t\t}\n\n\t\t\t\tconst badRef = new URL(url).searchParams.get(\"ref\")\n\t\t\t\tconst issue = error instanceof RefNotFoundError ? \"invalid\" : \"expired\"\n\t\t\t\tthrottledWarn(\n\t\t\t\t\t`[@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.`,\n\t\t\t\t)\n\n\t\t\t\treturn await this.#internalGet({ ...params, ref: masterRef }, attempt + 1)\n\t\t\t}\n\n\t\t\tthrow error\n\t\t}\n\t}\n\n\t/** Throws an error based on a Content API response. Only call in known-errored states. */\n\tasync #throwContentAPIError(response: ResponseLike, url: string): Promise<never> {\n\t\tswitch (response.status) {\n\t\t\tcase 400: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tthrow new ParsingError(json.message, url, json)\n\t\t\t}\n\t\t\tcase 401: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tthrow new ForbiddenError(json.message, url, json)\n\t\t\t}\n\t\t\tcase 404: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tswitch (json.type) {\n\t\t\t\t\tcase \"api_notfound_error\": {\n\t\t\t\t\t\tthrow new RefNotFoundError(json.message, url, json)\n\t\t\t\t\t}\n\t\t\t\t\tcase \"api_security_error\": {\n\t\t\t\t\t\tif (/preview token.*expired/i.test(json.message)) {\n\t\t\t\t\t\t\tthrow new PreviewTokenExpiredError(json.message, url, json)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tthrow new NotFoundError(json.message, url, json)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcase 410: {\n\t\t\t\tconst json = await response.clone().json()\n\t\t\t\tthrow new RefExpiredError(json.message, url, json)\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new PrismicError(undefined, url, await response.text())\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Performs a low-level network request with the client's fetch options. */\n\tasync #request(url: URL, params?: FetchParams): Promise<ResponseLike> {\n\t\treturn await request(\n\t\t\turl,\n\t\t\t{\n\t\t\t\t...this.fetchOptions,\n\t\t\t\t...params?.fetchOptions,\n\t\t\t\theaders: {\n\t\t\t\t\t...this.fetchOptions?.headers,\n\t\t\t\t\t...params?.fetchOptions?.headers,\n\t\t\t\t},\n\t\t\t\tsignal: params?.fetchOptions?.signal || params?.signal || this.fetchOptions?.signal,\n\t\t\t},\n\t\t\tthis.fetchFn,\n\t\t)\n\t}\n}\n\n/** Appends filters to a params object. */\nfunction appendFilters<T extends Pick<BuildQueryURLArgs, \"filters\">>(\n\tparams = {} as T,\n\t...filters: string[]\n): T & { filters: string[] } {\n\treturn { ...params, filters: [...(params.filters ?? []), ...filters] }\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,MAAM,gBAAgB;AACtB,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAC5B,MAAM,iCAAiC;;;;;;;AAmIvC,IAAa,SAAb,MAA0E;;;;;;CAMzE;;;;;;CAMA;;;;;;;CAOA;;;;;;;CAOA;;;;;;;CAOA;;;;;;;CAOA;;;;;;;CAOA;CAEA;CAEA;CACA,gBAAgB;CAChB;CAEA;CACA,8BAA8B;;;;;;CAO9B,YAAY,0BAAkC,SAAuB,CAAC,GAAG;EACxE,MAAM,EACL,qBACA,aACA,KACA,QACA,aACA,eACA,eAAe,CAAC,GAChB,QAAQ,WAAW,OAAO,KAAK,UAAU,MACtC;EAEJ,IAAIA,6BAAAA,qBAAqB,wBAAwB,GAAG;GACnD,IAAI;IACH,KAAK,iBAAiBC,0BAAAA,kBAAkB,wBAAwB;GACjE,QAAQ;IACP,QAAQ,KACP,6FAA6F,yBAAyB,+HAA+HC,eAAAA,OAAO,wBAAwB,GACrR;GACD;GACA,KAAK,sBAAsB,uBAAuB;EACnD,OAAO;GACN,KAAK,iBAAiB;GACtB,KAAK,sBACJ,uBAAuBC,8BAAAA,sBAAsB,wBAAwB;EACvE;EAEA,IAAI,CAAC,OACJ,MAAM,IAAI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