aury-boot 0.0.4__tar.gz → 0.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. {aury_boot-0.0.4 → aury_boot-0.0.7}/PKG-INFO +20 -2
  2. {aury_boot-0.0.4 → aury_boot-0.0.7}/README.md +18 -1
  3. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/__init__.py +2 -2
  4. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/_version.py +2 -2
  5. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/__init__.py +60 -36
  6. aury_boot-0.0.7/aury/boot/application/adapter/__init__.py +112 -0
  7. aury_boot-0.0.7/aury/boot/application/adapter/base.py +511 -0
  8. aury_boot-0.0.7/aury/boot/application/adapter/config.py +242 -0
  9. aury_boot-0.0.7/aury/boot/application/adapter/decorators.py +259 -0
  10. aury_boot-0.0.7/aury/boot/application/adapter/exceptions.py +202 -0
  11. aury_boot-0.0.7/aury/boot/application/adapter/http.py +325 -0
  12. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/app/__init__.py +12 -8
  13. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/app/base.py +12 -0
  14. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/app/components.py +137 -44
  15. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/app/middlewares.py +9 -4
  16. aury_boot-0.0.7/aury/boot/application/app/startup.py +249 -0
  17. aury_boot-0.0.7/aury/boot/application/config/__init__.py +79 -0
  18. aury_boot-0.0.7/aury/boot/application/config/multi_instance.py +216 -0
  19. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/config/settings.py +398 -149
  20. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/constants/components.py +6 -0
  21. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/errors/handlers.py +17 -3
  22. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/middleware/logging.py +21 -120
  23. aury_boot-0.0.7/aury/boot/commands/__init__.py +50 -0
  24. aury_boot-0.0.7/aury/boot/commands/app.py +235 -0
  25. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/docs.py +104 -17
  26. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/generate.py +22 -22
  27. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/init.py +68 -17
  28. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/server/app.py +2 -3
  29. aury_boot-0.0.7/aury/boot/commands/templates/project/AGENTS.md.tpl +221 -0
  30. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/README.md.tpl +2 -2
  31. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/00-overview.md.tpl +59 -0
  32. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/01-model.md.tpl +184 -0
  33. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/02-repository.md.tpl +206 -0
  34. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/03-service.md.tpl +398 -0
  35. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/04-schema.md.tpl +95 -0
  36. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/05-api.md.tpl +116 -0
  37. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/06-exception.md.tpl +118 -0
  38. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/07-cache.md.tpl +122 -0
  39. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/08-scheduler.md.tpl +32 -0
  40. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/09-tasks.md.tpl +38 -0
  41. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/10-storage.md.tpl +115 -0
  42. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/11-logging.md.tpl +131 -0
  43. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/12-admin.md.tpl +56 -0
  44. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/13-channel.md.tpl +104 -0
  45. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/14-mq.md.tpl +102 -0
  46. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/15-events.md.tpl +147 -0
  47. aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/16-adapter.md.tpl +403 -0
  48. aury_boot-0.0.4/aury/boot/commands/templates/project/CLI.md.tpl → aury_boot-0.0.7/aury/boot/commands/templates/project/aury_docs/99-cli.md.tpl +19 -19
  49. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/config.py.tpl +10 -10
  50. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/_header.tpl +10 -0
  51. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/admin.tpl +49 -0
  52. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/cache.tpl +14 -0
  53. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/database.tpl +22 -0
  54. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/log.tpl +18 -0
  55. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/messaging.tpl +46 -0
  56. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/rpc.tpl +28 -0
  57. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/scheduler.tpl +18 -0
  58. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/service.tpl +18 -0
  59. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/storage.tpl +38 -0
  60. aury_boot-0.0.7/aury/boot/commands/templates/project/env_templates/third_party.tpl +43 -0
  61. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/modules/tasks.py.tpl +1 -1
  62. aury_boot-0.0.7/aury/boot/common/logging/__init__.py +68 -0
  63. aury_boot-0.0.7/aury/boot/common/logging/context.py +132 -0
  64. aury_boot-0.0.7/aury/boot/common/logging/decorators.py +118 -0
  65. aury_boot-0.0.7/aury/boot/common/logging/format.py +315 -0
  66. aury_boot-0.0.7/aury/boot/common/logging/setup.py +214 -0
  67. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/contrib/admin_console/auth.py +2 -3
  68. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/contrib/admin_console/install.py +1 -1
  69. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/models/mixins.py +48 -1
  70. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/pagination/__init__.py +94 -0
  71. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/repository/interface.py +1 -1
  72. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/transaction/__init__.py +8 -9
  73. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/__init__.py +86 -29
  74. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/cache/backends.py +102 -18
  75. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/cache/base.py +12 -0
  76. aury_boot-0.0.7/aury/boot/infrastructure/cache/manager.py +336 -0
  77. aury_boot-0.0.7/aury/boot/infrastructure/channel/__init__.py +24 -0
  78. aury_boot-0.0.7/aury/boot/infrastructure/channel/backends/__init__.py +9 -0
  79. aury_boot-0.0.7/aury/boot/infrastructure/channel/backends/memory.py +83 -0
  80. aury_boot-0.0.7/aury/boot/infrastructure/channel/backends/redis.py +88 -0
  81. aury_boot-0.0.7/aury/boot/infrastructure/channel/base.py +92 -0
  82. aury_boot-0.0.7/aury/boot/infrastructure/channel/manager.py +203 -0
  83. aury_boot-0.0.7/aury/boot/infrastructure/clients/__init__.py +22 -0
  84. aury_boot-0.0.7/aury/boot/infrastructure/clients/rabbitmq/__init__.py +9 -0
  85. aury_boot-0.0.7/aury/boot/infrastructure/clients/rabbitmq/config.py +46 -0
  86. aury_boot-0.0.7/aury/boot/infrastructure/clients/rabbitmq/manager.py +288 -0
  87. aury_boot-0.0.7/aury/boot/infrastructure/clients/redis/__init__.py +28 -0
  88. aury_boot-0.0.7/aury/boot/infrastructure/clients/redis/config.py +51 -0
  89. aury_boot-0.0.7/aury/boot/infrastructure/clients/redis/manager.py +264 -0
  90. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/database/config.py +7 -16
  91. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/database/manager.py +16 -38
  92. aury_boot-0.0.7/aury/boot/infrastructure/events/__init__.py +30 -0
  93. aury_boot-0.0.7/aury/boot/infrastructure/events/backends/__init__.py +11 -0
  94. aury_boot-0.0.7/aury/boot/infrastructure/events/backends/memory.py +86 -0
  95. aury_boot-0.0.7/aury/boot/infrastructure/events/backends/rabbitmq.py +193 -0
  96. aury_boot-0.0.7/aury/boot/infrastructure/events/backends/redis.py +162 -0
  97. aury_boot-0.0.7/aury/boot/infrastructure/events/base.py +127 -0
  98. aury_boot-0.0.7/aury/boot/infrastructure/events/manager.py +224 -0
  99. aury_boot-0.0.7/aury/boot/infrastructure/mq/__init__.py +24 -0
  100. aury_boot-0.0.7/aury/boot/infrastructure/mq/backends/__init__.py +9 -0
  101. aury_boot-0.0.7/aury/boot/infrastructure/mq/backends/rabbitmq.py +179 -0
  102. aury_boot-0.0.7/aury/boot/infrastructure/mq/backends/redis.py +167 -0
  103. aury_boot-0.0.7/aury/boot/infrastructure/mq/base.py +143 -0
  104. aury_boot-0.0.7/aury/boot/infrastructure/mq/manager.py +239 -0
  105. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/scheduler/manager.py +7 -3
  106. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/storage/base.py +17 -5
  107. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/storage/factory.py +0 -1
  108. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/tasks/__init__.py +2 -2
  109. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/tasks/config.py +5 -13
  110. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/tasks/manager.py +55 -33
  111. {aury_boot-0.0.4 → aury_boot-0.0.7}/pyproject.toml +8 -0
  112. aury_boot-0.0.4/aury/boot/application/config/__init__.py +0 -44
  113. aury_boot-0.0.4/aury/boot/commands/__init__.py +0 -30
  114. aury_boot-0.0.4/aury/boot/commands/app.py +0 -105
  115. aury_boot-0.0.4/aury/boot/commands/templates/project/DEVELOPMENT.md.tpl +0 -1397
  116. aury_boot-0.0.4/aury/boot/commands/templates/project/env.example.tpl +0 -213
  117. aury_boot-0.0.4/aury/boot/common/logging/__init__.py +0 -716
  118. aury_boot-0.0.4/aury/boot/infrastructure/cache/manager.py +0 -274
  119. aury_boot-0.0.4/aury/boot/infrastructure/events/__init__.py +0 -33
  120. aury_boot-0.0.4/aury/boot/infrastructure/events/bus.py +0 -362
  121. aury_boot-0.0.4/aury/boot/infrastructure/events/config.py +0 -52
  122. aury_boot-0.0.4/aury/boot/infrastructure/events/consumer.py +0 -134
  123. aury_boot-0.0.4/aury/boot/infrastructure/events/models.py +0 -63
  124. {aury_boot-0.0.4 → aury_boot-0.0.7}/.gitignore +0 -0
  125. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/constants/__init__.py +0 -0
  126. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/constants/scheduler.py +0 -0
  127. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/constants/service.py +0 -0
  128. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/errors/__init__.py +0 -0
  129. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/errors/chain.py +0 -0
  130. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/errors/codes.py +0 -0
  131. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/errors/exceptions.py +0 -0
  132. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/errors/response.py +0 -0
  133. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/interfaces/__init__.py +0 -0
  134. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/interfaces/egress.py +0 -0
  135. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/interfaces/ingress.py +0 -0
  136. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/middleware/__init__.py +0 -0
  137. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/migrations/__init__.py +0 -0
  138. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/migrations/manager.py +0 -0
  139. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/migrations/setup.py +0 -0
  140. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/rpc/__init__.py +2 -2
  141. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/rpc/base.py +0 -0
  142. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/rpc/client.py +0 -0
  143. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/rpc/discovery.py +0 -0
  144. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/scheduler/__init__.py +0 -0
  145. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/scheduler/runner.py +0 -0
  146. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/application/server/__init__.py +0 -0
  147. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/add.py +0 -0
  148. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/config.py +0 -0
  149. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/docker.py +0 -0
  150. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/migrate/__init__.py +0 -0
  151. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/migrate/app.py +0 -0
  152. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/migrate/commands.py +0 -0
  153. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/scheduler.py +0 -0
  154. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/server/__init__.py +0 -0
  155. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/generate/api.py.tpl +0 -0
  156. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/generate/model.py.tpl +0 -0
  157. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/generate/repository.py.tpl +0 -0
  158. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/generate/schema.py.tpl +0 -0
  159. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/generate/service.py.tpl +0 -0
  160. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/admin_console_init.py.tpl +0 -0
  161. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/conftest.py.tpl +0 -0
  162. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/gitignore.tpl +0 -0
  163. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/main.py.tpl +0 -0
  164. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/modules/api.py.tpl +0 -0
  165. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/modules/exceptions.py.tpl +0 -0
  166. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/templates/project/modules/schedules.py.tpl +0 -0
  167. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/commands/worker.py +0 -0
  168. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/common/__init__.py +0 -0
  169. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/common/exceptions/__init__.py +0 -0
  170. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/common/i18n/__init__.py +0 -0
  171. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/common/i18n/translator.py +0 -0
  172. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/contrib/__init__.py +0 -0
  173. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/contrib/admin_console/__init__.py +0 -0
  174. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/contrib/admin_console/discovery.py +0 -0
  175. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/contrib/admin_console/utils.py +0 -0
  176. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/__init__.py +0 -0
  177. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/exceptions/__init__.py +0 -0
  178. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/models/__init__.py +0 -0
  179. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/models/base.py +0 -0
  180. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/models/models.py +0 -0
  181. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/repository/__init__.py +0 -0
  182. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/repository/impl.py +1 -1
  183. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/repository/interceptors.py +0 -0
  184. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/repository/query_builder.py +0 -0
  185. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/service/__init__.py +0 -0
  186. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/domain/service/base.py +0 -0
  187. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/cache/__init__.py +0 -0
  188. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/cache/exceptions.py +0 -0
  189. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/cache/factory.py +0 -0
  190. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/database/__init__.py +0 -0
  191. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/database/exceptions.py +0 -0
  192. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/database/query_tools/__init__.py +0 -0
  193. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/database/strategies/__init__.py +0 -0
  194. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/di/__init__.py +0 -0
  195. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/di/container.py +0 -0
  196. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/events/middleware.py +0 -0
  197. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/monitoring/__init__.py +0 -0
  198. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/scheduler/__init__.py +0 -0
  199. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/scheduler/exceptions.py +0 -0
  200. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/storage/__init__.py +9 -9
  201. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/storage/exceptions.py +0 -0
  202. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/tasks/constants.py +0 -0
  203. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/infrastructure/tasks/exceptions.py +0 -0
  204. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/testing/__init__.py +0 -0
  205. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/testing/base.py +0 -0
  206. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/testing/client.py +0 -0
  207. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/testing/factory.py +0 -0
  208. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/toolkit/__init__.py +0 -0
  209. {aury_boot-0.0.4 → aury_boot-0.0.7}/aury/boot/toolkit/http/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aury-boot
