ai-lls-lib 1.4.0rc6__py3-none-any.whl → 1.5.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.

Potentially problematic release.


This version of ai-lls-lib might be problematic. Click here for more details.

ai_lls_lib/__init__.py CHANGED
@@ -2,6 +2,8 @@
2
2
  AI LLS Library - Core business logic for Landline Scrubber.
3
3
 
4
4
  This library provides phone verification and DNC checking capabilities.
5
+
6
+ Version 1.5.x includes removal of environment-based Stripe filtering.
5
7
  """
6
8
  from ai_lls_lib.core.models import (
7
9
  PhoneVerification,
@@ -15,7 +17,7 @@ from ai_lls_lib.core.verifier import PhoneVerifier
15
17
  from ai_lls_lib.core.processor import BulkProcessor
16
18
  from ai_lls_lib.core.cache import DynamoDBCache
17
19
 
18
- __version__ = "1.4.0-rc.6"
20
+ __version__ = "1.5.0-rc.3"
19
21
  __all__ = [
20
22
  "PhoneVerification",
21
23
  "BulkJob",
@@ -28,8 +28,9 @@ def seed_products(environment: str, api_key: Optional[str], dry_run: bool):
28
28
  if not api_key:
29
29
  api_key = get_stripe_key(environment)
30
30
  if not api_key:
31
+ env_prefix = 'STAGING' if environment == 'staging' else 'PROD'
31
32
  click.echo(f"Error: No Stripe API key found for {environment} environment", err=True)
32
- click.echo(f"Set {environment.upper()}_STRIPE_SECRET_KEY or STRIPE_SECRET_KEY", err=True)
33
+ click.echo(f"Set {env_prefix}_STRIPE_SECRET_KEY or STRIPE_SECRET_KEY", err=True)
33
34
  return
34
35
  click.echo(f"Using Stripe key for {environment} environment", err=True)
35
36
 
@@ -283,8 +284,9 @@ def list_products(environment: str, api_key: Optional[str], output_json: bool):
283
284
  if not api_key:
284
285
  api_key = get_stripe_key(environment)
285
286
  if not api_key:
287
+ env_prefix = 'STAGING' if environment == 'staging' else 'PROD'
286
288
  click.echo(f"Error: No Stripe API key found for {environment} environment", err=True)
287
- click.echo(f"Set {environment.upper()}_STRIPE_SECRET_KEY or STRIPE_SECRET_KEY", err=True)
289
+ click.echo(f"Set {env_prefix}_STRIPE_SECRET_KEY or STRIPE_SECRET_KEY", err=True)
288
290
  return
289
291
 
290
292
  try:
@@ -327,11 +329,13 @@ def setup_webhook(endpoint_url: Optional[str], environment: str, api_key: Option
327
329
  if not api_key:
328
330
  api_key = get_stripe_key(environment)
329
331
  if not api_key:
332
+ env_prefix = 'STAGING' if environment == 'staging' else 'PROD'
330
333
  click.echo(f"Error: No Stripe API key found for {environment} environment", err=True)
331
- click.echo(f"Set {environment.upper()}_STRIPE_SECRET_KEY or STRIPE_SECRET_KEY", err=True)
334
+ click.echo(f"Set {env_prefix}_STRIPE_SECRET_KEY or STRIPE_SECRET_KEY", err=True)
332
335
  return
333
336
 
334
337
  stripe.api_key = api_key
338
+ env_prefix = 'STAGING' if environment == 'staging' else 'PROD'
335
339
 
336
340
  if print_secret:
337
341
  # List existing webhooks
@@ -371,7 +375,7 @@ def setup_webhook(endpoint_url: Optional[str], environment: str, api_key: Option
371
375
  click.echo(f" ID: {webhook.id}")
372
376
  click.echo(f" Secret: {webhook.secret}")
373
377
  click.echo(f"\nAdd this to your environment:")
374
- click.echo(f" {environment.upper()}_STRIPE_WEBHOOK_SECRET={webhook.secret}")
378
+ click.echo(f" {env_prefix}_STRIPE_WEBHOOK_SECRET={webhook.secret}")
375
379
 
376
380
  except stripe.error.StripeError as e:
377
381
  click.echo(f"Error creating webhook: {e}", err=True)
@@ -74,10 +74,13 @@ def get_stripe_key(environment: str, env_vars: Optional[Dict[str, str]] = None)
74
74
  env_vars = load_environment_config()
75
75
 
76
76
  # Map environment names to prefixes
77
- env_prefix = {
77
+ env_prefix_map = {
78
78
  'staging': 'STAGING',
79
79
  'production': 'PROD'
80
- }.get(environment, environment.upper())
80
+ }
81
+ if environment not in env_prefix_map:
82
+ raise ValueError(f"Invalid environment '{environment}'. Must be 'staging' or 'production'")
83
+ env_prefix = env_prefix_map[environment]
81
84
 
82
85
  # Try environment-specific key first
83
86
  env_key = f"{env_prefix}_STRIPE_SECRET_KEY"
@@ -108,10 +111,13 @@ def get_env_variable(key: str, environment: Optional[str] = None,
108
111
  env_vars = load_environment_config()
109
112
 
110
113
  if environment:
111
- env_prefix = {
114
+ env_prefix_map = {
112
115
  'staging': 'STAGING',
113
116
  'production': 'PROD'
114
- }.get(environment, environment.upper())
117
+ }
118
+ if environment not in env_prefix_map:
119
+ raise ValueError(f"Invalid environment '{environment}'. Must be 'staging' or 'production'")
120
+ env_prefix = env_prefix_map[environment]
115
121
 
116
122
  # Try environment-specific key first
117
123
  env_key = f"{env_prefix}_{key}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ai-lls-lib
3
- Version: 1.4.0rc6
3
+ Version: 1.5.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=jySixyQs-rY5KBpS29zddIrbbCEG41Ez8sXUfIypgJ8,663
1
+ ai_lls_lib/__init__.py,sha256=pGHYFGC4SkH9TaaSFWG7qyjwC63DGMx2zZOvHaY5diI,734
2
2
  ai_lls_lib/auth/__init__.py,sha256=ZjwlfTvYUo9A9BaLinaXW2elxYectScmu0XtKAppSFs,198
3
3
  ai_lls_lib/auth/context_parser.py,sha256=AWyGWejrFR0jJ7fMhajdA1ABo656Qlvs2YAzz-IfTrs,2290
4
4
  ai_lls_lib/cli/__init__.py,sha256=HyjnIBGlrbTlHQ82n_UppjtJbZl4_7QsnAgRqNlXKMU,77
@@ -7,10 +7,10 @@ ai_lls_lib/cli/aws_client.py,sha256=lqihYQQtpx8Xb5HcVTbexl1pZdlYYdozPLDEGcen27Q,
7
7
  ai_lls_lib/cli/commands/__init__.py,sha256=yi0bdkZSPIXY33apvJRcuK410-Ta0-_-n31MQYuL_aU,31
8
8
  ai_lls_lib/cli/commands/admin.py,sha256=JlFljbblVWJkJ2z2FIM6P0fy3Pmc0VqG62Y3POtvRFw,6861
9
9
  ai_lls_lib/cli/commands/cache.py,sha256=1Vm3m5vXJkRagNmQXpT8_YEsQEv92veJUFwA_v9FPb0,5822
10
- ai_lls_lib/cli/commands/stripe.py,sha256=5Exkxst9xf3KRynfIlQRw5NJavWol9DYrHCMKRPzGpA,15016
10
+ ai_lls_lib/cli/commands/stripe.py,sha256=_aRsz6Z7BN-S9_07efUovXwsbL-eCE-raw1uBOkDP5g,15276
11
11
  ai_lls_lib/cli/commands/test_stack.py,sha256=FK6ITOek7j4e0QiSNTv_taLghNnR8d_kWG02cl0A3rY,7594
12
12
  ai_lls_lib/cli/commands/verify.py,sha256=a63KSXd0XfJq2LFEt3RrGmQ7SXK40pQhS-oaPo8SCdo,4349
13
- ai_lls_lib/cli/env_loader.py,sha256=zqCIZvySqXQMxbOW45k6qevrsKbk8X14OU7EDr1jx8Q,3884
13
+ ai_lls_lib/cli/env_loader.py,sha256=dIgD5PC3u4MW2Qs_MHRJcUeoA0Wwe7e8nnitEe26xrY,4208
14
14
  ai_lls_lib/core/__init__.py,sha256=ATh5sGhhB9g5Sd2H0kRqoCA0hxqe6UWonlPq2Wnl_i8,39
15
15
  ai_lls_lib/core/cache.py,sha256=4HSVaRvv_wueLV30fVbTk_KWZmXjR2mBrGl7UNT_5kQ,3817
16
16
  ai_lls_lib/core/models.py,sha256=jzvc-SlP-nLgvkom9hj-TwKHxBePbEfC9xL_Tt1Uh4Y,2458
@@ -27,7 +27,7 @@ ai_lls_lib/providers/external.py,sha256=T8P_XtLNCXZBB0DzK4fradNBoiapIbpQ09Ai4Dih
27
27
  ai_lls_lib/providers/stub.py,sha256=n8WCcuqcv62DnIO-WPhuold-AC3yrxjQAboJ4CO2n6U,1198
28
28
  ai_lls_lib/testing/__init__.py,sha256=NytBz7T0YtNLDArRYHsczaeopIQmmBeV21-XXUprdeY,42
29
29
  ai_lls_lib/testing/fixtures.py,sha256=OC1huorIqUndePoUTfgoU-aDvsWAFJqmQ6fGDjH9E14,3414
30
- ai_lls_lib-1.4.0rc6.dist-info/METADATA,sha256=O1iLupAUoebcmusePX6z6MyOr8Vwz8SR2iiwQ0uxy2A,7302
31
- ai_lls_lib-1.4.0rc6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
32
- ai_lls_lib-1.4.0rc6.dist-info/entry_points.txt,sha256=Pi0V_HBViEKGFbNQKatl5lhhnHHBXlxaom-5gH9gXZ0,55
33
- ai_lls_lib-1.4.0rc6.dist-info/RECORD,,
30
+ ai_lls_lib-1.5.0rc3.dist-info/METADATA,sha256=G3VICOTTMbTEJ5AvC6Iz0ezj0jerMMAOQS8ynl4Z91I,7302
31
+ ai_lls_lib-1.5.0rc3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
32
+ ai_lls_lib-1.5.0rc3.dist-info/entry_points.txt,sha256=Pi0V_HBViEKGFbNQKatl5lhhnHHBXlxaom-5gH9gXZ0,55
33
+ ai_lls_lib-1.5.0rc3.dist-info/RECORD,,