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