mindroot 9.8.0__py3-none-any.whl → 9.10.0__py3-none-any.whl
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.
- mindroot/coreplugins/subscriptions/mod.py +54 -1
- mindroot/coreplugins/subscriptions/subscription_manager.py +1 -1
- mindroot/coreplugins/user_service/templates/reset_password.jinja2 +2 -2
- {mindroot-9.8.0.dist-info → mindroot-9.10.0.dist-info}/METADATA +1 -1
- {mindroot-9.8.0.dist-info → mindroot-9.10.0.dist-info}/RECORD +9 -9
- {mindroot-9.8.0.dist-info → mindroot-9.10.0.dist-info}/WHEEL +0 -0
- {mindroot-9.8.0.dist-info → mindroot-9.10.0.dist-info}/entry_points.txt +0 -0
- {mindroot-9.8.0.dist-info → mindroot-9.10.0.dist-info}/licenses/LICENSE +0 -0
- {mindroot-9.8.0.dist-info → mindroot-9.10.0.dist-info}/top_level.txt +0 -0
|
@@ -778,6 +778,59 @@ async def cancel_subscription(subscription_id: str, at_period_end: bool = True,
|
|
|
778
778
|
|
|
779
779
|
return updated_subscription.to_dict()
|
|
780
780
|
|
|
781
|
+
@service()
|
|
782
|
+
async def get_subscription_by_provider_id(provider_subscription_id: str, context=None) -> Optional[Dict]:
|
|
783
|
+
"""Get subscription by provider subscription ID (e.g., Stripe subscription ID)
|
|
784
|
+
|
|
785
|
+
Args:
|
|
786
|
+
provider_subscription_id: Provider's subscription ID
|
|
787
|
+
context: Request context
|
|
788
|
+
|
|
789
|
+
Returns:
|
|
790
|
+
Optional[Dict]: Subscription details or None if not found
|
|
791
|
+
"""
|
|
792
|
+
global _subscription_manager
|
|
793
|
+
if not _subscription_manager:
|
|
794
|
+
plugin = SubscriptionsPlugin(get_base_path(context))
|
|
795
|
+
_, subscription_manager, _ = plugin.create_components()
|
|
796
|
+
_subscription_manager = subscription_manager
|
|
797
|
+
|
|
798
|
+
try:
|
|
799
|
+
subscriptions = await _subscription_manager.get_subscriptions_by_provider_id(
|
|
800
|
+
provider='stripe',
|
|
801
|
+
provider_subscription_id=provider_subscription_id
|
|
802
|
+
)
|
|
803
|
+
return subscriptions[0].to_dict() if subscriptions else None
|
|
804
|
+
except Exception as e:
|
|
805
|
+
logger.error(f"Error getting subscription by provider ID: {e}")
|
|
806
|
+
return None
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
@service()
|
|
810
|
+
async def update_subscription_status(subscription_id: str, status: str, context=None) -> Optional[Dict]:
|
|
811
|
+
"""Update a subscription's status
|
|
812
|
+
|
|
813
|
+
Args:
|
|
814
|
+
subscription_id: Internal subscription ID
|
|
815
|
+
status: New status (active, canceled, etc.)
|
|
816
|
+
context: Request context
|
|
817
|
+
|
|
818
|
+
Returns:
|
|
819
|
+
Optional[Dict]: Updated subscription details or None if not found
|
|
820
|
+
"""
|
|
821
|
+
global _subscription_manager
|
|
822
|
+
if not _subscription_manager:
|
|
823
|
+
plugin = SubscriptionsPlugin(get_base_path(context))
|
|
824
|
+
_, subscription_manager, _ = plugin.create_components()
|
|
825
|
+
_subscription_manager = subscription_manager
|
|
826
|
+
|
|
827
|
+
try:
|
|
828
|
+
subscription = await _subscription_manager.update_subscription_status(subscription_id, status)
|
|
829
|
+
return subscription.to_dict() if subscription else None
|
|
830
|
+
except Exception as e:
|
|
831
|
+
logger.error(f"Error updating subscription status: {e}")
|
|
832
|
+
return None
|
|
833
|
+
|
|
781
834
|
# Command methods
|
|
782
835
|
|
|
783
836
|
@command()
|
|
@@ -851,4 +904,4 @@ async def get_my_subscriptions(params, context=None):
|
|
|
851
904
|
|
|
852
905
|
result += "\n"
|
|
853
906
|
|
|
854
|
-
return result
|
|
907
|
+
return result
|
|
@@ -134,7 +134,7 @@ class SubscriptionManager:
|
|
|
134
134
|
async def get_user_subscriptions(self, username: str) -> List[UserSubscription]:
|
|
135
135
|
"""Get all subscriptions for a user"""
|
|
136
136
|
return await self.storage.get_user_subscriptions(username)
|
|
137
|
-
|
|
137
|
+
|
|
138
138
|
async def get_subscriptions_by_provider_id(self, provider: str, provider_subscription_id: str) -> List[UserSubscription]:
|
|
139
139
|
"""Get subscriptions by provider subscription ID"""
|
|
140
140
|
return await self.storage.get_subscriptions_by_provider_id(provider, provider_subscription_id)
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<div class="container">
|
|
22
22
|
<h1>Reset Your Password</h1>
|
|
23
23
|
{% if success %}
|
|
24
|
-
<div class="success">Your password has been reset successfully. You can now log in with your new password.</div>
|
|
24
|
+
<div class="success">Your password has been reset successfully. You can now <a href="/login">log in</a> with your new password.</div>
|
|
25
25
|
{% else %}
|
|
26
26
|
<form method="post">
|
|
27
27
|
<label for="password">New Password</label>
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
{% endif %}
|
|
37
37
|
</div>
|
|
38
38
|
</body>
|
|
39
|
-
</html>
|
|
39
|
+
</html>
|
|
@@ -1761,13 +1761,13 @@ mindroot/coreplugins/startup/mod.py,sha256=6NsrpuVFvLeKGjgV3erCBBeYhy5Y3pT8gJmI6
|
|
|
1761
1761
|
mindroot/coreplugins/subscriptions/__init__.py,sha256=4uQ6vAhRyCOIAuegQGf03CMabsCPHMz00g1UMkCH2Ec,96
|
|
1762
1762
|
mindroot/coreplugins/subscriptions/credit_integration.py,sha256=X92tUNcWxvJXv2uCzmhLKTnjbhZC_pLlWYEPLlhQbCY,2103
|
|
1763
1763
|
mindroot/coreplugins/subscriptions/default_templates.py,sha256=S32UkKZLbLyEYUn1Js34TWTvwVA7paYP72UYRJiqv6Y,9749
|
|
1764
|
-
mindroot/coreplugins/subscriptions/mod.py,sha256=
|
|
1764
|
+
mindroot/coreplugins/subscriptions/mod.py,sha256=kSkT-2u43zM1DQ5Do1jH1TbhDmyThIHuAGRCcAhvPyc,33298
|
|
1765
1765
|
mindroot/coreplugins/subscriptions/models.py,sha256=XOUkmWTXE_bjSzluNwW9UmGczXvHLfqa_WNb-lgaPBU,4183
|
|
1766
1766
|
mindroot/coreplugins/subscriptions/plugin_info.json,sha256=o31KLpE2xY6Gjy-AmmDhZjVSO4iEw7Pg0199sdmsRWI,810
|
|
1767
1767
|
mindroot/coreplugins/subscriptions/router.py,sha256=Uyo72_Ocip2CmFCdKmgkWxtaEABlM9E4XXCt812beno,13092
|
|
1768
1768
|
mindroot/coreplugins/subscriptions/storage.py,sha256=NUh2Syy_tK677aJ4FXOs94BlcY59hdITHmyxG3VsA28,9755
|
|
1769
1769
|
mindroot/coreplugins/subscriptions/stripe_integration.py,sha256=RHUsZiojQK3NV54L4AMJcu4utGm9ErYlpD8skPyS7ac,2447
|
|
1770
|
-
mindroot/coreplugins/subscriptions/subscription_manager.py,sha256=
|
|
1770
|
+
mindroot/coreplugins/subscriptions/subscription_manager.py,sha256=vFnKSH3mHtrGeQ6KjdXljJbUh5rgw2zE4Kamg6YjxVY,6138
|
|
1771
1771
|
mindroot/coreplugins/subscriptions/webhook_handler.py,sha256=FWidmQ6S-rgN7MkRDhEdT9s4qiQ8qSmpae4OEfPAmwc,9529
|
|
1772
1772
|
mindroot/coreplugins/subscriptions/inject/admin.jinja2,sha256=WJT8duAPzSevPI5i3tatae_fyUqjkz7c6RBlmyCaScY,412
|
|
1773
1773
|
mindroot/coreplugins/subscriptions/inject/chat.jinja2,sha256=v50HjG4uGKGJ1fXhadkNSzg50QNNsiY_W7XjqPb3Muw,1078
|
|
@@ -1801,7 +1801,7 @@ mindroot/coreplugins/user_service/role_service.py,sha256=e6XrxhMC4903C-Y515XSC54
|
|
|
1801
1801
|
mindroot/coreplugins/user_service/router.py,sha256=j7Y2vn87b86FOA5KkMIiduYjfyHuymkE4hSsrhD7tss,4968
|
|
1802
1802
|
mindroot/coreplugins/user_service/backup/admin_service.py,sha256=scc59rxlZz4uuVvgjf-9HL2gKi7-uiCdSt6LjWJILR8,4259
|
|
1803
1803
|
mindroot/coreplugins/user_service/backup/admin_setup.py,sha256=JGszAw8nVtnNiisSUGu9jtoStKGyN44KpbRlKAhDJho,3001
|
|
1804
|
-
mindroot/coreplugins/user_service/templates/reset_password.jinja2,sha256=
|
|
1804
|
+
mindroot/coreplugins/user_service/templates/reset_password.jinja2,sha256=81UNN9bWFS2GNIO4_jji6iz5Dfk95Ln2vc9_Brac4ac,2119
|
|
1805
1805
|
mindroot/lib/__init__.py,sha256=388n_hMskU0TnZ4xT10US_kFkya-EPBjWcv7AZf_HOk,74
|
|
1806
1806
|
mindroot/lib/buchatlog.py,sha256=LJZc3ksKgJcStltmHrrwNLaON3EDzhOKVAWj0Wl22wk,5861
|
|
1807
1807
|
mindroot/lib/buchatlog2.py,sha256=Va9FteBWePEjWD9OZcw-OtQfEb-IoCVGTmJeMRaX9is,13729
|
|
@@ -1861,9 +1861,9 @@ mindroot/protocols/services/stream_chat.py,sha256=fMnPfwaB5fdNMBLTEg8BXKAGvrELKH
|
|
|
1861
1861
|
mindroot/registry/__init__.py,sha256=40Xy9bmPHsgdIrOzbtBGzf4XMqXVi9P8oZTJhn0r654,151
|
|
1862
1862
|
mindroot/registry/component_manager.py,sha256=WZFNPg4SNvpqsM5NFiC2DpgmrJQCyR9cNhrCBpp30Qk,995
|
|
1863
1863
|
mindroot/registry/data_access.py,sha256=81In5TwETpaqnnY1_-tBQM7rfWvUxZUZkG7lEelRUfU,5321
|
|
1864
|
-
mindroot-9.
|
|
1865
|
-
mindroot-9.
|
|
1866
|
-
mindroot-9.
|
|
1867
|
-
mindroot-9.
|
|
1868
|
-
mindroot-9.
|
|
1869
|
-
mindroot-9.
|
|
1864
|
+
mindroot-9.10.0.dist-info/licenses/LICENSE,sha256=8plAmZh8y9ccuuqFFz4kp7G-cO_qsPgAOoHNvabSB4U,1070
|
|
1865
|
+
mindroot-9.10.0.dist-info/METADATA,sha256=4eOjm8CiVZo_t5vuQK4DtKlTS-JMRmumB5ygmOUwJ68,1035
|
|
1866
|
+
mindroot-9.10.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1867
|
+
mindroot-9.10.0.dist-info/entry_points.txt,sha256=0bpyjMccLttx6VcjDp6zfJPN0Kk0rffor6IdIbP0j4c,50
|
|
1868
|
+
mindroot-9.10.0.dist-info/top_level.txt,sha256=gwKm7DmNjhdrCJTYCrxa9Szne4lLpCtrEBltfsX-Mm8,9
|
|
1869
|
+
mindroot-9.10.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|