3
- Version: 0.0.4
3
+ Version: 0.0.7
4
4
  Summary: Aury Boot - 基于 FastAPI 生态的企业级 API 开发框架
5
5
  Requires-Python: >=3.13
6
6
  Requires-Dist: alembic>=1.17.2
@@ -49,6 +49,7 @@ Requires-Dist: asyncpg>=0.31.0; extra == 'postgres'
49
49
  Provides-Extra: rabbitmq
50
50
  Requires-Dist: amqp>=5.3.1; extra == 'rabbitmq'
51
51
  Provides-Extra: recommended
52
+ Requires-Dist: aiosqlite>=0.21.0; extra == 'recommended'
52
53
  Requires-Dist: apscheduler>=3.11.1; extra == 'recommended'
53
54
  Requires-Dist: asyncpg>=0.31.0; extra == 'recommended'
54
55
  Requires-Dist: aury-sdk-storage[aws]>=0.0.1; extra == 'recommended'
@@ -72,7 +73,24 @@ Description-Content-Type: text/markdown
72
73
 
73
74
  # Aury Boot
74
75
 
75
- 这是AUM项目的基于 FastAPI 生态的企业级 API 开发框架,提供所有微服务共用的基础设施组件。
76
+ 基于 FastAPI 生态的企业级 API 开发框架,提供所有微服务共用的基础设施组件。
77
+
78
+ ## 快速开始
79
+
80
+ ```bash
81
+ # 1. 创建项目目录并初始化
82
+ mkdir my-service && cd my-service
83
+ uv init . --name my_service --no-package --python 3.13
84
+
85
+ # 2. 添加依赖
86
+ uv add "aury-boot[recommended,admin]" # admin 可选,提供 SQLAdmin 管理后台
87
+
88
+ # 3. 初始化项目结构
89
+ aury init
90
+
91
+ # 4. 启动开发服务器
92
+ aury server dev
93
+ ```
76
94
 
