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 grpc;
61pub mod builder;
62pub mod utils;
63pub mod persistence;
64pub mod specification;
65pub mod registry;
66
67pub mod module;
69pub mod module_registry;
70
71pub mod domain_service;
73pub mod command;
74pub mod query;
75pub mod value_object;
76pub mod aggregate;
77pub mod error;
78
79pub mod service;
81pub mod violation;
82pub mod write_guard;
83pub mod row_rule;
84pub mod actor_roles;
85pub mod usecase;
86pub mod validation;
87pub mod policy;
88pub mod bulk;
89pub mod integration;
90pub mod cqrs;
91pub mod graphql;
92
93pub mod trigger;
95pub mod flow;
96pub mod projection;
97pub mod state_machine;
98
99#[cfg(feature = "openapi")]
101pub mod openapi;
102
103pub use trigger::{
104 TriggerHandler, TriggerEvent, TriggerContext, TriggerContextMut,
105 ActionExecutor, TriggerRegistry,
106};
107
108pub use entity::*;
110pub use repository::*;
111pub use grpc::*;
112pub use builder::*;
113
114pub use config::{
116 BackboneConfig, ConfigError, ConfigResult, ConfigLoader,
117 AppConfig, Environment,
119 ServerConfig,
121 DatabaseConfig, CacheConfig,
123 ModulesConfig, SapiensConfig, PostmanConfig, BucketConfig,
125 SapiensAuthConfig, PasswordHasherConfig, SapiensLockoutConfig,
126 SmtpConfig, TemplatesConfig, StorageConfig,
127 LoggingConfig, LoggingFileConfig,
129 MonitoringConfig,
131 ContextsConfig, RedisEventBusConfig,
133 FeaturesConfig, RateLimitingConfig,
135 SecurityConfig, CsrfConfig, SecurityHeadersConfig,
137 ConfigurationBus, ConfigValue, ConfigChangeEvent,
139};
140
141pub use http::{
143 CrudService,
145 BackboneCrudHandler,
146 BackboneHttpHandler,
147 AccessScope,
149 ApiResponse,
151 PaginatedResponse,
152 PaginatedApiResponse,
153 PaginationResponse,
154 BulkResponse,
155 BulkCreateRequest,
156 ListQueryParams,
158 ListRequest,
159 UpsertRequest,
160 FilterOptions,
161 SortOrder,
162 BatchIdsRequest,
163 BulkUpdateItem,
164 BulkPatchItem,
165 BulkPatchRequest,
166 PaginationRequest,
168};
169
170#[cfg(feature = "openapi")]
172pub use openapi::BackboneComponents;
173
174pub use utils::{
176 BackboneError, PaginationParams, PaginationMeta as BackbonePaginationMeta,
177 now, days_ago, days_from_now, hours_ago, hours_from_now, minutes_from_now,
178 new_id, new_id_string, parse_id, is_valid_uuid,
179 is_valid_email, is_valid_username, normalize_string,
180};
181
182pub use persistence::{
184 CrudRepository, PersistentEntity, RepositoryError, PartialUpdatable, SearchableRepository, Versioned,
186 InMemoryRepository,
188 CrudServiceAdapter, SimpleCrudServiceAdapter, AdapterError,
190};
191
192pub use specification::{
194 Specification,
196 AndSpecification, OrSpecification, NotSpecification,
198 SpecificationResult, SpecificationEvaluator,
200 AlwaysTrue, AlwaysFalse, PredicateSpecification,
202 predicate,
204};
205
206#[cfg(feature = "postgres")]
208pub use persistence::{PostgresRepository, PostgresRepositoryBuilder, PostgresEntity};
209
210pub use registry::{
212 ModuleService,
214 ServiceRegistry,
216 ServiceHealth, HealthStatus, RegistryHealth, RegistryStatistics,
218 ServiceDescriptor,
220};
221
222pub use module::{
224 BackboneModule,
225 MigrationInfo,
226 SeedInfo,
227};
228
229pub use module_registry::{
230 ModuleRegistry,
231 ModuleRegistryError,
232 ModuleRegistryResult,
233};
234
235pub use domain_service::{DomainService, TransactionalDomainService};
237
238pub use command::{Command, CommandHandler, CommandDispatcher, ValidatableCommand, ValidatingCommandHandler};
239
240pub use query::{
241 Query, QueryHandler, QueryDispatcher,
242 CacheableQuery, PaginatedQuery, PaginatedQueryResult,
243};
244
245pub use value_object::{ValueObject, OptionalValueObject, ValueObjectError};
246
247pub use aggregate::{AggregateRoot, EventSourcedAggregate, InvariantAggregate, AggregateMetadata};
248
249pub use error::{ModuleError, ErrorCategory, ErrorResponse, CommonError};
250
251pub use violation::{code_from_constraint, Violation};
253pub use write_guard::{AllowAll, GuardOutcome, WriteCtx, WriteGuard, WriteKind};
254pub use service::{
255 GenericCrudService, ServiceError, ServiceResult,
256 FromCreateDto, ApplyUpdateDto, ServiceLifecycle, NoOpLifecycle,
257};
258
259pub use usecase::{
260 UseCaseError, UseCaseResult,
261 UseCaseHooks, DefaultHooks,
262 UseCaseService, EntityFactory, EntityUpdater,
263 CreateUseCase, UpdateUseCase, GetUseCase, DeleteUseCase,
264 ListUseCase, ListParams, ListResult, ListService,
265};
266
267pub use validation::{
268 ValidationError, ValidationErrors, FieldRule, EntityValidator,
269 RequiredString, MaxLength, NonNegative, OptionalNotBlank, Regex, RequiredUuid,
270};
271
272pub use policy::{
273 PolicyContext, PolicyOutcome, PolicyDecision, DomainPolicy,
274 PermitAllPolicy, DenyAllPolicy,
275 AllOfPolicy, AnyOfPolicy, NotPolicy,
276};
277
278pub use bulk::{
279 BulkFailureMode, BulkOperationConfig, BulkItemResult, BulkOperationResult,
280 BulkOperationProgress, BulkCapableService, GenericBulkService,
281};
282
283pub use integration::{
284 ModuleAdapter, ProjectionAdapter, IntegrationError,
285 EventBridge, IdentityAdapter, identity_adapter,
286};
287
288pub use cqrs::{
289 GenericCreateCommand, GenericUpdateCommand, GenericDeleteCommand, GenericRestoreCommand,
291 GenericGetQuery, GenericListQuery, GenericListDeletedQuery,
293 GenericCommandHandler, GenericQueryHandler,
295 CqrsService, CqrsReadService,
297};
298
299pub use graphql::{
300 GenericGraphQLResolver, GraphQLCapableService,
301 GraphQLListResult, GraphQLPaginationInput,
302};
303
304pub const VERSION: &str = env!("CARGO_PKG_VERSION");
309
310pub const STANDARD_ENDPOINTS: [&str; 11] = [
323 "GET /api/v1/{collection}",
324 "POST /api/v1/{collection}",
325 "GET /api/v1/{collection}/:id",
326 "PUT /api/v1/{collection}/:id",
327 "PATCH /api/v1/{collection}/:id",
328 "DELETE /api/v1/{collection}/:id",
329 "POST /api/v1/{collection}/bulk",
330 "POST /api/v1/{collection}/upsert",
331 "GET /api/v1/{collection}/trash",
332 "POST /api/v1/{collection}/:id/restore",
333 "DELETE /api/v1/{collection}/empty",
334];