@prismicio/client 6.4.1-alpha.1 → 6.4.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +23 -23
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
- package/src/client.ts +21 -11
- package/src/predicate.ts +9 -10
package/dist/index.d.ts
CHANGED
|
@@ -600,7 +600,7 @@ declare class Client {
|
|
|
600
600
|
*
|
|
601
601
|
* @returns A list of documents with IDs matching the `ids` parameter.
|
|
602
602
|
*/
|
|
603
|
-
getAllByIDs<TDocument extends prismicT.PrismicDocument>(ids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument[]>;
|
|
603
|
+
getAllByIDs<TDocument extends prismicT.PrismicDocument>(ids: string[], params?: Partial<BuildQueryURLArgs> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
604
604
|
/**
|
|
605
605
|
* Queries a document from the Prismic repository with a specific UID and Custom Type.
|
|
606
606
|
*
|
|
@@ -673,7 +673,7 @@ declare class Client {
|
|
|
673
673
|
*
|
|
674
674
|
* @returns A list of documents with UIDs matching the `uids` parameter.
|
|
675
675
|
*/
|
|
676
|
-
getAllByUIDs<TDocument extends prismicT.PrismicDocument>(documentType: string, uids: string[], params?: Partial<BuildQueryURLArgs> & FetchParams): Promise<TDocument[]>;
|
|
676
|
+
getAllByUIDs<TDocument extends prismicT.PrismicDocument>(documentType: string, uids: string[], params?: Partial<BuildQueryURLArgs> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
677
677
|
/**
|
|
678
678
|
* Queries a singleton document from the Prismic repository for a specific Custom Type.
|
|
679
679
|
*
|
|
@@ -731,7 +731,7 @@ declare class Client {
|
|
|
731
731
|
*
|
|
732
732
|
* @returns A list of all documents of the Custom Type.
|
|
733
733
|
*/
|
|
734
|
-
getAllByType<TDocument extends prismicT.PrismicDocument>(documentType: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & FetchParams): Promise<TDocument[]>;
|
|
734
|
+
getAllByType<TDocument extends prismicT.PrismicDocument>(documentType: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
735
735
|
/**
|
|
736
736
|
* Queries documents from the Prismic repository with a specific tag.
|
|
737
737
|
*
|
|
@@ -767,7 +767,7 @@ declare class Client {
|
|
|
767
767
|
*
|
|
768
768
|
* @returns A list of all documents with the tag.
|
|
769
769
|
*/
|
|
770
|
-
getAllByTag<TDocument extends prismicT.PrismicDocument>(tag: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & FetchParams): Promise<TDocument[]>;
|
|
770
|
+
getAllByTag<TDocument extends prismicT.PrismicDocument>(tag: string, params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
771
771
|
/**
|
|
772
772
|
* Queries documents from the Prismic repository with specific tags. A
|
|
773
773
|
* document must be tagged with all of the queried tags to be included.
|
|
@@ -803,7 +803,7 @@ declare class Client {
|
|
|
803
803
|
*
|
|
804
804
|
* @returns A list of all documents with the tags.
|
|
805
805
|
*/
|
|
806
|
-
getAllByEveryTag<TDocument extends prismicT.PrismicDocument>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & FetchParams): Promise<TDocument[]>;
|
|
806
|
+
getAllByEveryTag<TDocument extends prismicT.PrismicDocument>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
807
807
|
/**
|
|
808
808
|
* Queries documents from the Prismic repository with specific tags. A
|
|
809
809
|
* document must be tagged with at least one of the queried tags to be included.
|
|
@@ -839,7 +839,7 @@ declare class Client {
|
|
|
839
839
|
*
|
|
840
840
|
* @returns A list of all documents with at least one of the tags.
|
|
841
841
|
*/
|
|
842
|
-
getAllBySomeTags<TDocument extends prismicT.PrismicDocument>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & FetchParams): Promise<TDocument[]>;
|
|
842
|
+
getAllBySomeTags<TDocument extends prismicT.PrismicDocument>(tags: string[], params?: Partial<Omit<BuildQueryURLArgs, "page">> & GetAllParams & FetchParams): Promise<TDocument[]>;
|
|
843
843
|
/**
|
|
844
844
|
* Returns metadata about the Prismic repository, such as its refs, releases,
|
|
845
845
|
* and custom types.
|
|
@@ -963,7 +963,7 @@ declare class Client {
|
|
|
963
963
|
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
964
964
|
* ```
|
|
965
965
|
*
|
|
966
|
-
* @param
|
|
966
|
+
* @param releaseID - The ID of the Release.
|
|
967
967
|
*/
|
|
968
968
|
queryContentFromReleaseByID(releaseID: string): void;
|
|
969
969
|
/**
|
|
@@ -979,7 +979,7 @@ declare class Client {
|
|
|
979
979
|
* const document = await client.getByID("WW4bKScAAMAqmluX");
|
|
980
980
|
* ```
|
|
981
981
|
*
|
|
982
|
-
* @param
|
|
982
|
+
* @param releaseLabel - The label of the Release.
|
|
983
983
|
*/
|
|
984
984
|
queryContentFromReleaseByLabel(releaseLabel: string): void;
|
|
985
985
|
/**
|
|
@@ -1090,14 +1090,14 @@ declare const predicate: {
|
|
|
1090
1090
|
*
|
|
1091
1091
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#at}
|
|
1092
1092
|
*/
|
|
1093
|
-
at: (path: string, value: string | number |
|
|
1093
|
+
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1094
1094
|
/**
|
|
1095
1095
|
* The `not` predicate checks that the path doesn't match the provided value
|
|
1096
1096
|
* exactly. It takes a single value as the argument.
|
|
1097
1097
|
*
|
|
1098
1098
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#not}
|
|
1099
1099
|
*/
|
|
1100
|
-
not: (path: string, value: string | number |
|
|
1100
|
+
not: (path: string, value: string | number | boolean | Date) => string;
|
|
1101
1101
|
/**
|
|
1102
1102
|
* The `any` predicate takes an array of values. It works exactly the same way
|
|
1103
1103
|
* as the `at` operator, but checks whether the fragment matches any of the
|
|
@@ -1105,7 +1105,7 @@ declare const predicate: {
|
|
|
1105
1105
|
*
|
|
1106
1106
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#any}
|
|
1107
1107
|
*/
|
|
1108
|
-
any: (path: string,
|
|
1108
|
+
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
1109
1109
|
/**
|
|
1110
1110
|
* The `in` predicate is used specifically to retrieve an array of documents
|
|
1111
1111
|
* by their IDs or UIDs. This predicate is much more efficient at this than
|
|
@@ -1113,7 +1113,7 @@ declare const predicate: {
|
|
|
1113
1113
|
*
|
|
1114
1114
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#in}
|
|
1115
1115
|
*/
|
|
1116
|
-
in: (path: string,
|
|
1116
|
+
in: (path: string, values: string[]) => string;
|
|
1117
1117
|
/**
|
|
1118
1118
|
* The `fulltext` predicate provides two capabilities:
|
|
1119
1119
|
*
|
|
@@ -1124,7 +1124,7 @@ declare const predicate: {
|
|
|
1124
1124
|
*
|
|
1125
1125
|
* {@link https://prismic.io/docs/technologies/query-predicates-reference-rest-api#fulltext}
|
|
1126
1126
|
*/
|
|
1127
|
-
fulltext: (path: string,
|
|
1127
|
+
fulltext: (path: string, searchTerms: string) => string;
|
|
1128
1128
|
/**
|
|
1129
1129
|
* The `has` predicate checks whether a fragment has a value. It will return
|
|
1130
1130
|
* all the documents of the specified type that contain a value for the
|
|
@@ -1344,11 +1344,11 @@ declare const getEndpoint: <RepositoryName extends string>(repositoryName: Repos
|
|
|
1344
1344
|
* @deprecated Renamed to `predicate` (without an "s").
|
|
1345
1345
|
*/
|
|
1346
1346
|
declare const predicates: {
|
|
1347
|
-
at: (path: string, value: string | number |
|
|
1348
|
-
not: (path: string, value: string | number |
|
|
1349
|
-
any: (path: string,
|
|
1350
|
-
in: (path: string,
|
|
1351
|
-
fulltext: (path: string,
|
|
1347
|
+
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1348
|
+
not: (path: string, value: string | number | boolean | Date) => string;
|
|
1349
|
+
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
1350
|
+
in: (path: string, values: string[]) => string;
|
|
1351
|
+
fulltext: (path: string, searchTerms: string) => string;
|
|
1352
1352
|
has: (path: string) => string;
|
|
1353
1353
|
missing: (path: string) => string;
|
|
1354
1354
|
similar: (id: string, value: number) => string;
|
|
@@ -1377,11 +1377,11 @@ declare const predicates: {
|
|
|
1377
1377
|
* @deprecated Renamed to `predicate` (lowercase and without an "s").
|
|
1378
1378
|
*/
|
|
1379
1379
|
declare const Predicates: {
|
|
1380
|
-
at: (path: string, value: string | number |
|
|
1381
|
-
not: (path: string, value: string | number |
|
|
1382
|
-
any: (path: string,
|
|
1383
|
-
in: (path: string,
|
|
1384
|
-
fulltext: (path: string,
|
|
1380
|
+
at: (path: string, value: string | number | boolean | Date | string[]) => string;
|
|
1381
|
+
not: (path: string, value: string | number | boolean | Date) => string;
|
|
1382
|
+
any: (path: string, values: (string | number | boolean | Date)[]) => string;
|
|
1383
|
+
in: (path: string, values: string[]) => string;
|
|
1384
|
+
fulltext: (path: string, searchTerms: string) => string;
|
|
1385
1385
|
has: (path: string) => string;
|
|
1386
1386
|
missing: (path: string) => string;
|
|
1387
1387
|
similar: (id: string, value: number) => string;
|
package/dist/index.js
CHANGED
|
@@ -291,7 +291,7 @@ class Client {
|
|
|
291
291
|
const { limit = Infinity, ...actualParams } = params;
|
|
292
292
|
const resolvedParams = {
|
|
293
293
|
...actualParams,
|
|
294
|
-
pageSize: actualParams.pageSize || ((_a = this.defaultParams) == null ? void 0 : _a.pageSize) || MAX_PAGE_SIZE
|
|
294
|
+
pageSize: Math.min(limit, actualParams.pageSize || ((_a = this.defaultParams) == null ? void 0 : _a.pageSize) || MAX_PAGE_SIZE)
|
|
295
295
|
};
|
|
296
296
|
const documents = [];
|
|
297
297
|
let latestResult;
|