Hello from MCP server

List Files | Just Commands | Repo | Logs

← back |
/**
* This file was @generated using pocketbase-typegen
*/

import type PocketBase from 'pocketbase'
import type { RecordService } from 'pocketbase'

export enum Collections {
	Authorigins = "_authOrigins",
	Externalauths = "_externalAuths",
	Mfas = "_mfas",
	Otps = "_otps",
	Superusers = "_superusers",
	Books = "books",
	ContentItems = "contentItems",
	CostsMaterial = "costsMaterial",
	CostsTime = "costsTime",
	Currencies = "currencies",
	CurrencyRateFixed = "currencyRateFixed",
	CurrencyRates = "currencyRates",
	MenuCopy = "menuCopy",
	MenuTiers = "menuTiers",
	Menus = "menus",
	Offers = "offers",
	Organizations = "organizations",
	PermissionActions = "permissionActions",
	PermissionTypes = "permissionTypes",
	Permissions = "permissions",
	PricebookChanges = "pricebookChanges",
	ProblemCategories = "problemCategories",
	ProblemTags = "problemTags",
	Problems = "problems",
	Profiles = "profiles",
	Resources = "resources",
	Roles = "roles",
	Tiers = "tiers",
	Users = "users",
}

// Alias types for improved usability
export type IsoDateString = string
export type RecordIdString = string
export type HTMLString = string

type ExpandType<T> = unknown extends T
	? T extends unknown
		? { expand?: unknown }
		: { expand: T }
	: { expand: T }

// System fields
export type BaseSystemFields<T = unknown> = {
	id: RecordIdString
	collectionId: string
	collectionName: Collections
} & ExpandType<T>

export type AuthSystemFields<T = unknown> = {
	email: string
	emailVisibility: boolean
	username: string
	verified: boolean
} & BaseSystemFields<T>

// Record types for each collection

export type AuthoriginsRecord = {
	collectionRef: string
	created?: IsoDateString
	fingerprint: string
	id: string
	recordRef: string
	updated?: IsoDateString
}

export type ExternalauthsRecord = {
	collectionRef: string
	created?: IsoDateString
	id: string
	provider: string
	providerId: string
	recordRef: string
	updated?: IsoDateString
}

export type MfasRecord = {
	collectionRef: string
	created?: IsoDateString
	id: string
	method: string
	recordRef: string
	updated?: IsoDateString
}

export type OtpsRecord = {
	collectionRef: string
	created?: IsoDateString
	id: string
	password: string
	recordRef: string
	sentTo?: string
	updated?: IsoDateString
}

export type SuperusersRecord = {
	created?: IsoDateString
	email: string
	emailVisibility?: boolean
	id: string
	password: string
	tokenKey: string
	updated?: IsoDateString
	verified?: boolean
}

export type BooksRecord = {
	created?: IsoDateString
	dependencies?: RecordIdString[]
	id: string
	name?: string
	org?: RecordIdString
	parent?: RecordIdString
	refId?: string
	subscribers?: RecordIdString[]
	updated?: IsoDateString
}

export type ContentItemsRecord = {
	content?: string
	created?: IsoDateString
	id: string
	name?: string
	org?: RecordIdString
	refId?: string
	updated?: IsoDateString
}

export type CostsMaterialRecord = {
	created?: IsoDateString
	id: string
	name?: string
	org?: RecordIdString
	quantity?: string
	refId?: string
	updated?: IsoDateString
}

export type CostsTimeRecord = {
	created?: IsoDateString
	hours?: number
	id: string
	name?: string
	org?: RecordIdString
	refId?: string
	updated?: IsoDateString
}

export type CurrenciesRecord = {
	created?: IsoDateString
	id: string
	name?: string
	refId?: string
	symbol?: string
	updated?: IsoDateString
}

export type CurrencyRateFixedRecord = {
	created?: IsoDateString
	id: string
	name?: string
	updated?: IsoDateString
}

export type CurrencyRatesRecord = {
	baseCurrency?: RecordIdString
	created?: IsoDateString
	currencyRateFixed?: RecordIdString
	id: string
	quoteCurrency?: RecordIdString
	rate?: string
	updated?: IsoDateString
}

