Shared TypeScript types for Baasix packages
npm install @baasix/typesShared TypeScript type definitions for Baasix packages.
``bash`
npm install @baasix/types
`typescript
import type {
// Auth types
User,
Role,
Permission,
Accountability,
AuthResponse,
AuthMode,
// Schema types
FieldType,
FieldDefinition,
SchemaDefinition,
RelationshipType,
// Query types
Filter,
FilterOperator,
OperatorName,
Sort,
QueryParams,
ReportQuery,
StatsQuery,
// Response types
PaginatedResponse,
SingleResponse,
// File types
FileMetadata,
UploadOptions,
ImportOptions,
ExportOptions,
// Spatial types
GeoJSONPoint,
GeoJSONGeometry,
// Cache types
CacheConfig,
ICacheAdapter,
// Workflow types
Workflow,
WorkflowExecution,
// Common types
BaseItem,
DeepPartial,
} from '@baasix/types';
`
``
src/
├── index.ts # Main exports (aggregates all types)
├── auth.ts # Authentication & authorization types
├── schema.ts # Schema & field definition types
├── query.ts # Query, filter, sort, aggregation, report & stats types
├── response.ts # API response types
├── files.ts # File, asset, import/export types
├── workflow.ts # Workflow types
├── notification.ts # Notification types
├── spatial.ts # GeoJSON/spatial types
├── cache.ts # Cache configuration & adapter types
├── common.ts # Base types, utilities, settings, hooks, mail, seed
└── plugin.ts # Plugin system types (Express, services, hooks)
User and authentication types:
- User, UserWithPassword, UserWithRolesAndPermissionsRole
- , Permission, PermissionAction, PermissionData, CreatePermissionDataTenant
- , Session, AuthTokens, JWTPayloadAccountability
- - User context for permission checkingLoginCredentials
- , RegisterData, AuthResponseAuthStateEvent
- , AuthState, MagicLinkOptions, PasswordResetOptionsOAuth2Tokens
- , OAuth2UserInfoAuthMode
- - Authentication mode ("jwt" | "cookie")
Field and schema definition types:
- FieldType, DefaultValueType, FieldValidationRules, FieldValuesFieldDefinition
- , FlattenedField, FieldInfoIndexDefinition
- , SchemaDefinition, SchemaInfoSchemaValidation
- , FieldValidation, ValidationResultRelationshipType
- , AssociationType, RelationshipDefinitionAssociationDefinition
- , IncludeConfig, ProcessedInclude
Filter, sort, pagination, and aggregation types:
- FilterOperator, OperatorName - All supported filter operatorsFilter
- , FilterValue, FilterCondition, LogicalFilter, FilterObjectSort
- , SortDirection, SortItem, SortObjectPaginationOptions
- , PaginationMetadataAggregateFunction
- , AggregateConfig, Aggregate, AggregateMappingDatePart
- , DateTruncPrecisionQueryParams
- , QueryOptions, QueryContext
Report and stats query types:
- ReportConfig, ReportResult, ReportQueryStatsQuery
- , StatsResult
API response wrapper types:
- PaginatedResponse - Paginated list responseSingleResponse
- - Single item responseMutationResponse
- - Create/update responseDeleteResponse
- - Delete operation responseBulkResponse
- - Bulk operation responseReadResult
- - Read operation resultErrorResponse
- - Error response
File and asset handling types:
- FileMetadata, FileData, UploadOptions, InternalUploadedFileAssetTransformOptions
- , AssetQuery, ProcessedImageStorageProvider
- , StorageAdapter
Import/Export types:
- UploadedFile - Uploaded file from multipart formImportOptions
- , ImportResultExportOptions
- , ExportResult
Workflow automation types:
- Workflow, WorkflowFlowData, WorkflowTriggerWorkflowNode
- , WorkflowNodeData, WorkflowEdgeWorkflowExecution
- , WorkflowExecutionLogWorkflowTriggerType
- , WorkflowStatus, WorkflowExecutionStatus
Notification system types:
- Notification, NotificationTypeNotificationOptions
- , SendNotificationData
GeoJSON/PostGIS compatible types:
- GeoJSONPoint - Point geometry [longitude, latitude]GeoJSONLineString
- - Line geometryGeoJSONPolygon
- - Polygon geometryGeoJSONGeometry
- - Union of all geometry types
Caching system types:
- CacheConfig - Cache configuration (enabled, ttl, prefix)CacheSetOptions
- - Options for cache.set operationsCacheStrategy
- - Cache strategy ("explicit" | "all")CacheEntry
- - Cache entry structureICacheAdapter
- - Interface for custom cache adapters
Base and utility types:
- BaseItem, TimestampedItem, SoftDeletableItemDeepPartial
- , CollectionItem, WithRequired, WithOptionalKeysOfType
- , AnyRecord
Settings types:
- Settings, TenantSettings
Task types:
- BackgroundTask
Hook types:
- HookEvent, HookContext, HookHandler, Hook
Other types:
- HttpMethod - HTTP methodsMailOptions
- , SenderConfig - Email typesSeedData
- , SeedResult - Database seeding types
Express types (re-exported from @types/express):Request
- , Response, NextFunction, Express, RouterExpressRequest
- Aliases: , PluginRequest, etc.
Service interfaces:
- IItemsService, IPermissionService, IMailServiceIStorageService
- , ISettingsService, ISocketServiceIRealtimeService
- , ITasksService, IWorkflowServiceIMigrationService
- , IHooksManager, ICacheServiceIFilesService
- , IAssetsService, INotificationServiceIReportService
- , IStatsService
Plugin definition types:
- PluginType, PluginMeta, PluginDefinition, BaasixPluginPluginRoute
- , PluginHook, PluginMiddleware, PluginSchedulePluginContext
- , PluginRouteContext, PluginHookContextPluginServiceFactory
- , PluginService, PluginAuthProviderStartServerOptions
- , PluginManagerOptions, LoadedPlugin
For Express types to work, you need @types/express installed:
`bash`
npm install -D @types/express
`bashInstall dependencies
npm install
MIT