Skip to content

Commit 96c9dd6

Browse files
Chore/update dependencies (#135)
* (chore) update dependencies * (chore) update dependencies and sanity.types
1 parent aa448f5 commit 96c9dd6

File tree

2 files changed

+127
-216
lines changed

2 files changed

+127
-216
lines changed

frontend/sanity.types.ts

Lines changed: 89 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,11 @@ export type Page = {
176176
slug: Slug;
177177
heading: string;
178178
subheading?: string;
179-
pageBuilder?: Array<
180-
| ({
181-
_key: string;
182-
} & CallToAction)
183-
| ({
184-
_key: string;
185-
} & InfoSection)
186-
>;
179+
pageBuilder?: Array<{
180+
_key: string;
181+
} & CallToAction | {
182+
_key: string;
183+
} & InfoSection>;
187184
};
188185

189186
export type Post = {
@@ -252,21 +249,17 @@ export type SanityAssistInstructionTask = {
252249

253250
export type SanityAssistTaskStatus = {
254251
_type: "sanity.assist.task.status";
255-
tasks?: Array<
256-
{
257-
_key: string;
258-
} & SanityAssistInstructionTask
259-
>;
252+
tasks?: Array<{
253+
_key: string;
254+
} & SanityAssistInstructionTask>;
260255
};
261256

262257
export type SanityAssistSchemaTypeAnnotations = {
263258
_type: "sanity.assist.schemaType.annotations";
264259
title?: string;
265-
fields?: Array<
266-
{
267-
_key: string;
268-
} & SanityAssistSchemaTypeField
269-
>;
260+
fields?: Array<{
261+
_key: string;
262+
} & SanityAssistSchemaTypeField>;
270263
};
271264

272265
export type SanityAssistOutputType = {
@@ -319,23 +312,18 @@ export type SanityAssistInstructionUserInput = {
319312
};
320313

321314
export type SanityAssistInstructionPrompt = Array<{
322-
children?: Array<
323-
| {
324-
marks?: Array<string>;
325-
text?: string;
326-
_type: "span";
327-
_key: string;
328-
}
329-
| ({
330-
_key: string;
331-
} & SanityAssistInstructionFieldRef)
332-
| ({
333-
_key: string;
334-
} & SanityAssistInstructionContext)
335-
| ({
336-
_key: string;
337-
} & SanityAssistInstructionUserInput)
338-
>;
315+
children?: Array<{
316+
marks?: Array<string>;
317+
text?: string;
318+
_type: "span";
319+
_key: string;
320+
} | {
321+
_key: string;
322+
} & SanityAssistInstructionFieldRef | {
323+
_key: string;
324+
} & SanityAssistInstructionContext | {
325+
_key: string;
326+
} & SanityAssistInstructionUserInput>;
339327
style?: "normal";
340328
listItem?: never;
341329
markDefs?: null;
@@ -356,24 +344,19 @@ export type SanityAssistInstruction = {
356344
title?: string;
357345
userId?: string;
358346
createdById?: string;
359-
output?: Array<
360-
| ({
361-
_key: string;
362-
} & SanityAssistOutputField)
363-
| ({
364-
_key: string;
365-
} & SanityAssistOutputType)
366-
>;
347+
output?: Array<{
348+
_key: string;
349+
} & SanityAssistOutputField | {
350+
_key: string;
351+
} & SanityAssistOutputType>;
367352
};
368353

369354
export type SanityAssistSchemaTypeField = {
370355
_type: "sanity.assist.schemaType.field";
371356
path?: string;
372-
instructions?: Array<
373-
{
374-
_key: string;
375-
} & SanityAssistInstruction
376-
>;
357+
instructions?: Array<{
358+
_key: string;
359+
} & SanityAssistInstruction>;
377360
};
378361

379362
export type SanityImagePaletteSwatch = {
@@ -494,38 +477,7 @@ export type SanityAssetSourceData = {
494477
url?: string;
495478
};
496479

497-
export type AllSanitySchemaTypes =
498-
| CallToAction
499-
| Link
500-
| InfoSection
501-
| BlockContent
502-
| Settings
503-
| Page
504-
| Post
505-
| Person
506-
| SanityAssistInstructionTask
507-
| SanityAssistTaskStatus
508-
| SanityAssistSchemaTypeAnnotations
509-
| SanityAssistOutputType
510-
| SanityAssistOutputField
511-
| SanityAssistInstructionContext
512-
| AssistInstructionContext
513-
| SanityAssistInstructionUserInput
514-
| SanityAssistInstructionPrompt
515-
| SanityAssistInstructionFieldRef
516-
| SanityAssistInstruction
517-
| SanityAssistSchemaTypeField
518-
| SanityImagePaletteSwatch
519-
| SanityImagePalette
520-
| SanityImageDimensions
521-
| SanityImageHotspot
522-
| SanityImageCrop
523-
| SanityFileAsset
524-
| SanityImageAsset
525-
| SanityImageMetadata
526-
| Geopoint
527-
| Slug
528-
| SanityAssetSourceData;
480+
export type AllSanitySchemaTypes = CallToAction | Link | InfoSection | BlockContent | Settings | Page | Post | Person | SanityAssistInstructionTask | SanityAssistTaskStatus | SanityAssistSchemaTypeAnnotations | SanityAssistOutputType | SanityAssistOutputField | SanityAssistInstructionContext | AssistInstructionContext | SanityAssistInstructionUserInput | SanityAssistInstructionPrompt | SanityAssistInstructionFieldRef | SanityAssistInstruction | SanityAssistSchemaTypeField | SanityImagePaletteSwatch | SanityImagePalette | SanityImageDimensions | SanityImageHotspot | SanityImageCrop | SanityFileAsset | SanityImageAsset | SanityImageMetadata | Geopoint | Slug | SanityAssetSourceData;
529481
export declare const internalGroqTypeReferenceTo: unique symbol;
530482
// Source: ./sanity/lib/queries.ts
531483
// Variable: settingsQuery
@@ -593,74 +545,60 @@ export type GetPageQueryResult = {
593545
slug: Slug;
594546
heading: string;
595547
subheading: string | null;
596-
pageBuilder: Array<
597-
| {
598-
_key: string;
599-
_type: "callToAction";
600-
heading: string;
548+
pageBuilder: Array<{
549+
_key: string;
550+
_type: "callToAction";
551+
heading: string;
552+
text?: string;
553+
buttonText?: string;
554+
link: {
555+
_type: "link";
556+
linkType?: "href" | "page" | "post";
557+
href?: string;
558+
page: string | null;
559+
post: string | null;
560+
openInNewTab?: boolean;
561+
} | null;
562+
} | {
563+
_key: string;
564+
_type: "infoSection";
565+
heading?: string;
566+
subheading?: string;
567+
content: Array<{
568+
children?: Array<{
569+
marks?: Array<string>;
601570
text?: string;
602-
buttonText?: string;
603-
link: {
604-
_type: "link";
605-
linkType?: "href" | "page" | "post";
606-
href?: string;
607-
page: string | null;
608-
post: string | null;
609-
openInNewTab?: boolean;
610-
} | null;
611-
}
612-
| {
571+
_type: "span";
613572
_key: string;
614-
_type: "infoSection";
615-
heading?: string;
616-
subheading?: string;
617-
content: Array<{
618-
children?: Array<{
619-
marks?: Array<string>;
620-
text?: string;
621-
_type: "span";
622-
_key: string;
623-
}>;
624-
style?:
625-
| "blockquote"
626-
| "h1"
627-
| "h2"
628-
| "h3"
629-
| "h4"
630-
| "h5"
631-
| "h6"
632-
| "normal";
633-
listItem?: "bullet" | "number";
634-
markDefs: Array<{
635-
linkType?: "href" | "page" | "post";
636-
href?: string;
637-
page: string | null;
638-
post: string | null;
639-
openInNewTab?: boolean;
640-
_type: "link";
641-
_key: string;
642-
}> | null;
643-
level?: number;
644-
_type: "block";
645-
_key: string;
646-
}> | null;
647-
}
648-
> | null;
573+
}>;
574+
style?: "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "normal";
575+
listItem?: "bullet" | "number";
576+
markDefs: Array<{
577+
linkType?: "href" | "page" | "post";
578+
href?: string;
579+
page: string | null;
580+
post: string | null;
581+
openInNewTab?: boolean;
582+
_type: "link";
583+
_key: string;
584+
}> | null;
585+
level?: number;
586+
_type: "block";
587+
_key: string;
588+
}> | null;
589+
}> | null;
649590
} | null;
650591
// Variable: sitemapData
651592
// Query: *[_type == "page" || _type == "post" && defined(slug.current)] | order(_type asc) { "slug": slug.current, _type, _updatedAt, }
652-
export type SitemapDataResult = Array<
653-
| {
654-
slug: string;
655-
_type: "page";
656-
_updatedAt: string;
657-
}
658-
| {
659-
slug: string;
660-
_type: "post";
661-
_updatedAt: string;
662-
}
663-
>;
593+
export type SitemapDataResult = Array<{
594+
slug: string;
595+
_type: "page";
596+
_updatedAt: string;
597+
} | {
598+
slug: string;
599+
_type: "post";
600+
_updatedAt: string;
601+
}>;
664602
// Variable: allPostsQuery
665603
// 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}, }
666604
export type AllPostsQueryResult = Array<{
@@ -818,13 +756,13 @@ export type PagesSlugsResult = Array<{
818756
import "@sanity/client";
819757
declare module "@sanity/client" {
820758
interface SanityQueries {
821-
'*[_type == "settings"][0]': SettingsQueryResult;
822-
'\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 link {\n ...,\n \n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n\n }\n,\n },\n _type == "infoSection" => {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n\n }\n }\n },\n },\n }\n': GetPageQueryResult;
823-
'\n *[_type == "page" || _type == "post" && defined(slug.current)] | order(_type asc) {\n "slug": slug.current,\n _type,\n _updatedAt,\n }\n': SitemapDataResult;
824-
'\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;
825-
'\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;
826-
'\n *[_type == "post" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\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;
827-
'\n *[_type == "post" && defined(slug.current)]\n {"slug": slug.current}\n': PostPagesSlugsResult;
828-
'\n *[_type == "page" && defined(slug.current)]\n {"slug": slug.current}\n': PagesSlugsResult;
759+
"*[_type == \"settings\"][0]": SettingsQueryResult;
760+
"\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 link {\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n,\n },\n _type == \"infoSection\" => {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n }\n },\n },\n }\n": GetPageQueryResult;
761+
"\n *[_type == \"page\" || _type == \"post\" && defined(slug.current)] | order(_type asc) {\n \"slug\": slug.current,\n _type,\n _updatedAt,\n }\n": SitemapDataResult;
762+
"\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;
763+
"\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;
764+
"\n *[_type == \"post\" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\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;
765+
"\n *[_type == \"post\" && defined(slug.current)]\n {\"slug\": slug.current}\n": PostPagesSlugsResult;
766+
"\n *[_type == \"page\" && defined(slug.current)]\n {\"slug\": slug.current}\n": PagesSlugsResult;
829767
}
830768
}

0 commit comments

Comments
 (0)