@prismicio/client 6.4.1-alpha.0 → 6.4.2
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1369 -1369
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/client.ts +1 -1
- package/src/predicate.ts +9 -10
package/src/predicate.ts
CHANGED
|
@@ -91,11 +91,6 @@ const argsPredicate = <Args extends unknown[]>(name: string) => {
|
|
|
91
91
|
return fn;
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* The default arguments allowed by predicates.
|
|
96
|
-
*/
|
|
97
|
-
type DefaultPredicateArgs = [value: string | number | (string | number)[]];
|
|
98
|
-
|
|
99
94
|
export const predicate = {
|
|
100
95
|
/**
|
|
101
96
|
* The `at` predicate checks that the path matches the described value
|
|
@@ -103,7 +98,9 @@ export const predicate = {
|
|
|
103
98
|
*
|
|
104
99
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}
|
|
105
100
|
*/
|
|
106
|
-
at: pathWithArgsPredicate<
|
|
101
|
+
at: pathWithArgsPredicate<
|
|
102
|
+
[value: string | number | boolean | Date | string[]]
|
|
103
|
+
>("at"),
|
|
107
104
|
|
|
108
105
|
/**
|
|
109
106
|
* The `not` predicate checks that the path doesn't match the provided value
|
|
@@ -111,7 +108,7 @@ export const predicate = {
|
|
|
111
108
|
*
|
|
112
109
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}
|
|
113
110
|
*/
|
|
114
|
-
not: pathWithArgsPredicate<
|
|
111
|
+
not: pathWithArgsPredicate<[value: string | number | boolean | Date]>("not"),
|
|
115
112
|
|
|
116
113
|
/**
|
|
117
114
|
* The `any` predicate takes an array of values. It works exactly the same way
|
|
@@ -120,7 +117,9 @@ export const predicate = {
|
|
|
120
117
|
*
|
|
121
118
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}
|
|
122
119
|
*/
|
|
123
|
-
any: pathWithArgsPredicate<
|
|
120
|
+
any: pathWithArgsPredicate<[values: (string | number | boolean | Date)[]]>(
|
|
121
|
+
"any",
|
|
122
|
+
),
|
|
124
123
|
|
|
125
124
|
/**
|
|
126
125
|
* The `in` predicate is used specifically to retrieve an array of documents
|
|
@@ -129,7 +128,7 @@ export const predicate = {
|
|
|
129
128
|
*
|
|
130
129
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}
|
|
131
130
|
*/
|
|
132
|
-
in: pathWithArgsPredicate<
|
|
131
|
+
in: pathWithArgsPredicate<[values: string[]]>("in"),
|
|
133
132
|
|
|
134
133
|
/**
|
|
135
134
|
* The `fulltext` predicate provides two capabilities:
|
|
@@ -141,7 +140,7 @@ export const predicate = {
|
|
|
141
140
|
*
|
|
142
141
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}
|
|
143
142
|
*/
|
|
144
|
-
fulltext: pathWithArgsPredicate<
|
|
143
|
+
fulltext: pathWithArgsPredicate<[searchTerms: string]>("fulltext"),
|
|
145
144
|
|
|
146
145
|
/**
|
|
147
146
|
* The `has` predicate checks whether a fragment has a value. It will return
|