@dealcrawl/sdk 2.9.0 → 2.10.0

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.
package/README.md CHANGED
@@ -65,12 +65,12 @@ console.log(result.data.screenshot); // Public screenshot URL
65
65
 
66
66
  ## January 2026 Features in Detail
67
67
 
68
- ### 📸 Screenshot Storage
68
+ ### 📸 Screenshot Storage (SEC-011)
69
69
 
70
- Automatically capture and store screenshots with public URLs:
70
+ **Private by default** with configurable signed URL expiration:
71
71
 
72
72
  ```typescript
73
- // With screenshot options
73
+ // Basic screenshot (private with tier-specific TTL)
74
74
  const job = await client.scrape.create({
75
75
  url: "https://example.com",
76
76
  screenshot: {
@@ -78,14 +78,52 @@ const job = await client.scrape.create({
78
78
  fullPage: true,
79
79
  format: "webp",
80
80
  quality: 85,
81
+ signedUrlTtl: 604800, // 7 days (default for Pro/Enterprise)
81
82
  },
82
83
  });
83
84
 
84
85
  const result = await client.waitForResult(job.jobId);
85
- console.log(result.data.screenshot);
86
- // → "https://...supabase.co/storage/v1/object/public/screenshots/..."
86
+ console.log(result.data.screenshotMetadata);
87
+ // {
88
+ // url: "https://...supabase.co/storage/v1/object/sign/screenshots-private/...",
89
+ // isPublic: false,
90
+ // expiresAt: "2026-01-25T12:00:00Z",
91
+ // width: 1280,
92
+ // height: 720,
93
+ // format: "webp",
94
+ // sizeBytes: 125000
95
+ // }
96
+
97
+ // Refresh signed URL before expiration
98
+ const refreshed = await client.screenshots.refresh({
99
+ path: "job_abc123/1234567890_nanoid_example.png",
100
+ ttl: 604800 // Extend for another 7 days
101
+ });
102
+ console.log(refreshed.url); // New signed URL
103
+ console.log(refreshed.expiresAt); // "2026-02-01T12:00:00Z"
104
+
105
+ // Get tier-specific TTL limits
106
+ const limits = await client.screenshots.getLimits();
107
+ console.log(limits);
108
+ // {
109
+ // tier: "pro",
110
+ // limits: { min: 3600, max: 604800, default: 604800 },
111
+ // formattedLimits: { min: "1 hour", max: "7 days", default: "7 days" }
112
+ // }
113
+
114
+ // Enterprise: Public URLs (opt-in)
115
+ const jobPublic = await client.scrape.create({
116
+ url: "https://example.com",
117
+ screenshot: {
118
+ enabled: true,
119
+ publicUrl: true, // ⚠️ Enterprise only - exposes data publicly
120
+ },
121
+ });
122
+ // → Public URL without expiration (Enterprise tier only)
87
123
  ```
88
124
 
125
+ **Security Note:** Screenshots are private by default to prevent exposure of personal data, copyrighted content, or sensitive tokens. Public URLs require Enterprise tier + explicit opt-in.
126
+
89
127
  ### 🎯 Priority Crawl System
90
128
 
91
129
  3-tier queue system automatically prioritizes high-value pages:
