aury-boot 0.0.10__tar.gz → 0.0.12__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 (198) hide show
  1. {aury_boot-0.0.10 → aury_boot-0.0.12}/PKG-INFO +1 -1
  2. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/_version.py +2 -2
  3. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/migrations/setup.py +4 -0
  4. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/app.py +8 -1
  5. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/init.py +6 -0
  6. aury_boot-0.0.12/aury/boot/commands/pkg.py +471 -0
  7. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/10-storage.md.tpl +49 -6
  8. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/16-adapter.md.tpl +28 -28
  9. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/99-cli.md.tpl +25 -0
  10. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/config.py.tpl +8 -0
  11. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/storage/__init__.py +17 -6
  12. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/storage/base.py +6 -9
  13. {aury_boot-0.0.10 → aury_boot-0.0.12}/.gitignore +0 -0
  14. {aury_boot-0.0.10 → aury_boot-0.0.12}/README.md +0 -0
  15. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/__init__.py +0 -0
  16. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/__init__.py +0 -0
  17. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/adapter/__init__.py +0 -0
  18. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/adapter/base.py +0 -0
  19. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/adapter/config.py +0 -0
  20. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/adapter/decorators.py +0 -0
  21. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/adapter/exceptions.py +0 -0
  22. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/adapter/http.py +0 -0
  23. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/app/__init__.py +0 -0
  24. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/app/base.py +0 -0
  25. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/app/components.py +0 -0
  26. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/app/middlewares.py +0 -0
  27. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/app/startup.py +0 -0
  28. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/config/__init__.py +0 -0
  29. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/config/multi_instance.py +0 -0
  30. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/config/settings.py +0 -0
  31. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/constants/__init__.py +0 -0
  32. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/constants/components.py +0 -0
  33. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/constants/scheduler.py +0 -0
  34. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/constants/service.py +0 -0
  35. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/errors/__init__.py +0 -0
  36. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/errors/chain.py +0 -0
  37. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/errors/codes.py +0 -0
  38. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/errors/exceptions.py +0 -0
  39. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/errors/handlers.py +0 -0
  40. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/errors/response.py +0 -0
  41. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/interfaces/__init__.py +0 -0
  42. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/interfaces/egress.py +0 -0
  43. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/interfaces/ingress.py +0 -0
  44. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/middleware/__init__.py +0 -0
  45. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/middleware/logging.py +0 -0
  46. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/migrations/__init__.py +0 -0
  47. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/migrations/manager.py +0 -0
  48. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/rpc/__init__.py +0 -0
  49. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/rpc/base.py +0 -0
  50. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/rpc/client.py +0 -0
  51. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/rpc/discovery.py +0 -0
  52. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/scheduler/__init__.py +0 -0
  53. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/scheduler/runner.py +0 -0
  54. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/application/server/__init__.py +0 -0
  55. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/__init__.py +0 -0
  56. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/add.py +0 -0
  57. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/config.py +0 -0
  58. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/docker.py +0 -0
  59. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/docs.py +0 -0
  60. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/generate.py +0 -0
  61. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/migrate/__init__.py +0 -0
  62. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/migrate/app.py +0 -0
  63. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/migrate/commands.py +0 -0
  64. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/scheduler.py +0 -0
  65. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/server/__init__.py +0 -0
  66. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/server/app.py +0 -0
  67. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/generate/api.py.tpl +0 -0
  68. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/generate/model.py.tpl +0 -0
  69. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/generate/repository.py.tpl +0 -0
  70. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/generate/schema.py.tpl +0 -0
  71. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/generate/service.py.tpl +0 -0
  72. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/AGENTS.md.tpl +0 -0
  73. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/README.md.tpl +0 -0
  74. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/admin_console_init.py.tpl +0 -0
  75. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/00-overview.md.tpl +0 -0
  76. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/01-model.md.tpl +0 -0
  77. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/02-repository.md.tpl +0 -0
  78. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/03-service.md.tpl +0 -0
  79. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/04-schema.md.tpl +0 -0
  80. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/05-api.md.tpl +0 -0
  81. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/06-exception.md.tpl +0 -0
  82. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/07-cache.md.tpl +0 -0
  83. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/08-scheduler.md.tpl +0 -0
  84. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/09-tasks.md.tpl +0 -0
  85. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/11-logging.md.tpl +0 -0
  86. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/12-admin.md.tpl +0 -0
  87. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/13-channel.md.tpl +0 -0
  88. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/14-mq.md.tpl +0 -0
  89. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/aury_docs/15-events.md.tpl +0 -0
  90. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/conftest.py.tpl +0 -0
  91. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/_header.tpl +0 -0
  92. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/admin.tpl +0 -0
  93. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/cache.tpl +0 -0
  94. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/database.tpl +0 -0
  95. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/log.tpl +0 -0
  96. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/messaging.tpl +0 -0
  97. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/rpc.tpl +0 -0
  98. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/scheduler.tpl +0 -0
  99. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/service.tpl +0 -0
  100. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/storage.tpl +0 -0
  101. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/env_templates/third_party.tpl +0 -0
  102. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/gitignore.tpl +0 -0
  103. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/main.py.tpl +0 -0
  104. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/modules/api.py.tpl +0 -0
  105. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/modules/exceptions.py.tpl +0 -0
  106. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/modules/schedules.py.tpl +0 -0
  107. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/templates/project/modules/tasks.py.tpl +0 -0
  108. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/commands/worker.py +0 -0
  109. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/__init__.py +0 -0
  110. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/exceptions/__init__.py +0 -0
  111. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/i18n/__init__.py +0 -0
  112. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/i18n/translator.py +0 -0
  113. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/logging/__init__.py +0 -0
  114. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/logging/context.py +0 -0
  115. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/logging/decorators.py +0 -0
  116. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/logging/format.py +0 -0
  117. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/common/logging/setup.py +0 -0
  118. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/contrib/__init__.py +0 -0
  119. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/contrib/admin_console/__init__.py +0 -0
  120. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/contrib/admin_console/auth.py +0 -0
  121. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/contrib/admin_console/discovery.py +0 -0
  122. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/contrib/admin_console/install.py +0 -0
  123. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/contrib/admin_console/utils.py +0 -0
  124. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/__init__.py +0 -0
  125. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/exceptions/__init__.py +0 -0
  126. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/models/__init__.py +0 -0
  127. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/models/base.py +0 -0
  128. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/models/mixins.py +0 -0
  129. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/models/models.py +0 -0
  130. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/pagination/__init__.py +0 -0
  131. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/repository/__init__.py +0 -0
  132. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/repository/impl.py +0 -0
  133. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/repository/interceptors.py +0 -0
  134. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/repository/interface.py +0 -0
  135. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/repository/query_builder.py +0 -0
  136. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/service/__init__.py +0 -0
  137. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/service/base.py +0 -0
  138. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/domain/transaction/__init__.py +0 -0
  139. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/__init__.py +0 -0
  140. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/cache/__init__.py +0 -0
  141. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/cache/backends.py +0 -0
  142. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/cache/base.py +0 -0
  143. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/cache/exceptions.py +0 -0
  144. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/cache/factory.py +0 -0
  145. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/cache/manager.py +0 -0
  146. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/channel/__init__.py +0 -0
  147. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/channel/backends/__init__.py +0 -0
  148. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/channel/backends/memory.py +0 -0
  149. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/channel/backends/redis.py +0 -0
  150. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/channel/base.py +0 -0
  151. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/channel/manager.py +0 -0
  152. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/__init__.py +0 -0
  153. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/rabbitmq/__init__.py +0 -0
  154. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/rabbitmq/config.py +0 -0
  155. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/rabbitmq/manager.py +0 -0
  156. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/redis/__init__.py +0 -0
  157. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/redis/config.py +0 -0
  158. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/clients/redis/manager.py +0 -0
  159. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/database/__init__.py +0 -0
  160. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/database/config.py +0 -0
  161. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/database/exceptions.py +0 -0
  162. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/database/manager.py +0 -0
  163. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/database/query_tools/__init__.py +0 -0
  164. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/database/strategies/__init__.py +0 -0
  165. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/di/__init__.py +0 -0
  166. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/di/container.py +0 -0
  167. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/__init__.py +0 -0
  168. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/backends/__init__.py +0 -0
  169. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/backends/memory.py +0 -0
  170. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/backends/rabbitmq.py +0 -0
  171. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/backends/redis.py +0 -0
  172. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/base.py +0 -0
  173. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/manager.py +0 -0
  174. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/events/middleware.py +0 -0
  175. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/monitoring/__init__.py +0 -0
  176. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/mq/__init__.py +0 -0
  177. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/mq/backends/__init__.py +0 -0
  178. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/mq/backends/rabbitmq.py +0 -0
  179. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/mq/backends/redis.py +0 -0
  180. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/mq/base.py +0 -0
  181. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/mq/manager.py +0 -0
  182. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/scheduler/__init__.py +0 -0
  183. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/scheduler/exceptions.py +0 -0
  184. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/scheduler/manager.py +0 -0
  185. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/storage/exceptions.py +0 -0
  186. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/storage/factory.py +0 -0
  187. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/tasks/__init__.py +0 -0
  188. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/tasks/config.py +0 -0
  189. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/tasks/constants.py +0 -0
  190. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/tasks/exceptions.py +0 -0
  191. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/infrastructure/tasks/manager.py +0 -0
  192. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/testing/__init__.py +0 -0
  193. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/testing/base.py +0 -0
  194. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/testing/client.py +0 -0
  195. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/testing/factory.py +0 -0
  196. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/toolkit/__init__.py +0 -0
  197. {aury_boot-0.0.10 → aury_boot-0.0.12}/aury/boot/toolkit/http/__init__.py +0 -0
  198. {aury_boot-0.0.10 → aury_boot-0.0.12}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aury-boot