export type MenuCopyRecord = {
	contentItems?: RecordIdString[]
	created?: IsoDateString
	id: string
	name?: string
	org?: RecordIdString
	refId?: string
	updated?: IsoDateString
}

export type MenuTiersRecord = {
	contentItems?: RecordIdString[]
	created?: IsoDateString
	id: string
	menuCopy?: RecordIdString[]
	menus?: RecordIdString
	offers?: RecordIdString
	org?: RecordIdString
	refId?: string
	tiers?: RecordIdString
	updated?: IsoDateString
}

export type MenusRecord = {
	books?: RecordIdString[]
	created?: IsoDateString
	id: string
	name?: string
	org?: RecordIdString
	refId?: string
	updated?: IsoDateString
}

export type OffersRecord = {
	costsMaterial?: RecordIdString[]
	costsTime?: RecordIdString[]
	created?: IsoDateString
	id: string
	menus?: RecordIdString[]
	multiplier?: string
	name?: string
	org?: RecordIdString
	refId?: string
	updated?: IsoDateString
}

export type OrganizationsRecord<Tvariables = unknown> = {
	created?: IsoDateString
	currency?: RecordIdString
	id: string
	name?: string
	org?: string
	owner?: RecordIdString
	updated?: IsoDateString
	variables?: null | Tvariables
}

export type PermissionActionsRecord = {
	created?: IsoDateString
	id: string
	name?: string
	updated?: IsoDateString
}

export type PermissionTypesRecord = {
	created?: IsoDateString
	id: string
	name?: string
	updated?: IsoDateString
}

export type PermissionsRecord = {
	action?: RecordIdString
	created?: IsoDateString
	id: string
	org?: RecordIdString
	resource?: RecordIdString
	role?: RecordIdString
	type?: RecordIdString
	updated?: IsoDateString
}

export type PricebookChangesRecord<Tchangeset = unknown> = {
	book?: RecordIdString
	changeset?: null | Tchangeset
	created?: IsoDateString
	id: string
	org?: RecordIdString
	updated?: IsoDateString
}

export type ProblemCategoriesRecord = {
	created?: IsoDateString
	id: string
	name?: string
	org?: string
	parent?: RecordIdString
	refId?: string
	updated?: IsoDateString
}

export type ProblemTagsRecord = {
	created?: IsoDateString
	id: string
	name?: string
	org?: string
	refId?: string
	updated?: IsoDateString
}

export type ProblemsRecord = {
	created?: IsoDateString
	description?: string
	id: string
	menus?: RecordIdString[]
	name?: string
	org?: RecordIdString
	problemCategories?: RecordIdString[]
	problemTags?: RecordIdString[]
	refId?: string
	updated?: IsoDateString
}

export type ProfilesRecord = {
	created?: IsoDateString
	id: string
	org?: RecordIdString
	roles?: RecordIdString[]
	updated?: IsoDateString
	user?: RecordIdString
}

export type ResourcesRecord = {
	created?: IsoDateString
	description?: string
	id: string
	name?: string
	route?: string
	updated?: IsoDateString
}

export type RolesRecord = {
	created?: IsoDateString
	id: string
	name?: string
	org?: RecordIdString
	updated?: IsoDateString
}

export type TiersRecord = {
	created?: IsoDateString
	id: string
	name?: string
	org?: RecordIdString
	rank?: number
	refId?: string
	updated?: IsoDateString
}

export type UsersRecord = {
	activeOrg?: RecordIdString
	avatar?: string
	created?: IsoDateString
	email: string
	emailVisibility: boolean
	id: string
	name?: string
	password: string
	tokenKey: string
	updated?: IsoDateString
	verified?: boolean
}

