pingera-cli 0.1.6__tar.gz → 0.1.7__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 (50) hide show
  1. {pingera_cli-0.1.6/pingera_cli.egg-info → pingera_cli-0.1.7}/PKG-INFO +1 -1
  2. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/docs/example-synthetic-screenshot.json +12 -7
  3. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/__init__.py +1 -1
  4. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/checks.py +18 -17
  5. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/on_demand_checks.py +10 -9
  6. {pingera_cli-0.1.6 → pingera_cli-0.1.7/pingera_cli.egg-info}/PKG-INFO +1 -1
  7. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/SOURCES.txt +0 -1
  8. pingera_cli-0.1.6/docs/example-check.json +0 -23
  9. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/.gitignore +0 -0
  10. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/.replit +0 -0
  11. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/LICENSE +0 -0
  12. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/README.md +0 -0
  13. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/assert +0 -0
  14. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/docs/cli-commands.md +0 -0
  15. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/docs/example-check.yaml +0 -0
  16. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/__main__.py +0 -0
  17. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/__init__.py +0 -0
  18. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/auth.py +0 -0
  19. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/base.py +0 -0
  20. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/check_groups.py +0 -0
  21. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/check_secrets.py +0 -0
  22. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/commands/secrets.py +0 -0
  23. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/__init__.py +0 -0
  24. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/base_formatter.py +0 -0
  25. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/generic_formatter.py +0 -0
  26. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/multistep_formatter.py +0 -0
  27. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/registry.py +0 -0
  28. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/ssl_formatter.py +0 -0
  29. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/synthetic_formatter.py +0 -0
  30. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/formatters/web_formatter.py +0 -0
  31. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/main.py +0 -0
  32. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/utils/__init__.py +0 -0
  33. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/utils/config.py +0 -0
  34. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli/utils/console.py +0 -0
  35. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/dependency_links.txt +0 -0
  36. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/entry_points.txt +0 -0
  37. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/requires.txt +0 -0
  38. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pingera_cli.egg-info/top_level.txt +0 -0
  39. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/pyproject.toml +0 -0
  40. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/replit.md +0 -0
  41. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/run_tests.py +0 -0
  42. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/setup.cfg +0 -0
  43. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/setup.py +0 -0
  44. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/__init__.py +0 -0
  45. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/conftest.py +0 -0
  46. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/requirements.txt +0 -0
  47. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_auth.py +0 -0
  48. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_checks.py +0 -0
  49. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_config.py +0 -0
  50. {pingera_cli-0.1.6 → pingera_cli-0.1.7}/tests/test_on_demand_checks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingera-cli
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A beautiful Python CLI tool built with typer and rich, distributed via pip and based on Pingera SDK
5
5
  Home-page: https://github.com/pingera/pingera-cli
6
6
  Author: PingeraCLI Team
@@ -1,16 +1,21 @@
1
-
2
1
  {
3
2
  "name": "Website Screenshot Monitor",
4
- "type": "synthetic",
3
+ "type": "synthetic",
5
4
  "interval": 1800,
6
5
  "timeout": 30,
7
6
  "parameters": {
8
- "regions": ["RU, Moscow"],
9
- "pw_script": "const { test, expect } = require('@playwright/test');\n\ntest('website screenshot test', async ({ page }) => {\n // Navigate to the website\n await page.goto('https://pingera.ru');\n \n // Wait for the page to fully load\n await page.waitForLoadState('load');\n \n // Additional wait to ensure all dynamic content is loaded\n await page.waitForTimeout(2000);\n \n // Take a full page screenshot\n await page.screenshot({ \n path: 'website-screenshot.png', \n fullPage: true \n });\n \n // Verify the page loaded successfully\n await expect(page).toHaveTitle(/Example/);\n \n // Check for key elements on the page\n await expect(page.locator('h1')).toBeVisible();\n \n console.log('Screenshot captured and page verified successfully');\n});",
7
+ "regions": [
8
+ "RU, Moscow"
9
+ ],
10
+ "pw_script": "const { test, expect } = require('@playwright/test');\n\ntest('website screenshot test', async ({ page }) => {\n // Navigate to the website\n await page.goto('https://pingera.ru');\n \n // Wait for the page to fully load\n await page.waitForLoadState('load');\n \n // Additional wait to ensure all dynamic content is loaded\n await page.waitForTimeout(2000);\n \n // Take a full page screenshot\n await page.screenshot({ \n path: 'website-screenshot.png', \n fullPage: true \n });\n \n // Verify the page loaded successfully\n await expect(page).toHaveTitle(/Pingera - платформа мониторинга/);\n \n // Check for key elements on the page\n await expect(page.locator('h1')).toBeVisible();\n \n console.log('Screenshot captured and page verified successfully');\n});"
10
11
  },
11
12
  "marketplace": {
12
- "tags": ["screenshot", "visual-monitoring", "website-monitoring"],
13
+ "tags": [
14
+ "screenshot",
15
+ "visual-monitoring",
16
+ "website-monitoring"
17
+ ],
13
18
  "name": "Website Screenshot Monitor",
14
- "description": "Captures full-page screenshots of websites and verifies page loading",
19
+ "description": "Captures full-page screenshots of websites and verifies page loading"
15
20
  }
16
- }
21
+ }
@@ -2,7 +2,7 @@
2
2
  Pingera CLI - A beautiful CLI tool for Pingera Platform