@@ -553,16 +591,16 @@ const job = await client.agent.withClaude(
553
591
 
554
592
  **Action Types:**
555
593
 
556
- | Action | Key Parameters | Description |
557
- |--------------|---------------------------------------------------|---------------------------|
558
- | `click` | `selector`, `waitAfter?`, `button?`, `force?` | Click an element |
559
- | `scroll` | `direction`, `amount?`, `smooth?` | Scroll page/to element |
560
- | `write` | `selector`, `text`, `clearFirst?`, `typeDelay?` | Type text into input |
561
- | `wait` | `milliseconds?`, `selector?`, `condition?` | Wait for time or element |
562
- | `press` | `key`, `modifiers?` | Press keyboard key |
563
- | `screenshot` | `fullPage?`, `selector?`, `name?` | Capture screenshot |
564
- | `hover` | `selector`, `duration?` | Hover over element |
565
- | `select` | `selector`, `value`, `byLabel?` | Select dropdown option |
594
+ | Action | Key Parameters | Description |
595
+ |--------------|---------------------------------------------------|--------------------------|
596
+ | `click` | `selector`, `waitAfter?`, `button?`, `force?` | Click an element |
597
+ | `scroll` | `direction`, `amount?`, `smooth?` | Scroll page/to element |
598
+ | `write` | `selector`, `text`, `clearFirst?`, `typeDelay?` | Type text into input |
599
+ | `wait` | `milliseconds?`, `selector?`, `condition?` | Wait for time or element |
600
+ | `press` | `key`, `modifiers?` | Press keyboard key |
601
+ | `screenshot` | `fullPage?`, `selector?`, `name?` | Capture screenshot |
602
+ | `hover` | `selector`, `duration?` | Hover over element |
603
+ | `select` | `selector`, `value`, `byLabel?` | Select dropdown option |
566
604
 
567
605
  **Action Resilience (all actions support):**
568
606
 
@@ -687,6 +725,44 @@ await client.webhooks.delete(webhookId);
687
725
  - `crawl.completed` - Crawl job finished
688
726
  - `crawl.failed` - Crawl job failed
689
727
 
728
+ ### Screenshots - Signed URL Management
729
+
730
+ Manage screenshot signed URLs with configurable TTL and automatic refresh:
731
+
732
+ ```typescript
733
+ // Refresh a signed URL before expiration
734
+ const refreshed = await client.screenshots.refresh({
735
+ path: "job_abc123/1234567890_nanoid_example.png",
736
+ ttl: 604800 // Optional: 7 days (defaults to tier default)
737
+ });
738
+ console.log(refreshed.url); // New signed URL
739
+ console.log(refreshed.expiresAt); // "2026-01-25T12:00:00Z"
740
+ console.log(refreshed.tierLimits); // { min: 3600, max: 604800, default: 604800 }
741
+
742
+ // Get tier-specific TTL limits
743
+ const limits = await client.screenshots.getLimits();
744
+ console.log(limits.tier); // "pro"
745
+ console.log(limits.limits); // { min: 3600, max: 604800, default: 604800 }
746
+ console.log(limits.formattedLimits); // { min: "1 hour", max: "7 days", default: "7 days" }
747
+
748
+ // Specify custom bucket (defaults to 'screenshots-private')
749
+ const refreshed = await client.screenshots.refresh({
750
+ path: "job_xyz/screenshot.png",
751
+ ttl: 86400, // 1 day
752
+ bucket: "screenshots-private"
753
+ });
754
+ ```
755
+
756
+ **TTL Limits by Tier:**
757
+
758
+ | Tier | Min TTL | Max TTL | Default TTL |
759
+ |------------|---------|---------|-------------|
760
+ | Free | 1 hour | 24 hours| 24 hours |
761
+ | Pro | 1 hour | 7 days | 7 days |
762
+ | Enterprise | 1 hour | 30 days | 7 days |
763
+
764
+ **Security Note:** All screenshots are private by default. Public URLs (Enterprise only) don't require refresh as they don't expire.
765
+
690
766
  ### Keys - API Key Management
691
767
 
692
768
  ```typescript
@@ -958,9 +1034,12 @@ import type {
958
1034
  HoverAction,
959
1035
  SelectAction,
960
1036
 
961
- // Screenshot Options
1037
+ // Screenshot Options & Responses
962
1038
  ScreenshotOptions,
963
1039
  ScreenshotResult,
1040
+ RefreshScreenshotOptions,
1041
+ ScreenshotRefreshResponse,
1042
+ ScreenshotLimitsResponse,
964
1043
 
965
1044
  // Re-exports from @dealcrawl/shared
966
1045
  ScrapeResult,
package/dist/index.d.mts CHANGED
@@ -1089,6 +1089,13 @@ interface ScreenshotOptions {
1089
1089
  format?: "png" | "jpeg" | "webp";
1090
1090
  /** JPEG/WebP quality 0-100 (default: 80, only for jpeg/webp) */
1091
1091
  quality?: number;
1092
+ /**
1093
+ * Request public URL (Enterprise only, default: false)
1094
+ * SECURITY WARNING: Public URLs can expose personal data, copyrighted content, and tokens
1095
+ * By default, screenshots use private signed URLs with 7-day expiration
1096
+ * Requires Enterprise tier
1097
+ */
1098
+ publicUrl?: boolean;
1092
1099
  }
1093
1100
  /** Options for scraping a single page */
1094
1101
  interface ScrapeOptions {
package/dist/index.d.ts CHANGED
@@ -1089,6 +1089,13 @@ interface ScreenshotOptions {
1089
1089
  format?: "png" | "jpeg" | "webp";
1090
1090
  /** JPEG/WebP quality 0-100 (default: 80, only for jpeg/webp) */
1091
1091
  quality?: number;
1092
+ /**
1093
+ * Request public URL (Enterprise only, default: false)
1094
+ * SECURITY WARNING: Public URLs can expose personal data, copyrighted content, and tokens
1095
+ * By default, screenshots use private signed URLs with 7-day expiration
1096
+ * Requires Enterprise tier
1097
+ */
1098
+ publicUrl?: boolean;
1092
1099
  }
1093
1100
  /** Options for scraping a single page */
1094
1101
  interface ScrapeOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dealcrawl/sdk",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "private": false,
5
5
  "description": "Official SDK for DealCrawl web scraping, crawling and AI agent API",
6
6
  "author": "DealUp <contact@dealup.cc>",