@quikturn/logos 0.2.0 → 0.3.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 +80 -82
- package/dist/client/index.cjs +18 -57
- package/dist/client/index.d.cts +2 -187
- package/dist/client/index.d.ts +2 -187
- package/dist/client/index.mjs +19 -55
- package/dist/element/index.cjs +288 -0
- package/dist/element/index.d.cts +29 -0
- package/dist/element/index.d.ts +29 -0
- package/dist/element/index.mjs +286 -0
- package/dist/index.cjs +1 -91
- package/dist/index.d.cts +1 -167
- package/dist/index.d.ts +1 -167
- package/dist/index.mjs +2 -83
- package/dist/server/index.cjs +15 -24
- package/dist/server/index.d.cts +2 -94
- package/dist/server/index.d.ts +2 -94
- package/dist/server/index.mjs +16 -23
- package/package.json +14 -3
package/dist/server/index.mjs
CHANGED
|
@@ -181,7 +181,6 @@ function logoUrl(domain, options) {
|
|
|
181
181
|
greyscale,
|
|
182
182
|
theme,
|
|
183
183
|
format,
|
|
184
|
-
autoScrape,
|
|
185
184
|
baseUrl
|
|
186
185
|
} = options ?? {};
|
|
187
186
|
const maxWidth = token?.startsWith("sk_") ? MAX_WIDTH_SERVER : MAX_WIDTH;
|
|
@@ -208,9 +207,7 @@ function logoUrl(domain, options) {
|
|
|
208
207
|
if (resolvedFormat !== void 0) {
|
|
209
208
|
url.searchParams.set("format", resolvedFormat);
|
|
210
209
|
}
|
|
211
|
-
|
|
212
|
-
url.searchParams.set("autoScrape", "true");
|
|
213
|
-
}
|
|
210
|
+
url.searchParams.set("autoScrape", "true");
|
|
214
211
|
return url.toString();
|
|
215
212
|
}
|
|
216
213
|
|
|
@@ -670,7 +667,6 @@ var QuikturnLogos = class {
|
|
|
670
667
|
greyscale: options?.greyscale,
|
|
671
668
|
theme: options?.theme,
|
|
672
669
|
format: options?.format,
|
|
673
|
-
autoScrape: options?.autoScrape,
|
|
674
670
|
baseUrl: this.baseUrl
|
|
675
671
|
});
|
|
676
672
|
const format = options?.format;
|
|
@@ -683,23 +679,21 @@ var QuikturnLogos = class {
|
|
|
683
679
|
onRateLimitWarning: (remaining, limit) => this.emit("rateLimitWarning", remaining, limit),
|
|
684
680
|
onQuotaWarning: (remaining, limit) => this.emit("quotaWarning", remaining, limit)
|
|
685
681
|
});
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
682
|
+
const fetchForPoller = (fetchUrl) => serverFetch(fetchUrl, {
|
|
683
|
+
token: this.secretKey,
|
|
684
|
+
maxRetries: this.maxRetries,
|
|
685
|
+
signal: options?.signal
|
|
686
|
+
});
|
|
687
|
+
response = await handleScrapeResponse(
|
|
688
|
+
response,
|
|
689
|
+
url,
|
|
690
|
+
fetchForPoller,
|
|
691
|
+
{
|
|
692
|
+
scrapeTimeout: options?.scrapeTimeout,
|
|
693
|
+
onScrapeProgress: options?.onScrapeProgress,
|
|
690
694
|
signal: options?.signal
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
response,
|
|
694
|
-
url,
|
|
695
|
-
fetchForPoller,
|
|
696
|
-
{
|
|
697
|
-
scrapeTimeout: options?.scrapeTimeout,
|
|
698
|
-
onScrapeProgress: options?.onScrapeProgress,
|
|
699
|
-
signal: options?.signal
|
|
700
|
-
}
|
|
701
|
-
);
|
|
702
|
-
}
|
|
695
|
+
}
|
|
696
|
+
);
|
|
703
697
|
const contentLength = response.headers.get("Content-Length");
|
|
704
698
|
if (contentLength) {
|
|
705
699
|
const size = parseInt(contentLength, 10);
|
|
@@ -780,7 +774,6 @@ var QuikturnLogos = class {
|
|
|
780
774
|
greyscale: options?.greyscale,
|
|
781
775
|
theme: options?.theme,
|
|
782
776
|
format: options?.format,
|
|
783
|
-
autoScrape: options?.autoScrape,
|
|
784
777
|
baseUrl: this.baseUrl
|
|
785
778
|
});
|
|
786
779
|
const format = options?.format;
|
|
@@ -851,4 +844,4 @@ var QuikturnLogos = class {
|
|
|
851
844
|
}
|
|
852
845
|
};
|
|
853
846
|
|
|
854
|
-
export { QuikturnLogos
|
|
847
|
+
export { QuikturnLogos };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quikturn/logos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Quikturn Logo SDK — URL builder, browser client, and server client for the Quikturn Logos API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Quikturn",
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
"sdk"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"sideEffects":
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"./dist/element/index.mjs",
|
|
25
|
+
"./dist/element/index.cjs"
|
|
26
|
+
],
|
|
24
27
|
"packageManager": "pnpm@10.28.1",
|
|
25
28
|
"engines": {
|
|
26
29
|
"node": ">=18"
|
|
@@ -55,6 +58,14 @@
|
|
|
55
58
|
},
|
|
56
59
|
"import": "./dist/server/index.mjs",
|
|
57
60
|
"require": "./dist/server/index.cjs"
|
|
61
|
+
},
|
|
62
|
+
"./element": {
|
|
63
|
+
"types": {
|
|
64
|
+
"import": "./dist/element/index.d.ts",
|
|
65
|
+
"require": "./dist/element/index.d.cts"
|
|
66
|
+
},
|
|
67
|
+
"import": "./dist/element/index.mjs",
|
|
68
|
+
"require": "./dist/element/index.cjs"
|
|
58
69
|
}
|
|
59
70
|
},
|
|
60
71
|
"publishConfig": {
|
|
@@ -65,7 +76,7 @@
|
|
|
65
76
|
"types": "./dist/index.d.ts",
|
|
66
77
|
"scripts": {
|
|
67
78
|
"build": "tsup",
|
|
68
|
-
"test": "vitest run --project unit --project client --project server",
|
|
79
|
+
"test": "vitest run --project unit --project client --project server --project element",
|
|
69
80
|
"test:integration": "vitest run --project integration",
|
|
70
81
|
"test:watch": "vitest",
|
|
71
82
|
"test:coverage": "vitest run --coverage",
|