// Response types include system fields and match responses from the PocketBase API
export type AuthoriginsResponse<Texpand = unknown> = Required<AuthoriginsRecord> & BaseSystemFields<Texpand>
export type ExternalauthsResponse<Texpand = unknown> = Required<ExternalauthsRecord> & BaseSystemFields<Texpand>
export type MfasResponse<Texpand = unknown> = Required<MfasRecord> & BaseSystemFields<Texpand>
export type OtpsResponse<Texpand = unknown> = Required<OtpsRecord> & BaseSystemFields<Texpand>
export type SuperusersResponse<Texpand = unknown> = Required<SuperusersRecord> & AuthSystemFields<Texpand>
export type BooksResponse<Texpand = unknown> = Required<BooksRecord> & BaseSystemFields<Texpand>
export type ContentItemsResponse<Texpand = unknown> = Required<ContentItemsRecord> & BaseSystemFields<Texpand>
export type CostsMaterialResponse<Texpand = unknown> = Required<CostsMaterialRecord> & BaseSystemFields<Texpand>
export type CostsTimeResponse<Texpand = unknown> = Required<CostsTimeRecord> & BaseSystemFields<Texpand>
export type CurrenciesResponse<Texpand = unknown> = Required<CurrenciesRecord> & BaseSystemFields<Texpand>
export type CurrencyRateFixedResponse<Texpand = unknown> = Required<CurrencyRateFixedRecord> & BaseSystemFields<Texpand>
export type CurrencyRatesResponse<Texpand = unknown> = Required<CurrencyRatesRecord> & BaseSystemFields<Texpand>
export type MenuCopyResponse<Texpand = unknown> = Required<MenuCopyRecord> & BaseSystemFields<Texpand>
export type MenuTiersResponse<Texpand = unknown> = Required<MenuTiersRecord> & BaseSystemFields<Texpand>
export type MenusResponse<Texpand = unknown> = Required<MenusRecord> & BaseSystemFields<Texpand>
export type OffersResponse<Texpand = unknown> = Required<OffersRecord> & BaseSystemFields<Texpand>
export type OrganizationsResponse<Tvariables = unknown, Texpand = unknown> = Required<OrganizationsRecord<Tvariables>> & BaseSystemFields<Texpand>
export type PermissionActionsResponse<Texpand = unknown> = Required<PermissionActionsRecord> & BaseSystemFields<Texpand>
export type PermissionTypesResponse<Texpand = unknown> = Required<PermissionTypesRecord> & BaseSystemFields<Texpand>
export type PermissionsResponse<Texpand = unknown> = Required<PermissionsRecord> & BaseSystemFields<Texpand>
export type PricebookChangesResponse<Tchangeset = unknown, Texpand = unknown> = Required<PricebookChangesRecord<Tchangeset>> & BaseSystemFields<Texpand>
export type ProblemCategoriesResponse<Texpand = unknown> = Required<ProblemCategoriesRecord> & BaseSystemFields<Texpand>
export type ProblemTagsResponse<Texpand = unknown> = Required<ProblemTagsRecord> & BaseSystemFields<Texpand>
export type ProblemsResponse<Texpand = unknown> = Required<ProblemsRecord> & BaseSystemFields<Texpand>
export type ProfilesResponse<Texpand = unknown> = Required<ProfilesRecord> & BaseSystemFields<Texpand>
export type ResourcesResponse<Texpand = unknown> = Required<ResourcesRecord> & BaseSystemFields<Texpand>
export type RolesResponse<Texpand = unknown> = Required<RolesRecord> & BaseSystemFields<Texpand>
export type TiersResponse<Texpand = unknown> = Required<TiersRecord> & BaseSystemFields<Texpand>
export type UsersResponse<Texpand = unknown> = Required<UsersRecord> & AuthSystemFields<Texpand>

// Types containing all Records and Responses, useful for creating typing helper functions

export type CollectionRecords = {
	_authOrigins: AuthoriginsRecord
	_externalAuths: ExternalauthsRecord
	_mfas: MfasRecord
	_otps: OtpsRecord
	_superusers: SuperusersRecord
	books: BooksRecord
	contentItems: ContentItemsRecord
	costsMaterial: CostsMaterialRecord
	costsTime: CostsTimeRecord
	currencies: CurrenciesRecord
	currencyRateFixed: CurrencyRateFixedRecord
	currencyRates: CurrencyRatesRecord
	menuCopy: MenuCopyRecord
	menuTiers: MenuTiersRecord
	menus: MenusRecord
	offers: OffersRecord
	organizations: OrganizationsRecord
	permissionActions: PermissionActionsRecord
	permissionTypes: PermissionTypesRecord
	permissions: PermissionsRecord
	pricebookChanges: PricebookChangesRecord
	problemCategories: ProblemCategoriesRecord
	problemTags: ProblemTagsRecord
	problems: ProblemsRecord
	profiles: ProfilesRecord
	resources: ResourcesRecord
	roles: RolesRecord
	tiers: TiersRecord
	users: UsersRecord
}

