ai-lls-lib 1.4.0rc2__py3-none-any.whl → 1.4.0rc3__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.
ai_lls_lib/__init__.py CHANGED
@@ -13,7 +13,7 @@ from ai_lls_lib.core.verifier import PhoneVerifier
13
13
  from ai_lls_lib.core.processor import BulkProcessor
14
14
  from ai_lls_lib.core.cache import DynamoDBCache
15
15
 
16
- __version__ = "1.4.0-rc.2"
16
+ __version__ = "1.4.0-rc.3"
17
17
  __all__ = [
18
18
  "PhoneVerification",
19
19
  "BulkJob",
@@ -23,12 +23,10 @@ class CreditManager:
23
23
  def __init__(self, table_name: Optional[str] = None):
24
24
  """Initialize with DynamoDB table."""
25
25
  if not boto3:
26
- logger.warning("boto3 not installed, using mock credit manager")
27
- self.table = None
28
- return
26
+ raise RuntimeError("boto3 is required for CreditManager")
29
27
 
30
28
  self.dynamodb = boto3.resource("dynamodb")
31
- self.table_name = table_name or os.environ.get("CREDITS_TABLE", "CreditsTable")
29
+ self.table_name = table_name if table_name else os.environ['CREDITS_TABLE']
32
30
 
33
31
  try:
34
32
  self.table = self.dynamodb.Table(self.table_name)
@@ -39,7 +37,7 @@ class CreditManager:
39
37
  def get_balance(self, user_id: str) -> int:
40
38
  """Get current credit balance for a user."""
41
39
  if not self.table:
42
- return 1000 # Mock balance for testing
40
+ raise RuntimeError(f"DynamoDB table {self.table_name} not accessible")
43
41
 
44
42
  try:
45
43
  response = self.table.get_item(Key={"user_id": user_id})
@@ -53,7 +51,7 @@ class CreditManager:
53
51
  def add_credits(self, user_id: str, amount: int) -> int:
54
52
  """Add credits to user balance and return new balance."""
55
53
  if not self.table:
56
- return 1000 + amount # Mock for testing
54
+ raise RuntimeError(f"DynamoDB table {self.table_name} not accessible")
57
55
 
58
56
  try:
59
57
  response = self.table.update_item(
@@ -76,7 +74,7 @@ class CreditManager:
76
74
  Returns True if successful, False if insufficient balance.
77
75
  """
78
76
  if not self.table:
79
- return True # Mock for testing
77
+ raise RuntimeError(f"DynamoDB table {self.table_name} not accessible")
80
78
 
81
79
  try:
82
80
  # Conditional update - only deduct if balance >= amount
@@ -107,7 +105,7 @@ class CreditManager:
107
105
  ) -> None:
108
106
  """Update subscription state in CreditsTable."""
109
107
  if not self.table:
110
- return # Mock for testing
108
+ raise RuntimeError(f"DynamoDB table {self.table_name} not accessible")
111
109
 
112
110
  try:
113
111
  update_expr = "SET subscription_status = :status, updated_at = :now"
@@ -136,12 +134,7 @@ class CreditManager:
136
134
  def get_user_payment_info(self, user_id: str) -> Dict[str, Any]:
137
135
  """Get user's payment-related information."""
138
136
  if not self.table:
139
- return {
140
- "credits": 1000,
141
- "stripe_customer_id": None,
142
- "stripe_subscription_id": None,
143
- "subscription_status": None
144
- }
137
+ raise RuntimeError(f"DynamoDB table {self.table_name} not accessible")
145
138
 
146
139
  try:
147
140
  response = self.table.get_item(Key={"user_id": user_id})
@@ -176,7 +169,7 @@ class CreditManager:
176
169
  def set_stripe_customer_id(self, user_id: str, stripe_customer_id: str) -> None:
177
170
  """Store Stripe customer ID for a user."""
178
171
  if not self.table:
179
- return # Mock for testing
172
+ raise RuntimeError(f"DynamoDB table {self.table_name} not accessible")
180
173
 
181
174
  try:
182
175
  self.table.update_item(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ai-lls-lib
3
- Version: 1.4.0rc2
3
+ Version: 1.4.0rc3
4
4
  Summary: Landline Scrubber core library - phone verification and DNC checking
5
5
  Author: LandlineScrubber Team
6
6
  Requires-Python: >=3.12,<4.0
@@ -1,4 +1,4 @@
1
- ai_lls_lib/__init__.py,sha256=0poXvWj7ugCNm9UUymXIfKaFUONnODl3crlDvT2VrWU,589
1
+ ai_lls_lib/__init__.py,sha256=UP9ZiqSs3cEXqNunHbIuzjmrDyGv7nNa_Vx3zdB4xew,589
2
2
  ai_lls_lib/auth/__init__.py,sha256=c6zomHSB6y9Seakf84ciGsD3XgWarIty9xty6P8fxVw,194
3
3
  ai_lls_lib/auth/context_parser.py,sha256=8I0vGbtykNLWqm8ldedxXjE-E3nqsCy113JgeyuiJoM,2222
4
4
  ai_lls_lib/cli/__init__.py,sha256=m9qjZTW1jpENwXAUeuRrlP0b66BWRcqSO28MSjvOyCs,74
@@ -17,7 +17,7 @@ ai_lls_lib/core/models.py,sha256=ABRYaeMCWahQh4WdbkCxt3AO0-EvPWZwlL-JITQSnEM,238
17
17
  ai_lls_lib/core/processor.py,sha256=6752IPDQ-Mz5i_CU7aBM0UjvV7IjyZFl35LKVPkHMpc,9974
18
18
  ai_lls_lib/core/verifier.py,sha256=6uB_jawWoIqsNYAadTKr0lSolIWygg2gK6ykf8lrul0,2716
19
19
  ai_lls_lib/payment/__init__.py,sha256=xhUWgfLnk3syXXQItswmDXdfXUyJTXTQAA0zIUuCVII,295
20
- ai_lls_lib/payment/credit_manager.py,sha256=ynjweRkbdHI-A6fROUoqlazNDmXOugXsIaMco7k62S0,7147
20
+ ai_lls_lib/payment/credit_manager.py,sha256=gQABSr8Lgy_IqNwQ5Dg-Ep-_7P7Q9Atx77RGMgmW0V8,7154
21
21
  ai_lls_lib/payment/models.py,sha256=Du5sRc_cCsnyFJv0G3Rp67tLvZ68gq61Cm3QLC9jERI,3507
22
22
  ai_lls_lib/payment/stripe_manager.py,sha256=R_M4Bii9BGianL_STqvz4UU8ww8mlCByGo66V-e2C6Y,18027
23
23
  ai_lls_lib/payment/webhook_processor.py,sha256=cIZqCS98Q305SCI3-4AJ1h-IJ-l-7fMby1FFy1ckP6k,8765
@@ -27,7 +27,7 @@ ai_lls_lib/providers/external.py,sha256=-Hhnlm8lQWRcWr5vG0dmD3sca2rohURrx0usOR2y
27
27
  ai_lls_lib/providers/stub.py,sha256=847Tmw522B3HQ2j38BH1sdcZQy--RdtDcXsrIrFKNBQ,1150
28
28
  ai_lls_lib/testing/__init__.py,sha256=RUxRYBzzPCPS15Umb6bUrE6rL5BQXBQf4SJM2E3ffrg,39
29
29
  ai_lls_lib/testing/fixtures.py,sha256=_n6bbr95LnQf9Dvu1qKs2HsvHEA7AAbe59B75qxE10w,3310
30
- ai_lls_lib-1.4.0rc2.dist-info/METADATA,sha256=htsgnIQ-MJ32O71Vn-isPhmoru6EaTPmOP3sMII7M3o,7251
31
- ai_lls_lib-1.4.0rc2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- ai_lls_lib-1.4.0rc2.dist-info/entry_points.txt,sha256=Pi0V_HBViEKGFbNQKatl5lhhnHHBXlxaom-5gH9gXZ0,55
33
- ai_lls_lib-1.4.0rc2.dist-info/RECORD,,
30
+ ai_lls_lib-1.4.0rc3.dist-info/METADATA,sha256=LP2Jz8xjGUZZU3-6IaefvMUfRJalzjLsXviMElbV8D0,7251
31
+ ai_lls_lib-1.4.0rc3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ ai_lls_lib-1.4.0rc3.dist-info/entry_points.txt,sha256=Pi0V_HBViEKGFbNQKatl5lhhnHHBXlxaom-5gH9gXZ0,55
33
+ ai_lls_lib-1.4.0rc3.dist-info/RECORD,,