@prismicio/client 6.7.1 → 6.7.3
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/ForbiddenError.cjs +7 -0
- package/dist/ForbiddenError.cjs.map +1 -0
- package/dist/ForbiddenError.d.ts +11 -0
- package/dist/ForbiddenError.js +7 -0
- package/dist/ForbiddenError.js.map +1 -0
- package/dist/NotFoundError.cjs +7 -0
- package/dist/NotFoundError.cjs.map +1 -0
- package/dist/NotFoundError.d.ts +3 -0
- package/dist/NotFoundError.js +7 -0
- package/dist/NotFoundError.js.map +1 -0
- package/dist/ParsingError.cjs +7 -0
- package/dist/ParsingError.cjs.map +1 -0
- package/dist/ParsingError.d.ts +12 -0
- package/dist/ParsingError.js +7 -0
- package/dist/ParsingError.js.map +1 -0
- package/dist/PrismicError.cjs +19 -0
- package/dist/PrismicError.cjs.map +1 -0
- package/dist/PrismicError.d.ts +5 -0
- package/dist/PrismicError.js +19 -0
- package/dist/PrismicError.js.map +1 -0
- package/dist/buildQueryURL.cjs +40 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.ts +130 -0
- package/dist/buildQueryURL.js +40 -0
- package/dist/buildQueryURL.js.map +1 -0
- package/dist/client.cjs +436 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.ts +929 -0
- package/dist/client.js +419 -0
- package/dist/client.js.map +1 -0
- package/dist/cookie.cjs +5 -0
- package/dist/cookie.cjs.map +1 -0
- package/dist/cookie.d.ts +5 -0
- package/dist/cookie.js +5 -0
- package/dist/cookie.js.map +1 -0
- package/dist/getGraphQLEndpoint.cjs +13 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -0
- package/dist/getGraphQLEndpoint.d.ts +9 -0
- package/dist/getGraphQLEndpoint.js +13 -0
- package/dist/getGraphQLEndpoint.js.map +1 -0
- package/dist/getRepositoryEndpoint.cjs +13 -0
- package/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/getRepositoryEndpoint.d.ts +10 -0
- package/dist/getRepositoryEndpoint.js +13 -0
- package/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/getRepositoryName.cjs +12 -0
- package/dist/getRepositoryName.cjs.map +1 -0
- package/dist/getRepositoryName.d.ts +13 -0
- package/dist/getRepositoryName.js +12 -0
- package/dist/getRepositoryName.js.map +1 -0
- package/dist/index.cjs +32 -719
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +88 -1526
- package/dist/index.js +34 -679
- package/dist/index.js.map +1 -1
- package/dist/isRepositoryEndpoint.cjs +12 -0
- package/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/isRepositoryEndpoint.d.ts +10 -0
- package/dist/isRepositoryEndpoint.js +12 -0
- package/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/isRepositoryName.cjs +7 -0
- package/dist/isRepositoryName.cjs.map +1 -0
- package/dist/isRepositoryName.d.ts +9 -0
- package/dist/isRepositoryName.js +7 -0
- package/dist/isRepositoryName.js.map +1 -0
- package/dist/lib/appendPredicates.cjs +14 -0
- package/dist/lib/appendPredicates.cjs.map +1 -0
- package/dist/lib/appendPredicates.d.ts +18 -0
- package/dist/lib/appendPredicates.js +14 -0
- package/dist/lib/appendPredicates.js.map +1 -0
- package/dist/lib/castArray.cjs +5 -0
- package/dist/lib/castArray.cjs.map +1 -0
- package/dist/lib/castArray.d.ts +11 -0
- package/dist/lib/castArray.js +5 -0
- package/dist/lib/castArray.js.map +1 -0
- package/dist/lib/castThunk.cjs +5 -0
- package/dist/lib/castThunk.cjs.map +1 -0
- package/dist/lib/castThunk.d.ts +10 -0
- package/dist/lib/castThunk.js +5 -0
- package/dist/lib/castThunk.js.map +1 -0
- package/dist/lib/findMasterRef.cjs +8 -0
- package/dist/lib/findMasterRef.cjs.map +1 -0
- package/dist/lib/findMasterRef.d.ts +10 -0
- package/dist/lib/findMasterRef.js +8 -0
- package/dist/lib/findMasterRef.js.map +1 -0
- package/dist/lib/findRef.cjs +12 -0
- package/dist/lib/findRef.cjs.map +1 -0
- package/dist/lib/findRef.d.ts +13 -0
- package/dist/lib/findRef.js +12 -0
- package/dist/lib/findRef.js.map +1 -0
- package/dist/lib/findRefByID.cjs +8 -0
- package/dist/lib/findRefByID.cjs.map +1 -0
- package/dist/lib/findRefByID.d.ts +11 -0
- package/dist/lib/findRefByID.js +8 -0
- package/dist/lib/findRefByID.js.map +1 -0
- package/dist/lib/findRefByLabel.cjs +8 -0
- package/dist/lib/findRefByLabel.cjs.map +1 -0
- package/dist/lib/findRefByLabel.d.ts +11 -0
- package/dist/lib/findRefByLabel.js +8 -0
- package/dist/lib/findRefByLabel.js.map +1 -0
- package/dist/lib/getPreviewCookie.cjs +21 -0
- package/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/lib/getPreviewCookie.d.ts +9 -0
- package/dist/lib/getPreviewCookie.js +21 -0
- package/dist/lib/getPreviewCookie.js.map +1 -0
- package/dist/lib/minifyGraphQLQuery.cjs +7 -0
- package/dist/lib/minifyGraphQLQuery.cjs.map +1 -0
- package/dist/lib/minifyGraphQLQuery.d.ts +8 -0
- package/dist/lib/minifyGraphQLQuery.js +7 -0
- package/dist/lib/minifyGraphQLQuery.js.map +1 -0
- package/dist/lib/orElseThrow.d.ts +11 -0
- package/dist/predicate.cjs +68 -0
- package/dist/predicate.cjs.map +1 -0
- package/dist/predicate.d.ts +209 -0
- package/dist/predicate.js +68 -0
- package/dist/predicate.js.map +1 -0
- package/dist/types.d.ts +156 -0
- package/package.json +21 -21
- package/src/buildQueryURL.ts +6 -3
- package/src/client.ts +71 -36
- package/src/cookie.ts +2 -1
- package/src/getRepositoryName.ts +4 -2
- package/src/isRepositoryEndpoint.ts +2 -1
- package/src/isRepositoryName.ts +2 -1
- package/src/lib/appendPredicates.ts +2 -1
- package/src/lib/getPreviewCookie.ts +2 -1
- package/src/predicate.ts +4 -2
- package/src/types.ts +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,1526 +1,88 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*/
|
|
90
|
-
declare type FetchLike = (input: string, init?: RequestInitLike) => Promise<ResponseLike>;
|
|
91
|
-
/**
|
|
92
|
-
* An object that allows you to abort a `fetch()` request if needed via an
|
|
93
|
-
* `AbortController` object
|
|
94
|
-
*
|
|
95
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal}
|
|
96
|
-
*/
|
|
97
|
-
declare type AbortSignalLike = any;
|
|
98
|
-
/**
|
|
99
|
-
* The minimum required properties from RequestInit.
|
|
100
|
-
*/
|
|
101
|
-
interface RequestInitLike {
|
|
102
|
-
headers?: Record<string, string>;
|
|
103
|
-
/**
|
|
104
|
-
* An object that allows you to abort a `fetch()` request if needed via an
|
|
105
|
-
* `AbortController` object
|
|
106
|
-
*
|
|
107
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal}
|
|
108
|
-
*/
|
|
109
|
-
signal?: AbortSignalLike;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* The minimum required properties from Response.
|
|
113
|
-
*/
|
|
114
|
-
interface ResponseLike {
|
|
115
|
-
status: number;
|
|
116
|
-
json(): Promise<any>;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* The minimum required properties to treat as an HTTP Request for automatic
|
|
120
|
-
* Prismic preview support.
|
|
121
|
-
*/
|
|
122
|
-
declare type HttpRequestLike = /**
|
|
123
|
-
* Web API Request
|
|
124
|
-
*
|
|
125
|
-
* @see http://developer.mozilla.org/en-US/docs/Web/API/Request
|
|
126
|
-
*/ {
|
|
127
|
-
headers?: {
|
|
128
|
-
get(name: string): string | null;
|
|
129
|
-
};
|
|
130
|
-
url?: string;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Express-style Request
|
|
134
|
-
*/
|
|
135
|
-
| {
|
|
136
|
-
headers?: {
|
|
137
|
-
cookie?: string;
|
|
138
|
-
};
|
|
139
|
-
query?: Record<string, unknown>;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* An `orderings` parameter that orders the results by the specified field.
|
|
143
|
-
*
|
|
144
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#orderings}
|
|
145
|
-
*/
|
|
146
|
-
interface Ordering {
|
|
147
|
-
field: string;
|
|
148
|
-
direction?: "asc" | "desc";
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* A `routes` parameter that determines how a document's URL field is resolved.
|
|
152
|
-
*
|
|
153
|
-
* @example With a document's UID field.
|
|
154
|
-
*
|
|
155
|
-
* ```ts
|
|
156
|
-
* {
|
|
157
|
-
* "type": "page",
|
|
158
|
-
* "path": "/:uid"
|
|
159
|
-
* }
|
|
160
|
-
* ```
|
|
161
|
-
*
|
|
162
|
-
* @example With a Content Relationship `parent` field.
|
|
163
|
-
*
|
|
164
|
-
* ```ts
|
|
165
|
-
* {
|
|
166
|
-
* "type": "page",
|
|
167
|
-
* "path": "/:parent?/:uid",
|
|
168
|
-
* "resolvers": {
|
|
169
|
-
* "parent": "parent"
|
|
170
|
-
* }
|
|
171
|
-
* }
|
|
172
|
-
* ```
|
|
173
|
-
*
|
|
174
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
175
|
-
*/
|
|
176
|
-
interface Route {
|
|
177
|
-
/**
|
|
178
|
-
* The Custom Type of the document.
|
|
179
|
-
*/
|
|
180
|
-
type: string;
|
|
181
|
-
/**
|
|
182
|
-
* A specific UID to which this route definition is scoped. The route is only
|
|
183
|
-
* defined for the document whose UID matches the given UID.
|
|
184
|
-
*/
|
|
185
|
-
uid?: string;
|
|
186
|
-
/**
|
|
187
|
-
* A specific language to which this route definition is scoped. The route is
|
|
188
|
-
* only defined for documents whose language matches the given language.
|
|
189
|
-
*/
|
|
190
|
-
lang?: string;
|
|
191
|
-
/**
|
|
192
|
-
* The resolved path of the document with optional placeholders.
|
|
193
|
-
*/
|
|
194
|
-
path: string;
|
|
195
|
-
/**
|
|
196
|
-
* An object that lists the API IDs of the Content Relationships in the route.
|
|
197
|
-
*/
|
|
198
|
-
resolvers?: Record<string, string>;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Parameters for the Prismic REST API V2.
|
|
203
|
-
*
|
|
204
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api}
|
|
205
|
-
*/
|
|
206
|
-
interface QueryParams {
|
|
207
|
-
/**
|
|
208
|
-
* The secure token for accessing the API (only needed if your repository is
|
|
209
|
-
* set to private).
|
|
210
|
-
*
|
|
211
|
-
* {@link https://user-guides.prismic.io/en/articles/1036153-generating-an-access-token}
|
|
212
|
-
*/
|
|
213
|
-
accessToken?: string;
|
|
214
|
-
/**
|
|
215
|
-
* The `pageSize` parameter defines the maximum number of documents that the
|
|
216
|
-
* API will return for your query.
|
|
217
|
-
*
|
|
218
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#pagesize}
|
|
219
|
-
*/
|
|
220
|
-
pageSize?: number;
|
|
221
|
-
/**
|
|
222
|
-
* The `page` parameter defines the pagination for the result of your query.
|
|
223
|
-
*
|
|
224
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#page}
|
|
225
|
-
*/
|
|
226
|
-
page?: number;
|
|
227
|
-
/**
|
|
228
|
-
* The `after` parameter can be used along with the orderings option. It will
|
|
229
|
-
* remove all the documents except for those after the specified document in the list.
|
|
230
|
-
*
|
|
231
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#after}
|
|
232
|
-
*/
|
|
233
|
-
after?: string;
|
|
234
|
-
/**
|
|
235
|
-
* The `fetch` parameter is used to make queries faster by only retrieving the
|
|
236
|
-
* specified field(s).
|
|
237
|
-
*
|
|
238
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#fetch}
|
|
239
|
-
*/
|
|
240
|
-
fetch?: string | string[];
|
|
241
|
-
/**
|
|
242
|
-
* The `fetchLinks` parameter allows you to retrieve a specific content field
|
|
243
|
-
* from a linked document and add it to the document response object.
|
|
244
|
-
*
|
|
245
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#fetchlinks}
|
|
246
|
-
*/
|
|
247
|
-
fetchLinks?: string | string[];
|
|
248
|
-
/**
|
|
249
|
-
* The `graphQuery` parameter allows you to specify which fields to retrieve
|
|
250
|
-
* and what content to retrieve from Linked Documents / Content Relationships.
|
|
251
|
-
*
|
|
252
|
-
* {@link https://prismic.io/docs/technologies/graphquery-rest-api}
|
|
253
|
-
*/
|
|
254
|
-
graphQuery?: string;
|
|
255
|
-
/**
|
|
256
|
-
* The `lang` option defines the language code for the results of your query.
|
|
257
|
-
*
|
|
258
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#lang}
|
|
259
|
-
*/
|
|
260
|
-
lang?: string;
|
|
261
|
-
/**
|
|
262
|
-
* The `orderings` parameter orders the results by the specified field(s). You
|
|
263
|
-
* can specify as many fields as you want.
|
|
264
|
-
*
|
|
265
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#orderings}
|
|
266
|
-
*/
|
|
267
|
-
orderings?: Ordering | string | (Ordering | string)[];
|
|
268
|
-
/**
|
|
269
|
-
* The `routes` option allows you to define how a document's `url` field is resolved.
|
|
270
|
-
*
|
|
271
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
272
|
-
*/
|
|
273
|
-
routes?: Route | string | (Route | string)[];
|
|
274
|
-
/**
|
|
275
|
-
* The `brokenRoute` option allows you to define the route populated in the
|
|
276
|
-
* `url` property for broken Link or Content Relationship fields. A broken
|
|
277
|
-
* link is a Link or Content Relationship field whose linked document has been
|
|
278
|
-
* unpublished or deleted.
|
|
279
|
-
*
|
|
280
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
281
|
-
*/
|
|
282
|
-
brokenRoute?: string;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Arguments for `buildQueryURL` to construct a Query URL.
|
|
286
|
-
*/
|
|
287
|
-
declare type BuildQueryURLParams = {
|
|
288
|
-
/**
|
|
289
|
-
* Ref used to query documents.
|
|
290
|
-
*
|
|
291
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#prismic-api-ref}
|
|
292
|
-
*/
|
|
293
|
-
ref: string;
|
|
294
|
-
/**
|
|
295
|
-
* Ref used to populate Integration Fields with the latest content.
|
|
296
|
-
*
|
|
297
|
-
* {@link https://prismic.io/docs/core-concepts/integration-fields}
|
|
298
|
-
*/
|
|
299
|
-
integrationFieldsRef?: string;
|
|
300
|
-
/**
|
|
301
|
-
* One or more predicates to filter documents for the query.
|
|
302
|
-
*
|
|
303
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api}
|
|
304
|
-
*/
|
|
305
|
-
predicates?: string | string[];
|
|
306
|
-
};
|
|
307
|
-
declare type BuildQueryURLArgs = QueryParams & BuildQueryURLParams;
|
|
308
|
-
/**
|
|
309
|
-
* Build a Prismic REST API V2 URL to request documents from a repository. The
|
|
310
|
-
* paginated response for this URL includes documents matching the parameters.
|
|
311
|
-
*
|
|
312
|
-
* A ref is required to make a request. Request the `endpoint` URL to retrieve a
|
|
313
|
-
* list of available refs.
|
|
314
|
-
*
|
|
315
|
-
* Type the JSON response with `Query`.
|
|
316
|
-
*
|
|
317
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#prismic-api-ref}
|
|
318
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api}
|
|
319
|
-
*
|
|
320
|
-
* @param endpoint - URL to the repository's REST API V2.
|
|
321
|
-
* @param args - Arguments to filter and scope the query.
|
|
322
|
-
*
|
|
323
|
-
* @returns URL that can be used to request documents from the repository.
|
|
324
|
-
*/
|
|
325
|
-
declare const buildQueryURL: (endpoint: string, args: BuildQueryURLArgs) => string;
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* A ref or a function that returns a ref. If a static ref is known, one can be
|
|
329
|
-
* given. If the ref must be fetched on-demand, a function can be provided. This
|
|
330
|
-
* function can optionally be asynchronous.
|
|
331
|
-
*/
|
|
332
|
-
declare type RefStringOrThunk = string | (() => string | undefined | Promise<string | undefined>);
|
|
333
|
-
/**
|
|
334
|
-
* Configuration for clients that determine how content is queried.
|
|
335
|
-
*/
|
|
336
|
-
declare type ClientConfig = {
|
|
337
|
-
/**
|
|
338
|
-
* The secure token for accessing the Prismic repository. This is only
|
|
339
|
-
* required if the repository is set to private.
|
|
340
|
-
*/
|
|
341
|
-
accessToken?: string;
|
|
342
|
-
/**
|
|
343
|
-
* A string representing a version of the Prismic repository's content. This
|
|
344
|
-
* may point to the latest version (called the "master ref"), or a preview
|
|
345
|
-
* with draft content.
|
|
346
|
-
*/
|
|
347
|
-
ref?: RefStringOrThunk;
|
|
348
|
-
/**
|
|
349
|
-
* A list of Route Resolver objects that define how a document's `url` field
|
|
350
|
-
* is resolved.
|
|
351
|
-
*
|
|
352
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
353
|
-
*/
|
|
354
|
-
routes?: NonNullable<BuildQueryURLArgs["routes"]>;
|
|
355
|
-
/**
|
|
356
|
-
* The `brokenRoute` option allows you to define the route populated in the
|
|
357
|
-
* `url` property for broken Link or Content Relationship fields. A broken
|
|
358
|
-
* link is a Link or Content Relationship field whose linked document has been
|
|
359
|
-
* unpublished or deleted.
|
|
360
|
-
*
|
|
361
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
362
|
-
*/
|
|
363
|
-
brokenRoute?: NonNullable<BuildQueryURLArgs["brokenRoute"]>;
|
|
364
|
-
/**
|
|
365
|
-
* Default parameters that will be sent with each query. These parameters can
|
|
366
|
-
* be overridden on each query if needed.
|
|
367
|
-
*/
|
|
368
|
-
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "integrationFieldsRef" | "accessToken" | "routes" | "brokenRoute">;
|
|
369
|
-
/**
|
|
370
|
-
* The function used to make network requests to the Prismic REST API. In
|
|
371
|
-
* environments where a global `fetch` function does not exist, such as
|
|
372
|
-
* Node.js, this function must be provided.
|
|
373
|
-
*/
|
|
374
|
-
fetch?: FetchLike;
|
|
375
|
-
};
|
|
376
|
-
/**
|
|
377
|
-
* Parameters for any client method that use `fetch()`. Only a subset of
|
|
378
|
-
* `fetch()` parameters are exposed.
|
|
379
|
-
*/
|
|
380
|
-
declare type FetchParams = {
|
|
381
|
-
/**
|
|
382
|
-
* An `AbortSignal` provided by an `AbortController`. This allows the network
|
|
383
|
-
* request to be cancelled if necessary.
|
|
384
|
-
*
|
|
385
|
-
* {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal}
|
|
386
|
-
*/
|
|
387
|
-
signal?: AbortSignalLike;
|
|
388
|
-
};
|
|
389
|
-
/**
|
|
390
|
-
* Parameters specific to client methods that fetch all documents. These methods
|
|
391
|
-
* start with `getAll` (for example, `getAllByType`).
|
|
392
|
-
*/
|
|
393
|
-
declare type GetAllParams = {
|
|
394
|
-
/**
|
|
395
|
-
* Limit the number of documents queried. If a number is not provided, there
|
|
396
|
-
* will be no limit and all matching documents will be returned.
|
|
397
|
-
*/
|
|
398
|
-
limit?: number;
|
|
399
|
-
};
|
|
400
|
-
/**
|
|
401
|
-
* Arguments to determine how the URL for a preview session is resolved.
|
|
402
|
-
*/
|
|
403
|
-
declare type ResolvePreviewArgs<LinkResolverReturnType> = {
|
|
404
|
-
/**
|
|
405
|
-
* A function that maps a Prismic document to a URL within your app.
|
|
406
|
-
*/
|
|
407
|
-
linkResolver?: prismicH.LinkResolverFunction<LinkResolverReturnType>;
|
|
408
|
-
/**
|
|
409
|
-
* A fallback URL if the Link Resolver does not return a value.
|
|
410
|
-
*/
|
|
411
|
-
defaultURL: string;
|
|
412
|
-
/**
|
|
413
|
-
* The preview token (also known as a ref) that will be used to query preview
|
|
414
|
-
* content from the Prismic repository.
|
|
415
|
-
*/
|
|
416
|
-
previewToken?: string;
|
|
417
|
-
/**
|
|
418
|
-
* The previewed document that will be used to determine the destination URL.
|
|
419
|
-
*/
|
|
420
|
-
documentID?: string;
|
|
421
|
-
};
|
|
422
|
-
/**
|
|
423
|
-
* Type definitions for the `createClient()` function. May be augmented by
|
|
424
|
-
* third-party libraries.
|
|
425
|
-
*/
|
|
426
|
-
interface CreateClient {
|
|
427
|
-
<TDocuments extends prismicT.PrismicDocument>(...args: ConstructorParameters<typeof Client>): Client<TDocuments>;
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Creates a Prismic client that can be used to query a repository.
|
|
431
|
-
*
|
|
432
|
-
* @example
|
|
433
|
-
*
|
|
434
|
-
* ```ts
|
|
435
|
-
* // With a repository name.
|
|
436
|
-
* createClient("qwerty");
|
|
437
|
-
*
|
|
438
|
-
* // Or with a full Prismic Rest API V2 endpoint.
|
|
439
|
-
* createClient("https://qwerty.cdn.prismic.io/api/v2");
|
|
440
|
-
* ```
|
|
441
|
-
*
|
|
442
|
-
* @typeParam TDocuments - A map of Prismic document type IDs mapped to their
|
|
443
|
-
* TypeScript type.
|
|
444
|
-
* @param repositoryNameOrEndpoint - The Prismic repository name or full Rest
|
|
445
|
-
* API V2 endpoint for the repository.
|
|
446
|
-
* @param options - Configuration that determines how content will be queried
|
|
447
|
-
* from the Prismic repository.
|
|
448
|
-
*
|
|
449
|
-
* @returns A client that can query content from the repository.
|
|
450
|
-
*/
|
|
451
|
-
declare const createClient: CreateClient;
|
|
452
|
-
/**
|
|
453
|
-
* A client that allows querying content from a Prismic repository.
|
|
454
|
-
*
|
|
455
|
-
* If used in an environment where a global `fetch` function is unavailable,
|
|
456
|
-
* such as Node.js, the `fetch` option must be provided as part of the `options`
|
|
457
|
-
* parameter.
|
|
458
|
-
*
|
|
459
|
-
* @typeParam TDocuments - Document types that are registered for the Prismic
|
|
460
|
-
* repository. Query methods will automatically be typed based on this type.
|
|
461
|
-
*/
|
|
462
|
-
declare class Client<TDocuments extends prismicT.PrismicDocument = prismicT.PrismicDocument> {
|
|
463
|
-
/**
|
|
464
|
-
* The Prismic REST API V2 endpoint for the repository (use
|
|
465
|
-
* `prismic.getRepositoryEndpoint` for the default endpoint).
|
|
466
|
-
*/
|
|
467
|
-
endpoint: string;
|
|
468
|
-
/**
|
|
469
|
-
* The secure token for accessing the API (only needed if your repository is
|
|
470
|
-
* set to private).
|
|
471
|
-
*
|
|
472
|
-
* {@link https://user-guides.prismic.io/en/articles/1036153-generating-an-access-token}
|
|
473
|
-
*/
|
|
474
|
-
accessToken?: string;
|
|
475
|
-
/**
|
|
476
|
-
* A list of Route Resolver objects that define how a document's `url` field
|
|
477
|
-
* is resolved.
|
|
478
|
-
*
|
|
479
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
480
|
-
*/
|
|
481
|
-
routes?: NonNullable<BuildQueryURLArgs["routes"]>;
|
|
482
|
-
/**
|
|
483
|
-
* The `brokenRoute` option allows you to define the route populated in the
|
|
484
|
-
* `url` property for broken Link or Content Relationship fields. A broken
|
|
485
|
-
* link is a Link or Content Relationship field whose linked document has been
|
|
486
|
-
* unpublished or deleted.
|
|
487
|
-
*
|
|
488
|
-
* {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
|
|
489
|
-
*/
|
|
490
|
-
brokenRoute?: NonNullable<BuildQueryURLArgs["brokenRoute"]>;
|
|
491
|
-
/**
|
|
492
|
-
* The function used to make network requests to the Prismic REST API. In
|
|
493
|
-
* environments where a global `fetch` function does not exist, such as
|
|
494
|
-
* Node.js, this function must be provided.
|
|
495
|
-
*/
|
|
496
|
-
fetchFn: FetchLike;
|
|
497
|
-
/**
|
|
498
|
-
* Default parameters that will be sent with each query. These parameters can
|
|
499
|
-
* be overridden on each query if needed.
|
|
500
|
-
*/
|
|
501
|
-
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "integrationFieldsRef" | "accessToken" | "routes">;
|
|
502
|
-
/**
|
|
503
|
-
* The client's ref mode state. This determines which ref is used during queries.
|
|
504
|
-
*/
|
|
505
|
-
private refState;
|
|
506
|
-
/**
|
|
507
|
-
* Cached repository value.
|
|
508
|
-
*/
|
|
509
|
-
private cachedRepository;
|
|
510
|
-
/**
|
|
511
|
-
* Timestamp at which the cached repository data is considered stale.
|
|
512
|
-
*/
|
|
513
|
-
private cachedRepositoryExpiration;
|
|
514
|
-
/**
|
|
515
|
-
* Creates a Prismic client that can be used to query a repository.
|
|
516
|
-
*
|
|
517
|
-
* If used in an environment where a global `fetch` function is unavailable,
|
|
518
|
-
* such as Node.js, the `fetch` option must be provided as part of the
|
|
519
|
-
* `options` parameter.
|
|
520
|
-
*
|
|
521
|
-
* @param repositoryNameOrEndpoint - The Prismic repository name or full Rest
|
|
522
|
-
* API V2 endpoint for the repository.
|
|
523
|
-
* @param options - Configuration that determines how content will be queried
|
|
524
|
-
* from the Prismic repository.
|
|
525
|
-
*
|
|
526
|
-
* @returns A client that can query content from the repository.
|
|
527
|
-
*/
|
|
528
|
-
constructor(repositoryNameOrEndpoint: string, options?: ClientConfig);
|
|
529
|
-
/**
|
|
530
|
-
* Enables the client to automatically query content from a preview session if
|
|
531
|
-
* one is active in browser environments. This is enabled by default in the browser.
|
|
532
|
-
*
|
|
533
|
-
* For server environments, use `enableAutoPreviewsFromReq`.
|
|
534
|
-
*
|
|
535
|
-
* @example
|
|
536
|
-
*
|
|
537
|
-
* ```ts
|
|
538
|
-
* client.enableAutoPreviews();
|
|
539
|
-
* ```
|
|
540
|
-
*
|
|
541
|
-
* @see enableAutoPreviewsFromReq
|
|
542
|
-
*/
|
|
543
|
-
enableAutoPreviews(): void;
|
|
544
|
-
/**
|
|
545
|
-
* Enables the client to automatically query content from a preview session if
|
|
546
|
-
* one is active in server environments. This is disabled by default on the server.
|
|
547
|
-
*
|
|
548
|
-
* For browser environments, use `enableAutoPreviews`.
|
|
549
|
-
*
|
|
550
|
-
* @example
|
|
551
|
-
*
|
|
552
|
-
* ```ts
|
|
553
|
-
* // In an express app
|
|
554
|
-
* app.get("/", function (req, res) {
|
|
555
|
-
* client.enableAutoPreviewsFromReq(req);
|
|
556
|
-
* });
|
|
557
|
-
* ```
|
|
558
|
-
*
|
|
559
|
-
* @param req - An HTTP server request object containing the request's cookies.
|
|
560
|
-
*/
|
|
561
|
-
enableAutoPreviewsFromReq<R extends HttpRequestLike>(req: R): void;
|
|
562
|
-
/**
|
|
563
|
-
* Disables the client from automatically querying content from a preview
|
|
564
|
-
* session if one is active.
|
|
565
|
-
*
|
|
566
|
-
* Automatic preview content querying is enabled by default unless this method
|
|
567
|
-
* is called.
|
|
568
|
-
*
|
|
569
|
-
* @example
|
|
570
|
-
*
|
|
571
|
-
* ```ts
|
|
572
|
-
* client.disableAutoPreviews();
|
|
573
|
-
* ```
|
|
574
|
-
*/
|
|
575
|
-
disableAutoPreviews(): void;
|
|
576
|
-
/**
|
|
577
|
-
* Queries content from the Prismic repository.
|
|
578
|
-
*
|
|
579
|
-
* @deprecated Use `get` instead.
|
|
580
|
-
* @example
|
|
581
|
-
*
|
|
582
|
-
* ```ts
|
|
583
|
-
* const response = await client.query(
|
|
584
|
-
* prismic.predicate.at("document.type", "page"),
|
|
585
|
-
* );
|
|
586
|
-
* ```
|
|
587
|
-
*
|
|
588
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
589
|
-
* @param params - Parameters to filter, sort, and paginate results.
|
|
590
|
-
*
|
|
591
|
-
* @returns A paginated response containing the result of the query.
|
|
592
|
-
*/
|
|
593
|
-
query<TDocument extends TDocuments>(predicates: NonNullable<BuildQueryURLArgs["predicates"]>, params?: Partial<Omit<BuildQueryURLArgs, "predicates">> & FetchParams): Promise<prismicT.Query<TDocument>>;
|
|
594
|
-
/**
|
|
595
|
-
* Queries content from the Prismic repository.
|
|
596
|
-
*
|
|
597
|
-
* @example
|
|
598
|
-
*
|
|
599
|
-
* ```ts
|
|
600
|
-
* const response = await client.get();
|
|
601
|
-
* ```
|
|
602
|
-
*
|
|
603
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
604
|
-
* @param params - Parameters to filter, sort, and paginate results.
|
|
605
|
-
*
|
|
606
|
-
* @returns A paginated response containing the result of the query.
|
|
607
|
-
*/
|
|
608
|
-
get<TDocument extends TDocuments>(params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<TDocument>>;
|
|
609
|
-
/**
|
|
610
|
-
* Queries content from the Prismic repository and returns only the first
|
|
611
|
-
* result, if any.
|
|
612
|
-
*
|
|
613
|
-
* @example
|
|
614
|
-
*
|
|
615
|
-
* ```ts
|
|
616
|
-
* const document = await client.getFirst();
|
|
617
|
-
* ```
|
|
618
|
-
*
|
|
619
|
-
* @typeParam TDocument - Type of the Prismic document returned.
|
|
620
|
-
* @param params - Parameters to filter, sort, and paginate results. @returns
|
|
621
|
-
* The first result of the query, if any.
|
|
622
|
-
*/
|
|
623
|
-
getFirst<TDocument extends TDocuments>(params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument>;
|
|
624
|
-
/**
|
|
625
|
-
* **IMPORTANT**: Avoid using `dangerouslyGetAll` as it may be slower and
|
|
626
|
-
* require more resources than other methods. Prefer using other methods that
|
|
627
|
-
* filter by predicates such as `getAllByType`.
|
|
628
|
-
*
|
|
629
|
-
* Queries content from the Prismic repository and returns all matching
|
|
630
|
-
* content. If no predicates are provided, all documents will be fetched.
|
|
631
|
-
*
|
|
632
|
-
* This method may make multiple network requests to query all matching content.
|
|
633
|
-
*
|
|
634
|
-
* @example
|
|
635
|
-
*
|
|
636
|
-
* ```ts
|
|
637
|
-
* const response = await client.dangerouslyGetAll();
|
|
638
|
-
* ```
|
|
639
|
-
*
|
|
640
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
641
|
-
* @param params - Parameters to filter, sort, and paginate results.
|
|
642
|
-
*
|
|
643
|
-
* @returns A list of documents matching the query.
|
|
644
|
-
*/
|
|
645
|
-
dangerouslyGetAll<TDocument extends TDocuments>(params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
646
|
-
/**
|
|
647
|
-
* Queries a document from the Prismic repository with a specific ID.
|
|
648
|
-
*
|
|
649
|
-
* @remarks
|
|
650
|
-
* A document's UID is different from its ID. An ID is automatically generated
|
|
651
|
-
* for all documents and is made available on its `id` property. A UID is
|
|
652
|
-
* provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
653
|
-
* @example
|
|
654
|
-
*
|
|
655
|
-
* ```ts
|
|
656
|
-
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
657
|
-
* ```
|
|
658
|
-
*
|
|
659
|
-
* @typeParam TDocument- Type of the Prismic document returned.
|
|
660
|
-
* @param id - ID of the document.
|
|
661
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
662
|
-
*
|
|
663
|
-
* @returns The document with an ID matching the `id` parameter, if a matching
|
|
664
|
-
* document exists.
|
|
665
|
-
*/
|
|
666
|
-
getByID<TDocument extends TDocuments>(id: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument>;
|
|
667
|
-
/**
|
|
668
|
-
* Queries documents from the Prismic repository with specific IDs.
|
|
669
|
-
*
|
|
670
|
-
* @remarks
|
|
671
|
-
* A document's UID is different from its ID. An ID is automatically generated
|
|
672
|
-
* for all documents and is made available on its `id` property. A UID is
|
|
673
|
-
* provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
674
|
-
* @example
|
|
675
|
-
*
|
|
676
|
-
* ```ts
|
|
677
|
-
* const response = await client.getByIDs([
|
|
678
|
-
* "WW4bKScAAMAqmluX",
|
|
679
|
-
* "U1kTRgEAAC8A5ldS",
|
|
680
|
-
* ]);
|
|
681
|
-
* ```
|
|
682
|
-
*
|
|
683
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
684
|
-
* @param ids - A list of document IDs.
|
|
685
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
686
|
-
*
|
|
687
|
-
* @returns A paginated response containing documents with IDs matching the
|
|
688
|
-
* `ids` parameter.
|
|
689
|
-
*/
|
|
690
|
-
getByIDs<TDocument extends TDocuments>(ids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<TDocument>>;
|
|
691
|
-
/**
|
|
692
|
-
* Queries all documents from the Prismic repository with specific IDs.
|
|
693
|
-
*
|
|
694
|
-
* This method may make multiple network requests to query all matching content.
|
|
695
|
-
*
|
|
696
|
-
* @remarks
|
|
697
|
-
* A document's UID is different from its ID. An ID is automatically generated
|
|
698
|
-
* for all documents and is made available on its `id` property. A UID is
|
|
699
|
-
* provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
700
|
-
* @example
|
|
701
|
-
*
|
|
702
|
-
* ```ts
|
|
703
|
-
* const response = await client.getAllByIDs([
|
|
704
|
-
* "WW4bKScAAMAqmluX",
|
|
705
|
-
* "U1kTRgEAAC8A5ldS",
|
|
706
|
-
* ]);
|
|
707
|
-
* ```
|
|
708
|
-
*
|
|
709
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
710
|
-
* @param ids - A list of document IDs.
|
|
711
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
712
|
-
*
|
|
713
|
-
* @returns A list of documents with IDs matching the `ids` parameter.
|
|
714
|
-
*/
|
|
715
|
-
getAllByIDs<TDocument extends TDocuments>(ids: string[], params?: Partial<BuildQueryURLArgs> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
716
|
-
/**
|
|
717
|
-
* Queries a document from the Prismic repository with a specific UID and Custom Type.
|
|
718
|
-
*
|
|
719
|
-
* @remarks
|
|
720
|
-
* A document's UID is different from its ID. An ID is automatically generated
|
|
721
|
-
* for all documents and is made available on its `id` property. A UID is
|
|
722
|
-
* provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
723
|
-
* @example
|
|
724
|
-
*
|
|
725
|
-
* ```ts
|
|
726
|
-
* const document = await client.getByUID("blog_post", "my-first-post");
|
|
727
|
-
* ```
|
|
728
|
-
*
|
|
729
|
-
* @typeParam TDocument - Type of the Prismic document returned.
|
|
730
|
-
* @param documentType - The API ID of the document's Custom Type.
|
|
731
|
-
* @param uid - UID of the document.
|
|
732
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
733
|
-
*
|
|
734
|
-
* @returns The document with a UID matching the `uid` parameter, if a
|
|
735
|
-
* matching document exists.
|
|
736
|
-
*/
|
|
737
|
-
getByUID<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uid: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>>;
|
|
738
|
-
/**
|
|
739
|
-
* Queries document from the Prismic repository with specific UIDs and Custom Type.
|
|
740
|
-
*
|
|
741
|
-
* @remarks
|
|
742
|
-
* A document's UID is different from its ID. An ID is automatically generated
|
|
743
|
-
* for all documents and is made available on its `id` property. A UID is
|
|
744
|
-
* provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
745
|
-
* @example
|
|
746
|
-
*
|
|
747
|
-
* ```ts
|
|
748
|
-
* const document = await client.getByUIDs("blog_post", [
|
|
749
|
-
* "my-first-post",
|
|
750
|
-
* "my-second-post",
|
|
751
|
-
* ]);
|
|
752
|
-
* ```
|
|
753
|
-
*
|
|
754
|
-
* @typeParam TDocument - Type of the Prismic document returned.
|
|
755
|
-
* @param documentType - The API ID of the document's Custom Type.
|
|
756
|
-
* @param uids - A list of document UIDs.
|
|
757
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
758
|
-
*
|
|
759
|
-
* @returns A paginated response containing documents with UIDs matching the
|
|
760
|
-
* `uids` parameter.
|
|
761
|
-
*/
|
|
762
|
-
getByUIDs<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<ExtractDocumentType<TDocument, TDocumentType>>>;
|
|
763
|
-
/**
|
|
764
|
-
* Queries all documents from the Prismic repository with specific UIDs and Custom Type.
|
|
765
|
-
*
|
|
766
|
-
* This method may make multiple network requests to query all matching content.
|
|
767
|
-
*
|
|
768
|
-
* @remarks
|
|
769
|
-
* A document's UID is different from its ID. An ID is automatically generated
|
|
770
|
-
* for all documents and is made available on its `id` property. A UID is
|
|
771
|
-
* provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
772
|
-
* @example
|
|
773
|
-
*
|
|
774
|
-
* ```ts
|
|
775
|
-
* const response = await client.getAllByUIDs([
|
|
776
|
-
* "my-first-post",
|
|
777
|
-
* "my-second-post",
|
|
778
|
-
* ]);
|
|
779
|
-
* ```
|
|
780
|
-
*
|
|
781
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
782
|
-
* @param documentType - The API ID of the document's Custom Type.
|
|
783
|
-
* @param uids - A list of document UIDs.
|
|
784
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
785
|
-
*
|
|
786
|
-
* @returns A list of documents with UIDs matching the `uids` parameter.
|
|
787
|
-
*/
|
|
788
|
-
getAllByUIDs<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, uids: string[], params?: Partial<BuildQueryURLArgs> & GetAllParams & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>[]>;
|
|
789
|
-
/**
|
|
790
|
-
* Queries a singleton document from the Prismic repository for a specific Custom Type.
|
|
791
|
-
*
|
|
792
|
-
* @remarks
|
|
793
|
-
* A singleton document is one that is configured in Prismic to only allow one
|
|
794
|
-
* instance. For example, a repository may be configured to contain just one
|
|
795
|
-
* Settings document. This is in contrast to a repeatable Custom Type which
|
|
796
|
-
* allows multiple instances of itself.
|
|
797
|
-
* @example
|
|
798
|
-
*
|
|
799
|
-
* ```ts
|
|
800
|
-
* const document = await client.getSingle("settings");
|
|
801
|
-
* ```
|
|
802
|
-
*
|
|
803
|
-
* @typeParam TDocument - Type of the Prismic document returned.
|
|
804
|
-
* @param documentType - The API ID of the singleton Custom Type.
|
|
805
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
806
|
-
*
|
|
807
|
-
* @returns The singleton document for the Custom Type, if a matching document exists.
|
|
808
|
-
*/
|
|
809
|
-
getSingle<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>>;
|
|
810
|
-
/**
|
|
811
|
-
* Queries documents from the Prismic repository for a specific Custom Type.
|
|
812
|
-
*
|
|
813
|
-
* Use `getAllByType` instead if you need to query all documents for a
|
|
814
|
-
* specific Custom Type.
|
|
815
|
-
*
|
|
816
|
-
* @example
|
|
817
|
-
*
|
|
818
|
-
* ```ts
|
|
819
|
-
* const response = await client.getByType("blog_post");
|
|
820
|
-
* ```
|
|
821
|
-
*
|
|
822
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
823
|
-
* @param documentType - The API ID of the Custom Type.
|
|
824
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
825
|
-
*
|
|
826
|
-
* @returns A paginated response containing documents of the Custom Type.
|
|
827
|
-
*/
|
|
828
|
-
getByType<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<ExtractDocumentType<TDocument, TDocumentType>>>;
|
|
829
|
-
/**
|
|
830
|
-
* Queries all documents from the Prismic repository for a specific Custom Type.
|
|
831
|
-
*
|
|
832
|
-
* This method may make multiple network requests to query all matching content.
|
|
833
|
-
*
|
|
834
|
-
* @example
|
|
835
|
-
*
|
|
836
|
-
* ```ts
|
|
837
|
-
* const response = await client.getByType("blog_post");
|
|
838
|
-
* ```
|
|
839
|
-
*
|
|
840
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
841
|
-
* @param documentType - The API ID of the Custom Type.
|
|
842
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
843
|
-
*
|
|
844
|
-
* @returns A list of all documents of the Custom Type.
|
|
845
|
-
*/
|
|
846
|
-
getAllByType<TDocument extends TDocuments, TDocumentType extends TDocument["type"] = TDocument["type"]>(documentType: TDocumentType, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<ExtractDocumentType<TDocument, TDocumentType>[]>;
|
|
847
|
-
/**
|
|
848
|
-
* Queries documents from the Prismic repository with a specific tag.
|
|
849
|
-
*
|
|
850
|
-
* Use `getAllByTag` instead if you need to query all documents with a specific tag.
|
|
851
|
-
*
|
|
852
|
-
* @example
|
|
853
|
-
*
|
|
854
|
-
* ```ts
|
|
855
|
-
* const response = await client.getByTag("food");
|
|
856
|
-
* ```
|
|
857
|
-
*
|
|
858
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
859
|
-
* @param tag - The tag that must be included on a document.
|
|
860
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
861
|
-
*
|
|
862
|
-
* @returns A paginated response containing documents with the tag.
|
|
863
|
-
*/
|
|
864
|
-
getByTag<TDocument extends TDocuments>(tag: string, params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<TDocument>>;
|
|
865
|
-
/**
|
|
866
|
-
* Queries all documents from the Prismic repository with a specific tag.
|
|
867
|
-
*
|
|
868
|
-
* This method may make multiple network requests to query all matching content.
|
|
869
|
-
*
|
|
870
|
-
* @example
|
|
871
|
-
*
|
|
872
|
-
* ```ts
|
|
873
|
-
* const response = await client.getAllByTag("food");
|
|
874
|
-
* ```
|
|
875
|
-
*
|
|
876
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
877
|
-
* @param tag - The tag that must be included on a document.
|
|
878
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
879
|
-
*
|
|
880
|
-
* @returns A list of all documents with the tag.
|
|
881
|
-
*/
|
|
882
|
-
getAllByTag<TDocument extends TDocuments>(tag: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
883
|
-
/**
|
|
884
|
-
* Queries documents from the Prismic repository with specific tags. A
|
|
885
|
-
* document must be tagged with all of the queried tags to be included.
|
|
886
|
-
*
|
|
887
|
-
* @example
|
|
888
|
-
*
|
|
889
|
-
* ```ts
|
|
890
|
-
* const response = await client.getByEveryTag(["food", "fruit"]);
|
|
891
|
-
* ```
|
|
892
|
-
*
|
|
893
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
894
|
-
* @param tags - A list of tags that must be included on a document.
|
|
895
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
896
|
-
*
|
|
897
|
-
* @returns A paginated response containing documents with the tags.
|
|
898
|
-
*/
|
|
899
|
-
getByEveryTag<TDocument extends TDocuments>(tags: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<TDocument>>;
|
|
900
|
-
/**
|
|
901
|
-
* Queries documents from the Prismic repository with specific tags. A
|
|
902
|
-
* document must be tagged with all of the queried tags to be included.
|
|
903
|
-
*
|
|
904
|
-
* This method may make multiple network requests to query all matching content.
|
|
905
|
-
*
|
|
906
|
-
* @example
|
|
907
|
-
*
|
|
908
|
-
* ```ts
|
|
909
|
-
* const response = await client.getAllByEveryTag(["food", "fruit"]);
|
|
910
|
-
* ```
|
|
911
|
-
*
|
|
912
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
913
|
-
* @param tags - A list of tags that must be included on a document.
|
|
914
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
915
|
-
*
|
|
916
|
-
* @returns A list of all documents with the tags.
|
|
917
|
-
*/
|
|
918
|
-
getAllByEveryTag<TDocument extends TDocuments>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
919
|
-
/**
|
|
920
|
-
* Queries documents from the Prismic repository with specific tags. A
|
|
921
|
-
* document must be tagged with at least one of the queried tags to be included.
|
|
922
|
-
*
|
|
923
|
-
* @example
|
|
924
|
-
*
|
|
925
|
-
* ```ts
|
|
926
|
-
* const response = await client.getByEveryTag(["food", "fruit"]);
|
|
927
|
-
* ```
|
|
928
|
-
*
|
|
929
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
930
|
-
* @param tags - A list of tags that must be included on a document.
|
|
931
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
932
|
-
*
|
|
933
|
-
* @returns A paginated response containing documents with at least one of the tags.
|
|
934
|
-
*/
|
|
935
|
-
getBySomeTags<TDocument extends TDocuments>(tags: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<prismicT.Query<TDocument>>;
|
|
936
|
-
/**
|
|
937
|
-
* Queries documents from the Prismic repository with specific tags. A
|
|
938
|
-
* document must be tagged with at least one of the queried tags to be included.
|
|
939
|
-
*
|
|
940
|
-
* This method may make multiple network requests to query all matching content.
|
|
941
|
-
*
|
|
942
|
-
* @example
|
|
943
|
-
*
|
|
944
|
-
* ```ts
|
|
945
|
-
* const response = await client.getAllByEveryTag(["food", "fruit"]);
|
|
946
|
-
* ```
|
|
947
|
-
*
|
|
948
|
-
* @typeParam TDocument - Type of Prismic documents returned.
|
|
949
|
-
* @param tags - A list of tags that must be included on a document.
|
|
950
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
951
|
-
*
|
|
952
|
-
* @returns A list of all documents with at least one of the tags.
|
|
953
|
-
*/
|
|
954
|
-
getAllBySomeTags<TDocument extends TDocuments>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
955
|
-
/**
|
|
956
|
-
* Returns metadata about the Prismic repository, such as its refs, releases,
|
|
957
|
-
* and custom types.
|
|
958
|
-
*
|
|
959
|
-
* @returns Repository metadata.
|
|
960
|
-
*/
|
|
961
|
-
getRepository(params?: FetchParams): Promise<prismicT.Repository>;
|
|
962
|
-
/**
|
|
963
|
-
* Returns a list of all refs for the Prismic repository.
|
|
964
|
-
*
|
|
965
|
-
* Refs are used to identify which version of the repository's content should
|
|
966
|
-
* be queried. All repositories will have at least one ref pointing to the
|
|
967
|
-
* latest published content called the "master ref".
|
|
968
|
-
*
|
|
969
|
-
* @returns A list of all refs for the Prismic repository.
|
|
970
|
-
*/
|
|
971
|
-
getRefs(params?: FetchParams): Promise<prismicT.Ref[]>;
|
|
972
|
-
/**
|
|
973
|
-
* Returns a ref for the Prismic repository with a matching ID.
|
|
974
|
-
*
|
|
975
|
-
* @param id - ID of the ref.
|
|
976
|
-
*
|
|
977
|
-
* @returns The ref with a matching ID, if it exists.
|
|
978
|
-
*/
|
|
979
|
-
getRefByID(id: string, params?: FetchParams): Promise<prismicT.Ref>;
|
|
980
|
-
/**
|
|
981
|
-
* Returns a ref for the Prismic repository with a matching label.
|
|
982
|
-
*
|
|
983
|
-
* @param label - Label of the ref.
|
|
984
|
-
*
|
|
985
|
-
* @returns The ref with a matching label, if it exists.
|
|
986
|
-
*/
|
|
987
|
-
getRefByLabel(label: string, params?: FetchParams): Promise<prismicT.Ref>;
|
|
988
|
-
/**
|
|
989
|
-
* Returns the master ref for the Prismic repository. The master ref points to
|
|
990
|
-
* the repository's latest published content.
|
|
991
|
-
*
|
|
992
|
-
* @returns The repository's master ref.
|
|
993
|
-
*/
|
|
994
|
-
getMasterRef(params?: FetchParams): Promise<prismicT.Ref>;
|
|
995
|
-
/**
|
|
996
|
-
* Returns a list of all Releases for the Prismic repository. Releases are
|
|
997
|
-
* used to group content changes before publishing.
|
|
998
|
-
*
|
|
999
|
-
* @returns A list of all Releases for the Prismic repository.
|
|
1000
|
-
*/
|
|
1001
|
-
getReleases(params?: FetchParams): Promise<prismicT.Ref[]>;
|
|
1002
|
-
/**
|
|
1003
|
-
* Returns a Release for the Prismic repository with a matching ID.
|
|
1004
|
-
*
|
|
1005
|
-
* @param id - ID of the Release.
|
|
1006
|
-
*
|
|
1007
|
-
* @returns The Release with a matching ID, if it exists.
|
|
1008
|
-
*/
|
|
1009
|
-
getReleaseByID(id: string, params?: FetchParams): Promise<prismicT.Ref>;
|
|
1010
|
-
/**
|
|
1011
|
-
* Returns a Release for the Prismic repository with a matching label.
|
|
1012
|
-
*
|
|
1013
|
-
* @param label - Label of the ref.
|
|
1014
|
-
*
|
|
1015
|
-
* @returns The ref with a matching label, if it exists.
|
|
1016
|
-
*/
|
|
1017
|
-
getReleaseByLabel(label: string, params?: FetchParams): Promise<prismicT.Ref>;
|
|
1018
|
-
/**
|
|
1019
|
-
* Returns a list of all tags used in the Prismic repository.
|
|
1020
|
-
*
|
|
1021
|
-
* @returns A list of all tags used in the repository.
|
|
1022
|
-
*/
|
|
1023
|
-
getTags(params?: FetchParams): Promise<string[]>;
|
|
1024
|
-
/**
|
|
1025
|
-
* Builds a URL used to query content from the Prismic repository.
|
|
1026
|
-
*
|
|
1027
|
-
* @param params - Parameters to filter, sort, and paginate the results.
|
|
1028
|
-
*
|
|
1029
|
-
* @returns A URL string that can be requested to query content.
|
|
1030
|
-
*/
|
|
1031
|
-
buildQueryURL({ signal, ...params }?: Partial<BuildQueryURLArgs> & FetchParams): Promise<string>;
|
|
1032
|
-
/**
|
|
1033
|
-
* Determines the URL for a previewed document during an active preview
|
|
1034
|
-
* session. The result of this method should be used to redirect the user to
|
|
1035
|
-
* the document's URL.
|
|
1036
|
-
*
|
|
1037
|
-
* @example
|
|
1038
|
-
*
|
|
1039
|
-
* ```ts
|
|
1040
|
-
* const url = client.resolvePreviewURL({
|
|
1041
|
-
* linkResolver: (document) => `/${document.uid}`
|
|
1042
|
-
* defaultURL: '/'
|
|
1043
|
-
* })
|
|
1044
|
-
* ```
|
|
1045
|
-
*
|
|
1046
|
-
* @param args - Arguments to configure the URL resolving.
|
|
1047
|
-
*
|
|
1048
|
-
* @returns The URL for the previewed document during an active preview
|
|
1049
|
-
* session. The user should be redirected to this URL.
|
|
1050
|
-
*/
|
|
1051
|
-
resolvePreviewURL<LinkResolverReturnType>(args: ResolvePreviewArgs<LinkResolverReturnType> & FetchParams): Promise<string>;
|
|
1052
|
-
/**
|
|
1053
|
-
* Configures the client to query the latest published content for all future queries.
|
|
1054
|
-
*
|
|
1055
|
-
* If the `ref` parameter is provided during a query, it takes priority for that query.
|
|
1056
|
-
*
|
|
1057
|
-
* @example
|
|
1058
|
-
*
|
|
1059
|
-
* ```ts
|
|
1060
|
-
* await client.queryLatestContent();
|
|
1061
|
-
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
1062
|
-
* ```
|
|
1063
|
-
*/
|
|
1064
|
-
queryLatestContent(): void;
|
|
1065
|
-
/**
|
|
1066
|
-
* Configures the client to query content from a specific Release identified
|
|
1067
|
-
* by its ID for all future queries.
|
|
1068
|
-
*
|
|
1069
|
-
* If the `ref` parameter is provided during a query, it takes priority for that query.
|
|
1070
|
-
*
|
|
1071
|
-
* @example
|
|
1072
|
-
*
|
|
1073
|
-
* ```ts
|
|
1074
|
-
* await client.queryContentFromReleaseByID("YLB7OBAAACMA7Cpa");
|
|
1075
|
-
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
1076
|
-
* ```
|
|
1077
|
-
*
|
|
1078
|
-
* @param releaseID - The ID of the Release.
|
|
1079
|
-
*/
|
|
1080
|
-
queryContentFromReleaseByID(releaseID: string): void;
|
|
1081
|
-
/**
|
|
1082
|
-
* Configures the client to query content from a specific Release identified
|
|
1083
|
-
* by its label for all future queries.
|
|
1084
|
-
*
|
|
1085
|
-
* If the `ref` parameter is provided during a query, it takes priority for that query.
|
|
1086
|
-
*
|
|
1087
|
-
* @example
|
|
1088
|
-
*
|
|
1089
|
-
* ```ts
|
|
1090
|
-
* await client.queryContentFromReleaseByLabel("My Release");
|
|
1091
|
-
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
1092
|
-
* ```
|
|
1093
|
-
*
|
|
1094
|
-
* @param releaseLabel - The label of the Release.
|
|
1095
|
-
*/
|
|
1096
|
-
queryContentFromReleaseByLabel(releaseLabel: string): void;
|
|
1097
|
-
/**
|
|
1098
|
-
* Configures the client to query content from a specific ref. The ref can be
|
|
1099
|
-
* provided as a string or a function.
|
|
1100
|
-
*
|
|
1101
|
-
* If a function is provided, the ref is fetched lazily before each query. The
|
|
1102
|
-
* function may also be asynchronous.
|
|
1103
|
-
*
|
|
1104
|
-
* @example
|
|
1105
|
-
*
|
|
1106
|
-
* ```ts
|
|
1107
|
-
* await client.queryContentFromRef("my-ref");
|
|
1108
|
-
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
1109
|
-
* ```
|
|
1110
|
-
*
|
|
1111
|
-
* @param ref - The ref or a function that returns the ref from which to query content.
|
|
1112
|
-
*/
|
|
1113
|
-
queryContentFromRef(ref: RefStringOrThunk): void;
|
|
1114
|
-
/**
|
|
1115
|
-
* @deprecated Renamed to `graphQLFetch()` (note the capitalization of "QL").
|
|
1116
|
-
*/
|
|
1117
|
-
graphqlFetch: (input: RequestInfo, init?: Omit<RequestInit, "signal"> & {
|
|
1118
|
-
signal?: AbortSignalLike;
|
|
1119
|
-
}) => Promise<Response>;
|
|
1120
|
-
/**
|
|
1121
|
-
* A `fetch()` function to be used with GraphQL clients configured for
|
|
1122
|
-
* Prismic's GraphQL API. It automatically applies the necessary `prismic-ref`
|
|
1123
|
-
* and Authorization headers. Queries will automatically be minified by
|
|
1124
|
-
* removing whitespace where possible.
|
|
1125
|
-
*
|
|
1126
|
-
* @example
|
|
1127
|
-
*
|
|
1128
|
-
* ```ts
|
|
1129
|
-
* const graphqlClient = new ApolloClient({
|
|
1130
|
-
* link: new HttpLink({
|
|
1131
|
-
* uri: prismic.getGraphQLEndpoint(repositoryName),
|
|
1132
|
-
* // Provide `client.graphqlFetch` as the fetch implementation.
|
|
1133
|
-
* fetch: client.graphqlFetch,
|
|
1134
|
-
* // Using GET is required.
|
|
1135
|
-
* useGETForQueries: true,
|
|
1136
|
-
* }),
|
|
1137
|
-
* cache: new InMemoryCache(),
|
|
1138
|
-
* });
|
|
1139
|
-
* ```
|
|
1140
|
-
*
|
|
1141
|
-
* @param input - The `fetch()` `input` parameter. Only strings are supported.
|
|
1142
|
-
* @param init - The `fetch()` `init` parameter. Only plain objects are supported.
|
|
1143
|
-
*
|
|
1144
|
-
* @returns The `fetch()` Response for the request.
|
|
1145
|
-
* @experimental
|
|
1146
|
-
*/
|
|
1147
|
-
graphQLFetch(input: RequestInfo, init?: Omit<RequestInit, "signal"> & {
|
|
1148
|
-
signal?: AbortSignalLike;
|
|
1149
|
-
}): Promise<Response>;
|
|
1150
|
-
/**
|
|
1151
|
-
* Returns a cached version of `getRepository` with a TTL.
|
|
1152
|
-
*
|
|
1153
|
-
* @returns Cached repository metadata.
|
|
1154
|
-
*/
|
|
1155
|
-
private getCachedRepository;
|
|
1156
|
-
/**
|
|
1157
|
-
* Returns a cached Prismic repository form. Forms are used to determine API
|
|
1158
|
-
* endpoints for types of repository data.
|
|
1159
|
-
*
|
|
1160
|
-
* @param name - Name of the form.
|
|
1161
|
-
*
|
|
1162
|
-
* @returns The repository form.
|
|
1163
|
-
* @throws If a matching form cannot be found.
|
|
1164
|
-
*/
|
|
1165
|
-
private getCachedRepositoryForm;
|
|
1166
|
-
/**
|
|
1167
|
-
* Returns the ref needed to query based on the client's current state. This
|
|
1168
|
-
* method may make a network request to fetch a ref or resolve the user's ref thunk.
|
|
1169
|
-
*
|
|
1170
|
-
* If auto previews are enabled, the preview ref takes priority if available.
|
|
1171
|
-
*
|
|
1172
|
-
* The following strategies are used depending on the client's state:
|
|
1173
|
-
*
|
|
1174
|
-
* - If the user called `queryLatestContent`: Use the repository's master ref.
|
|
1175
|
-
* The ref is cached for 5 seconds. After 5 seconds, a new master ref is fetched.
|
|
1176
|
-
* - If the user called `queryContentFromReleaseByID`: Use the release's ref.
|
|
1177
|
-
* The ref is cached for 5 seconds. After 5 seconds, a new ref for the
|
|
1178
|
-
* release is fetched.
|
|
1179
|
-
* - If the user called `queryContentFromReleaseByLabel`: Use the release's ref.
|
|
1180
|
-
* The ref is cached for 5 seconds. After 5 seconds, a new ref for the
|
|
1181
|
-
* release is fetched.
|
|
1182
|
-
* - If the user called `queryContentFromRef`: Use the provided ref. Fall back
|
|
1183
|
-
* to the master ref if the ref is not a string.
|
|
1184
|
-
*
|
|
1185
|
-
* @returns The ref to use during a query.
|
|
1186
|
-
*/
|
|
1187
|
-
private getResolvedRefString;
|
|
1188
|
-
/**
|
|
1189
|
-
* Performs a network request using the configured `fetch` function. It
|
|
1190
|
-
* assumes all successful responses will have a JSON content type. It also
|
|
1191
|
-
* normalizes unsuccessful network requests.
|
|
1192
|
-
*
|
|
1193
|
-
* @typeParam T - The JSON response.
|
|
1194
|
-
* @param url - URL to the resource to fetch.
|
|
1195
|
-
* @param params - Prismic REST API parameters for the network request.
|
|
1196
|
-
*
|
|
1197
|
-
* @returns The JSON response from the network request.
|
|
1198
|
-
*/
|
|
1199
|
-
private fetch;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
declare const predicate: {
|
|
1203
|
-
/**
|
|
1204
|
-
* The `at` predicate checks that the path matches the described value
|
|
1205
|
-
* exactly. It takes a single value for a field or an array (only for tags).
|
|
1206
|
-
*
|
|
1207
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}
|
|
1208
|
-
*/
|
|
1209
|
-
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1210
|
-
/**
|
|
1211
|
-
* The `not` predicate checks that the path doesn't match the provided value
|
|
1212
|
-
* exactly. It takes a single value for a field or an array (only for tags).
|
|
1213
|
-
*
|
|
1214
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}
|
|
1215
|
-
*/
|
|
1216
|
-
not: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1217
|
-
/**
|
|
1218
|
-
* The `any` predicate takes an array of values. It works exactly the same way
|
|
1219
|
-
* as the `at` operator, but checks whether the fragment matches any of the
|
|
1220
|
-
* values in the array.
|
|
1221
|
-
*
|
|
1222
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}
|
|
1223
|
-
*/
|
|
1224
|
-
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
1225
|
-
/**
|
|
1226
|
-
* The `in` predicate is used specifically to retrieve an array of documents
|
|
1227
|
-
* by their IDs or UIDs. This predicate is much more efficient at this than
|
|
1228
|
-
* the any predicate.
|
|
1229
|
-
*
|
|
1230
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}
|
|
1231
|
-
*/
|
|
1232
|
-
in: (path: string, values: string[]) => string;
|
|
1233
|
-
/**
|
|
1234
|
-
* The `fulltext` predicate provides two capabilities:
|
|
1235
|
-
*
|
|
1236
|
-
* 1. Checking if a certain string is anywhere inside a document (this is what
|
|
1237
|
-
* you should use to make your project's search engine feature)
|
|
1238
|
-
* 2. Checking if the string is contained inside a specific custom type’s Rich
|
|
1239
|
-
* Text or Key Text fragment.
|
|
1240
|
-
*
|
|
1241
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}
|
|
1242
|
-
*/
|
|
1243
|
-
fulltext: (path: string, searchTerms: string) => string;
|
|
1244
|
-
/**
|
|
1245
|
-
* The `has` predicate checks whether a fragment has a value. It will return
|
|
1246
|
-
* all the documents of the specified type that contain a value for the
|
|
1247
|
-
* specified field.
|
|
1248
|
-
*
|
|
1249
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#has}
|
|
1250
|
-
*/
|
|
1251
|
-
has: (path: string) => string;
|
|
1252
|
-
/**
|
|
1253
|
-
* The `missing` predicate checks if a fragment doesn't have a value. It will
|
|
1254
|
-
* return all the documents of the specified type that do not contain a value
|
|
1255
|
-
* for the specified field.
|
|
1256
|
-
*
|
|
1257
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#missing}
|
|
1258
|
-
*/
|
|
1259
|
-
missing: (path: string) => string;
|
|
1260
|
-
/**
|
|
1261
|
-
* The `similar` predicate takes the ID of a document, and returns a list of
|
|
1262
|
-
* documents with similar content. This allows you to build an automated
|
|
1263
|
-
* content discovery feature (for example, a "Related posts" section).
|
|
1264
|
-
*
|
|
1265
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#similar}
|
|
1266
|
-
*/
|
|
1267
|
-
similar: (id: string, value: number) => string;
|
|
1268
|
-
/**
|
|
1269
|
-
* The `geopoint.near` predicate checks that the value in the path is within
|
|
1270
|
-
* the radius of the given coordinates.
|
|
1271
|
-
*
|
|
1272
|
-
* This predicate will only work for a GeoPoint field.
|
|
1273
|
-
*
|
|
1274
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#near}
|
|
1275
|
-
*/
|
|
1276
|
-
geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
1277
|
-
/**
|
|
1278
|
-
* The `number.lt` predicate checks that the value in the number field is less
|
|
1279
|
-
* than the value passed into the predicate.
|
|
1280
|
-
*
|
|
1281
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#lt-less-than}
|
|
1282
|
-
*/
|
|
1283
|
-
numberLessThan: (path: string, value: number) => string;
|
|
1284
|
-
/**
|
|
1285
|
-
* The `number.gt` predicate checks that the value in the number field is
|
|
1286
|
-
* greater than the value passed into the predicate.
|
|
1287
|
-
*
|
|
1288
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#gt-greater-than}
|
|
1289
|
-
*/
|
|
1290
|
-
numberGreaterThan: (path: string, value: number) => string;
|
|
1291
|
-
/**
|
|
1292
|
-
* The `number.inRange` predicate checks that the value in the path is within
|
|
1293
|
-
* the two values passed into the predicate.
|
|
1294
|
-
*
|
|
1295
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#inrange}
|
|
1296
|
-
*/
|
|
1297
|
-
numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
1298
|
-
/**
|
|
1299
|
-
* The `date.after` predicate checks that the value in the path is after the
|
|
1300
|
-
* date value passed into the predicate.
|
|
1301
|
-
*
|
|
1302
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#after}
|
|
1303
|
-
*/
|
|
1304
|
-
dateAfter: (path: string, date: string | number | Date) => string;
|
|
1305
|
-
/**
|
|
1306
|
-
* The `date.before` predicate checks that the value in the path is before the
|
|
1307
|
-
* date value passed into the predicate.
|
|
1308
|
-
*
|
|
1309
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#before}
|
|
1310
|
-
*/
|
|
1311
|
-
dateBefore: (path: string, date: string | number | Date) => string;
|
|
1312
|
-
/**
|
|
1313
|
-
* The `date.between` predicate checks that the value in the path is within
|
|
1314
|
-
* the date values passed into the predicate.
|
|
1315
|
-
*
|
|
1316
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#between}
|
|
1317
|
-
*/
|
|
1318
|
-
dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
1319
|
-
/**
|
|
1320
|
-
* The `date.day-of-month` predicate checks that the value in the path is
|
|
1321
|
-
* equal to the day of the month passed into the predicate.
|
|
1322
|
-
*
|
|
1323
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonth}
|
|
1324
|
-
*/
|
|
1325
|
-
dateDayOfMonth: (path: string, day: number) => string;
|
|
1326
|
-
/**
|
|
1327
|
-
* The `date.day-of-month-after` predicate checks that the value in the path
|
|
1328
|
-
* is after the day of the month passed into the predicate.
|
|
1329
|
-
*
|
|
1330
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthafter}
|
|
1331
|
-
*/
|
|
1332
|
-
dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
1333
|
-
/**
|
|
1334
|
-
* The `date.day-of-month-before` predicate checks that the value in the path
|
|
1335
|
-
* is before the day of the month passed into the predicate.
|
|
1336
|
-
*
|
|
1337
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthbefore}
|
|
1338
|
-
*/
|
|
1339
|
-
dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
1340
|
-
/**
|
|
1341
|
-
* The `date.day-of-week` predicate checks that the value in the path is equal
|
|
1342
|
-
* to the day of the week passed into the predicate.
|
|
1343
|
-
*
|
|
1344
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweek}
|
|
1345
|
-
*/
|
|
1346
|
-
dateDayOfWeek: (path: string, day: string | number) => string;
|
|
1347
|
-
/**
|
|
1348
|
-
* The `date.day-of-week-after` predicate checks that the value in the path is
|
|
1349
|
-
* after the day of the week passed into the predicate.
|
|
1350
|
-
*
|
|
1351
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekafter}
|
|
1352
|
-
*/
|
|
1353
|
-
dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
1354
|
-
/**
|
|
1355
|
-
* The date.day-of-week-before predicate checks that the value in the path is
|
|
1356
|
-
* before the day of the week passed into the predicate.
|
|
1357
|
-
*
|
|
1358
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekbefore}
|
|
1359
|
-
*/
|
|
1360
|
-
dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
1361
|
-
/**
|
|
1362
|
-
* The `date.month` predicate checks that the value in the path occurs in the
|
|
1363
|
-
* month value passed into the predicate.
|
|
1364
|
-
*
|
|
1365
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#month}
|
|
1366
|
-
*/
|
|
1367
|
-
dateMonth: (path: string, month: string | number) => string;
|
|
1368
|
-
/**
|
|
1369
|
-
* The `date.month-after` predicate checks that the value in the path occurs
|
|
1370
|
-
* in any month after the value passed into the predicate.
|
|
1371
|
-
*
|
|
1372
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthafter}
|
|
1373
|
-
*/
|
|
1374
|
-
dateMonthAfter: (path: string, month: string | number) => string;
|
|
1375
|
-
/**
|
|
1376
|
-
* The `date.month-before` predicate checks that the value in the path occurs
|
|
1377
|
-
* in any month before the value passed into the predicate.
|
|
1378
|
-
*
|
|
1379
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthbefore}
|
|
1380
|
-
*/
|
|
1381
|
-
dateMonthBefore: (path: string, month: string | number) => string;
|
|
1382
|
-
/**
|
|
1383
|
-
* The `date.year` predicate checks that the value in the path occurs in the
|
|
1384
|
-
* year value passed into the predicate.
|
|
1385
|
-
*
|
|
1386
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#year}
|
|
1387
|
-
*/
|
|
1388
|
-
dateYear: (path: string, year: number) => string;
|
|
1389
|
-
/**
|
|
1390
|
-
* The `date.hour` predicate checks that the value in the path occurs within
|
|
1391
|
-
* the hour value passed into the predicate.
|
|
1392
|
-
*
|
|
1393
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hour}
|
|
1394
|
-
*/
|
|
1395
|
-
dateHour: (path: string, hour: number) => string;
|
|
1396
|
-
/**
|
|
1397
|
-
* The `date.hour-after` predicate checks that the value in the path occurs
|
|
1398
|
-
* after the hour value passed into the predicate.
|
|
1399
|
-
*
|
|
1400
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourafter}
|
|
1401
|
-
*/
|
|
1402
|
-
dateHourAfter: (path: string, hour: number) => string;
|
|
1403
|
-
/**
|
|
1404
|
-
* The `date.hour-before` predicate checks that the value in the path occurs
|
|
1405
|
-
* before the hour value passed into the predicate.
|
|
1406
|
-
*
|
|
1407
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourbefore}
|
|
1408
|
-
*/
|
|
1409
|
-
dateHourBefore: (path: string, hour: number) => string;
|
|
1410
|
-
};
|
|
1411
|
-
|
|
1412
|
-
declare class PrismicError<Response> extends Error {
|
|
1413
|
-
url?: string;
|
|
1414
|
-
response: Response;
|
|
1415
|
-
constructor(message: string | undefined, url: string | undefined, response: Response);
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
declare type ForbiddenErrorRepositoryAPIResponse = {
|
|
1419
|
-
type: string;
|
|
1420
|
-
message: string;
|
|
1421
|
-
};
|
|
1422
|
-
declare type ForbiddenErrorQueryAPIResponse = {
|
|
1423
|
-
error: string;
|
|
1424
|
-
};
|
|
1425
|
-
declare class ForbiddenError extends PrismicError<ForbiddenErrorRepositoryAPIResponse | ForbiddenErrorQueryAPIResponse> {
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
declare type ParsingErrorAPIResponse = {
|
|
1429
|
-
type: "parsing-error";
|
|
1430
|
-
message: string;
|
|
1431
|
-
line: number;
|
|
1432
|
-
column: number;
|
|
1433
|
-
id: number;
|
|
1434
|
-
location: string;
|
|
1435
|
-
};
|
|
1436
|
-
declare class ParsingError extends PrismicError<ParsingErrorAPIResponse> {
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
declare class NotFoundError extends PrismicError<undefined> {
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* The well-known name of the cookie used to store a Prismic preview session's ref.
|
|
1444
|
-
*/
|
|
1445
|
-
declare const preview = "io.prismic.preview";
|
|
1446
|
-
|
|
1447
|
-
declare const cookie_preview: typeof preview;
|
|
1448
|
-
declare namespace cookie {
|
|
1449
|
-
export {
|
|
1450
|
-
cookie_preview as preview,
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
/**
|
|
1455
|
-
* @deprecated Renamed to `getRepositoryEndpoint`.
|
|
1456
|
-
*/
|
|
1457
|
-
declare const getEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
|
|
1458
|
-
|
|
1459
|
-
/**
|
|
1460
|
-
* @deprecated Renamed to `predicate` (without an "s").
|
|
1461
|
-
*/
|
|
1462
|
-
declare const predicates: {
|
|
1463
|
-
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1464
|
-
not: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1465
|
-
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
1466
|
-
in: (path: string, values: string[]) => string;
|
|
1467
|
-
fulltext: (path: string, searchTerms: string) => string;
|
|
1468
|
-
has: (path: string) => string;
|
|
1469
|
-
missing: (path: string) => string;
|
|
1470
|
-
similar: (id: string, value: number) => string;
|
|
1471
|
-
geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
1472
|
-
numberLessThan: (path: string, value: number) => string;
|
|
1473
|
-
numberGreaterThan: (path: string, value: number) => string;
|
|
1474
|
-
numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
1475
|
-
dateAfter: (path: string, date: string | number | Date) => string;
|
|
1476
|
-
dateBefore: (path: string, date: string | number | Date) => string;
|
|
1477
|
-
dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
1478
|
-
dateDayOfMonth: (path: string, day: number) => string;
|
|
1479
|
-
dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
1480
|
-
dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
1481
|
-
dateDayOfWeek: (path: string, day: string | number) => string;
|
|
1482
|
-
dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
1483
|
-
dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
1484
|
-
dateMonth: (path: string, month: string | number) => string;
|
|
1485
|
-
dateMonthAfter: (path: string, month: string | number) => string;
|
|
1486
|
-
dateMonthBefore: (path: string, month: string | number) => string;
|
|
1487
|
-
dateYear: (path: string, year: number) => string;
|
|
1488
|
-
dateHour: (path: string, hour: number) => string;
|
|
1489
|
-
dateHourAfter: (path: string, hour: number) => string;
|
|
1490
|
-
dateHourBefore: (path: string, hour: number) => string;
|
|
1491
|
-
};
|
|
1492
|
-
/**
|
|
1493
|
-
* @deprecated Renamed to `predicate` (lowercase and without an "s").
|
|
1494
|
-
*/
|
|
1495
|
-
declare const Predicates: {
|
|
1496
|
-
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1497
|
-
not: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1498
|
-
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
1499
|
-
in: (path: string, values: string[]) => string;
|
|
1500
|
-
fulltext: (path: string, searchTerms: string) => string;
|
|
1501
|
-
has: (path: string) => string;
|
|
1502
|
-
missing: (path: string) => string;
|
|
1503
|
-
similar: (id: string, value: number) => string;
|
|
1504
|
-
geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
1505
|
-
numberLessThan: (path: string, value: number) => string;
|
|
1506
|
-
numberGreaterThan: (path: string, value: number) => string;
|
|
1507
|
-
numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
1508
|
-
dateAfter: (path: string, date: string | number | Date) => string;
|
|
1509
|
-
dateBefore: (path: string, date: string | number | Date) => string;
|
|
1510
|
-
dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
1511
|
-
dateDayOfMonth: (path: string, day: number) => string;
|
|
1512
|
-
dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
1513
|
-
dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
1514
|
-
dateDayOfWeek: (path: string, day: string | number) => string;
|
|
1515
|
-
dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
1516
|
-
dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
1517
|
-
dateMonth: (path: string, month: string | number) => string;
|
|
1518
|
-
dateMonthAfter: (path: string, month: string | number) => string;
|
|
1519
|
-
dateMonthBefore: (path: string, month: string | number) => string;
|
|
1520
|
-
dateYear: (path: string, year: number) => string;
|
|
1521
|
-
dateHour: (path: string, hour: number) => string;
|
|
1522
|
-
dateHourAfter: (path: string, hour: number) => string;
|
|
1523
|
-
dateHourBefore: (path: string, hour: number) => string;
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
export { AbortSignalLike, BuildQueryURLArgs, Client, ClientConfig, CreateClient, FetchLike, ForbiddenError, HttpRequestLike, NotFoundError, Ordering, ParsingError, Predicates, PrismicError, QueryParams, RequestInitLike, ResponseLike, Route, buildQueryURL, cookie, createClient, getEndpoint, getGraphQLEndpoint, getRepositoryEndpoint, getRepositoryName, isRepositoryEndpoint, isRepositoryName, predicate, predicates };
|
|
1
|
+
import { getRepositoryEndpoint } from "./getRepositoryEndpoint";
|
|
2
|
+
export { getRepositoryEndpoint };
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Renamed to `getRepositoryEndpoint`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
|
|
7
|
+
export { getRepositoryName } from "./getRepositoryName";
|
|
8
|
+
export { getGraphQLEndpoint } from "./getGraphQLEndpoint";
|
|
9
|
+
export { isRepositoryName } from "./isRepositoryName";
|
|
10
|
+
export { isRepositoryEndpoint } from "./isRepositoryEndpoint";
|
|
11
|
+
export { buildQueryURL } from "./buildQueryURL";
|
|
12
|
+
export { createClient, Client } from "./client";
|
|
13
|
+
import { predicate } from "./predicate";
|
|
14
|
+
export { predicate };
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Renamed to `predicate` (without an "s").
|
|
17
|
+
*/
|
|
18
|
+
export declare const predicates: {
|
|
19
|
+
at: (path: string, value: string | number | boolean | string[] | Date) => string;
|
|
20
|
+
not: (path: string, value: string | number | boolean | string[] | Date) => string;
|
|
21
|
+
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
22
|
+
in: (path: string, values: string[]) => string;
|
|
23
|
+
fulltext: (path: string, searchTerms: string) => string;
|
|
24
|
+
has: (path: string) => string;
|
|
25
|
+
missing: (path: string) => string;
|
|
26
|
+
similar: (id: string, value: number) => string;
|
|
27
|
+
geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
28
|
+
numberLessThan: (path: string, value: number) => string;
|
|
29
|
+
numberGreaterThan: (path: string, value: number) => string;
|
|
30
|
+
numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
31
|
+
dateAfter: (path: string, date: string | number | Date) => string;
|
|
32
|
+
dateBefore: (path: string, date: string | number | Date) => string;
|
|
33
|
+
dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
34
|
+
dateDayOfMonth: (path: string, day: number) => string;
|
|
35
|
+
dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
36
|
+
dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
37
|
+
dateDayOfWeek: (path: string, day: string | number) => string;
|
|
38
|
+
dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
39
|
+
dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
40
|
+
dateMonth: (path: string, month: string | number) => string;
|
|
41
|
+
dateMonthAfter: (path: string, month: string | number) => string;
|
|
42
|
+
dateMonthBefore: (path: string, month: string | number) => string;
|
|
43
|
+
dateYear: (path: string, year: number) => string;
|
|
44
|
+
dateHour: (path: string, hour: number) => string;
|
|
45
|
+
dateHourAfter: (path: string, hour: number) => string;
|
|
46
|
+
dateHourBefore: (path: string, hour: number) => string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated Renamed to `predicate` (lowercase and without an "s").
|
|
50
|
+
*/
|
|
51
|
+
export declare const Predicates: {
|
|
52
|
+
at: (path: string, value: string | number | boolean | string[] | Date) => string;
|
|
53
|
+
not: (path: string, value: string | number | boolean | string[] | Date) => string;
|
|
54
|
+
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
55
|
+
in: (path: string, values: string[]) => string;
|
|
56
|
+
fulltext: (path: string, searchTerms: string) => string;
|
|
57
|
+
has: (path: string) => string;
|
|
58
|
+
missing: (path: string) => string;
|
|
59
|
+
similar: (id: string, value: number) => string;
|
|
60
|
+
geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
61
|
+
numberLessThan: (path: string, value: number) => string;
|
|
62
|
+
numberGreaterThan: (path: string, value: number) => string;
|
|
63
|
+
numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
64
|
+
dateAfter: (path: string, date: string | number | Date) => string;
|
|
65
|
+
dateBefore: (path: string, date: string | number | Date) => string;
|
|
66
|
+
dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
67
|
+
dateDayOfMonth: (path: string, day: number) => string;
|
|
68
|
+
dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
69
|
+
dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
70
|
+
dateDayOfWeek: (path: string, day: string | number) => string;
|
|
71
|
+
dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
72
|
+
dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
73
|
+
dateMonth: (path: string, month: string | number) => string;
|
|
74
|
+
dateMonthAfter: (path: string, month: string | number) => string;
|
|
75
|
+
dateMonthBefore: (path: string, month: string | number) => string;
|
|
76
|
+
dateYear: (path: string, year: number) => string;
|
|
77
|
+
dateHour: (path: string, hour: number) => string;
|
|
78
|
+
dateHourAfter: (path: string, hour: number) => string;
|
|
79
|
+
dateHourBefore: (path: string, hour: number) => string;
|
|
80
|
+
};
|
|
81
|
+
export { PrismicError } from "./PrismicError";
|
|
82
|
+
export { ForbiddenError } from "./ForbiddenError";
|
|
83
|
+
export { ParsingError } from "./ParsingError";
|
|
84
|
+
export { NotFoundError } from "./NotFoundError";
|
|
85
|
+
export * as cookie from "./cookie";
|
|
86
|
+
export type { CreateClient, ClientConfig } from "./client";
|
|
87
|
+
export type { QueryParams, BuildQueryURLArgs } from "./buildQueryURL";
|
|
88
|
+
export type { AbortSignalLike, FetchLike, HttpRequestLike, Ordering, RequestInitLike, ResponseLike, Route, } from "./types";
|