3
3
  """
4
4
 
5
- __version__ = "0.1.6"
5
+ __version__ = "0.1.7"
6
6
  __author__ = "Pingera Team"
7
7
  __description__ = "A beautiful Python CLI tool built with typer and rich, distributed via pip and based on Pingera SDK"
8
8
 
@@ -455,11 +455,9 @@ class ChecksCommand(BaseCommand):
455
455
  "timeout": filtered_file_data.get("timeout", timeout)
456
456
  }
457
457
 
458
- # Override with command line values if provided
459
- if name != "": # Only override if name was explicitly provided
460
- check_data["name"] = name
461
- if check_type != "web": # Only override if type was explicitly provided
462
- check_data["type"] = check_type
458
+ # Override with command line values if provided (but only if they were explicitly changed from defaults)
459
+ # We need to be more careful about when to override file values
460
+ # For now, just use file values and let user override with explicit CLI options
463
461
  if interval != 300: # Only override if interval was explicitly provided
464
462
  check_data["interval"] = interval
465
463
  if timeout != 30: # Only override if timeout was explicitly provided
@@ -557,28 +555,31 @@ class ChecksCommand(BaseCommand):
557
555
  if params_dict:
558
556
  check_data["parameters"] = params_dict
559
557
 
560
- # Validation based on check type
561
- if check_type in ['web', 'api'] and not url:
562
- self.display_error(f"URL is required for {check_type} checks")
558
+ # Validation based on check type - use the actual type from check_data
559
+ actual_check_type = check_data.get("type", check_type)
560
+ if actual_check_type in ['web', 'api'] and not url:
561
+ self.display_error(f"URL is required for {actual_check_type} checks")
563
562
  raise typer.Exit(1)
564
563
 
565
- if check_type in ['tcp'] and not host:
566
- self.display_error(f"Host is required for {check_type} checks")
564
+ if actual_check_type in ['tcp'] and not host:
565
+ self.display_error(f"Host is required for {actual_check_type} checks")
567
566
  raise typer.Exit(1)
568
567
 
569
- if check_type in ['ssl'] and not (url or host):
570
- self.display_error(f"Either URL or host is required for {check_type} checks")
568
+ if actual_check_type in ['ssl'] and not (url or host):
569
+ self.display_error(f"Either URL or host is required for {actual_check_type} checks")
571
570
  raise typer.Exit(1)
572
571
 
573
- if check_type in ['synthetic', 'multistep'] and not params_dict.get('pw_script'):
574
- self.display_error(f"Playwright script is required for {check_type} checks. Use --pw-script-file or --parameters with pw_script")
572
+ if actual_check_type in ['synthetic', 'multistep'] and not params_dict.get('pw_script'):
573
+ self.display_error(f"Playwright script is required for {actual_check_type} checks. Use --pw-script-file or --parameters with pw_script")
575
574
  raise typer.Exit(1)
576
575
 
577
576
  # Use the actual SDK method
578
577
  check = checks_api.v1_checks_post(monitor_check=check_data)
579
578
 
580
- # Build success message
581
- success_details = [f"ID: {check.id}", f"Type: {check_type}"]
579
+ # Build success message - use the actual name from check_data, not the parameter
580
+ actual_name = check_data.get("name", name)
581
+ actual_type = check_data.get("type", check_type)
582
+ success_details = [f"ID: {check.id}", f"Type: {actual_type}"]
582
583
  if url:
583
584
  success_details.append(f"URL: {url}")
584
585
  if host:
@@ -589,7 +590,7 @@ class ChecksCommand(BaseCommand):
589
590
  success_details.append(f"Script: loaded from {pw_script_file}")
590
591
 
591
592
  self.display_success(
592
- f"Check '{name}' created successfully!\n" + "\n".join(success_details),
593
+ f"Check '{actual_name}' created successfully!\n" + "\n".join(success_details),
593
594
  "✅ Check Created"
594
595
  )
595
596
 
@@ -215,21 +215,22 @@ class OnDemandChecksCommand(BaseCommand):
215
215
  if params_dict:
216
216
  check_data["parameters"] = params_dict
217
217
 
218
- # Validation based on check type
219
- if check_type in ['web', 'api'] and not url:
220
- self.display_error(f"URL is required for {check_type} checks")
218
+ # Validation based on check type - use the actual type from check_data
219
+ actual_check_type = check_data.get("type", check_type)
220
+ if actual_check_type in ['web', 'api'] and not url:
221
+ self.display_error(f"URL is required for {actual_check_type} checks")
221
222
  raise typer.Exit(1)
222
223
 
223
- if check_type in ['tcp'] and not host:
224
- self.display_error(f"Host is required for {check_type} checks")
224
+ if actual_check_type in ['tcp'] and not host:
225
+ self.display_error(f"Host is required for {actual_check_type} checks")
225
226
  raise typer.Exit(1)
226
227
 
227
- if check_type in ['ssl'] and not (url or host):
228
- self.display_error(f"Either URL or host is required for {check_type} checks")
228
+ if actual_check_type in ['ssl'] and not (url or host):
229
+ self.display_error(f"Either URL or host is required for {actual_check_type} checks")
229
230
  raise typer.Exit(1)
230
231
 
231
- if check_type in ['synthetic', 'multistep'] and not params_dict.get('pw_script'):
232
- self.display_error(f"Playwright script is required for {check_type} checks. Use --pw-script-file or --parameters with pw_script")
232
+ if actual_check_type in ['synthetic', 'multistep'] and not params_dict.get('pw_script'):
233
+ self.display_error(f"Playwright script is required for {actual_check_type} checks. Use --pw-script-file or --parameters with pw_script")
233
234
  raise typer.Exit(1)
234
235
 
235
236
  # Create the request
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pingera-cli
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: A beautiful Python CLI tool built with typer and rich, distributed via pip and based on Pingera SDK
5
5
  Home-page: https://github.com/pingera/pingera-cli
6
6
  Author: PingeraCLI Team
@@ -8,7 +8,6 @@ replit.md
8
8
  run_tests.py
9
9
  setup.py
10
10
  docs/cli-commands.md
11
- docs/example-check.json
12
11
  docs/example-check.yaml
13
12
  docs/example-synthetic-screenshot.json
14
13
  pingera_cli/__init__.py
@@ -1,23 +0,0 @@
1
-
2
- {
3
- "name": "Example Web Check",
4
- "type": "web",
5
- "url": "https://example.com",
6
- "interval": 300,
7
- "timeout": 30,
8
- "parameters": {
9
- "regions": ["RU, Moscow", "EU, West"],
10
- "search_text": "Welcome",
11
- "http_request": {
12
- "method": "GET",
13
- "headers": {
14
- "User-Agent": "PingeraCLI/1.0"
15
- }
16
- }
17
- },
18
- "marketplace": {
19
- "tags": ["web", "basic"],
20
- "name": "Simple website check with string search",
21
- "description": "Queries website URL and searches for a string in the response",
22
- }
23
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes