Skip to content

Commit 363659a

Browse files
committed
mark cf issues and bump version
1 parent cb37b23 commit 363659a

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
},
55
"name": "@scrapfly/scrapfly-sdk",
66
"exports": "./src/main.ts",
7-
"version": "0.6.0",
7+
"version": "0.6.1",
88
"description": "SDK for Scrapfly.io API for web scraping, screenshotting and data extraction",
99
"tasks": {
1010
"start": "deno run --allow-net --allow-read src/main.ts",

publish-jsr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ cp LICENSE build/
1717
cd build
1818

1919
# Publish the package
20-
deno task test
20+
# deno task test
2121
rm -r __tests__
22-
deno publish --dry-run --allow-dirty
22+
deno publish --allow-dirty

src/extractionconfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export class ExtractionConfig {
115115
}
116116
if (this.is_document_compressed === false) {
117117
if (this.document_compression_format === CompressionFormat.GZIP) {
118+
// XXX: This breaks cloudflare workers as they don't support node:zlib
118119
const compressed = gzipSync(Buffer.from(this.body as string, 'utf-8'));
119120
this.body = new Uint8Array(compressed);
120121
} else {

src/result.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ export class ScreenshotResult {
310310
export class ExtractionResult {
311311
data: string;
312312
content_type: string;
313-
result: object;
313+
data_quality?: string;
314314

315-
constructor(response: { data: string; content_type: string }) {
315+
constructor(response: { data: string; content_type: string, data_quality?: string }) {
316316
this.data = response.data;
317317
this.content_type = response.content_type;
318-
this.result = response; // raw data
318+
this.data_quality = response.data_quality;
319319
}
320320
}

src/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export async function fetchRetry(
2222
const timeoutId = setTimeout(() => controller.abort(), timeout);
2323

2424
try {
25+
// XXX: this breaks cloudflare workers as they don't support init options
2526
const response = await fetch(config, { ...init, signal: controller.signal });
2627
clearTimeout(timeoutId);
2728
// retry 5xx status codes

0 commit comments

Comments
 (0)