3
- Version: 0.0.10
3
+ Version: 0.0.12
4
4
  Summary: Aury Boot - 基于 FastAPI 生态的企业级 API 开发框架
5
5
  Requires-Python: >=3.13
6
6
  Requires-Dist: alembic>=1.17.2
@@ -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.10'
32
- __version_tuple__ = version_tuple = (0, 0, 10)
31
+ __version__ = version = '0.0.12'
32
+ __version_tuple__ = version_tuple = (0, 0, 12)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -117,6 +117,8 @@ def run_migrations_offline() -> None:
117
117
  dialect_opts={{"paramstyle": "named"}},
118
118
  compare_type=True,
119
119
  compare_server_default=True,
120
+ # 启用 batch 模式以更好地支持 SQLite 等不完整 DDL 的后端
121
+ render_as_batch=True,
120
122
  )
121
123
  with context.begin_transaction():
122
124
  context.run_migrations()
@@ -129,6 +131,8 @@ def _do_run_migrations(connection) -> None:
129
131
  target_metadata=target_metadata,
130
132
  compare_type=True,
131
133
  compare_server_default=True,
134
+ # 启用 batch 模式以更好地支持 SQLite 等不完整 DDL 的后端
135
+ render_as_batch=True,
132
136
  )
133
137
  with context.begin_transaction():
