@prismicio/client 5.0.0-alpha.0 → 5.1.1
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/README.md +561 -72
- package/cjs/@prismicio/client.js +1280 -0
- package/cjs/@prismicio/client.js.map +1 -0
- package/cjs/@prismicio/client.min.js +16 -0
- package/cjs/@prismicio/client.min.js.map +1 -0
- package/esm/@prismicio/client.min.mjs +16 -0
- package/esm/@prismicio/client.min.mjs.map +1 -0
- package/esm/@prismicio/client.mjs +1276 -0
- package/esm/@prismicio/client.mjs.map +1 -0
- package/package.json +42 -67
- package/types/Api.d.ts +27 -0
- package/types/ApiSearchResponse.d.ts +11 -0
- package/types/Cookies.d.ts +9 -0
- package/types/HttpClient.d.ts +16 -0
- package/types/LazySearchForm.d.ts +24 -0
- package/types/Predicates.d.ts +58 -0
- package/types/PreviewResolver.d.ts +9 -0
- package/types/ResolvedApi.d.ts +126 -0
- package/types/SearchForm.d.ts +47 -0
- package/types/TagsForm.d.ts +7 -0
- package/types/cache.d.ts +17 -0
- package/types/client.d.ts +34 -0
- package/types/documents.d.ts +20 -0
- package/types/experiments.d.ts +22 -0
- package/types/form.d.ts +25 -0
- package/types/index.d.ts +129 -0
- package/types/lru.d.ts +25 -0
- package/types/request.d.ts +13 -0
- package/umd/@prismicio/client.js +1284 -0
- package/umd/@prismicio/client.js.map +1 -0
- package/umd/@prismicio/client.min.js +17 -0
- package/umd/@prismicio/client.min.js.map +1 -0
- package/CHANGELOG.md +0 -100
- package/LICENSE.md +0 -202
- package/dist/index.d.ts +0 -1038
- package/dist/index.es.js +0 -397
- package/dist/index.js +0 -407
package/dist/index.d.ts
DELETED
|
@@ -1,1038 +0,0 @@
|
|
|
1
|
-
import * as prismicT from '@prismicio/types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Get a repository's Prismic REST API V2 endpoint.
|
|
5
|
-
*
|
|
6
|
-
* @typeParam RepositoryName Name of the Prismic repository.
|
|
7
|
-
* @param repositoryName Name of the repository.
|
|
8
|
-
*
|
|
9
|
-
* @returns The repository's Prismic REST API V2 endpoint
|
|
10
|
-
*/
|
|
11
|
-
declare const getEndpoint: <RepositoryName extends string>(repositoryName: RepositoryName) => `https://${RepositoryName}.cdn.prismic.io/api/v2`;
|
|
12
|
-
|
|
13
|
-
interface Ref {
|
|
14
|
-
ref: string;
|
|
15
|
-
label: string;
|
|
16
|
-
isMasterRef: boolean;
|
|
17
|
-
scheduledAt?: string;
|
|
18
|
-
id: string;
|
|
19
|
-
}
|
|
20
|
-
interface Language {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
}
|
|
24
|
-
interface Repository {
|
|
25
|
-
refs: Ref[];
|
|
26
|
-
bookmarks: Record<string, string>;
|
|
27
|
-
languages: Language[];
|
|
28
|
-
types: Record<string, string>;
|
|
29
|
-
tags: string[];
|
|
30
|
-
forms: Record<string, Form>;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated
|
|
33
|
-
*/
|
|
34
|
-
experiments: unknown;
|
|
35
|
-
oauth_initiate: string;
|
|
36
|
-
oauth_token: string;
|
|
37
|
-
version: string;
|
|
38
|
-
license: string;
|
|
39
|
-
}
|
|
40
|
-
interface Query<TDocument extends prismicT.PrismicDocument = prismicT.PrismicDocument> {
|
|
41
|
-
page: number;
|
|
42
|
-
results_per_page: number;
|
|
43
|
-
results_size: number;
|
|
44
|
-
total_results_size: number;
|
|
45
|
-
total_pages: number;
|
|
46
|
-
next_page: string | null;
|
|
47
|
-
prev_page: string | null;
|
|
48
|
-
results: TDocument[];
|
|
49
|
-
}
|
|
50
|
-
interface Form {
|
|
51
|
-
method: "GET";
|
|
52
|
-
enctype: string;
|
|
53
|
-
action: string;
|
|
54
|
-
name?: string;
|
|
55
|
-
rel?: string;
|
|
56
|
-
fields: Record<string, FormField>;
|
|
57
|
-
}
|
|
58
|
-
interface FormField {
|
|
59
|
-
type: "String" | "Integer";
|
|
60
|
-
multiple: boolean;
|
|
61
|
-
default?: string;
|
|
62
|
-
}
|
|
63
|
-
declare type LinkResolver<TDocument extends prismicT.PrismicDocument = prismicT.PrismicDocument> = (document: TDocument) => string;
|
|
64
|
-
/**
|
|
65
|
-
* A universal API to make network requests. A subset of the `fetch()` API.
|
|
66
|
-
*/
|
|
67
|
-
declare type FetchLike = (input: string, init?: RequestInitLike) => Promise<ResponseLike>;
|
|
68
|
-
/**
|
|
69
|
-
* The minimum required properties from RequestInit.
|
|
70
|
-
*/
|
|
71
|
-
interface RequestInitLike {
|
|
72
|
-
headers?: Record<string, string>;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* The minimum required properties from Response.
|
|
76
|
-
*/
|
|
77
|
-
interface ResponseLike {
|
|
78
|
-
status: number;
|
|
79
|
-
json(): Promise<any>;
|
|
80
|
-
clone(): ResponseLike;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The minimum required properties to treat as an HTTP Request for automatic Prismic preview support.
|
|
84
|
-
*/
|
|
85
|
-
interface HttpRequestLike {
|
|
86
|
-
headers?: {
|
|
87
|
-
cookie?: string;
|
|
88
|
-
};
|
|
89
|
-
query?: Record<string, unknown>;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* An `orderings` parameter that orders the results by the specified field.
|
|
93
|
-
*
|
|
94
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#orderings}
|
|
95
|
-
*/
|
|
96
|
-
interface Ordering {
|
|
97
|
-
field: string;
|
|
98
|
-
direction?: "asc" | "desc";
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Parameters for the Prismic REST API V2.
|
|
103
|
-
*
|
|
104
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api}
|
|
105
|
-
*/
|
|
106
|
-
interface QueryParams {
|
|
107
|
-
/**
|
|
108
|
-
* The secure token for accessing the API (only needed if your repository is set to private).
|
|
109
|
-
*
|
|
110
|
-
* {@link https://user-guides.prismic.io/en/articles/1036153-generating-an-access-token}
|
|
111
|
-
*/
|
|
112
|
-
accessToken?: string;
|
|
113
|
-
/**
|
|
114
|
-
* The `pageSize` parameter defines the maximum number of documents that the API will return for your query.
|
|
115
|
-
*
|
|
116
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#pagesize}
|
|
117
|
-
*/
|
|
118
|
-
pageSize?: number;
|
|
119
|
-
/**
|
|
120
|
-
* The `page` parameter defines the pagination for the result of your query.
|
|
121
|
-
*
|
|
122
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#page}
|
|
123
|
-
*/
|
|
124
|
-
page?: number;
|
|
125
|
-
/**
|
|
126
|
-
* The `after` parameter can be used along with the orderings option. It will remove all the documents except for those after the specified document in the list.
|
|
127
|
-
*
|
|
128
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#after}
|
|
129
|
-
*/
|
|
130
|
-
after?: string;
|
|
131
|
-
/**
|
|
132
|
-
* The `fetch` parameter is used to make queries faster by only retrieving the specified field(s).
|
|
133
|
-
*
|
|
134
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#fetch}
|
|
135
|
-
*/
|
|
136
|
-
fetch?: string | string[];
|
|
137
|
-
/**
|
|
138
|
-
* The `fetchLinks` parameter allows you to retrieve a specific content field from a linked document and add it to the document response object.
|
|
139
|
-
*
|
|
140
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#fetchlinks}
|
|
141
|
-
*/
|
|
142
|
-
fetchLinks?: string | string[];
|
|
143
|
-
/**
|
|
144
|
-
* The `graphQuery` parameter allows you to specify which fields to retrieve and what content to retrieve from Linked Documents / Content Relationships.
|
|
145
|
-
*
|
|
146
|
-
* {@link https://prismic.io/docs/technologies/graphquery-rest-api}
|
|
147
|
-
*/
|
|
148
|
-
graphQuery?: string;
|
|
149
|
-
/**
|
|
150
|
-
* The `lang` option defines the language code for the results of your query.
|
|
151
|
-
*
|
|
152
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#lang}
|
|
153
|
-
*/
|
|
154
|
-
lang?: string;
|
|
155
|
-
/**
|
|
156
|
-
* The `orderings` parameter orders the results by the specified field(s). You can specify as many fields as you want.
|
|
157
|
-
*
|
|
158
|
-
* {@link https://prismic.io/docs/technologies/search-parameters-reference-rest-api#orderings}
|
|
159
|
-
*/
|
|
160
|
-
orderings?: Ordering | string | (Ordering | string)[];
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Arguments for `buildQueryURL` to construct a Query URL.
|
|
164
|
-
*/
|
|
165
|
-
declare type BuildQueryURLParams = {
|
|
166
|
-
/**
|
|
167
|
-
* Ref used to query documents.
|
|
168
|
-
*
|
|
169
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#prismic-api-ref}
|
|
170
|
-
*/
|
|
171
|
-
ref: string;
|
|
172
|
-
/**
|
|
173
|
-
* One or more predicates to filter documents for the query.
|
|
174
|
-
*
|
|
175
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api}
|
|
176
|
-
*/
|
|
177
|
-
predicates?: string | string[];
|
|
178
|
-
};
|
|
179
|
-
declare type BuildQueryURLArgs = QueryParams & BuildQueryURLParams;
|
|
180
|
-
/**
|
|
181
|
-
* Build a Prismic REST API V2 URL to request documents from a repository. The
|
|
182
|
-
* paginated response for this URL includes documents matching the parameters.
|
|
183
|
-
*
|
|
184
|
-
* A ref is required to make a request. Request the `endpoint` URL to retrieve a
|
|
185
|
-
* list of available refs.
|
|
186
|
-
*
|
|
187
|
-
* Type the JSON response with `Query`.
|
|
188
|
-
*
|
|
189
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#prismic-api-ref}
|
|
190
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api}
|
|
191
|
-
*
|
|
192
|
-
* @param endpoint URL to the repository's REST API V2.
|
|
193
|
-
* @param args Arguments to filter and scope the query.
|
|
194
|
-
*
|
|
195
|
-
* @returns URL that can be used to request documents from the repository.
|
|
196
|
-
*/
|
|
197
|
-
declare const buildQueryURL: (endpoint: string, args: BuildQueryURLArgs) => string;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* A ref or a function that returns a ref. If a static ref is known, one can be given. If the ref must be fetched on-demand, a function can be provided. This function can optionally be asynchronous.
|
|
201
|
-
*/
|
|
202
|
-
declare type RefStringOrFn = string | (() => string | undefined | Promise<string | undefined>);
|
|
203
|
-
/**
|
|
204
|
-
* Configuration for clients that determine how content is queried.
|
|
205
|
-
*/
|
|
206
|
-
declare type ClientConfig = {
|
|
207
|
-
/**
|
|
208
|
-
* The secure token for accessing the Prismic repository. This is only required if the repository is set to private.
|
|
209
|
-
*/
|
|
210
|
-
accessToken?: string;
|
|
211
|
-
/**
|
|
212
|
-
* A string representing a version of the Prismic repository's content. This may point to the latest version (called the "master ref"), or a preview with draft content.
|
|
213
|
-
*/
|
|
214
|
-
ref?: RefStringOrFn;
|
|
215
|
-
/**
|
|
216
|
-
* Default parameters that will be sent with each query. These parameters can be overridden on each query if needed.
|
|
217
|
-
*/
|
|
218
|
-
defaultParams?: Omit<BuildQueryURLArgs, "ref" | "accessToken">;
|
|
219
|
-
/**
|
|
220
|
-
* The function used to make network requests to the Prismic REST API. In environments where a global `fetch` function does not exist, such as Node.js, this function must be provided.
|
|
221
|
-
*/
|
|
222
|
-
fetch?: FetchLike;
|
|
223
|
-
};
|
|
224
|
-
/**
|
|
225
|
-
* Parameters specific to client methods that fetch all documents. These methods start with `getAll` (for example, `getAllByType`).
|
|
226
|
-
*/
|
|
227
|
-
declare type GetAllParams = {
|
|
228
|
-
/**
|
|
229
|
-
* Limit the number of documents queried. If a number is not provided, there will be no limit and all matching documents will be returned.
|
|
230
|
-
*/
|
|
231
|
-
limit?: number;
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Arguments to determine how the URL for a preview session is resolved.
|
|
235
|
-
*/
|
|
236
|
-
declare type ResolvePreviewArgs = {
|
|
237
|
-
/**
|
|
238
|
-
* A function that maps a Prismic document to a URL within your app.
|
|
239
|
-
*/
|
|
240
|
-
linkResolver: LinkResolver;
|
|
241
|
-
/**
|
|
242
|
-
* A fallback URL if the Link Resolver does not return a value.
|
|
243
|
-
*/
|
|
244
|
-
defaultUrl: string;
|
|
245
|
-
/**
|
|
246
|
-
* The preview token (also known as a ref) that will be used to query preview content from the Prismic repository.
|
|
247
|
-
*/
|
|
248
|
-
previewToken?: string;
|
|
249
|
-
/**
|
|
250
|
-
* The previewed document that will be used to determine the destination URL.
|
|
251
|
-
*/
|
|
252
|
-
documentId?: string;
|
|
253
|
-
};
|
|
254
|
-
/**
|
|
255
|
-
* Creates a Prismic client that can be used to query a repository.
|
|
256
|
-
*
|
|
257
|
-
* @param endpoint The Prismic REST API V2 endpoint for the repository (use `prismic.getEndpoint` for the default endpoint).
|
|
258
|
-
* @param options Configuration that determines how content will be queried from the Prismic repository.
|
|
259
|
-
*
|
|
260
|
-
* @returns A client that can query content from the repository.
|
|
261
|
-
*/
|
|
262
|
-
declare const createClient: (endpoint: string, options?: ClientConfig | undefined) => Client;
|
|
263
|
-
/**
|
|
264
|
-
* A client that allows querying content from a Prismic repository.
|
|
265
|
-
*
|
|
266
|
-
* If used in an environment where a global `fetch` function is unavailable, such as Node.js, the `fetch` option must be provided as part of the `options` parameter.
|
|
267
|
-
*/
|
|
268
|
-
declare class Client {
|
|
269
|
-
/**
|
|
270
|
-
* The Prismic REST API V2 endpoint for the repository (use `prismic.getEndpoint` for the default endpoint).
|
|
271
|
-
*/
|
|
272
|
-
endpoint: string;
|
|
273
|
-
/**
|
|
274
|
-
* The secure token for accessing the API (only needed if your repository is set to private).
|
|
275
|
-
*
|
|
276
|
-
* {@link https://user-guides.prismic.io/en/articles/1036153-generating-an-access-token}
|
|
277
|
-
*/
|
|
278
|
-
accessToken?: string;
|
|
279
|
-
/**
|
|
280
|
-
* Ref used to query documents.
|
|
281
|
-
*
|
|
282
|
-
* {@link https://prismic.io/docs/technologies/introduction-to-the-content-query-api#prismic-api-ref}
|
|
283
|
-
*/
|
|
284
|
-
ref?: RefStringOrFn;
|
|
285
|
-
/**
|
|
286
|
-
* The function used to make network requests to the Prismic REST API. In environments where a global `fetch` function does not exist, such as Node.js, this function must be provided.
|
|
287
|
-
*/
|
|
288
|
-
fetchFn: FetchLike;
|
|
289
|
-
/**
|
|
290
|
-
* An HTTP server request object containing the request's cookies. In a server environment, the request is used to support automatic Prismic preview support when querying draft content.
|
|
291
|
-
*/
|
|
292
|
-
httpRequest?: HttpRequestLike;
|
|
293
|
-
/**
|
|
294
|
-
* Default parameters that will be sent with each query. These parameters can be overridden on each query if needed.
|
|
295
|
-
*/
|
|
296
|
-
defaultParams?: Omit<BuildQueryURLArgs, "ref">;
|
|
297
|
-
/**
|
|
298
|
-
* Determines if queries will automatically point to a preview ref if available.
|
|
299
|
-
*/
|
|
300
|
-
private autoPreviewsEnabled;
|
|
301
|
-
/**
|
|
302
|
-
* Creates a Prismic client that can be used to query a repository.
|
|
303
|
-
*
|
|
304
|
-
* If used in an environment where a global `fetch` function is unavailable, such as Node.js, the `fetch` option must be provided as part of the `options` parameter.
|
|
305
|
-
*
|
|
306
|
-
* @param endpoint The Prismic REST API V2 endpoint for the repository (use `prismic.getEndpoint` to get the default endpoint).
|
|
307
|
-
* @param options Configuration that determines how content will be queried from the Prismic repository.
|
|
308
|
-
*
|
|
309
|
-
* @returns A client that can query content from the repository.
|
|
310
|
-
*/
|
|
311
|
-
constructor(endpoint: string, options?: ClientConfig);
|
|
312
|
-
/**
|
|
313
|
-
* Enables the client to automatically query content from a preview session if one is active in browser environments. This is enabled by default in the browser.
|
|
314
|
-
*
|
|
315
|
-
* For server environments, use `enableAutoPreviewsFromReq`.
|
|
316
|
-
*
|
|
317
|
-
* @see enableAutoPreviewsFromReq
|
|
318
|
-
*
|
|
319
|
-
* @example
|
|
320
|
-
* ```ts
|
|
321
|
-
* client.enableAutoPreviews()
|
|
322
|
-
* ```
|
|
323
|
-
*/
|
|
324
|
-
enableAutoPreviews(): void;
|
|
325
|
-
/**
|
|
326
|
-
* Enables the client to automatically query content from a preview session if one is active in server environments. This is disabled by default on the server.
|
|
327
|
-
*
|
|
328
|
-
* For browser environments, use `enableAutoPreviews`.
|
|
329
|
-
*
|
|
330
|
-
* @param req An HTTP server request object containing the request's cookies.
|
|
331
|
-
*
|
|
332
|
-
* @example
|
|
333
|
-
* ```ts
|
|
334
|
-
* // In an express app
|
|
335
|
-
* app.get('/', function (req, res) {
|
|
336
|
-
* client.enableAutoPreviewsFromReq(req)
|
|
337
|
-
* })
|
|
338
|
-
* ```
|
|
339
|
-
*/
|
|
340
|
-
enableAutoPreviewsFromReq<R extends HttpRequestLike>(req: R): void;
|
|
341
|
-
/**
|
|
342
|
-
* Disables the client from automatically querying content from a preview session if one is active.
|
|
343
|
-
*
|
|
344
|
-
* Automatic preview content querying is enabled by default unless this method is called.
|
|
345
|
-
*
|
|
346
|
-
* @example
|
|
347
|
-
* ```ts
|
|
348
|
-
* client.disableAutoPreviews()
|
|
349
|
-
* ```
|
|
350
|
-
*/
|
|
351
|
-
disableAutoPreviews(): void;
|
|
352
|
-
/**
|
|
353
|
-
* Queries content from the Prismic repository.
|
|
354
|
-
*
|
|
355
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
356
|
-
* @param params Parameters to filter, sort, and paginate results.
|
|
357
|
-
*
|
|
358
|
-
* @returns A paginated response containing the result of the query.
|
|
359
|
-
*
|
|
360
|
-
* ```ts
|
|
361
|
-
* const response = await client.get()
|
|
362
|
-
* ```
|
|
363
|
-
*
|
|
364
|
-
* @deprecated Use `get` instead.
|
|
365
|
-
*/
|
|
366
|
-
query: <TDocument extends prismicT.PrismicDocument<{
|
|
367
|
-
[key: string]: prismicT.AnyRegularField | prismicT.GroupField | prismicT.SliceZone<prismicT.Slice<string, {
|
|
368
|
-
[key: string]: prismicT.AnyRegularField;
|
|
369
|
-
}, {
|
|
370
|
-
[key: string]: prismicT.AnyRegularField;
|
|
371
|
-
}>>;
|
|
372
|
-
}, string, string>>(params?: Partial<BuildQueryURLArgs> | undefined) => Promise<Query<TDocument>>;
|
|
373
|
-
/**
|
|
374
|
-
* Queries content from the Prismic repository.
|
|
375
|
-
*
|
|
376
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
377
|
-
* @param params Parameters to filter, sort, and paginate results.
|
|
378
|
-
*
|
|
379
|
-
* @returns A paginated response containing the result of the query.
|
|
380
|
-
*
|
|
381
|
-
* ```ts
|
|
382
|
-
* const response = await client.get()
|
|
383
|
-
* ```
|
|
384
|
-
*/
|
|
385
|
-
get<TDocument extends prismicT.PrismicDocument>(params?: Partial<BuildQueryURLArgs>): Promise<Query<TDocument>>;
|
|
386
|
-
/**
|
|
387
|
-
* Queries content from the Prismic repository and returns only the first result, if any.
|
|
388
|
-
*
|
|
389
|
-
* @typeParam TDocument Type of the Prismic document returned.
|
|
390
|
-
* @param params Parameters to filter, sort, and paginate results.
|
|
391
|
-
*
|
|
392
|
-
* @returns The first result of the query, if any.
|
|
393
|
-
*
|
|
394
|
-
* @example
|
|
395
|
-
* ```ts
|
|
396
|
-
* const document = await client.getFirst()
|
|
397
|
-
* ```
|
|
398
|
-
*/
|
|
399
|
-
getFirst<TDocument extends prismicT.PrismicDocument>(params?: Partial<BuildQueryURLArgs>): Promise<TDocument>;
|
|
400
|
-
/**
|
|
401
|
-
* Queries content from the Prismic repository and returns all matching content. If no predicates are provided, all documents will be fetched.
|
|
402
|
-
*
|
|
403
|
-
* This method may make multiple network requests to query all matching content.
|
|
404
|
-
*
|
|
405
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
406
|
-
* @param params Parameters to filter, sort, and paginate results.
|
|
407
|
-
*
|
|
408
|
-
* @returns A list of documents matching the query.
|
|
409
|
-
*
|
|
410
|
-
* @example
|
|
411
|
-
* ```ts
|
|
412
|
-
* const response = await client.getAll()
|
|
413
|
-
* ```
|
|
414
|
-
*/
|
|
415
|
-
getAll<TDocument extends prismicT.PrismicDocument>(params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams): Promise<TDocument[]>;
|
|
416
|
-
/**
|
|
417
|
-
* Queries a document from the Prismic repository with a specific ID.
|
|
418
|
-
*
|
|
419
|
-
* @remarks
|
|
420
|
-
*
|
|
421
|
-
* A document's UID is different from its ID. An ID is automatically generated for all documents and is made available on its `id` property. A UID is provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
422
|
-
*
|
|
423
|
-
* @typeParam TDocument Type of the Prismic document returned.
|
|
424
|
-
* @param id ID of the document.
|
|
425
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
426
|
-
*
|
|
427
|
-
* @returns The document with an ID matching the `id` parameter, if a matching document exists.
|
|
428
|
-
*
|
|
429
|
-
* @example
|
|
430
|
-
* ```ts
|
|
431
|
-
* const document = await client.getByID('WW4bKScAAMAqmluX')
|
|
432
|
-
* ```
|
|
433
|
-
*/
|
|
434
|
-
getByID<TDocument extends prismicT.PrismicDocument>(id: string, params?: Partial<BuildQueryURLArgs>): Promise<TDocument>;
|
|
435
|
-
/**
|
|
436
|
-
* Queries documents from the Prismic repository with specific IDs.
|
|
437
|
-
*
|
|
438
|
-
* @remarks
|
|
439
|
-
*
|
|
440
|
-
* A document's UID is different from its ID. An ID is automatically generated for all documents and is made available on its `id` property. A UID is provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
441
|
-
*
|
|
442
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
443
|
-
* @param ids A list of document IDs.
|
|
444
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
445
|
-
*
|
|
446
|
-
* @returns A paginated response containing documents with IDs matching the `ids` parameter.
|
|
447
|
-
*
|
|
448
|
-
* @example
|
|
449
|
-
* ```ts
|
|
450
|
-
* const response = await client.getByIDs(['WW4bKScAAMAqmluX', 'U1kTRgEAAC8A5ldS'])
|
|
451
|
-
* ```
|
|
452
|
-
*/
|
|
453
|
-
getByIDs<TDocument extends prismicT.PrismicDocument>(ids: string[], params?: Partial<BuildQueryURLArgs>): Promise<Query<TDocument>>;
|
|
454
|
-
/**
|
|
455
|
-
* Queries all documents from the Prismic repository with specific IDs.
|
|
456
|
-
*
|
|
457
|
-
* This method may make multiple network requests to query all matching content.
|
|
458
|
-
*
|
|
459
|
-
* @remarks
|
|
460
|
-
*
|
|
461
|
-
* A document's UID is different from its ID. An ID is automatically generated for all documents and is made available on its `id` property. A UID is provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
462
|
-
*
|
|
463
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
464
|
-
* @param ids A list of document IDs.
|
|
465
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
466
|
-
*
|
|
467
|
-
* @returns A list of documents with IDs matching the `ids` parameter, if a matching document exists.
|
|
468
|
-
*
|
|
469
|
-
* @example
|
|
470
|
-
* ```ts
|
|
471
|
-
* const response = await client.getAllByIDs(['WW4bKScAAMAqmluX', 'U1kTRgEAAC8A5ldS'])
|
|
472
|
-
* ```
|
|
473
|
-
*/
|
|
474
|
-
getAllByIDs<TDocument extends prismicT.PrismicDocument>(ids: string[], params?: Partial<BuildQueryURLArgs>): Promise<TDocument[]>;
|
|
475
|
-
/**
|
|
476
|
-
* Queries a document from the Prismic repository with a specific UID and Custom Type.
|
|
477
|
-
*
|
|
478
|
-
* @remarks
|
|
479
|
-
*
|
|
480
|
-
* A document's UID is different from its ID. An ID is automatically generated for all documents and is made available on its `id` property. A UID is provided in the Prismic editor and is unique among all documents of its Custom Type.
|
|
481
|
-
*
|
|
482
|
-
* @typeParam TDocument Type of the Prismic document returned.
|
|
483
|
-
* @param documentType The API ID of the document's Custom Type.
|
|
484
|
-
* @param uid UID of the document.
|
|
485
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
486
|
-
*
|
|
487
|
-
* @returns The document with a UID matching the `uid` parameter, if a matching document exists.
|
|
488
|
-
*
|
|
489
|
-
* @example
|
|
490
|
-
* ```ts
|
|
491
|
-
* const document = await client.getByUID('blog_post', 'my-first-post')
|
|
492
|
-
* ```
|
|
493
|
-
*/
|
|
494
|
-
getByUID<TDocument extends prismicT.PrismicDocument>(documentType: string, uid: string, params?: Partial<BuildQueryURLArgs>): Promise<TDocument>;
|
|
495
|
-
/**
|
|
496
|
-
* Queries a singleton document from the Prismic repository for a specific Custom Type.
|
|
497
|
-
*
|
|
498
|
-
* @remarks
|
|
499
|
-
*
|
|
500
|
-
* A singleton document is one that is configured in Prismic to only allow one instance. For example, a repository may be configured to contain just one Settings document. This is in contrast to a repeatable Custom Type which allows multiple instances of itself.
|
|
501
|
-
*
|
|
502
|
-
* @typeParam TDocument Type of the Prismic document returned.
|
|
503
|
-
* @param documentType The API ID of the singleton Custom Type.
|
|
504
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
505
|
-
*
|
|
506
|
-
* @returns The singleton document for the Custom Type, if a matching document exists.
|
|
507
|
-
*
|
|
508
|
-
* @example
|
|
509
|
-
* ```ts
|
|
510
|
-
* const document = await client.getSingle('settings')
|
|
511
|
-
* ```
|
|
512
|
-
*/
|
|
513
|
-
getSingle<TDocument extends prismicT.PrismicDocument>(documentType: string, params?: Partial<BuildQueryURLArgs>): Promise<TDocument>;
|
|
514
|
-
/**
|
|
515
|
-
* Queries documents from the Prismic repository for a specific Custom Type.
|
|
516
|
-
*
|
|
517
|
-
* Use `getAllByType` instead if you need to query all documents for a specific Custom Type.
|
|
518
|
-
*
|
|
519
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
520
|
-
* @param documentType The API ID of the Custom Type.
|
|
521
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
522
|
-
*
|
|
523
|
-
* @returns A paginated response containing documents of the Custom Type.
|
|
524
|
-
*
|
|
525
|
-
* @example
|
|
526
|
-
* ```ts
|
|
527
|
-
* const response = await client.getByType('blog_post')
|
|
528
|
-
* ```
|
|
529
|
-
*/
|
|
530
|
-
getByType<TDocument extends prismicT.PrismicDocument>(documentType: string, params?: Partial<BuildQueryURLArgs>): Promise<Query<TDocument>>;
|
|
531
|
-
/**
|
|
532
|
-
* Queries all documents from the Prismic repository for a specific Custom Type.
|
|
533
|
-
*
|
|
534
|
-
* This method may make multiple network requests to query all matching content.
|
|
535
|
-
*
|
|
536
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
537
|
-
* @param documentType The API ID of the Custom Type.
|
|
538
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
539
|
-
*
|
|
540
|
-
* @returns A list of all documents of the Custom Type.
|
|
541
|
-
*
|
|
542
|
-
* @example
|
|
543
|
-
* ```ts
|
|
544
|
-
* const response = await client.getByType('blog_post')
|
|
545
|
-
* ```
|
|
546
|
-
*/
|
|
547
|
-
getAllByType<TDocument extends prismicT.PrismicDocument>(documentType: string, params?: Partial<Omit<BuildQueryURLArgs, "page">>): Promise<TDocument[]>;
|
|
548
|
-
/**
|
|
549
|
-
* Queries documents from the Prismic repository with a specific tag.
|
|
550
|
-
*
|
|
551
|
-
* Use `getAllByTag` instead if you need to query all documents with a specific tag.
|
|
552
|
-
*
|
|
553
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
554
|
-
* @param tag The tag that must be included on a document.
|
|
555
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
556
|
-
*
|
|
557
|
-
* @returns A paginated response containing documents with the tag.
|
|
558
|
-
*
|
|
559
|
-
* @example
|
|
560
|
-
* ```ts
|
|
561
|
-
* const response = await client.getByTag('food')
|
|
562
|
-
* ```
|
|
563
|
-
*/
|
|
564
|
-
getByTag<TDocument extends prismicT.PrismicDocument>(tag: string, params?: Partial<BuildQueryURLArgs>): Promise<Query<TDocument>>;
|
|
565
|
-
/**
|
|
566
|
-
* Queries all documents from the Prismic repository with a specific tag.
|
|
567
|
-
*
|
|
568
|
-
* This method may make multiple network requests to query all matching content.
|
|
569
|
-
*
|
|
570
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
571
|
-
* @param tag The tag that must be included on a document.
|
|
572
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
573
|
-
*
|
|
574
|
-
* @returns A list of all documents with the tag.
|
|
575
|
-
*
|
|
576
|
-
* @example
|
|
577
|
-
* ```ts
|
|
578
|
-
* const response = await client.getAllByTag('food')
|
|
579
|
-
* ```
|
|
580
|
-
*/
|
|
581
|
-
getAllByTag<TDocument extends prismicT.PrismicDocument>(tag: string, params?: Partial<Omit<BuildQueryURLArgs, "page">>): Promise<TDocument[]>;
|
|
582
|
-
/**
|
|
583
|
-
* Queries documents from the Prismic repository with a specific tag.
|
|
584
|
-
*
|
|
585
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
586
|
-
* @param tags A list of tags that must be included on a document.
|
|
587
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
588
|
-
*
|
|
589
|
-
* @returns A paginated response containing documents with the tag.
|
|
590
|
-
*
|
|
591
|
-
* @example
|
|
592
|
-
* ```ts
|
|
593
|
-
* const response = await client.getAllByTag('food')
|
|
594
|
-
* ```
|
|
595
|
-
*/
|
|
596
|
-
getByTags<TDocument extends prismicT.PrismicDocument>(tags: string[], params?: Partial<BuildQueryURLArgs>): Promise<Query<TDocument>>;
|
|
597
|
-
/**
|
|
598
|
-
* Queries all documents from the Prismic repository with a specific tag.
|
|
599
|
-
*
|
|
600
|
-
* This method may make multiple network requests to query all matching content.
|
|
601
|
-
*
|
|
602
|
-
* @typeParam TDocument Type of Prismic documents returned.
|
|
603
|
-
* @param tags A list of tags that must be included on a document.
|
|
604
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
605
|
-
*
|
|
606
|
-
* @returns A list of all documents with the tag.
|
|
607
|
-
*
|
|
608
|
-
* @example
|
|
609
|
-
* ```ts
|
|
610
|
-
* const response = await client.getAllByTag('food')
|
|
611
|
-
* ```
|
|
612
|
-
*/
|
|
613
|
-
getAllByTags<TDocument extends prismicT.PrismicDocument>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">>): Promise<TDocument[]>;
|
|
614
|
-
/**
|
|
615
|
-
* Returns a list of all refs for the Prismic repository.
|
|
616
|
-
*
|
|
617
|
-
* Refs are used to identify which version of the repository's content should be queried. All repositories will have at least one ref pointing to the latest published content called the "master ref".
|
|
618
|
-
*
|
|
619
|
-
* @returns A list of all refs for the Prismic repository.
|
|
620
|
-
*/
|
|
621
|
-
getRefs(): Promise<Ref[]>;
|
|
622
|
-
/**
|
|
623
|
-
* Returns a ref for the Prismic repository with a matching ID.
|
|
624
|
-
*
|
|
625
|
-
* @param id ID of the ref.
|
|
626
|
-
*
|
|
627
|
-
* @returns The ref with a matching ID, if it exists.
|
|
628
|
-
*/
|
|
629
|
-
getRefById(id: string): Promise<Ref>;
|
|
630
|
-
/**
|
|
631
|
-
* Returns a ref for the Prismic repository with a matching label.
|
|
632
|
-
*
|
|
633
|
-
* @param label Label of the ref.
|
|
634
|
-
*
|
|
635
|
-
* @returns The ref with a matching label, if it exists.
|
|
636
|
-
*/
|
|
637
|
-
getRefByLabel(label: string): Promise<Ref>;
|
|
638
|
-
/**
|
|
639
|
-
* Returns the master ref for the Prismic repository. The master ref points to the repository's latest published content.
|
|
640
|
-
*
|
|
641
|
-
* @returns The repository's master ref.
|
|
642
|
-
*/
|
|
643
|
-
getMasterRef(): Promise<Ref>;
|
|
644
|
-
/**
|
|
645
|
-
* Returns a list of all Releases for the Prismic repository. Releases are used to group content changes before publishing.
|
|
646
|
-
*
|
|
647
|
-
* @returns A list of all Releases for the Prismic repository.
|
|
648
|
-
*/
|
|
649
|
-
getReleases(): Promise<Ref[]>;
|
|
650
|
-
/**
|
|
651
|
-
* Returns a Release for the Prismic repository with a matching ID.
|
|
652
|
-
*
|
|
653
|
-
* @param id ID of the Release.
|
|
654
|
-
*
|
|
655
|
-
* @returns The Release with a matching ID, if it exists.
|
|
656
|
-
*/
|
|
657
|
-
getReleaseById(id: string): Promise<Ref>;
|
|
658
|
-
/**
|
|
659
|
-
* Returns a Release for the Prismic repository with a matching label.
|
|
660
|
-
*
|
|
661
|
-
* @param label Label of the ref.
|
|
662
|
-
*
|
|
663
|
-
* @returns The ref with a matching label, if it exists.
|
|
664
|
-
*/
|
|
665
|
-
getReleaseByLabel(label: string): Promise<Ref>;
|
|
666
|
-
/**
|
|
667
|
-
* Returns a list of all tags used in the Prismic repository.
|
|
668
|
-
*
|
|
669
|
-
* @returns A list of all tags used in the repository.
|
|
670
|
-
*/
|
|
671
|
-
getTags(): Promise<string[]>;
|
|
672
|
-
/**
|
|
673
|
-
* Builds a URL used to query content from the Prismic repository.
|
|
674
|
-
*
|
|
675
|
-
* @param params Parameters to filter, sort, and paginate the results.
|
|
676
|
-
*
|
|
677
|
-
* @returns A URL string that can be requested to query content.
|
|
678
|
-
*/
|
|
679
|
-
buildQueryURL(params?: Partial<BuildQueryURLArgs>): Promise<string>;
|
|
680
|
-
/**
|
|
681
|
-
* Determines the URL for a previewed document during an active preview session. The result of this method should be used to redirect the user to the document's URL.
|
|
682
|
-
*
|
|
683
|
-
* @param args Arguments to configure the URL resolving.
|
|
684
|
-
*
|
|
685
|
-
* @returns The URL for the previewed document during an active preview session. The user should be redirected to this URL.
|
|
686
|
-
*
|
|
687
|
-
* @example
|
|
688
|
-
* ```ts
|
|
689
|
-
* const url = resolvePreviewUrl({
|
|
690
|
-
* linkResolver: (document) => `/${document.uid}`
|
|
691
|
-
* defaultUrl: '/'
|
|
692
|
-
* })
|
|
693
|
-
* ```
|
|
694
|
-
*/
|
|
695
|
-
resolvePreviewUrl(args: ResolvePreviewArgs): Promise<string>;
|
|
696
|
-
/**
|
|
697
|
-
* Sets the client to query content from currently published documents for all future queries.
|
|
698
|
-
*
|
|
699
|
-
* If the `ref` parameter is provided during a query, it takes priority for that query.
|
|
700
|
-
*
|
|
701
|
-
* @returns The repository's master Ref.
|
|
702
|
-
*/
|
|
703
|
-
queryCurrentContent(): Promise<Ref>;
|
|
704
|
-
/**
|
|
705
|
-
* Sets the client to query content from a specific Release identified by its ID for all future queries.
|
|
706
|
-
*
|
|
707
|
-
* If the `ref` parameter is provided during a query, it takes priority for that query.
|
|
708
|
-
*
|
|
709
|
-
* @param id The ID of the Release.
|
|
710
|
-
*
|
|
711
|
-
* @returns The Release with a matching ID, if it exists.
|
|
712
|
-
*/
|
|
713
|
-
queryContentFromReleaseByID(id: string): Promise<Ref>;
|
|
714
|
-
/**
|
|
715
|
-
* Sets the client to query content from a specific Release identified by its label for all future queries.
|
|
716
|
-
*
|
|
717
|
-
* If the `ref` parameter is provided during a query, it takes priority for that query.
|
|
718
|
-
*
|
|
719
|
-
* @param label The label of the Release.
|
|
720
|
-
*
|
|
721
|
-
* @returns The Release with a matching label, if it exists.
|
|
722
|
-
*/
|
|
723
|
-
queryContentFromReleaseByLabel(label: string): Promise<Ref>;
|
|
724
|
-
/**
|
|
725
|
-
* Returns the preview ref for the client, if one exists.
|
|
726
|
-
*
|
|
727
|
-
* If this method is used in the browser, the browser's cookies will be read. If this method is used on the server, the cookies from the saved HTTP Request will be read, if an HTTP Request was given.
|
|
728
|
-
*
|
|
729
|
-
* @returns The preview ref as a string, if one exists.
|
|
730
|
-
*/
|
|
731
|
-
private getPreviewRefString;
|
|
732
|
-
/**
|
|
733
|
-
* Returns the ref needed to query based on the client's current state. This method may make a network request to resolve the users's ref getter function or fetch the repository's master ref.
|
|
734
|
-
*
|
|
735
|
-
* The following flow is used:
|
|
736
|
-
*
|
|
737
|
-
* 1. If previews are enabled, it will return the preview ref if one is available.
|
|
738
|
-
*
|
|
739
|
-
* 2. If a ref or a function that returns a ref is given at client instantiation via the `ref` configuration option, it will be returned. If a function is provided, it will be resolved before returning.
|
|
740
|
-
*
|
|
741
|
-
* 3. If any of the above methods return a falsy value, the master ref will be used. If the master ref is used, it will be persisted for all future queries until overridden.
|
|
742
|
-
*/
|
|
743
|
-
private getResolvedRefString;
|
|
744
|
-
/**
|
|
745
|
-
* Returns the network request options required by the Prismic repository.
|
|
746
|
-
*
|
|
747
|
-
* It currently only includes an Authorization header if an access token is provided.
|
|
748
|
-
*
|
|
749
|
-
* @param params Parameters for the query, including an access token.
|
|
750
|
-
*
|
|
751
|
-
* @returns Request options that can be used to make a network request to query the repository.
|
|
752
|
-
*/
|
|
753
|
-
private buildRequestOptions;
|
|
754
|
-
/**
|
|
755
|
-
* Performs a network request using the configured `fetch` function. It assumes all successful responses will have a JSON content type. It also normalizes unsuccessful network requests.
|
|
756
|
-
*
|
|
757
|
-
* @typeParam T The JSON response.
|
|
758
|
-
* @param url URL to the resource to fetch.
|
|
759
|
-
* @param params Prismic REST API parameters for the network request.
|
|
760
|
-
*
|
|
761
|
-
* @returns The JSON response from the network request.
|
|
762
|
-
*/
|
|
763
|
-
private fetch;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* The `at` predicate checks that the path matches the described value exactly. It takes a single value for a field or an array (only for tags).
|
|
768
|
-
*
|
|
769
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}
|
|
770
|
-
*/
|
|
771
|
-
declare const at: (path: string, value: string | number | (string | number)[]) => string;
|
|
772
|
-
/**
|
|
773
|
-
* The `not` predicate checks that the path doesn't match the provided value exactly. It takes a single value as the argument.
|
|
774
|
-
*
|
|
775
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}
|
|
776
|
-
*/
|
|
777
|
-
declare const not: (path: string, value: string | number | (string | number)[]) => string;
|
|
778
|
-
/**
|
|
779
|
-
* The `any` predicate takes an array of values. It works exactly the same way as the `at` operator, but checks whether the fragment matches any of the values in the array.
|
|
780
|
-
*
|
|
781
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}
|
|
782
|
-
*/
|
|
783
|
-
declare const any: (path: string, value: string | number | (string | number)[]) => string;
|
|
784
|
-
/**
|
|
785
|
-
* The `in` predicate is used specifically to retrieve an array of documents by their IDs or UIDs. This predicate is much more efficient at this than the any predicate.
|
|
786
|
-
*
|
|
787
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}
|
|
788
|
-
*/
|
|
789
|
-
declare const _in: (path: string, value: string | number | (string | number)[]) => string;
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
* The `fulltext` predicate provides two capabilities:
|
|
793
|
-
*
|
|
794
|
-
* 1. Checking if a certain string is anywhere inside a document (this is what you should use to make your project's search engine feature)
|
|
795
|
-
* 2. Checking if the string is contained inside a specific custom type’s Rich Text or Key Text fragment.
|
|
796
|
-
*
|
|
797
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}
|
|
798
|
-
*/
|
|
799
|
-
declare const fulltext: (path: string, value: string | number | (string | number)[]) => string;
|
|
800
|
-
/**
|
|
801
|
-
* The `has` predicate checks whether a fragment has a value. It will return all the documents of the specified type that contain a value for the specified field.
|
|
802
|
-
*
|
|
803
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#has}
|
|
804
|
-
*/
|
|
805
|
-
declare const has: (path: string) => string;
|
|
806
|
-
/**
|
|
807
|
-
* The `missing` predicate checks if a fragment doesn't have a value. It will return all the documents of the specified type that do not contain a value for the specified field.
|
|
808
|
-
*
|
|
809
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#missing}
|
|
810
|
-
*/
|
|
811
|
-
declare const missing: (path: string) => string;
|
|
812
|
-
/**
|
|
813
|
-
* The `similar` predicate takes the ID of a document, and returns a list of documents with similar content. This allows you to build an automated content discovery feature (for example, a "Related posts" section).
|
|
814
|
-
*
|
|
815
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#similar}
|
|
816
|
-
*/
|
|
817
|
-
declare const similar: (id: string, value: number) => string;
|
|
818
|
-
/**
|
|
819
|
-
* The `geopoint.near` predicate checks that the value in the path is within the radius of the given coordinates.
|
|
820
|
-
*
|
|
821
|
-
* This predicate will only work for a GeoPoint field.
|
|
822
|
-
*
|
|
823
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#near}
|
|
824
|
-
*/
|
|
825
|
-
declare const geopointNear: (path: string, latitude: number, longitude: number, radius: number) => string;
|
|
826
|
-
/**
|
|
827
|
-
* The `number.lt` predicate checks that the value in the number field is less than the value passed into the predicate.
|
|
828
|
-
*
|
|
829
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#lt-less-than}
|
|
830
|
-
*/
|
|
831
|
-
declare const numberLessThan: (path: string, value: number) => string;
|
|
832
|
-
/**
|
|
833
|
-
* The `number.gt` predicate checks that the value in the number field is greater than the value passed into the predicate.
|
|
834
|
-
*
|
|
835
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#gt-greater-than}
|
|
836
|
-
*/
|
|
837
|
-
declare const numberGreaterThan: (path: string, value: number) => string;
|
|
838
|
-
/**
|
|
839
|
-
* The `number.inRange` predicate checks that the value in the path is within the two values passed into the predicate.
|
|
840
|
-
*
|
|
841
|
-
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#inrange}
|
|
842
|
-
*/
|
|
843
|
-
declare const numberInRange: (path: string, lowerLimit: number, upperLimit: number) => string;
|
|
844
|
-
/**
|
|
845
|
-
* The `date.after` predicate checks that the value in the path is after the date value passed into the predicate.
|
|
846
|
-
*
|
|
847
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#after}
|
|
848
|
-
*/
|
|
849
|
-
declare const dateAfter: (path: string, date: string | number | Date) => string;
|
|
850
|
-
/**
|
|
851
|
-
* The `date.before` predicate checks that the value in the path is before the date value passed into the predicate.
|
|
852
|
-
*
|
|
853
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#before}
|
|
854
|
-
*/
|
|
855
|
-
declare const dateBefore: (path: string, date: string | number | Date) => string;
|
|
856
|
-
/**
|
|
857
|
-
* The `date.between` predicate checks that the value in the path is within the date values passed into the predicate.
|
|
858
|
-
*
|
|
859
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#between}
|
|
860
|
-
*/
|
|
861
|
-
declare const dateBetween: (path: string, startDate: string | number | Date, endDate: string | number | Date) => string;
|
|
862
|
-
/**
|
|
863
|
-
* The `date.day-of-month` predicate checks that the value in the path is equal to the day of the month passed into the predicate.
|
|
864
|
-
*
|
|
865
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonth}
|
|
866
|
-
*/
|
|
867
|
-
declare const dateDayOfMonth: (path: string, day: number) => string;
|
|
868
|
-
/**
|
|
869
|
-
* The `date.day-of-month-after` predicate checks that the value in the path is after the day of the month passed into the predicate.
|
|
870
|
-
*
|
|
871
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthafter}
|
|
872
|
-
*/
|
|
873
|
-
declare const dateDayOfMonthAfter: (path: string, day: number) => string;
|
|
874
|
-
/**
|
|
875
|
-
* The `date.day-of-month-before` predicate checks that the value in the path is before the day of the month passed into the predicate.
|
|
876
|
-
*
|
|
877
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofmonthbefore}
|
|
878
|
-
*/
|
|
879
|
-
declare const dateDayOfMonthBefore: (path: string, day: number) => string;
|
|
880
|
-
/**
|
|
881
|
-
* The `date.day-of-week` predicate checks that the value in the path is equal to the day of the week passed into the predicate.
|
|
882
|
-
*
|
|
883
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweek}
|
|
884
|
-
*/
|
|
885
|
-
declare const dateDayOfWeek: (path: string, day: string | number) => string;
|
|
886
|
-
/**
|
|
887
|
-
* The `date.day-of-week-after` predicate checks that the value in the path is after the day of the week passed into the predicate.
|
|
888
|
-
*
|
|
889
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekafter}
|
|
890
|
-
*/
|
|
891
|
-
declare const dateDayOfWeekAfter: (path: string, day: string | number) => string;
|
|
892
|
-
/**
|
|
893
|
-
* The date.day-of-week-before predicate checks that the value in the path is before the day of the week passed into the predicate.
|
|
894
|
-
*
|
|
895
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#dayofweekbefore}
|
|
896
|
-
*/
|
|
897
|
-
declare const dateDayOfWeekBefore: (path: string, day: string | number) => string;
|
|
898
|
-
/**
|
|
899
|
-
* The `date.month` predicate checks that the value in the path occurs in the month value passed into the predicate.
|
|
900
|
-
*
|
|
901
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#month}
|
|
902
|
-
*/
|
|
903
|
-
declare const dateMonth: (path: string, month: string | number) => string;
|
|
904
|
-
/**
|
|
905
|
-
* The `date.month-after` predicate checks that the value in the path occurs in any month after the value passed into the predicate.
|
|
906
|
-
*
|
|
907
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthafter}
|
|
908
|
-
*/
|
|
909
|
-
declare const dateMonthAfter: (path: string, month: string | number) => string;
|
|
910
|
-
/**
|
|
911
|
-
* The `date.month-before` predicate checks that the value in the path occurs in any month before the value passed into the predicate.
|
|
912
|
-
*
|
|
913
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#monthbefore}
|
|
914
|
-
*/
|
|
915
|
-
declare const dateMonthBefore: (path: string, month: string | number) => string;
|
|
916
|
-
/**
|
|
917
|
-
* The `date.year` predicate checks that the value in the path occurs in the year value passed into the predicate.
|
|
918
|
-
*
|
|
919
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#year}
|
|
920
|
-
*/
|
|
921
|
-
declare const dateYear: (path: string, year: number) => string;
|
|
922
|
-
/**
|
|
923
|
-
* The `date.hour` predicate checks that the value in the path occurs within the hour value passed into the predicate.
|
|
924
|
-
*
|
|
925
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hour}
|
|
926
|
-
*/
|
|
927
|
-
declare const dateHour: (path: string, hour: number) => string;
|
|
928
|
-
/**
|
|
929
|
-
* The `date.hour-after` predicate checks that the value in the path occurs after the hour value passed into the predicate.
|
|
930
|
-
*
|
|
931
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourafter}
|
|
932
|
-
*/
|
|
933
|
-
declare const dateHourAfter: (path: string, hour: number) => string;
|
|
934
|
-
/**
|
|
935
|
-
* The `date.hour-before` predicate checks that the value in the path occurs before the hour value passed into the predicate.
|
|
936
|
-
*
|
|
937
|
-
* {@link https://prismic.io/docs/technologies/date-and-time-based-predicate-reference-rest-api#hourbefore}
|
|
938
|
-
*/
|
|
939
|
-
declare const dateHourBefore: (path: string, hour: number) => string;
|
|
940
|
-
|
|
941
|
-
declare const predicate_at: typeof at;
|
|
942
|
-
declare const predicate_not: typeof not;
|
|
943
|
-
declare const predicate_any: typeof any;
|
|
944
|
-
declare const predicate_fulltext: typeof fulltext;
|
|
945
|
-
declare const predicate_has: typeof has;
|
|
946
|
-
declare const predicate_missing: typeof missing;
|
|
947
|
-
declare const predicate_similar: typeof similar;
|
|
948
|
-
declare const predicate_geopointNear: typeof geopointNear;
|
|
949
|
-
declare const predicate_numberLessThan: typeof numberLessThan;
|
|
950
|
-
declare const predicate_numberGreaterThan: typeof numberGreaterThan;
|
|
951
|
-
declare const predicate_numberInRange: typeof numberInRange;
|
|
952
|
-
declare const predicate_dateAfter: typeof dateAfter;
|
|
953
|
-
declare const predicate_dateBefore: typeof dateBefore;
|
|
954
|
-
declare const predicate_dateBetween: typeof dateBetween;
|
|
955
|
-
declare const predicate_dateDayOfMonth: typeof dateDayOfMonth;
|
|
956
|
-
declare const predicate_dateDayOfMonthAfter: typeof dateDayOfMonthAfter;
|
|
957
|
-
declare const predicate_dateDayOfMonthBefore: typeof dateDayOfMonthBefore;
|
|
958
|
-
declare const predicate_dateDayOfWeek: typeof dateDayOfWeek;
|
|
959
|
-
declare const predicate_dateDayOfWeekAfter: typeof dateDayOfWeekAfter;
|
|
960
|
-
declare const predicate_dateDayOfWeekBefore: typeof dateDayOfWeekBefore;
|
|
961
|
-
declare const predicate_dateMonth: typeof dateMonth;
|
|
962
|
-
declare const predicate_dateMonthAfter: typeof dateMonthAfter;
|
|
963
|
-
declare const predicate_dateMonthBefore: typeof dateMonthBefore;
|
|
964
|
-
declare const predicate_dateYear: typeof dateYear;
|
|
965
|
-
declare const predicate_dateHour: typeof dateHour;
|
|
966
|
-
declare const predicate_dateHourAfter: typeof dateHourAfter;
|
|
967
|
-
declare const predicate_dateHourBefore: typeof dateHourBefore;
|
|
968
|
-
declare namespace predicate {
|
|
969
|
-
export {
|
|
970
|
-
_in as in,
|
|
971
|
-
predicate_at as at,
|
|
972
|
-
predicate_not as not,
|
|
973
|
-
predicate_any as any,
|
|
974
|
-
predicate_fulltext as fulltext,
|
|
975
|
-
predicate_has as has,
|
|
976
|
-
predicate_missing as missing,
|
|
977
|
-
predicate_similar as similar,
|
|
978
|
-
predicate_geopointNear as geopointNear,
|
|
979
|
-
predicate_numberLessThan as numberLessThan,
|
|
980
|
-
predicate_numberGreaterThan as numberGreaterThan,
|
|
981
|
-
predicate_numberInRange as numberInRange,
|
|
982
|
-
predicate_dateAfter as dateAfter,
|
|
983
|
-
predicate_dateBefore as dateBefore,
|
|
984
|
-
predicate_dateBetween as dateBetween,
|
|
985
|
-
predicate_dateDayOfMonth as dateDayOfMonth,
|
|
986
|
-
predicate_dateDayOfMonthAfter as dateDayOfMonthAfter,
|
|
987
|
-
predicate_dateDayOfMonthBefore as dateDayOfMonthBefore,
|
|
988
|
-
predicate_dateDayOfWeek as dateDayOfWeek,
|
|
989
|
-
predicate_dateDayOfWeekAfter as dateDayOfWeekAfter,
|
|
990
|
-
predicate_dateDayOfWeekBefore as dateDayOfWeekBefore,
|
|
991
|
-
predicate_dateMonth as dateMonth,
|
|
992
|
-
predicate_dateMonthAfter as dateMonthAfter,
|
|
993
|
-
predicate_dateMonthBefore as dateMonthBefore,
|
|
994
|
-
predicate_dateYear as dateYear,
|
|
995
|
-
predicate_dateHour as dateHour,
|
|
996
|
-
predicate_dateHourAfter as dateHourAfter,
|
|
997
|
-
predicate_dateHourBefore as dateHourBefore,
|
|
998
|
-
};
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
/**
|
|
1002
|
-
* An error representing a failed HTTP request.
|
|
1003
|
-
*/
|
|
1004
|
-
declare class HTTPError extends Error {
|
|
1005
|
-
/**
|
|
1006
|
-
* The URL used to make the network request.
|
|
1007
|
-
*/
|
|
1008
|
-
url: string;
|
|
1009
|
-
/**
|
|
1010
|
-
* Options used to make the network request.
|
|
1011
|
-
*/
|
|
1012
|
-
options: RequestInit;
|
|
1013
|
-
/**
|
|
1014
|
-
* The Response object returned by the network request.
|
|
1015
|
-
*/
|
|
1016
|
-
response: ResponseLike;
|
|
1017
|
-
/**
|
|
1018
|
-
* @param reason A message containing the reason for the failed HTTP request.
|
|
1019
|
-
* @param response The Response object returned by the network request.
|
|
1020
|
-
* @param url The URL used to make the network request.
|
|
1021
|
-
* @param options Options used to make the network request.
|
|
1022
|
-
*/
|
|
1023
|
-
constructor(reason: string | undefined, response: ResponseLike, url: string, options: RequestInit);
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
/**
|
|
1027
|
-
* The well-known name of the cookie used to store a Prismic preview session's ref.
|
|
1028
|
-
*/
|
|
1029
|
-
declare const preview = "io.prismic.preview";
|
|
1030
|
-
|
|
1031
|
-
declare const cookie_preview: typeof preview;
|
|
1032
|
-
declare namespace cookie {
|
|
1033
|
-
export {
|
|
1034
|
-
cookie_preview as preview,
|
|
1035
|
-
};
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
export { BuildQueryURLArgs, Client, ClientConfig, FetchLike, Form, FormField, HTTPError, HttpRequestLike, Language, LinkResolver, Ordering, Query, QueryParams, Ref, Repository, RequestInitLike, ResponseLike, buildQueryURL, cookie, createClient, getEndpoint, predicate };
|