1pub mod macros;
49pub use macros::log_include_hydration_failure;
50
51pub const STANDARD_ENDPOINT_COUNT: usize = 12;
53
54pub mod config;
55pub mod crud;
56pub mod entity;
57pub mod repository;
58pub mod extractors;
59pub mod http;
60pub mod permission;
61pub mod grpc;
62pub mod builder;
63pub mod utils;
64pub mod persistence;
65pub mod specification;
66pub mod registry;
67
68pub mod module;
70pub mod module_registry;
71
72pub mod domain_service;
74pub mod command;
75pub mod query;
76pub mod value_object;
77pub mod aggregate;
78pub mod error;
79
80pub mod service;
82pub mod violation;
83pub mod write_guard;
84pub mod write_hooks;
85pub mod row_rule;
86pub mod actor_roles;
87pub mod usecase;
88pub mod validation;
89pub mod policy;
90pub mod bulk;
91pub mod integration;
92pub mod cqrs;
93pub mod graphql;
94
95pub mod trigger;
97pub mod flow;
98pub mod projection;
99pub mod state_machine;
100
101#[cfg(feature = "openapi")]
103pub mod openapi;
104
105#[allow(deprecated)]
106pub use trigger::{
107 TriggerHandler, TriggerEvent, TriggerContext, TriggerContextMut,
108 ActionExecutor, TriggerRegistry,
109};
110
111pub use entity::*;
113pub use repository::*;
114pub use grpc::*;
115pub use builder::*;
116
117pub use config::{
119 BackboneConfig, ConfigError, ConfigResult, ConfigLoader,
120 AppConfig, Environment,
122 ServerConfig,
124 DatabaseConfig, CacheConfig,
126 ModulesConfig, SapiensConfig, PostmanConfig, BucketConfig,
128 SapiensAuthConfig, PasswordHasherConfig, SapiensLockoutConfig,
129 SmtpConfig, TemplatesConfig, StorageConfig,
130 LoggingConfig, LoggingFileConfig,
132 MonitoringConfig,
134 ContextsConfig, RedisEventBusConfig,
136 FeaturesConfig, RateLimitingConfig,
138 SecurityConfig, CsrfConfig, SecurityHeadersConfig,
140 ConfigurationBus, ConfigValue, ConfigChangeEvent,
142};
143
144pub use http::{
146 CrudService,
148 BackboneCrudHandler,
149 BackboneHttpHandler,
150 AccessScope,
152 ApiResponse,
154 PaginatedResponse,
155 PaginatedApiResponse,
156 PaginationResponse,
157 BulkResponse,
158 BulkCreateRequest,
159 ListQueryParams,
161 ListRequest,
162 UpsertRequest,
163 FilterOptions,
164 SortOrder,
165 BatchIdsRequest,
166 BulkUpdateItem,
167 BulkPatchItem,
168 BulkPatchRequest,
169 PaginationRequest,
171};
172
173#[cfg(feature = "openapi")]
175pub use openapi::BackboneComponents;
176
177pub use utils::{
179 BackboneError, PaginationParams, PaginationMeta as BackbonePaginationMeta,
180 now, days_ago, days_from_now, hours_ago, hours_from_now, minutes_from_now,
181 new_id, new_id_string, parse_id, is_valid_uuid,
182 is_valid_email, is_valid_username, normalize_string,
183};
184
185pub use persistence::{
187 CrudRepository, PersistentEntity, Reference, RepositoryError, PartialUpdatable, SearchableRepository, Versioned,
189 InMemoryRepository,
191 CrudServiceAdapter, SimpleCrudServiceAdapter, AdapterError,
193};
194
195pub use specification::{
197 Specification,
199 AndSpecification, OrSpecification, NotSpecification,
201 SpecificationResult, SpecificationEvaluator,
203 AlwaysTrue, AlwaysFalse, PredicateSpecification,
205 predicate,
207};
208
209#[cfg(feature = "postgres")]
211pub use persistence::{PostgresRepository, PostgresRepositoryBuilder, PostgresEntity};
212
213pub use registry::{
215 ModuleService,
217 ServiceRegistry,
219 ServiceHealth, HealthStatus, RegistryHealth, RegistryStatistics,
221 ServiceDescriptor,
223};
224
225pub use module::{
227 BackboneModule,
228 MigrationInfo,
229 SeedInfo,
230};
231
232pub use module_registry::{
233 ModuleRegistry,
234 ModuleRegistryError,
235 ModuleRegistryResult,
236};
237
238pub use domain_service::{DomainService, TransactionalDomainService};
240
241pub use command::{Command, CommandHandler, CommandDispatcher, ValidatableCommand, ValidatingCommandHandler};
242
243pub use query::{
244 Query, QueryHandler, QueryDispatcher,
245 CacheableQuery, PaginatedQuery, PaginatedQueryResult,
246};
247
248pub use value_object::{ValueObject, OptionalValueObject, ValueObjectError};
249
250pub use aggregate::{AggregateRoot, EventSourcedAggregate, InvariantAggregate, AggregateMetadata};
251
252pub use error::{ModuleError, ErrorCategory, ErrorResponse, CommonError};
253
254pub use violation::{code_from_constraint, Violation};
256pub use write_guard::{AllowAll, GuardOutcome, WriteCtx, WriteGuard, WriteKind};
257pub use write_hooks::{Change, ChangeKind, DeclaredEvent, NoWriteHooks, WriteHooks};
260pub use service::{
261 GenericCrudService, ServiceError, ServiceResult,
262 FromCreateDto, ApplyUpdateDto, ServiceLifecycle, NoOpLifecycle,
263};
264
265pub use usecase::{
266 UseCaseError, UseCaseResult,
267 UseCaseHooks, DefaultHooks,
268 UseCaseService, EntityFactory, EntityUpdater,
269 CreateUseCase, UpdateUseCase, GetUseCase, DeleteUseCase,
270 ListUseCase, ListParams, ListResult, ListService,
271};
272
273pub use validation::{
274 ValidationError, ValidationErrors, FieldRule, EntityValidator,
275 RequiredString, MaxLength, NonNegative, OptionalNotBlank, Regex, RequiredUuid,
276};
277
278pub use policy::{
279 PolicyContext, PolicyOutcome, PolicyDecision, DomainPolicy,
280 PermitAllPolicy, DenyAllPolicy,
281 AllOfPolicy, AnyOfPolicy, NotPolicy,
282};
283
284pub use bulk::{
285 BulkFailureMode, BulkOperationConfig, BulkItemResult, BulkOperationResult,
286 BulkOperationProgress, BulkCapableService, GenericBulkService,
287};
288
289pub use integration::{
290 ModuleAdapter, ProjectionAdapter, IntegrationError,
291 EventBridge, IdentityAdapter, identity_adapter,
292};
293
294pub use cqrs::{
295 GenericCreateCommand, GenericUpdateCommand, GenericDeleteCommand, GenericRestoreCommand,
297 GenericGetQuery, GenericListQuery, GenericListDeletedQuery,
299 GenericCommandHandler, GenericQueryHandler,
301 CqrsService, CqrsReadService,
303};
304
305pub use graphql::{
306 GenericGraphQLResolver, GraphQLCapableService,
307 GraphQLListResult, GraphQLPaginationInput,
308};
309
310pub const VERSION: &str = env!("CARGO_PKG_VERSION");
315
316pub const STANDARD_ENDPOINTS: [&str; 11] = [
329 "GET /api/v1/{collection}",
330 "POST /api/v1/{collection}",
331 "GET /api/v1/{collection}/:id",
332 "PUT /api/v1/{collection}/:id",
333 "PATCH /api/v1/{collection}/:id",
334 "DELETE /api/v1/{collection}/:id",
335 "POST /api/v1/{collection}/bulk",
336 "POST /api/v1/{collection}/upsert",
337 "GET /api/v1/{collection}/trash",
338 "POST /api/v1/{collection}/:id/restore",
339 "DELETE /api/v1/{collection}/empty",
340];