77
95
  ## 功能模块
78
96
 
@@ -1,6 +1,23 @@
1
1
  # Aury Boot
2
2
 
3
- 这是AUM项目的基于 FastAPI 生态的企业级 API 开发框架,提供所有微服务共用的基础设施组件。
3
+ 基于 FastAPI 生态的企业级 API 开发框架,提供所有微服务共用的基础设施组件。
4
+
5
+ ## 快速开始
6
+
7
+ ```bash
8
+ # 1. 创建项目目录并初始化
9
+ mkdir my-service && cd my-service
10
+ uv init . --name my_service --no-package --python 3.13
11
+
12
+ # 2. 添加依赖
13
+ uv add "aury-boot[recommended,admin]" # admin 可选,提供 SQLAdmin 管理后台
14
+
15
+ # 3. 初始化项目结构
16
+ aury init
17
+
18
+ # 4. 启动开发服务器
19
+ aury server dev
20
+ ```
4
21
 
5
22
  ## 功能模块
6
23
 
@@ -52,7 +52,7 @@ def __getattr__(name: str):
52
52
 
53
53
  def __dir__():
54
54
  """返回可用属性列表。"""
55
- return list(_SUBMODULES) + ["__version__"]
55
+ return [*list(_SUBMODULES), "__version__"]
56
56
 
57
57
 
58
58
  __all__ = [
@@ -61,6 +61,6 @@ __all__ = [
61
61
  "common",
62
62
  "domain",
63
63
  "infrastructure",
64
- "toolkit",
65
64
  "testing",
65
+ "toolkit",
66
66
  ]
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.0.4'
32
- __version_tuple__ = version_tuple = (0, 0, 4)
31
+ __version__ = version = '0.0.7'
32
+ __version_tuple__ = version_tuple = (0, 0, 7)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -5,6 +5,14 @@
5
5
 
6
6
  # 事件系统(从 infrastructure 导入 - Event 定义在最底层)
7
7
  # 事务管理(从 domain 导入)
8
+ # 第三方适配器
9
+ from aury.boot.application.adapter import (
10
+ AdapterError,
11
+ AdapterSettings,
12
+ BaseAdapter,
13
+ HttpAdapter,
14
+ adapter_method,
15
+ )
8
16
  from aury.boot.domain.transaction import (
9
17
  TransactionManager,
10
18
  TransactionRequiredError,
@@ -17,10 +25,15 @@ from aury.boot.domain.transaction import (
17
25
  from aury.boot.infrastructure.di import Container, Lifetime, Scope, ServiceDescriptor
18
26
  from aury.boot.infrastructure.events import (
19
27
  Event,
20
- EventBus,
21
- EventConsumer,
22
- EventLoggingMiddleware,
23
- EventMiddleware,
28
+ EventBackend,
29
+ EventBusManager,
30
+ EventHandler,
31
+ EventType,
32
+ IEventBus,
33
+ # 后端实现
34
+ MemoryEventBus,
35
+ RabbitMQEventBus,
36
+ RedisEventBus,
24
37
  )
25
38
 
26
39
  from . import interfaces, rpc
@@ -62,59 +75,70 @@ from .scheduler import run_scheduler, run_scheduler_sync
62
75
  from .server import ApplicationServer, run_app
63
76
 
64
77
  __all__ = [
78
+ # 第三方适配器
79
+ "AdapterError",
80
+ "AdapterSettings",
81
+ # 服务器集成
82
+ "ApplicationServer",
83
+ "BaseAdapter",
65
84
  # 配置
66
85
  "BaseConfig",
86
+ # 中间件
87
+ "CORSMiddleware",
67
88
  "CORSSettings",
89
+ # 组件
90
+ "CacheComponent",
68
91
  "CacheSettings",
69
- "LogSettings",
70
- "ServerSettings",
92
+ # 基类
93
+ "Component",
71
94
  # 常量
72
95
  "ComponentName",
73
- "MiddlewareName",
74
- "SchedulerMode",
75
- "ServiceType",
96
+ # 依赖注入容器
97
+ "Container",
98
+ "DatabaseComponent",
99
+ # 事件系统
100
+ "Event",
101
+ "EventBackend",
102
+ "EventBusManager",
103
+ "EventHandler",
104
+ "EventType",
76
105
  # 应用框架
77
106
  "FoundationApp",
78
- # 基类
79
- "Component",
107
+ "HttpAdapter",
108
+ "IEventBus",
109
+ "Lifetime",
110
+ "LogSettings",
111
+ "MemoryEventBus",
80
112
  "Middleware",
81
- # 中间件
82
- "CORSMiddleware",
83
- "RequestLoggingMiddleware",
84
- # 组件
85
- "CacheComponent",
86
- "DatabaseComponent",
113
+ "MiddlewareName",
87
114
  "MigrationComponent",
115
+ # 迁移
116
+ "MigrationManager",
117
+ "RabbitMQEventBus",
118
+ "RedisEventBus",
119
+ "RequestLoggingMiddleware",
88
120
  "SchedulerComponent",
89
- "TaskComponent",
90
- # 依赖注入容器
91
- "Container",
92
- "Lifetime",
121
+ "SchedulerMode",
93
122
  "Scope",
123
+ "ServerSettings",
94
124
  "ServiceDescriptor",
95
- # 事件系统
96
- "Event",
97
- "EventBus",
98
- "EventConsumer",
99
- "EventLoggingMiddleware",
100
- "EventMiddleware",
101
- # 迁移
102
- "MigrationManager",
103
- # HTTP 中间件装饰器
104
- "log_request",
125
+ "ServiceType",
126
+ "TaskComponent",
105
127
  # 事务管理
106
128
  "TransactionManager",
107
129
  "TransactionRequiredError",
130
+ # 第三方适配器装饰器
131
+ "adapter_method",
108
132
  "ensure_transaction",
109
- "transactional",
110
- "transactional_context",
133
+ # HTTP 中间件装饰器
134
+ "log_request",
111
135
  # RPC通信
112
136
  "rpc",
137
+ "run_app",
113
138
  # 调度器启动器
114
139
  "run_scheduler",
115
140
  "run_scheduler_sync",
116
- # 服务器集成
117
- "ApplicationServer",
118
- "run_app",
141
+ "transactional",
142
+ "transactional_context",
119
143
  ]
120
144
 
@@ -0,0 +1,112 @@
1
+ """第三方接口适配器模块。
2
+
3
+ 本模块用于封装第三方接口(如支付、短信、微信、云存储等外部服务)的调用,
4
+ 解决测试环境中第三方接口不可用的问题,通过配置切换真实调用与挡板(Mock)实现。
5
+
6
+ 核心特性:
7
+ - 多模式切换:real(真实)/sandbox(沙箱)/mock(挡板)/disabled(禁用)
8
+ - 按方法级别的模式覆盖:同一 Adapter 不同方法可用不同模式
9
+ - 装饰器声明式定义:@adapter_method + .mock 链式定义挡板逻辑
10
+ - HTTP 类第三方的便捷基类:HttpAdapter 封装请求/认证/错误处理
11
+ - 调用历史记录:便于测试断言,验证调用参数和结果
12
+
13
+ 模式说明:
14
+ - real: 调用真实第三方接口(生产环境)
15
+ - sandbox: 调用第三方提供的沙箱环境(如果有)
16
+ - mock: 使用本地挡板实现,不发出真实请求(测试/开发环境)
17
+ - disabled: 禁用该接口,调用时抛出 AdapterDisabledError
18
+
19
+ 设计原则:
20
+ - 最小约束:只约束"模式怎么切换",不限制具体调用方式
21
+ - 最大自由:HTTP/SDK/gRPC/任意协议都能用
22
+ - 可组合:Adapter 可以组合其他 Adapter
23
+
24
+ 典型使用场景:
25
+ 1. 测试环境:第三方接口不可用,使用 mock 模式运行测试
26
+ 2. 开发环境:避免消耗真实资源(如短信费用),使用 mock
27
+ 3. 部分挡板:查询接口走真实,写入接口走 mock
28
+ 4. 功能开关:禁用某些危险操作(如退款)在测试环境
29
+
30
+ 使用示例:
31
+ from aury.boot.application.adapter import (
32
+ HttpAdapter, adapter_method, AdapterSettings
33
+ )
34
+
35
+ class PaymentAdapter(HttpAdapter):
36
+ '''支付第三方接口适配器。'''
37
+
38
+ @adapter_method("create")
39
+ async def create_order(self, amount: int, order_id: str) -> dict:
40
+ '''创建支付订单(真实实现)。'''
41
+ return await self._request("POST", "/charge", json={"amount": amount, "order_id": order_id})
42
+
43
+ @create_order.mock
44
+ async def create_order_mock(self, amount: int, order_id: str) -> dict:
45
+ '''创建支付订单(挡板实现)。
46
+
47
+ 挡板可以包含业务逻辑,模拟各种场景(成功、失败、边界情况)。
48
+ '''
49
+ if amount > 10000:
50
+ return {"success": False, "error": "金额超限"}
51
+ return {"success": True, "mock": True, "order_id": order_id}
52
+
53
+ # 配置:测试环境使用挡板,但 query 走真实接口
54
+ settings = AdapterSettings(
55
+ mode="mock", # 默认走挡板
56
+ method_modes={"query": "real"}, # query 走真实
57
+ base_url="https://api.payment.com",
58
+ )
59
+
60
+ adapter = PaymentAdapter("payment", settings)
61
+ result = await adapter.create_order(100, "order-1") # 走挡板
62
+
63
+ 环境变量配置:
64
+ # 全局模式
65
+ THIRD_PARTY_PAYMENT_MODE=mock
66
+
67
+ # 连接配置
68
+ THIRD_PARTY_PAYMENT_BASE_URL=https://api.payment.com
69
+ THIRD_PARTY_PAYMENT_SANDBOX_URL=https://sandbox.payment.com
70
+ THIRD_PARTY_PAYMENT_API_KEY=sk_test_xxx
71
+ THIRD_PARTY_PAYMENT_TIMEOUT=30
72
+
73
+ # 方法级模式覆盖(JSON 格式)
74
+ THIRD_PARTY_PAYMENT_METHOD_MODES={"query": "real", "refund": "disabled"}
75
+
76
+ # 挡板配置
77
+ THIRD_PARTY_PAYMENT_MOCK_DELAY=0.1 # 模拟网络延迟
78
+ """
79
+
80
+ from .base import BaseAdapter, CallRecord
81
+ from .config import (
82
+ AdapterMode,
83
+ AdapterSettings,
84
+ MockStrategy,
85
+ ThirdPartySettings,
86
+ )
87
+ from .decorators import adapter_method
88
+ from .exceptions import (
89
+ AdapterDisabledError,
90
+ AdapterError,
91
+ AdapterTimeoutError,
92
+ )
93
+ from .http import HttpAdapter
94
+
95
+ __all__ = [
96
+ # 基类
97
+ "BaseAdapter",
98
+ "HttpAdapter",
99
+ # 配置
100
+ "AdapterSettings",
101
+ "AdapterMode",
102
+ "MockStrategy",
103
+ "ThirdPartySettings",
104
+ # 装饰器
105
+ "adapter_method",
106
+ # 异常
107
+ "AdapterError",
108
+ "AdapterDisabledError",
109
+ "AdapterTimeoutError",
110
+ # 数据类
111
+ "CallRecord",
112
+ ]