feat(apiclient): Add native Admin & Content API clients, JWT generator, and tag visibility features; remove external @tryghost deps and update docs
This commit is contained in:
66
ts/apiclient/ghost.types.ts
Normal file
66
ts/apiclient/ghost.types.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Shared types for Ghost API clients
|
||||
*/
|
||||
|
||||
export interface IGhostAPIResponse<T> {
|
||||
[key: string]: T | T[] | IGhostMeta;
|
||||
meta?: IGhostMeta;
|
||||
}
|
||||
|
||||
export interface IGhostMeta {
|
||||
pagination?: {
|
||||
page: number;
|
||||
limit: number;
|
||||
pages: number;
|
||||
total: number;
|
||||
next: number | null;
|
||||
prev: number | null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IGhostError {
|
||||
type: string;
|
||||
message: string;
|
||||
context?: string;
|
||||
property?: string;
|
||||
help?: string;
|
||||
code?: string;
|
||||
id?: string;
|
||||
ghostErrorCode?: string;
|
||||
}
|
||||
|
||||
export interface IGhostErrorResponse {
|
||||
errors: IGhostError[];
|
||||
}
|
||||
|
||||
export type THttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
||||
|
||||
export interface IRequestOptions {
|
||||
method?: THttpMethod;
|
||||
headers?: Record<string, string>;
|
||||
body?: string;
|
||||
signal?: AbortSignal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query parameters for browse operations
|
||||
*/
|
||||
export interface IBrowseOptions {
|
||||
limit?: number;
|
||||
page?: number;
|
||||
filter?: string;
|
||||
include?: string;
|
||||
fields?: string;
|
||||
order?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options for read operations (by ID, slug, or email)
|
||||
*/
|
||||
export interface IReadOptions {
|
||||
id?: string;
|
||||
slug?: string;
|
||||
email?: string;
|
||||
include?: string;
|
||||
fields?: string;
|
||||
}
|
Reference in New Issue
Block a user