134
138
  context.run_migrations()
@@ -86,12 +86,14 @@ def _get_app() -> typer.Typer:
86
86
  from .generate import app as generate_app
87
87
  from .init import init
88
88
  from .migrate import app as migrate_app
89
+ from .pkg import app as pkg_app
89
90
  from .scheduler import app as scheduler_app
90
91
  from .server import app as server_app
91
92
  from .worker import app as worker_app
92
93
 
93
94
  app.command(name="init", help="🎯 初始化项目脚手架")(init)
94
95
  app.add_typer(add_app, name="add", help="➕ 添加可选模块")
96
+ app.add_typer(pkg_app, name="pkg", help="📦 包管理")
95
97
  app.add_typer(generate_app, name="generate", help="⚡ 代码生成器")
96
98
  app.add_typer(server_app, name="server", help="🖥️ 服务器管理")
97
99
  app.add_typer(scheduler_app, name="scheduler", help="🕐 独立运行调度器")
@@ -162,6 +164,10 @@ def register_commands(
162
164
  from .add import app as add_app
163
165
  target_app.add_typer(add_app, name="add", help="➕ 添加可选模块")
164
166
 
167
+ # pkg 命令始终注册(包管理是通用功能)
168
+ from .pkg import app as pkg_app
169
+ target_app.add_typer(pkg_app, name="pkg", help="📦 包管理")
170
+
165
171
  if include_generate:
166
172
  from .generate import app as generate_app
167
173
  target_app.add_typer(generate_app, name="generate", help="⚡ 代码生成器")
@@ -205,11 +211,12 @@ def get_command_modules() -> dict[str, type]:
205
211
  # {'init': <module>, 'add': <module>, 'server': <module>, ...}
206
212
  ```
207
213
  """
208
- from . import add, docker, docs, generate, init, migrate, scheduler, server, worker
214
+ from . import add, docker, docs, generate, init, migrate, pkg, scheduler, server, worker
209
215
 
210
216
  return {
211
217
  "init": init,
212
218
  "add": add,
219
+ "pkg": pkg,
213
220
  "generate": generate,
214
221
  "server": server,
215
222
  "scheduler": scheduler,
@@ -928,6 +928,12 @@ def init(
928
928
  console.print(" 4. 访问 API 文档:")
929
929
  console.print(" [cyan]http://127.0.0.1:8000/docs[/cyan]")
930
930
  console.print()
931
+ console.print("[bold]包管理(按需安装可选模块):[/bold]")
932
+ console.print(" [cyan]aury pkg list[/cyan] # 查看所有可用模块")
933
+ console.print(" [cyan]aury pkg preset[/cyan] # 查看预设配置")
934
+ console.print(" [cyan]aury pkg install postgres redis[/cyan] # 安装指定模块")
935
+ console.print(" [cyan]aury pkg install --preset api[/cyan] # 按预设安装")
936
+ console.print()
931
937
  console.print("[bold]常用命令:[/bold]")
932
938
  console.print(" [cyan]aury generate crud user -i[/cyan] # 生成 CRUD(交互式)")
933
939
  console.print(" [cyan]aury generate model user -i[/cyan] # 生成模型(交互式)")
@@ -0,0 +1,471 @@
1
+ """包管理命令。
2
+
3
+ 用法:
4
+ aury pkg list # 列出所有可安装模块
5
+ aury pkg list --installed # 已安装的模块
6
+ aury pkg preset # 列出预设
7
+ aury pkg preset api # 查看预设详情
8
+ aury pkg install postgres redis # 安装模块
9
+ aury pkg install --preset api # 按预设安装
10
+ aury pkg remove redis # 卸载模块
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from dataclasses import dataclass
16
+ from enum import Enum
17
+ import subprocess
18
+ import sys
19
+ from typing import Annotated
20
+
21
+ from rich.console import Console
22
+ from rich.table import Table
23
+ import typer
24
+
25
+ console = Console()
26
+
27
+ app = typer.Typer(
28
+ name="pkg",
29
+ help="包管理 - 安装/卸载 aury 生态模块",
30
+ no_args_is_help=True,
31
+ )
32
+
33
+
34
+ # ============================================================================
35
+ # 数据定义
36
+ # ============================================================================
37
+
38
+
39
+ class Category(str, Enum):
40
+ """模块分类。"""
41
+
42
+ DATABASE = "database"
43
+ CACHE = "cache"
44
+ TASK = "task"
45
+ SCHEDULER = "scheduler"
46
+ ADMIN = "admin"
47
+ STORAGE = "storage"
48
+ ECOSYSTEM = "ecosystem"
49
+
50
+
51
+ @dataclass
52
+ class ModuleInfo:
53
+ """模块信息。"""
54
+
55
+ name: str
56
+ desc: str
57
+ usage: str
58
+ category: Category
59
+ deps: list[str] # extras 的依赖包名
60
+ is_extra: bool = True # True=extras, False=生态包
61
+ pkg: str | None = None # 生态包的完整包名
62
+
63
+
64
+ # Extras(aury-boot 的可选依赖)
65
+ MODULES: dict[str, ModuleInfo] = {
66
+ # 数据库驱动
67
+ "postgres": ModuleInfo(
68
+ name="postgres",
69
+ desc="PostgreSQL 异步驱动",
70
+ usage="DatabaseManager 使用 PostgreSQL 时需要",
71
+ category=Category.DATABASE,
72
+ deps=["asyncpg"],
73
+ ),
74
+ "mysql": ModuleInfo(
75
+ name="mysql",
76
+ desc="MySQL 异步驱动",
77
+ usage="DatabaseManager 使用 MySQL 时需要",
78
+ category=Category.DATABASE,
79
+ deps=["aiomysql"],
80
+ ),
81
+ "sqlite": ModuleInfo(
82
+ name="sqlite",
83
+ desc="SQLite 异步驱动",
84
+ usage="DatabaseManager 使用 SQLite 时需要(本地开发推荐)",
85
+ category=Category.DATABASE,
86
+ deps=["aiosqlite"],
87
+ ),
88
+ # 缓存
89
+ "redis": ModuleInfo(
90
+ name="redis",
91
+ desc="Redis 客户端",
92
+ usage="CacheManager 使用 Redis 后端时需要",
93
+ category=Category.CACHE,
94
+ deps=["redis"],
95
+ ),
96
+ # 任务队列
97
+ "tasks": ModuleInfo(
98
+ name="tasks",
99
+ desc="Dramatiq 任务队列",
100
+ usage="TaskManager 异步任务时需要",
101
+ category=Category.TASK,
102
+ deps=["dramatiq", "kombu", "dramatiq-kombu-broker"],
103
+ ),
104
+ "rabbitmq": ModuleInfo(
105
+ name="rabbitmq",
106
+ desc="RabbitMQ 消息队列后端",
107
+ usage="TaskManager/EventBus 使用 RabbitMQ 时需要(需配合 tasks)",
108
+ category=Category.TASK,
109
+ deps=["amqp"],
110
+ ),
111
+ # 调度器
112
+ "scheduler": ModuleInfo(
113
+ name="scheduler",
114
+ desc="APScheduler 定时调度",
115
+ usage="SchedulerManager 定时任务时需要",
116
+ category=Category.SCHEDULER,
117
+ deps=["apscheduler"],
118
+ ),
119
+ # 管理后台
120
+ "admin": ModuleInfo(
121
+ name="admin",
122
+ desc="SQLAdmin 管理后台",
123
+ usage="启用 /admin 管理界面时需要",
124
+ category=Category.ADMIN,
125
+ deps=["sqladmin", "itsdangerous"],
126
+ ),
127
+ # 存储(extras)
128
+ "s3": ModuleInfo(
129
+ name="s3",
130
+ desc="S3 兼容存储(AWS/MinIO/OSS)",
131
+ usage="StorageManager 使用 S3 兼容存储时需要",
132
+ category=Category.STORAGE,
133
+ deps=["aury-sdk-storage[aws]"],
134
+ ),
135
+ # 生态包
136
+ "storage-aws": ModuleInfo(
137
+ name="storage-aws",
138
+ desc="AWS S3 兼容存储",
139
+ usage="StorageManager 使用 AWS S3/MinIO/OSS 时需要",
140
+ category=Category.ECOSYSTEM,
141
+ deps=[],
142
+ is_extra=False,
143
+ pkg="aury-sdk-storage[aws]",
144
+ ),
145
+ "storage-cos": ModuleInfo(
146
+ name="storage-cos",
147
+ desc="腾讯云 COS 原生存储",
148
+ usage="StorageManager 使用腾讯云 COS 时推荐(性能更好)",
149
+ category=Category.ECOSYSTEM,
150
+ deps=[],
151
+ is_extra=False,
152
+ pkg="aury-sdk-storage[cos]",
153
+ ),
154
+ }
155
+
156
+
157
+ @dataclass
158
+ class PresetInfo:
159
+ """预设信息。"""
160
+
161
+ name: str
162
+ desc: str
163
+ modules: list[str]
164
+
165
+
166
+ PRESETS: dict[str, PresetInfo] = {
167
+ "minimal": PresetInfo(
168
+ name="minimal",
169
+ desc="最小化(本地开发/测试)",
170
+ modules=["sqlite"],
171
+ ),
172
+ "api": PresetInfo(
173
+ name="api",
174
+ desc="API 服务(Web 接口 + 管理后台)",
175
+ modules=["postgres", "redis", "admin"],
176
+ ),
177
+ "worker": PresetInfo(
178
+ name="worker",
179
+ desc="后台 Worker(任务队列 + 调度器)",
180
+ modules=["postgres", "redis", "tasks", "rabbitmq", "scheduler"],
181
+ ),
182
+ "full": PresetInfo(
183
+ name="full",
184
+ desc="完整功能(所有模块)",
185
+ modules=["postgres", "redis", "tasks", "rabbitmq", "scheduler", "admin", "storage-cos"],
186
+ ),
187
+ }
188
+
189
+
190
+ # 分类显示名称
191
+ CATEGORY_NAMES: dict[Category, str] = {
192
+ Category.DATABASE: "📦 数据库驱动",
193
+ Category.CACHE: "📦 缓存",
194
+ Category.TASK: "📦 任务队列",
195
+ Category.SCHEDULER: "📦 定时调度",
196
+ Category.ADMIN: "📦 管理后台",
197
+ Category.STORAGE: "📦 对象存储",
198
+ Category.ECOSYSTEM: "🌐 生态包",
199
+ }
200
+
201
+
202
+ # ============================================================================
203
+ # 工具函数
204
+ # ============================================================================
205
+
206
+
207
+ def _get_installed_packages() -> set[str]:
208
+ """获取已安装的包名。"""
209
+ try:
210
+ result = subprocess.run(
211
+ [sys.executable, "-m", "pip", "list", "--format=freeze"],
212
+ capture_output=True,
213
+ text=True,
214
+ check=True,
215
+ )
216
+ installed = set()
217
+ for line in result.stdout.strip().split("\n"):
218
+ if "==" in line:
219
+ pkg_name = line.split("==")[0].lower().replace("-", "_")
220
+ installed.add(pkg_name)
221
+ return installed
222
+ except subprocess.CalledProcessError:
223
+ return set()
224
+
225
+
226
+ def _is_module_installed(module: ModuleInfo) -> bool:
227
+ """检查模块是否已安装。"""
228
+ installed = _get_installed_packages()
229
+
230
+ if module.is_extra:
231
+ # 检查 deps 中的包是否已安装
232
+ for dep in module.deps:
233
+ # 处理 extras 语法,如 aury-sdk-storage[aws]
234
+ pkg_name = dep.split("[")[0].lower().replace("-", "_")
235
+ if pkg_name not in installed:
236
+ return False
237
+ return bool(module.deps)
238
+ else:
239
+ # 生态包:检查包名
240
+ if module.pkg:
241
+ pkg_name = module.pkg.split("[")[0].lower().replace("-", "_")
242
+ return pkg_name in installed
243
+ return False
244
+
245
+
246
+ def _run_uv_command(args: list[str]) -> bool:
247
+ """运行 uv 命令。"""
248
+ cmd = ["uv", *args]
249
+ console.print(f"[dim]$ {' '.join(cmd)}[/dim]")
250
+ try:
251
+ subprocess.run(cmd, check=True)
252
+ return True
253
+ except subprocess.CalledProcessError as e:
254
+ console.print(f"[red]命令失败: {e}[/red]")
255
+ return False
256
+ except FileNotFoundError:
257
+ console.print("[red]错误: 未找到 uv,请先安装: pip install uv[/red]")
258
+ return False
259
+
260
+
261
+ # ============================================================================
262
+ # 命令实现
263
+ # ============================================================================
264
+
265
+
266
+ @app.command(name="list")
267
+ def list_modules(
268
+ installed: Annotated[
269
+ bool,
270
+ typer.Option("--installed", "-i", help="仅显示已安装的模块"),
271
+ ] = False,
272
+ ) -> None:
273
+ """列出所有可安装的模块。"""
274
+ installed_pkgs = _get_installed_packages() if installed else None
275
+
276
+ # 按分类组织
277
+ by_category: dict[Category, list[ModuleInfo]] = {}
278
+ for module in MODULES.values():
279
+ if module.category not in by_category:
280
+ by_category[module.category] = []
281
+ by_category[module.category].append(module)
282
+
283
+ # 输出
284
+ for category in Category:
285
+ modules = by_category.get(category, [])
286
+ if not modules:
287
+ continue
288
+
289
+ # 过滤已安装
290
+ if installed:
291
+ modules = [m for m in modules if _is_module_installed(m)]
292
+ if not modules:
293
+ continue
294
+
295
+ console.print()
296
+ console.print(f"[bold]{CATEGORY_NAMES[category]}[/bold]")
297
+
298
+ table = Table(show_header=False, box=None, padding=(0, 2))
299
+ table.add_column("名称", style="cyan", width=15)
300
+ table.add_column("描述", width=30)
301
+ table.add_column("用途", style="dim")
302
+
303
+ for module in modules:
304
+ status = ""
305
+ if installed_pkgs is not None:
306
+ is_installed = _is_module_installed(module)
307
+ status = " [green]✓[/green]" if is_installed else ""
308
+ table.add_row(
309
+ f"{module.name}{status}",
310
+ module.desc,
311
+ f"→ {module.usage}",
312
+ )
313
+
314
+ console.print(table)
315
+
316
+ console.print()
317
+ console.print("[dim]提示: 使用 aury pkg install <模块名> 安装模块[/dim]")
318
+
319
+
320
+ @app.command(name="preset")
321
+ def list_presets(
322
+ name: Annotated[
323
+ str | None,
324
+ typer.Argument(help="预设名称(留空列出所有预设)"),
325
+ ] = None,
326
+ ) -> None:
327
+ """查看预设配置。"""
328
+ if name is None:
329
+ # 列出所有预设
330
+ console.print()
331
+ console.print("[bold]📋 可用预设[/bold]")
332
+ console.print()
333
+
334
+ table = Table(show_header=True, box=None, padding=(0, 2))
335
+ table.add_column("预设", style="cyan", width=12)
336
+ table.add_column("描述", width=35)
337
+ table.add_column("包含模块", style="dim")
338
+
339
+ for preset in PRESETS.values():
340
+ table.add_row(
341
+ preset.name,
342
+ preset.desc,
343
+ ", ".join(preset.modules),
344
+ )
345
+
346
+ console.print(table)
347
+ console.print()
348
+ console.print("[dim]提示: 使用 aury pkg preset <预设名> 查看详情[/dim]")
349
+ console.print("[dim] 使用 aury pkg install --preset <预设名> 安装[/dim]")
350
+ else:
351
+ # 查看指定预设
352
+ if name not in PRESETS:
353
+ console.print(f"[red]错误: 预设 '{name}' 不存在[/red]")
354
+ console.print(f"[dim]可用预设: {', '.join(PRESETS.keys())}[/dim]")
355
+ raise typer.Exit(1)
356
+
357
+ preset = PRESETS[name]
358
+ console.print()
359
+ console.print(f"[bold]📋 预设: {preset.name}[/bold]")
360
+ console.print(f"[dim]{preset.desc}[/dim]")
361
+ console.print()
362
+
363
+ console.print("[bold]包含模块:[/bold]")
364
+ for module_name in preset.modules:
365
+ module = MODULES.get(module_name)
366
+ if module:
367
+ installed = _is_module_installed(module)
368
+ status = "[green]✓ 已安装[/green]" if installed else "[dim]未安装[/dim]"
369
+ console.print(f" • {module.name}: {module.desc} {status}")
370
+ else:
371
+ console.print(f" • {module_name} [red](未知模块)[/red]")
372
+
373
+ console.print()
374
+ console.print(f"[dim]安装命令: aury pkg install --preset {name}[/dim]")
375
+
376
+
377
+ @app.command(name="install")
378
+ def install_modules(
379
+ modules: Annotated[
380
+ list[str] | None,
381
+ typer.Argument(help="要安装的模块名称"),
382
+ ] = None,
383
+ preset: Annotated[
384
+ str | None,
385
+ typer.Option("--preset", "-p", help="使用预设安装"),
386
+ ] = None,
387
+ ) -> None:
388
+ """安装模块。"""
389
+ if preset:
390
+ # 使用预设
391
+ if preset not in PRESETS:
392
+ console.print(f"[red]错误: 预设 '{preset}' 不存在[/red]")
393
+ console.print(f"[dim]可用预设: {', '.join(PRESETS.keys())}[/dim]")
394
+ raise typer.Exit(1)
395
+
396
+ preset_info = PRESETS[preset]
397
+ modules = preset_info.modules
398
+ console.print(f"[bold]📦 安装预设: {preset_info.name}[/bold]")
399
+ console.print(f"[dim]{preset_info.desc}[/dim]")
400
+ console.print()
401
+
402
+ if not modules:
403
+ console.print("[red]错误: 请指定要安装的模块,或使用 --preset[/red]")
404
+ raise typer.Exit(1)
405
+
406
+ # 收集要安装的包
407
+ extras_to_install: list[str] = []
408
+ pkgs_to_install: list[str] = []
409
+
410
+ for module_name in modules:
411
+ if module_name not in MODULES:
412
+ console.print(f"[yellow]警告: 模块 '{module_name}' 不存在,跳过[/yellow]")
413
+ continue
414
+
415
+ module = MODULES[module_name]
416
+ if module.is_extra:
417
+ extras_to_install.append(module.name)
418
+ else:
419
+ if module.pkg:
420
+ pkgs_to_install.append(module.pkg)
421
+
422
+ # 安装 extras
423
+ if extras_to_install:
424
+ extras_str = ",".join(extras_to_install)
425
+ console.print(f"[bold]安装 extras: {extras_str}[/bold]")
426
+ if not _run_uv_command(["add", f"aury-boot[{extras_str}]"]):
427
+ raise typer.Exit(1)
428
+
429
+ # 安装生态包
430
+ for pkg in pkgs_to_install:
431
+ console.print(f"[bold]安装生态包: {pkg}[/bold]")
432
+ if not _run_uv_command(["add", pkg]):
433
+ raise typer.Exit(1)
434
+
435
+ console.print()
436
+ console.print("[green]✅ 安装完成[/green]")
437
+
438
+
439
+ @app.command(name="remove")
440
+ def remove_modules(
441
+ modules: Annotated[
442
+ list[str],
443
+ typer.Argument(help="要卸载的模块名称"),
444
+ ],
445
+ ) -> None:
446
+ """卸载模块。"""
447
+ for module_name in modules:
448
+ if module_name not in MODULES:
449
+ console.print(f"[yellow]警告: 模块 '{module_name}' 不存在,跳过[/yellow]")
450
+ continue
451
+
452
+ module = MODULES[module_name]
453
+
454
+ if module.is_extra:
455
+ # extras 需要移除具体的依赖包
456
+ console.print(f"[bold]移除 {module.name} 的依赖...[/bold]")
457
+ for dep in module.deps:
458
+ pkg_name = dep.split("[")[0] # 去掉 extras 语法
459
+ _run_uv_command(["remove", pkg_name])
460
+ else:
461
+ # 生态包直接移除
462
+ if module.pkg:
463
+ pkg_name = module.pkg.split("[")[0]
464
+ console.print(f"[bold]移除生态包: {pkg_name}[/bold]")
465
+ _run_uv_command(["remove", pkg_name])
466
+
467
+ console.print()
468
+ console.print("[green]✅ 卸载完成[/green]")
469
+
470
+
471
+ __all__ = ["app"]
@@ -11,17 +11,20 @@ pip install "aury-sdk-storage[aws]"
11
11
 
12
12
  ## 10.2 基本用法(StorageManager)
13
13
 
14
- `StorageManager` 支持**命名多实例**,可以同时管理多个存储后端。
14
+ `StorageManager` 支持**命名多实例**,内部使用 `aury-sdk-storage` 提供的 `StorageFactory.from_config()` 智能选择后端(COS 原生 / S3 兼容等),对上层暴露统一接口。
15
15
 
16
16
  ```python
17
17
  from aury.boot.infrastructure.storage import (
18
- StorageManager, StorageConfig, StorageBackend, StorageFile,
18
+ StorageManager,
19
+ StorageConfig,
20
+ StorageBackend,
21
+ StorageFile,
19
22
  )
20
23
 
21
24
  # 默认实例
22
25
  storage = StorageManager.get_instance()
23
26
  await storage.initialize(StorageConfig(
24
- backend=StorageBackend.COS,
27
+ backend=StorageBackend.COS, # 自动选择 COS 原生 SDK 或 S3 兼容模式
25
28
  bucket_name="my-bucket-1250000000",
26
29
  region="ap-guangzhou",
27
30
  endpoint="https://cos.ap-guangzhou.myqcloud.com",
@@ -45,6 +48,12 @@ url = await storage.upload_file(
45
48
  )
46
49
  )
47
50
 
51
+ # 批量上传
52
+ urls = await storage.upload_files([
53
+ StorageFile(object_name="img/1.jpg", data=b"..."),
54
+ StorageFile(object_name="img/2.jpg", data=b"..."),
55
+ ])
56
+
48
57
  # 下载文件
49
58
  content = await storage.download_file("user/123/avatar.png")
50
59
 
@@ -58,7 +67,38 @@ exists = await storage.file_exists("user/123/avatar.png")
58
67
  await storage.delete_file("user/123/avatar.png")
59
68
  ```
60
69
 
61
- ## 10.3 STS 临时凭证(前端直传)
70
+ ## 10.3 高级用法:直接使用 SDKStorageFactory / StorageType
71
+
72
+ 对于需要更精细控制后端类型(如在脚手架或基础设施层扩展存储实现)的场景,可以直接使用 SDK 导出的类型:
73
+
74
+ ```python
75
+ from aury.boot.infrastructure.storage import (
76
+ COSStorage,
77
+ LocalStorage,
78
+ S3Storage,
79
+ SDKStorageFactory, # SDK 工厂(基于 StorageType 枚举)
80
+ StorageConfig,
81
+ StorageFile,
82
+ StorageType,
83
+ )
84
+
85
+ # 使用 StorageType 创建后端
86
+ config = StorageConfig(
87
+ backend=StorageType.COS,
88
+ bucket_name="my-bucket-1250000000",
89
+ region="ap-guangzhou",
90
+ )
91
+
92
+ backend = SDKStorageFactory.from_config(config)
93
+ result = await backend.upload_file(
94
+ StorageFile(object_name="dev/test.txt", data=b"hello"),
95
+ )
96
+ print(result.url)
97
+ ```
98
+
99
+ > 一般业务代码直接通过 `StorageManager` 即可,只有在需要自定义装配流程或编写基础设施扩展时才需要直接使用 `SDKStorageFactory` / `StorageType` / `COSStorage` 等类型。
100
+
101
+ ## 10.4 STS 临时凭证(前端直传)
62
102
 
63
103
  ```python
64
104
  from aury.sdk.storage.sts import (
@@ -95,11 +135,14 @@ return {{
95
135
  }}
96
136
  ```
97
137
 
98
- ## 10.4 本地存储(开发测试)
138
+ ## 10.5 本地存储(开发测试)
99
139
 
100
140
  ```python
101
141
  from aury.boot.infrastructure.storage import (
102
- StorageManager, StorageConfig, StorageBackend, StorageFile,
142
+ StorageManager,
143
+ StorageConfig,
144
+ StorageBackend,
145
+ StorageFile,
103
146
  )
104
147
 
105
148
  storage = StorageManager.get_instance()