export type CollectionResponses = {
	_authOrigins: AuthoriginsResponse
	_externalAuths: ExternalauthsResponse
	_mfas: MfasResponse
	_otps: OtpsResponse
	_superusers: SuperusersResponse
	books: BooksResponse
	contentItems: ContentItemsResponse
	costsMaterial: CostsMaterialResponse
	costsTime: CostsTimeResponse
	currencies: CurrenciesResponse
	currencyRateFixed: CurrencyRateFixedResponse
	currencyRates: CurrencyRatesResponse
	menuCopy: MenuCopyResponse
	menuTiers: MenuTiersResponse
	menus: MenusResponse
	offers: OffersResponse
	organizations: OrganizationsResponse
	permissionActions: PermissionActionsResponse
	permissionTypes: PermissionTypesResponse
	permissions: PermissionsResponse
	pricebookChanges: PricebookChangesResponse
	problemCategories: ProblemCategoriesResponse
	problemTags: ProblemTagsResponse
	problems: ProblemsResponse
	profiles: ProfilesResponse
	resources: ResourcesResponse
	roles: RolesResponse
	tiers: TiersResponse
	users: UsersResponse
}

// Type for usage with type asserted PocketBase instance
// https://github.com/pocketbase/js-sdk#specify-typescript-definitions

export type TypedPocketBase = PocketBase & {
	collection(idOrName: '_authOrigins'): RecordService<AuthoriginsResponse>
	collection(idOrName: '_externalAuths'): RecordService<ExternalauthsResponse>
	collection(idOrName: '_mfas'): RecordService<MfasResponse>
	collection(idOrName: '_otps'): RecordService<OtpsResponse>
	collection(idOrName: '_superusers'): RecordService<SuperusersResponse>
	collection(idOrName: 'books'): RecordService<BooksResponse>
	collection(idOrName: 'contentItems'): RecordService<ContentItemsResponse>
	collection(idOrName: 'costsMaterial'): RecordService<CostsMaterialResponse>
	collection(idOrName: 'costsTime'): RecordService<CostsTimeResponse>
	collection(idOrName: 'currencies'): RecordService<CurrenciesResponse>
	collection(idOrName: 'currencyRateFixed'): RecordService<CurrencyRateFixedResponse>
	collection(idOrName: 'currencyRates'): RecordService<CurrencyRatesResponse>
	collection(idOrName: 'menuCopy'): RecordService<MenuCopyResponse>
	collection(idOrName: 'menuTiers'): RecordService<MenuTiersResponse>
	collection(idOrName: 'menus'): RecordService<MenusResponse>
	collection(idOrName: 'offers'): RecordService<OffersResponse>
	collection(idOrName: 'organizations'): RecordService<OrganizationsResponse>
	collection(idOrName: 'permissionActions'): RecordService<PermissionActionsResponse>
	collection(idOrName: 'permissionTypes'): RecordService<PermissionTypesResponse>
	collection(idOrName: 'permissions'): RecordService<PermissionsResponse>
	collection(idOrName: 'pricebookChanges'): RecordService<PricebookChangesResponse>
	collection(idOrName: 'problemCategories'): RecordService<ProblemCategoriesResponse>
	collection(idOrName: 'problemTags'): RecordService<ProblemTagsResponse>
	collection(idOrName: 'problems'): RecordService<ProblemsResponse>
	collection(idOrName: 'profiles'): RecordService<ProfilesResponse>
	collection(idOrName: 'resources'): RecordService<ResourcesResponse>
	collection(idOrName: 'roles'): RecordService<RolesResponse>
	collection(idOrName: 'tiers'): RecordService<TiersResponse>
	collection(idOrName: 'users'): RecordService<UsersResponse>
}