@prismicio/client 5.1.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.
Files changed (41) hide show
  1. package/README.md +1 -1
  2. package/cjs/@prismicio/client.js +1200 -1200
  3. package/cjs/@prismicio/client.js.map +1 -1
  4. package/cjs/@prismicio/client.min.js.map +1 -1
  5. package/esm/@prismicio/client.min.mjs.map +1 -1
  6. package/esm/@prismicio/client.mjs +1200 -1200
  7. package/esm/@prismicio/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/types/Api.d.ts +27 -27
  10. package/types/ApiSearchResponse.d.ts +11 -11
  11. package/types/Cookies.d.ts +9 -9
  12. package/types/HttpClient.d.ts +16 -16
  13. package/types/LazySearchForm.d.ts +24 -24
  14. package/types/Predicates.d.ts +58 -58
  15. package/types/PreviewResolver.d.ts +9 -9
  16. package/types/ResolvedApi.d.ts +126 -126
  17. package/types/SearchForm.d.ts +47 -47
  18. package/types/TagsForm.d.ts +7 -7
  19. package/types/cache.d.ts +17 -17
  20. package/types/client.d.ts +34 -34
  21. package/types/documents.d.ts +20 -20
  22. package/types/experiments.d.ts +22 -22
  23. package/types/form.d.ts +25 -25
  24. package/types/index.d.ts +129 -129
  25. package/types/lru.d.ts +25 -25
  26. package/types/request.d.ts +13 -13
  27. package/umd/@prismicio/client.js +1200 -1200
  28. package/umd/@prismicio/client.js.map +1 -1
  29. package/umd/@prismicio/client.min.js.map +1 -1
  30. package/cjs/prismic-javascript.js +0 -1282
  31. package/cjs/prismic-javascript.js.map +0 -1
  32. package/cjs/prismic-javascript.min.js +0 -16
  33. package/cjs/prismic-javascript.min.js.map +0 -1
  34. package/esm/prismic-javascript.min.mjs +0 -16
  35. package/esm/prismic-javascript.min.mjs.map +0 -1
  36. package/esm/prismic-javascript.mjs +0 -1278
  37. package/esm/prismic-javascript.mjs.map +0 -1
  38. package/umd/prismic-javascript.js +0 -1286
  39. package/umd/prismic-javascript.js.map +0 -1
  40. package/umd/prismic-javascript.min.js +0 -17
  41. package/umd/prismic-javascript.min.js.map +0 -1
