@ts-ghost/core-api
Version:
TypeScript utilities to build type-safe queries and fetchers for the Ghost API based on Zod schemas.
1,455 lines (1,449 loc) • 114 kB
text/typescript
import { z, ZodRawShape, ZodTypeAny } from 'zod';
declare const baseAuthorsSchema: z.ZodObject<{
name: z.ZodString;
profile_image: z.ZodNullable<z.ZodString>;
cover_image: z.ZodNullable<z.ZodString>;
bio: z.ZodNullable<z.ZodString>;
website: z.ZodNullable<z.ZodString>;
location: z.ZodNullable<z.ZodString>;
facebook: z.ZodNullable<z.ZodString>;
twitter: z.ZodNullable<z.ZodString>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}>;
declare const basePagesSchema: z.ZodObject<{
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"members">, z.ZodLiteral<"none">, z.ZodLiteral<"internal">, z.ZodLiteral<"paid">, z.ZodLiteral<"tiers">]>;
custom_template: z.ZodNullable<z.ZodString>;
canonical_url: z.ZodNullable<z.ZodString>;
authors: z.ZodOptional<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
name: z.ZodString;
profile_image: z.ZodNullable<z.ZodString>;
cover_image: z.ZodNullable<z.ZodString>;
bio: z.ZodNullable<z.ZodString>;
website: z.ZodNullable<z.ZodString>;
location: z.ZodNullable<z.ZodString>;
facebook: z.ZodNullable<z.ZodString>;
twitter: z.ZodNullable<z.ZodString>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, {
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}>, "strip", z.ZodTypeAny, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}>, "many">>;
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodNullable<z.ZodString>;
feature_image: z.ZodNullable<z.ZodString>;
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"members">, z.ZodLiteral<"none">, z.ZodLiteral<"internal">, z.ZodLiteral<"paid">, z.ZodLiteral<"tiers">]>;
canonical_url: z.ZodNullable<z.ZodString>;
accent_color: z.ZodNullable<z.ZodString>;
url: z.ZodString;
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}>, "many">>;
primary_author: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
name: z.ZodString;
profile_image: z.ZodNullable<z.ZodString>;
cover_image: z.ZodNullable<z.ZodString>;
bio: z.ZodNullable<z.ZodString>;
website: z.ZodNullable<z.ZodString>;
location: z.ZodNullable<z.ZodString>;
facebook: z.ZodNullable<z.ZodString>;
twitter: z.ZodNullable<z.ZodString>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, {
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}>, "strip", z.ZodTypeAny, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}>>>;
primary_tag: z.ZodOptional<z.ZodNullable<z.ZodObject<{
name: z.ZodString;
description: z.ZodNullable<z.ZodString>;
feature_image: z.ZodNullable<z.ZodString>;
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"members">, z.ZodLiteral<"none">, z.ZodLiteral<"internal">, z.ZodLiteral<"paid">, z.ZodLiteral<"tiers">]>;
canonical_url: z.ZodNullable<z.ZodString>;
accent_color: z.ZodNullable<z.ZodString>;
url: z.ZodString;
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}>>>;
url: z.ZodString;
excerpt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
reading_time: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
created_at: z.ZodString;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
published_at: z.ZodNullable<z.ZodString>;
email_subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
is_page: z.ZodDefault<z.ZodBoolean>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
title: z.ZodString;
html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
plaintext: z.ZodOptional<z.ZodNullable<z.ZodString>>;
comment_id: z.ZodNullable<z.ZodString>;
feature_image: z.ZodNullable<z.ZodString>;
feature_image_alt: z.ZodNullable<z.ZodString>;
feature_image_caption: z.ZodNullable<z.ZodString>;
featured: z.ZodBoolean;
custom_excerpt: z.ZodNullable<z.ZodString>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
id: string;
slug: string;
custom_excerpt: string | null;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
created_at: string;
title: string;
comment_id: string | null;
feature_image_alt: string | null;
feature_image_caption: string | null;
featured: boolean;
custom_template: string | null;
reading_time: number;
published_at: string | null;
is_page: boolean;
authors?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}[] | undefined;
tags?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}[] | undefined;
excerpt?: string | null | undefined;
updated_at?: string | null | undefined;
html?: string | null | undefined;
plaintext?: string | null | undefined;
primary_author?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
} | null | undefined;
primary_tag?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
} | null | undefined;
email_subject?: string | null | undefined;
}, {
url: string;
id: string;
slug: string;
custom_excerpt: string | null;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
created_at: string;
title: string;
comment_id: string | null;
feature_image_alt: string | null;
feature_image_caption: string | null;
featured: boolean;
custom_template: string | null;
published_at: string | null;
authors?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}[] | undefined;
tags?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}[] | undefined;
excerpt?: string | null | undefined;
updated_at?: string | null | undefined;
html?: string | null | undefined;
plaintext?: string | null | undefined;
primary_author?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
} | null | undefined;
primary_tag?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
} | null | undefined;
reading_time?: number | undefined;
email_subject?: string | null | undefined;
is_page?: boolean | undefined;
}>;
declare const basePostsSchema: z.ZodObject<{
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"members">, z.ZodLiteral<"none">, z.ZodLiteral<"internal">, z.ZodLiteral<"paid">, z.ZodLiteral<"tiers">]>;
custom_template: z.ZodNullable<z.ZodString>;
canonical_url: z.ZodNullable<z.ZodString>;
authors: z.ZodOptional<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
name: z.ZodString;
profile_image: z.ZodNullable<z.ZodString>;
cover_image: z.ZodNullable<z.ZodString>;
bio: z.ZodNullable<z.ZodString>;
website: z.ZodNullable<z.ZodString>;
location: z.ZodNullable<z.ZodString>;
facebook: z.ZodNullable<z.ZodString>;
twitter: z.ZodNullable<z.ZodString>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, {
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}>, "strip", z.ZodTypeAny, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}>, "many">>;
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
description: z.ZodNullable<z.ZodString>;
feature_image: z.ZodNullable<z.ZodString>;
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"members">, z.ZodLiteral<"none">, z.ZodLiteral<"internal">, z.ZodLiteral<"paid">, z.ZodLiteral<"tiers">]>;
canonical_url: z.ZodNullable<z.ZodString>;
accent_color: z.ZodNullable<z.ZodString>;
url: z.ZodString;
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}>, "many">>;
primary_author: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
name: z.ZodString;
profile_image: z.ZodNullable<z.ZodString>;
cover_image: z.ZodNullable<z.ZodString>;
bio: z.ZodNullable<z.ZodString>;
website: z.ZodNullable<z.ZodString>;
location: z.ZodNullable<z.ZodString>;
facebook: z.ZodNullable<z.ZodString>;
twitter: z.ZodNullable<z.ZodString>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, {
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}>, "strip", z.ZodTypeAny, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}, {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}>>>;
primary_tag: z.ZodOptional<z.ZodNullable<z.ZodObject<{
name: z.ZodString;
description: z.ZodNullable<z.ZodString>;
feature_image: z.ZodNullable<z.ZodString>;
visibility: z.ZodUnion<[z.ZodLiteral<"public">, z.ZodLiteral<"members">, z.ZodLiteral<"none">, z.ZodLiteral<"internal">, z.ZodLiteral<"paid">, z.ZodLiteral<"tiers">]>;
canonical_url: z.ZodNullable<z.ZodString>;
accent_color: z.ZodNullable<z.ZodString>;
url: z.ZodString;
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
count: z.ZodOptional<z.ZodObject<{
posts: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
posts: number;
}, {
posts: number;
}>>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}, {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}>>>;
url: z.ZodString;
excerpt: z.ZodNullable<z.ZodString>;
reading_time: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
created_at: z.ZodString;
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
published_at: z.ZodNullable<z.ZodString>;
email_subject: z.ZodOptional<z.ZodNullable<z.ZodString>>;
is_page: z.ZodDefault<z.ZodBoolean>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
title: z.ZodString;
html: z.ZodOptional<z.ZodNullable<z.ZodString>>;
plaintext: z.ZodOptional<z.ZodNullable<z.ZodString>>;
comment_id: z.ZodNullable<z.ZodString>;
feature_image: z.ZodNullable<z.ZodString>;
feature_image_alt: z.ZodNullable<z.ZodString>;
feature_image_caption: z.ZodNullable<z.ZodString>;
featured: z.ZodBoolean;
custom_excerpt: z.ZodNullable<z.ZodString>;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
id: string;
slug: string;
excerpt: string | null;
custom_excerpt: string | null;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
created_at: string;
title: string;
comment_id: string | null;
feature_image_alt: string | null;
feature_image_caption: string | null;
featured: boolean;
custom_template: string | null;
reading_time: number;
published_at: string | null;
is_page: boolean;
authors?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}[] | undefined;
tags?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}[] | undefined;
updated_at?: string | null | undefined;
html?: string | null | undefined;
plaintext?: string | null | undefined;
primary_author?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
} | null | undefined;
primary_tag?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
} | null | undefined;
email_subject?: string | null | undefined;
}, {
url: string;
id: string;
slug: string;
excerpt: string | null;
custom_excerpt: string | null;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
created_at: string;
title: string;
comment_id: string | null;
feature_image_alt: string | null;
feature_image_caption: string | null;
featured: boolean;
custom_template: string | null;
published_at: string | null;
authors?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
}[] | undefined;
tags?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
}[] | undefined;
updated_at?: string | null | undefined;
html?: string | null | undefined;
plaintext?: string | null | undefined;
primary_author?: {
id: string;
slug: string;
meta_title: string | null;
meta_description: string | null;
name: string;
profile_image: string | null;
cover_image: string | null;
bio: string | null;
website: string | null;
location: string | null;
facebook: string | null;
twitter: string | null;
url?: string | null | undefined;
count?: {
posts: number;
} | undefined;
} | null | undefined;
primary_tag?: {
url: string;
id: string;
slug: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
name: string;
description: string | null;
feature_image: string | null;
visibility: "tiers" | "members" | "public" | "none" | "internal" | "paid";
canonical_url: string | null;
accent_color: string | null;
count?: {
posts: number;
} | undefined;
created_at?: string | null | undefined;
updated_at?: string | null | undefined;
} | null | undefined;
reading_time?: number | undefined;
email_subject?: string | null | undefined;
is_page?: boolean | undefined;
}>;
declare const baseSettingsSchema: z.ZodObject<{
title: z.ZodString;
description: z.ZodString;
logo: z.ZodNullable<z.ZodString>;
icon: z.ZodNullable<z.ZodString>;
accent_color: z.ZodNullable<z.ZodString>;
cover_image: z.ZodNullable<z.ZodString>;
facebook: z.ZodNullable<z.ZodString>;
twitter: z.ZodNullable<z.ZodString>;
lang: z.ZodString;
timezone: z.ZodString;
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
navigation: z.ZodArray<z.ZodObject<{
label: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
label: string;
}, {
url: string;
label: string;
}>, "many">;
secondary_navigation: z.ZodArray<z.ZodObject<{
label: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
label: string;
}, {
url: string;
label: string;
}>, "many">;
meta_title: z.ZodNullable<z.ZodString>;
meta_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
members_support_address: z.ZodString;
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
url: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
cover_image: string | null;
facebook: string | null;
twitter: string | null;
description: string;
accent_color: string | null;
title: string;
logo: string | null;
icon: string | null;
lang: string;
timezone: string;
navigation: {
url: string;
label: string;
}[];
secondary_navigation: {
url: string;
label: string;
}[];
members_support_address: string;
}, {
url: string;
codeinjection_head: string | null;
codeinjection_foot: string | null;
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
meta_title: string | null;
meta_description: string | null;
cover_image: string | null;
facebook: string | null;
twitter: string | null;
description: string;
accent_color: string | null;
title: string;
logo: string | null;
icon: string | null;
lang: string;
timezone: string;
navigation: {
url: string;
label: string;
}[];
secondary_navigation: {
url: string;
label: string;
}[];
members_support_address: string;
}>;
type HTTPClientOptions = {
key: string;
version: APICredentials["version"];
url: APICredentials["url"];
endpoint: "content" | "admin";
};
interface IHTTPClient {
get baseURL(): URL | undefined;
get jwt(): string | undefined;
generateJWT(key: string): Promise<string>;
genHeaders(): Promise<Record<string, string>>;
fetch({ resource, searchParams, options, pathnameIdentity, }: {
resource: APIResource;
searchParams?: URLSearchParams;
options?: RequestInit;
pathnameIdentity?: string;
}): Promise<any>;
fetchRawResponse({ resource, searchParams, options, pathnameIdentity, }: {
resource: APIResource;
searchParams?: URLSearchParams;
options?: RequestInit;
pathnameIdentity?: string;
}): Promise<Response>;
}
interface IHTTPClientFactory {
create(config: HTTPClientOptions): HTTPClient;
}
declare class HTTPClientFactory implements IHTTPClientFactory {
private config;
constructor(config: HTTPClientOptions);
create(): HTTPClient<HTTPClientOptions>;
}
declare class HTTPClient<const Options extends HTTPClientOptions = any> implements IHTTPClient {
protected config: Options;
private _jwt;
private _jwtExpiresAt;
protected _baseURL: URL | undefined;
constructor(config: Options);
get baseURL(): URL | undefined;
get jwt(): string | undefined;
generateJWT(key: string): Promise<string>;
genHeaders(): Promise<Record<string, string>>;
fetch({ resource, searchParams, options, pathnameIdentity, }: {
resource: APIResource;
searchParams?: URLSearchParams;
options?: RequestInit;
pathnameIdentity?: string;
}): Promise<any>;
fetchRawResponse({ resource, searchParams, options, pathnameIdentity, }: {
resource: APIResource;
searchParams?: URLSearchParams;
options?: RequestInit;
pathnameIdentity?: string;
}): Promise<Response>;
}
declare const ghostIdentitySchema: z.ZodObject<{
slug: z.ZodString;
id: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
slug: string;
}, {
id: string;
slug: string;
}>;
declare const ghostIdentityInputSchema: z.ZodObject<{
slug: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
email: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
slug?: string | undefined;
email?: string | undefined;
}, {
id?: string | undefined;
slug?: string | undefined;
email?: string | undefined;
}>;
type GhostIdentityInput = z.infer<typeof ghostIdentityInputSchema>;
type GhostIdentity = z.infer<typeof ghostIdentitySchema>;
declare const ghostMetaSchema: z.ZodObject<{
pagination: z.ZodObject<{
pages: z.ZodNumber;
page: z.ZodNumber;
limit: z.ZodUnion<[z.ZodNumber, z.ZodLiteral<"all">]>;
total: z.ZodNumber;
prev: z.ZodNullable<z.ZodNumber>;
next: z.ZodNullable<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
pages: number;
page: number;
limit: number | "all";
total: number;
prev: number | null;
next: number | null;
}, {
pages: number;
page: number;
limit: number | "all";
total: number;
prev: number | null;
next: number | null;
}>;
}, "strip", z.ZodTypeAny, {
pagination: {
pages: number;
page: number;
limit: number | "all";
total: number;
prev: number | null;
next: number | null;
};
}, {
pagination: {
pages: number;
page: number;
limit: number | "all";
total: number;
prev: number | null;
next: number | null;
};
}>;
type GhostMeta = z.infer<typeof ghostMetaSchema>;
declare const ghostExcerptSchema: z.ZodObject<{
excerpt: z.ZodOptional<z.ZodString>;
custom_excerpt: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
excerpt?: string | undefined;
custom_excerpt?: string | undefined;
}, {
excerpt?: string | undefined;
custom_excerpt?: string | undefined;
}>;
declare const ghostCodeInjectionSchema: z.ZodObject<{
codeinjection_head: z.ZodNullable<z.ZodString>;
codeinjection_foot: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
codeinjection_head: string | null;
codeinjection_foot: string | null;
}, {
codeinjection_head: string | null;
codeinjection_foot: string | null;
}>;
declare const ghostFacebookSchema: z.ZodObject<{
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
og_image: string | null;
og_title: string | null;
og_description: string | null;
}, {
og_image: string | null;
og_title: string | null;
og_description: string | null;
}>;
declare const ghostTwitterSchema: z.ZodObject<{
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
}, {
twitter_image: string | null;
twitter_title: string | null;
twitter_description: string | null;
}>;
declare const ghostSocialMediaSchema: z.ZodObject<{
twitter_image: z.ZodNullable<z.ZodString>;
twitter_title: z.ZodNullable<z.ZodString>;
twitter_description: z.ZodNullable<z.ZodString>;
og_image: z.ZodNullable<z.ZodString>;
og_title: z.ZodNullable<z.ZodString>;
og_description: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
og_image: string | null;
og_title: string | null;
og_description: string | null;
twitter_image: string | null;
twitter_title: stri