Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
59 lines
1.8 KiB
Plaintext
59 lines
1.8 KiB
Plaintext
import type { JoinQuery, PopulateType, SelectType, Where } from '../../types/index.js';
|
|
import type { JoinParams } from '../sanitizeJoinParams.js';
|
|
type RawParams = {
|
|
[key: string]: unknown;
|
|
autosave?: string;
|
|
data?: string;
|
|
depth?: string;
|
|
draft?: string;
|
|
field?: string;
|
|
flattenLocales?: string;
|
|
joins?: JoinParams;
|
|
limit?: string;
|
|
overrideLock?: string;
|
|
page?: string;
|
|
pagination?: string;
|
|
populate?: unknown;
|
|
publishAllLocales?: string;
|
|
publishSpecificLocale?: string;
|
|
select?: unknown;
|
|
selectedLocales?: string;
|
|
sort?: string | string[];
|
|
trash?: string;
|
|
unpublishAllLocales?: string;
|
|
where?: Where;
|
|
};
|
|
type ParsedParams = {
|
|
autosave?: boolean;
|
|
data?: Record<string, unknown>;
|
|
depth?: number;
|
|
draft?: boolean;
|
|
field?: string;
|
|
flattenLocales?: boolean;
|
|
joins?: JoinQuery;
|
|
limit?: number;
|
|
overrideLock?: boolean;
|
|
page?: number;
|
|
pagination?: boolean;
|
|
populate?: PopulateType;
|
|
publishAllLocales?: boolean;
|
|
publishSpecificLocale?: string;
|
|
select?: SelectType;
|
|
selectedLocales?: string[];
|
|
sort?: string[];
|
|
trash?: boolean;
|
|
unpublishAllLocales?: boolean;
|
|
where?: Where;
|
|
} & Record<string, unknown>;
|
|
export declare const booleanParams: string[];
|
|
export declare const numberParams: string[];
|
|
/**
|
|
* Takes raw query parameters and parses them into the correct types that Payload expects.
|
|
* Examples:
|
|
* a. `draft` provided as a string of "true" is converted to a boolean
|
|
* b. `depth` provided as a string of "0" is converted to a number
|
|
* c. `sort` provided as a comma-separated string or array is converted to an array of strings
|
|
*/
|
|
export declare const parseParams: (params: RawParams) => ParsedParams;
|
|
export {};
|
|
//# sourceMappingURL=index.d.ts.map |