package/types/index.d.ts CHANGED
@@ -1,129 +1,129 @@
1
- import ResolvedApi from './ResolvedApi';
2
- import { Experiments } from './experiments';
3
- import Api, { ApiOptions } from './Api';
4
- import { DefaultClient } from './client';
5
- declare const _default: {
6
- experimentCookie: string;
7
- previewCookie: string;
8
- Predicates: {
9
- at(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
10
- not(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
11
- missing(fragment: string): string;
12
- has(fragment: string): string;
13
- any(fragment: string, values: (string | number | boolean | Date)[]): string;
14
- in(fragment: string, values: string[]): string;
15
- fulltext(fragment: string, value: string): string;
16
- similar(documentId: string, maxResults: number): string;
17
- date: {
18
- before(fragment: string, before: string | number | boolean | Date): string;
19
- after(fragment: string, after: string | number | boolean | Date): string;
20
- between(fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date): string;
21
- dayOfMonth(fragment: string, day: number): string;
22
- dayOfMonthAfter(fragment: string, day: number): string;
23
- dayOfMonthBefore(fragment: string, day: number): string;
24
- dayOfWeek(fragment: string, day: string | number): string;
25
- dayOfWeekAfter(fragment: string, day: string | number): string;
26
- dayOfWeekBefore(fragment: string, day: string | number): string;
27
- month(fragment: string, month: string | number): string;
28
- monthBefore(fragment: string, month: string | number): string;
29
- monthAfter(fragment: string, month: string | number): string;
30
- year(fragment: string, year: number): string;
31
- hour(fragment: string, hour: number): string;
32
- hourBefore(fragment: string, hour: number): string;
33
- hourAfter(fragment: string, hour: number): string;
34
- };
35
- dateBefore: (fragment: string, before: string | number | boolean | Date) => string;
36
- dateAfter: (fragment: string, after: string | number | boolean | Date) => string;
37
- dateBetween: (fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date) => string;
38
- dayOfMonth: (fragment: string, day: number) => string;
39
- dayOfMonthAfter: (fragment: string, day: number) => string;
40
- dayOfMonthBefore: (fragment: string, day: number) => string;
41
- dayOfWeek: (fragment: string, day: string | number) => string;
42
- dayOfWeekAfter: (fragment: string, day: string | number) => string;
43
- dayOfWeekBefore: (fragment: string, day: string | number) => string;
44
- month: (fragment: string, month: string | number) => string;
45
- monthBefore: (fragment: string, month: string | number) => string;
46
- monthAfter: (fragment: string, month: string | number) => string;
47
- year: (fragment: string, year: number) => string;
48
- hour: (fragment: string, hour: number) => string;
49
- hourBefore: (fragment: string, hour: number) => string;
50
- hourAfter: (fragment: string, hour: number) => string;
51
- number: {
52
- gt(fragment: string, value: number): string;
53
- lt(fragment: string, value: number): string;
54
- inRange(fragment: string, before: number, after: number): string;
55
- };
56
- gt: (fragment: string, value: number) => string;
57
- lt: (fragment: string, value: number) => string;
58
- inRange: (fragment: string, before: number, after: number) => string;
59
- near: (fragment: string, latitude: number, longitude: number, radius: number) => string;
60
- geopoint: {
61
- near(fragment: string, latitude: number, longitude: number, radius: number): string;
62
- };
63
- };
64
- predicates: {
65
- at(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
66
- not(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
67
- missing(fragment: string): string;
68
- has(fragment: string): string;
69
- any(fragment: string, values: (string | number | boolean | Date)[]): string;
70
- in(fragment: string, values: string[]): string;
71
- fulltext(fragment: string, value: string): string;
72
- similar(documentId: string, maxResults: number): string;
73
- date: {
74
- before(fragment: string, before: string | number | boolean | Date): string;
75
- after(fragment: string, after: string | number | boolean | Date): string;
76
- between(fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date): string;
77
- dayOfMonth(fragment: string, day: number): string;
78
- dayOfMonthAfter(fragment: string, day: number): string;
79
- dayOfMonthBefore(fragment: string, day: number): string;
80
- dayOfWeek(fragment: string, day: string | number): string;
81
- dayOfWeekAfter(fragment: string, day: string | number): string;
82
- dayOfWeekBefore(fragment: string, day: string | number): string;
83
- month(fragment: string, month: string | number): string;
84
- monthBefore(fragment: string, month: string | number): string;
85
- monthAfter(fragment: string, month: string | number): string;
86
- year(fragment: string, year: number): string;
87
- hour(fragment: string, hour: number): string;
88
- hourBefore(fragment: string, hour: number): string;
89
- hourAfter(fragment: string, hour: number): string;
90
- };
91
- dateBefore: (fragment: string, before: string | number | boolean | Date) => string;
92
- dateAfter: (fragment: string, after: string | number | boolean | Date) => string;
93
- dateBetween: (fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date) => string;
94
- dayOfMonth: (fragment: string, day: number) => string;
95
- dayOfMonthAfter: (fragment: string, day: number) => string;
96
- dayOfMonthBefore: (fragment: string, day: number) => string;
97
- dayOfWeek: (fragment: string, day: string | number) => string;
98
- dayOfWeekAfter: (fragment: string, day: string | number) => string;
99
- dayOfWeekBefore: (fragment: string, day: string | number) => string;
100
- month: (fragment: string, month: string | number) => string;
101
- monthBefore: (fragment: string, month: string | number) => string;
102
- monthAfter: (fragment: string, month: string | number) => string;
103
- year: (fragment: string, year: number) => string;
104
- hour: (fragment: string, hour: number) => string;
105
- hourBefore: (fragment: string, hour: number) => string;
106
- hourAfter: (fragment: string, hour: number) => string;
107
- number: {
108
- gt(fragment: string, value: number): string;
109
- lt(fragment: string, value: number): string;
110
- inRange(fragment: string, before: number, after: number): string;
111
- };
112
- gt: (fragment: string, value: number) => string;
113
- lt: (fragment: string, value: number) => string;
114
- inRange: (fragment: string, before: number, after: number) => string;
115
- near: (fragment: string, latitude: number, longitude: number, radius: number) => string;
116
- geopoint: {
117
- near(fragment: string, latitude: number, longitude: number, radius: number): string;
118
- };
119
- };
120
- Experiments: typeof Experiments;
121
- Api: typeof Api;
122
- client: typeof client;
123
- getApi: typeof getApi;
124
- api: typeof api;
125
- };
126
- export default _default;
127
- declare function client(url: string, options?: ApiOptions): DefaultClient;
128
- declare function getApi(url: string, options?: ApiOptions): Promise<ResolvedApi>;
129
- declare function api(url: string, options?: ApiOptions): Promise<ResolvedApi>;
1
+ import ResolvedApi from './ResolvedApi';
2
+ import { Experiments } from './experiments';
3
+ import Api, { ApiOptions } from './Api';
4
+ import { DefaultClient } from './client';
5
+ declare const _default: {
6
+ experimentCookie: string;
7
+ previewCookie: string;
8
+ Predicates: {
9
+ at(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
10
+ not(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
11
+ missing(fragment: string): string;
12
+ has(fragment: string): string;
13
+ any(fragment: string, values: (string | number | boolean | Date)[]): string;
14
+ in(fragment: string, values: string[]): string;
15
+ fulltext(fragment: string, value: string): string;
16
+ similar(documentId: string, maxResults: number): string;
17
+ date: {
18
+ before(fragment: string, before: string | number | boolean | Date): string;
19
+ after(fragment: string, after: string | number | boolean | Date): string;
20
+ between(fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date): string;
21
+ dayOfMonth(fragment: string, day: number): string;
22
+ dayOfMonthAfter(fragment: string, day: number): string;
23
+ dayOfMonthBefore(fragment: string, day: number): string;
24
+ dayOfWeek(fragment: string, day: string | number): string;
25
+ dayOfWeekAfter(fragment: string, day: string | number): string;
26
+ dayOfWeekBefore(fragment: string, day: string | number): string;
27
+ month(fragment: string, month: string | number): string;
28
+ monthBefore(fragment: string, month: string | number): string;
29
+ monthAfter(fragment: string, month: string | number): string;
30
+ year(fragment: string, year: number): string;
31
+ hour(fragment: string, hour: number): string;
32
+ hourBefore(fragment: string, hour: number): string;
33
+ hourAfter(fragment: string, hour: number): string;
34
+ };
35
+ dateBefore: (fragment: string, before: string | number | boolean | Date) => string;
36
+ dateAfter: (fragment: string, after: string | number | boolean | Date) => string;
37
+ dateBetween: (fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date) => string;
38
+ dayOfMonth: (fragment: string, day: number) => string;
39
+ dayOfMonthAfter: (fragment: string, day: number) => string;
40
+ dayOfMonthBefore: (fragment: string, day: number) => string;
41
+ dayOfWeek: (fragment: string, day: string | number) => string;
42
+ dayOfWeekAfter: (fragment: string, day: string | number) => string;
43
+ dayOfWeekBefore: (fragment: string, day: string | number) => string;
44
+ month: (fragment: string, month: string | number) => string;
45
+ monthBefore: (fragment: string, month: string | number) => string;
46
+ monthAfter: (fragment: string, month: string | number) => string;
47
+ year: (fragment: string, year: number) => string;
48
+ hour: (fragment: string, hour: number) => string;
49
+ hourBefore: (fragment: string, hour: number) => string;
50
+ hourAfter: (fragment: string, hour: number) => string;
51
+ number: {
52
+ gt(fragment: string, value: number): string;
53
+ lt(fragment: string, value: number): string;
54
+ inRange(fragment: string, before: number, after: number): string;
55
+ };
56
+ gt: (fragment: string, value: number) => string;
57
+ lt: (fragment: string, value: number) => string;
58
+ inRange: (fragment: string, before: number, after: number) => string;
59
+ near: (fragment: string, latitude: number, longitude: number, radius: number) => string;
60
+ geopoint: {
61
+ near(fragment: string, latitude: number, longitude: number, radius: number): string;
62
+ };
63
+ };
64
+ predicates: {
65
+ at(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
66
+ not(fragment: string, value: string | number | boolean | Date | (string | number | boolean | Date)[]): string;
67
+ missing(fragment: string): string;
68
+ has(fragment: string): string;
69
+ any(fragment: string, values: (string | number | boolean | Date)[]): string;
70
+ in(fragment: string, values: string[]): string;
71
+ fulltext(fragment: string, value: string): string;
72
+ similar(documentId: string, maxResults: number): string;
73
+ date: {
74
+ before(fragment: string, before: string | number | boolean | Date): string;
75
+ after(fragment: string, after: string | number | boolean | Date): string;
76
+ between(fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date): string;
77
+ dayOfMonth(fragment: string, day: number): string;
78
+ dayOfMonthAfter(fragment: string, day: number): string;
79
+ dayOfMonthBefore(fragment: string, day: number): string;
80
+ dayOfWeek(fragment: string, day: string | number): string;
81
+ dayOfWeekAfter(fragment: string, day: string | number): string;
82
+ dayOfWeekBefore(fragment: string, day: string | number): string;
83
+ month(fragment: string, month: string | number): string;
84
+ monthBefore(fragment: string, month: string | number): string;
85
+ monthAfter(fragment: string, month: string | number): string;
86
+ year(fragment: string, year: number): string;
87
+ hour(fragment: string, hour: number): string;
88
+ hourBefore(fragment: string, hour: number): string;
89
+ hourAfter(fragment: string, hour: number): string;
90
+ };
91
+ dateBefore: (fragment: string, before: string | number | boolean | Date) => string;
92
+ dateAfter: (fragment: string, after: string | number | boolean | Date) => string;
93
+ dateBetween: (fragment: string, before: string | number | boolean | Date, after: string | number | boolean | Date) => string;
94
+ dayOfMonth: (fragment: string, day: number) => string;
95
+ dayOfMonthAfter: (fragment: string, day: number) => string;
96
+ dayOfMonthBefore: (fragment: string, day: number) => string;
97
+ dayOfWeek: (fragment: string, day: string | number) => string;
98
+ dayOfWeekAfter: (fragment: string, day: string | number) => string;
99
+ dayOfWeekBefore: (fragment: string, day: string | number) => string;
100
+ month: (fragment: string, month: string | number) => string;
101
+ monthBefore: (fragment: string, month: string | number) => string;
102
+ monthAfter: (fragment: string, month: string | number) => string;
103
+ year: (fragment: string, year: number) => string;
104
+ hour: (fragment: string, hour: number) => string;
105
+ hourBefore: (fragment: string, hour: number) => string;
106
+ hourAfter: (fragment: string, hour: number) => string;
107
+ number: {
108
+ gt(fragment: string, value: number): string;
109
+ lt(fragment: string, value: number): string;
110
+ inRange(fragment: string, before: number, after: number): string;
111
+ };
112
+ gt: (fragment: string, value: number) => string;
113
+ lt: (fragment: string, value: number) => string;
114
+ inRange: (fragment: string, before: number, after: number) => string;
115
+ near: (fragment: string, latitude: number, longitude: number, radius: number) => string;
116
+ geopoint: {
117
+ near(fragment: string, latitude: number, longitude: number, radius: number): string;
118
+ };
119
+ };
120
+ Experiments: typeof Experiments;
121
+ Api: typeof Api;
122
+ client: typeof client;
123
+ getApi: typeof getApi;
124
+ api: typeof api;
125
+ };
126
+ export default _default;
127
+ declare function client(url: string, options?: ApiOptions): DefaultClient;
128
+ declare function getApi(url: string, options?: ApiOptions): Promise<ResolvedApi>;
129
+ declare function api(url: string, options?: ApiOptions): Promise<ResolvedApi>;
package/types/lru.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- /**
2
- * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most
3
- * recently used items while discarding least recently used items when its limit
4
- * is reached.
5
- *
6
- * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
7
- * Typescript-ified by Oleksandr Nikitin <https://tvori.info>
8
- *
9
- * Illustration of the design:
10
- *
11
- * entry entry entry entry
12
- * ______ ______ ______ ______
13
- * | head |.newer => | |.newer => | |.newer => | tail |
14
- * | A | | B | | C | | D |
15
- * |______| <= older.|______| <= older.|______| <= older.|______|
16
- *
17
- * removed <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- added
18
- */
19
- export declare function MakeLRUCache(limit: number): ILRUCache;
20
- export interface ILRUCache {
21
- put(key: string, value: any): void;
22
- get(key: string, Entry: boolean): any;
23
- remove(key: String): void;
24
- removeAll(): void;
25
- }
1
+ /**
2
+ * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most
3
+ * recently used items while discarding least recently used items when its limit
4
+ * is reached.
5
+ *
6
+ * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
7
+ * Typescript-ified by Oleksandr Nikitin <https://tvori.info>
8
+ *
9
+ * Illustration of the design:
10
+ *
11
+ * entry entry entry entry
12
+ * ______ ______ ______ ______
13
+ * | head |.newer => | |.newer => | |.newer => | tail |
14
+ * | A | | B | | C | | D |
15
+ * |______| <= older.|______| <= older.|______| <= older.|______|
16
+ *
17
+ * removed <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- <-- added
18
+ */
19
+ export declare function MakeLRUCache(limit: number): ILRUCache;
20
+ export interface ILRUCache {
21
+ put(key: string, value: any): void;
22
+ get(key: string, Entry: boolean): any;
23
+ remove(key: String): void;
24
+ removeAll(): void;
25
+ }
@@ -1,13 +1,13 @@
1
- export declare type RequestCallback<T> = (error: Error | null, result?: T | null, resp?: Response, ttl?: number) => void;
2
- export interface RequestHandlerOption {
3
- proxyAgent?: any;
4
- timeoutInMs?: number;
5
- }
6
- export interface RequestHandler {
7
- request<T>(url: string, cb: RequestCallback<T>): void;
8
- }
9
- export declare class DefaultRequestHandler implements RequestHandler {
10
- options: RequestHandlerOption;
11
- constructor(options?: RequestHandlerOption);
12
- request<T>(url: string, callback: RequestCallback<T>): void;
13
- }
1
+ export declare type RequestCallback<T> = (error: Error | null, result?: T | null, resp?: Response, ttl?: number) => void;
2
+ export interface RequestHandlerOption {
3
+ proxyAgent?: any;
4
+ timeoutInMs?: number;
5
+ }
6
+ export interface RequestHandler {
7
+ request<T>(url: string, cb: RequestCallback<T>): void;
8
+ }
9
+ export declare class DefaultRequestHandler implements RequestHandler {
10
+ options: RequestHandlerOption;
11
+ constructor(options?: RequestHandlerOption);
12
+ request<T>(url: string, callback: RequestCallback<T>): void;
13
+ }