ai-lls-lib 1.3.1__tar.gz → 1.4.0rc2__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 (32) hide show
  1. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/PKG-INFO +1 -1
  2. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/pyproject.toml +1 -1
  3. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/__init__.py +1 -1
  4. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/commands/stripe.py +49 -1
  5. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/payment/models.py +7 -1
  6. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/README.md +0 -0
  7. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/auth/__init__.py +0 -0
  8. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/auth/context_parser.py +0 -0
  9. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/__init__.py +0 -0
  10. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/__main__.py +0 -0
  11. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/aws_client.py +0 -0
  12. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/commands/__init__.py +0 -0
  13. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/commands/admin.py +0 -0
  14. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/commands/cache.py +0 -0
  15. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/commands/test_stack.py +0 -0
  16. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/commands/verify.py +0 -0
  17. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/cli/env_loader.py +0 -0
  18. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/core/__init__.py +0 -0
  19. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/core/cache.py +0 -0
  20. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/core/models.py +0 -0
  21. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/core/processor.py +0 -0
  22. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/core/verifier.py +0 -0
  23. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/payment/__init__.py +0 -0
  24. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/payment/credit_manager.py +0 -0
  25. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/payment/stripe_manager.py +0 -0
  26. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/payment/webhook_processor.py +0 -0
  27. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/providers/__init__.py +0 -0
  28. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/providers/base.py +0 -0
  29. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/providers/external.py +0 -0
  30. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/providers/stub.py +0 -0
  31. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/testing/__init__.py +0 -0
  32. {ai_lls_lib-1.3.1 → ai_lls_lib-1.4.0rc2}/src/ai_lls_lib/testing/fixtures.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ai-lls-lib
3
- Version: 1.3.1
3
+ Version: 1.4.0rc2
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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ai-lls-lib"
3
- version = "1.3.1"
3
+ version = "1.4.0-rc.2"
4
4
  description = "Landline Scrubber core library - phone verification and DNC checking"
5
5
  authors = ["LandlineScrubber Team"]
6
6
  readme = "README.md"
@@ -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.3.1"
16
+ __version__ = "1.4.0-rc.2"
17
17
  __all__ = [
18
18
  "PhoneVerification",
19
19
  "BulkJob",
@@ -180,7 +180,8 @@ def seed_products(environment: str, api_key: Optional[str], dry_run: bool):
180
180
  for p in existing_products.data:
181
181
  if (p.metadata.get("product_type") == "landline_scrubber" and
182
182
  p.metadata.get("environment") == environment and
183
- p.metadata.get("tier") == config["metadata"]["tier"]):
183
+ p.metadata.get("tier") == config["metadata"]["tier"] and
184
+ p.active): # Only use active products
184
185
  product = p
185
186
  click.echo(f"Found existing product: {product.name}")
186
187
  break
@@ -219,6 +220,53 @@ def seed_products(environment: str, api_key: Optional[str], dry_run: bool):
219
220
  click.echo(f" {price_id}")
220
221
 
221
222
 
223
+ @stripe_group.command("clean")
224
+ @click.option("--environment", type=click.Choice(["staging", "production"]), default="staging")
225
+ @click.option("--api-key", help="Stripe API key (overrides environment)")
226
+ @click.option("--force", is_flag=True, help="Skip confirmation")
227
+ def clean_products(environment: str, api_key: Optional[str], force: bool):
228
+ """Remove all Landline Scrubber products and prices."""
229
+ import stripe
230
+
231
+ # Load API key from environment if not provided
232
+ if not api_key:
233
+ api_key = get_stripe_key(environment)
234
+ if not api_key:
235
+ click.echo(f"Error: No Stripe API key found for {environment} environment", err=True)
236
+ return
237
+
238
+ stripe.api_key = api_key
239
+
240
+ if not force:
241
+ if not click.confirm(f"This will DELETE all Landline Scrubber products in {environment}. Continue?"):
242
+ return
243
+
244
+ try:
245
+ # List all products
246
+ products = stripe.Product.list(limit=100)
247
+ deleted_count = 0
248
+
249
+ for product in products.data:
250
+ if (product.metadata.get("product_type") == "landline_scrubber" and
251
+ product.metadata.get("environment") == environment):
252
+ # Archive all prices first
253
+ prices = stripe.Price.list(product=product.id, limit=100)
254
+ for price in prices.data:
255
+ if price.active:
256
+ stripe.Price.modify(price.id, active=False)
257
+ click.echo(f" Archived price: {price.id}")
258
+
259
+ # Archive the product
260
+ stripe.Product.modify(product.id, active=False)
261
+ click.echo(f"Archived product: {product.name}")
262
+ deleted_count += 1
263
+
264
+ click.echo(f"\nArchived {deleted_count} products in {environment} environment")
265
+
266
+ except stripe.error.StripeError as e:
267
+ click.echo(f"Error: {e}", err=True)
268
+
269
+
222
270
  @stripe_group.command("list")
223
271
  @click.option("--environment", type=click.Choice(["staging", "production"]), default="staging")
224
272
  @click.option("--api-key", help="Stripe API key (overrides environment)")
@@ -41,7 +41,7 @@ class Plan:
41
41
 
42
42
  def to_dict(self) -> Dict[str, Any]:
43
43
  """Convert to dictionary for JSON serialization."""
44
- return {
44
+ result = {
45
45
  "plan_reference": self.plan_reference,
46
46
  "plan_type": self.plan_type,
47
47
  "plan_name": self.plan_name,
@@ -52,6 +52,12 @@ class Plan:
52
52
  "percent_off": self.percent_off
53
53
  }
54
54
 
55
+ # Add variable_amount flag for VARIABLE product
56
+ if self.plan_name == "VARIABLE":
57
+ result["variable_amount"] = True
58
+
59
+ return result
60
+
55
61
  @classmethod
56
62
  def from_stripe_price(cls, price: Dict[str, Any], product: Dict[str, Any]) -> "Plan":
57
63
  """
File without changes