feat: add SocialRecord, ContactsRecord, SiteSettingsRecord API types
Models PocketBase relations: SiteSettings → contacts → ContactsRecord → socials[] → SocialRecord. expand fields typed as optional resolved records for use with PocketBase expand query param.
This commit is contained in:
+67
-1
@@ -104,7 +104,7 @@ export type ProjectRecord = BaseRecord & {
|
|||||||
*/
|
*/
|
||||||
role: string;
|
role: string;
|
||||||
/**
|
/**
|
||||||
* Short summary of the project
|
* Project description as HTML from the PocketBase rich-text editor
|
||||||
*/
|
*/
|
||||||
description: string;
|
description: string;
|
||||||
/**
|
/**
|
||||||
@@ -119,12 +119,78 @@ export type ProjectRecord = BaseRecord & {
|
|||||||
* Primary thumbnail or hero image filename
|
* Primary thumbnail or hero image filename
|
||||||
*/
|
*/
|
||||||
image: string;
|
image: string;
|
||||||
|
/**
|
||||||
|
* Project's url
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
/**
|
/**
|
||||||
* Sorting weight for the project list
|
* Sorting weight for the project list
|
||||||
*/
|
*/
|
||||||
order: number;
|
order: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PocketBase collection for individual social profile links.
|
||||||
|
*/
|
||||||
|
export type SocialRecord = BaseRecord & {
|
||||||
|
/**
|
||||||
|
* Display name shown as the link text
|
||||||
|
*/
|
||||||
|
label: string;
|
||||||
|
/**
|
||||||
|
* Full URL for the social profile
|
||||||
|
*/
|
||||||
|
url: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PocketBase collection for the primary contact record.
|
||||||
|
* Single-record collection — only the first record is consumed.
|
||||||
|
*/
|
||||||
|
export type ContactsRecord = BaseRecord & {
|
||||||
|
/**
|
||||||
|
* Primary contact email address
|
||||||
|
*/
|
||||||
|
email: string;
|
||||||
|
/**
|
||||||
|
* Raw relation IDs — use expand?.socials for resolved records
|
||||||
|
*/
|
||||||
|
socials: string[];
|
||||||
|
/**
|
||||||
|
* Expanded relation data, present when fetched with expand=socials
|
||||||
|
*/
|
||||||
|
expand?: {
|
||||||
|
/**
|
||||||
|
* Resolved social link records
|
||||||
|
*/
|
||||||
|
socials?: SocialRecord[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PocketBase collection for global site configuration.
|
||||||
|
* Single-record collection — only the first record is consumed.
|
||||||
|
*/
|
||||||
|
export type SiteSettingsRecord = BaseRecord & {
|
||||||
|
/**
|
||||||
|
* CV filename stored in PocketBase — build the full URL with buildFileUrl()
|
||||||
|
*/
|
||||||
|
cv: string;
|
||||||
|
/**
|
||||||
|
* Raw relation ID — use expand?.contacts for the resolved record
|
||||||
|
*/
|
||||||
|
contacts: string;
|
||||||
|
/**
|
||||||
|
* Expanded relation data, present when fetched with expand=contacts,contacts.socials
|
||||||
|
*/
|
||||||
|
expand?: {
|
||||||
|
/**
|
||||||
|
* Resolved contacts record
|
||||||
|
*/
|
||||||
|
contacts?: ContactsRecord;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic response for a list of PocketBase records.
|
* Generic response for a list of PocketBase records.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user