Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(prettier): πŸ€– ✨ #103

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
237 changes: 148 additions & 89 deletions nextjs-app/sanity.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@ export type Page = {
slug: Slug;
heading: string;
subheading?: string;
pageBuilder?: Array<{
_key: string;
} & CallToAction | {
_key: string;
} & InfoSection>;
pageBuilder?: Array<
| ({
_key: string;
} & CallToAction)
| ({
_key: string;
} & InfoSection)
>;
};

export type Post = {
Expand Down Expand Up @@ -350,17 +353,21 @@ export type SanityAssistInstructionTask = {

export type SanityAssistTaskStatus = {
_type: "sanity.assist.task.status";
tasks?: Array<{
_key: string;
} & SanityAssistInstructionTask>;
tasks?: Array<
{
_key: string;
} & SanityAssistInstructionTask
>;
};

export type SanityAssistSchemaTypeAnnotations = {
_type: "sanity.assist.schemaType.annotations";
title?: string;
fields?: Array<{
_key: string;
} & SanityAssistSchemaTypeField>;
fields?: Array<
{
_key: string;
} & SanityAssistSchemaTypeField
>;
};

export type SanityAssistOutputType = {
Expand Down Expand Up @@ -413,18 +420,23 @@ export type SanityAssistInstructionUserInput = {
};

export type SanityAssistInstructionPrompt = Array<{
children?: Array<{
marks?: Array<string>;
text?: string;
_type: "span";
_key: string;
} | {
_key: string;
} & SanityAssistInstructionFieldRef | {
_key: string;
} & SanityAssistInstructionContext | {
_key: string;
} & SanityAssistInstructionUserInput>;
children?: Array<
| {
marks?: Array<string>;
text?: string;
_type: "span";
_key: string;
}
| ({
_key: string;
} & SanityAssistInstructionFieldRef)
| ({
_key: string;
} & SanityAssistInstructionContext)
| ({
_key: string;
} & SanityAssistInstructionUserInput)
>;
style?: "normal";
listItem?: never;
markDefs?: null;
Expand All @@ -445,22 +457,58 @@ export type SanityAssistInstruction = {
title?: string;
userId?: string;
createdById?: string;
output?: Array<{
_key: string;
} & SanityAssistOutputField | {
_key: string;
} & SanityAssistOutputType>;
output?: Array<
| ({
_key: string;
} & SanityAssistOutputField)
| ({
_key: string;
} & SanityAssistOutputType)
>;
};

export type SanityAssistSchemaTypeField = {
_type: "sanity.assist.schemaType.field";
path?: string;
instructions?: Array<{
_key: string;
} & SanityAssistInstruction>;
instructions?: Array<
{
_key: string;
} & SanityAssistInstruction
>;
};

export type AllSanitySchemaTypes = SanityImagePaletteSwatch | SanityImagePalette | SanityImageDimensions | SanityFileAsset | Geopoint | CallToAction | Link | InfoSection | BlockContent | Page | Post | Person | Slug | Settings | SanityImageCrop | SanityImageHotspot | SanityImageAsset | SanityAssetSourceData | SanityImageMetadata | SanityAssistInstructionTask | SanityAssistTaskStatus | SanityAssistSchemaTypeAnnotations | SanityAssistOutputType | SanityAssistOutputField | SanityAssistInstructionContext | AssistInstructionContext | SanityAssistInstructionUserInput | SanityAssistInstructionPrompt | SanityAssistInstructionFieldRef | SanityAssistInstruction | SanityAssistSchemaTypeField;
export type AllSanitySchemaTypes =
| SanityImagePaletteSwatch
| SanityImagePalette
| SanityImageDimensions
| SanityFileAsset
| Geopoint
| CallToAction
| Link
| InfoSection
| BlockContent
| Page
| Post
| Person
| Slug
| Settings
| SanityImageCrop
| SanityImageHotspot
| SanityImageAsset
| SanityAssetSourceData
| SanityImageMetadata
| SanityAssistInstructionTask
| SanityAssistTaskStatus
| SanityAssistSchemaTypeAnnotations
| SanityAssistOutputType
| SanityAssistOutputField
| SanityAssistInstructionContext
| AssistInstructionContext
| SanityAssistInstructionUserInput
| SanityAssistInstructionPrompt
| SanityAssistInstructionFieldRef
| SanityAssistInstruction
| SanityAssistSchemaTypeField;
export declare const internalGroqTypeReferenceTo: unique symbol;
// Source: ./sanity/lib/queries.ts
// Variable: settingsQuery
Expand Down Expand Up @@ -513,58 +561,69 @@ export type GetPageQueryResult = {
slug: Slug;
heading: string;
subheading: string | null;
pageBuilder: Array<{
_key: string;
_type: "callToAction";
heading: string;
text?: string;
buttonText?: string;
link: {
_type: "link";
linkType?: "href" | "page" | "post";
href?: string;
page: string | null;
post: string | null;
openInNewTab?: boolean;
} | null;
} | {
_key: string;
_type: "infoSection";
heading?: string;
subheading?: string;
content?: Array<{
children?: Array<{
marks?: Array<string>;
text?: string;
_type: "span";
pageBuilder: Array<
| {
_key: string;
}>;
style?: "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "normal";
listItem?: "bullet" | "number";
markDefs?: Array<{
linkType?: "href" | "page" | "post";
href?: string;
page?: {
_ref: string;
_type: "reference";
_weak?: boolean;
[internalGroqTypeReferenceTo]?: "page";
};
post?: {
_ref: string;
_type: "reference";
_weak?: boolean;
[internalGroqTypeReferenceTo]?: "post";
};
openInNewTab?: boolean;
_type: "link";
_type: "callToAction";
heading: string;
text?: string;
buttonText?: string;
link: {
_type: "link";
linkType?: "href" | "page" | "post";
href?: string;
page: string | null;
post: string | null;
openInNewTab?: boolean;
} | null;
}
| {
_key: string;
}>;
level?: number;
_type: "block";
_key: string;
}>;
}> | null;
_type: "infoSection";
heading?: string;
subheading?: string;
content?: Array<{
children?: Array<{
marks?: Array<string>;
text?: string;
_type: "span";
_key: string;
}>;
style?:
| "blockquote"
| "h1"
| "h2"
| "h3"
| "h4"
| "h5"
| "h6"
| "normal";
listItem?: "bullet" | "number";
markDefs?: Array<{
linkType?: "href" | "page" | "post";
href?: string;
page?: {
_ref: string;
_type: "reference";
_weak?: boolean;
[internalGroqTypeReferenceTo]?: "page";
};
post?: {
_ref: string;
_type: "reference";
_weak?: boolean;
[internalGroqTypeReferenceTo]?: "post";
};
openInNewTab?: boolean;
_type: "link";
_key: string;
}>;
level?: number;
_type: "block";
_key: string;
}>;
}
> | null;
} | null;
// Variable: allPostsQuery
// Query: *[_type == "post" && defined(slug.current)] | order(date desc, _updatedAt desc) { _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{firstName, lastName, picture}, }
Expand Down Expand Up @@ -728,12 +787,12 @@ export type PagesSlugsResult = Array<{
import "@sanity/client";
declare module "@sanity/client" {
interface SanityQueries {
"*[_type == \"settings\"][0]": SettingsQueryResult;
"\n *[_type == 'page' && slug.current == $slug][0]{\n _id,\n _type,\n name,\n slug,\n heading,\n subheading,\n \"pageBuilder\": pageBuilder[]{\n ...,\n _type == \"callToAction\" => {\n ...,\n \n link {\n ...,\n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n }\n,\n }\n },\n }\n": GetPageQueryResult;
"\n *[_type == \"post\" && defined(slug.current)] | order(date desc, _updatedAt desc) {\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n": AllPostsQueryResult;
"\n *[_type == \"post\" && _id != $skip && defined(slug.current)] | order(date desc, _updatedAt desc) [0...$limit] {\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n": MorePostsQueryResult;
"\n *[_type == \"post\" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n link {\n ...,\n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n }\n\n }\n },\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n": PostQueryResult;
"\n *[_type == \"post\" && defined(slug.current)]\n {\"slug\": slug.current}\n": PostPagesSlugsResult;
"\n *[_type == \"page\" && defined(slug.current)]\n {\"slug\": slug.current}\n": PagesSlugsResult;
'*[_type == "settings"][0]': SettingsQueryResult;
'\n *[_type == \'page\' && slug.current == $slug][0]{\n _id,\n _type,\n name,\n slug,\n heading,\n subheading,\n "pageBuilder": pageBuilder[]{\n ...,\n _type == "callToAction" => {\n ...,\n \n link {\n ...,\n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n }\n,\n }\n },\n }\n': GetPageQueryResult;
'\n *[_type == "post" && defined(slug.current)] | order(date desc, _updatedAt desc) {\n \n _id,\n "status": select(_originalId in path("drafts.**") => "draft", "published"),\n "title": coalesce(title, "Untitled"),\n "slug": slug.current,\n excerpt,\n coverImage,\n "date": coalesce(date, _updatedAt),\n "author": author->{firstName, lastName, picture},\n\n }\n': AllPostsQueryResult;
'\n *[_type == "post" && _id != $skip && defined(slug.current)] | order(date desc, _updatedAt desc) [0...$limit] {\n \n _id,\n "status": select(_originalId in path("drafts.**") => "draft", "published"),\n "title": coalesce(title, "Untitled"),\n "slug": slug.current,\n excerpt,\n coverImage,\n "date": coalesce(date, _updatedAt),\n "author": author->{firstName, lastName, picture},\n\n }\n': MorePostsQueryResult;
'\n *[_type == "post" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n link {\n ...,\n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n }\n\n }\n },\n \n _id,\n "status": select(_originalId in path("drafts.**") => "draft", "published"),\n "title": coalesce(title, "Untitled"),\n "slug": slug.current,\n excerpt,\n coverImage,\n "date": coalesce(date, _updatedAt),\n "author": author->{firstName, lastName, picture},\n\n }\n': PostQueryResult;
'\n *[_type == "post" && defined(slug.current)]\n {"slug": slug.current}\n': PostPagesSlugsResult;
'\n *[_type == "page" && defined(slug.current)]\n {"slug": slug.current}\n': PagesSlugsResult;
}
}
Loading