@ever-works/screenshotone-plugin 1.0.4 → 1.0.7
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 +7 -1
- package/dist/index.cjs +12 -3
- package/dist/index.d.cts +0 -16
- package/dist/index.d.ts +0 -16
- package/dist/index.js +12 -3
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -14,6 +14,12 @@ ScreenshotOne screenshot plugin for Ever Works - capture website screenshots usi
|
|
|
14
14
|
| Built-in | no |
|
|
15
15
|
| Auto-enable | no |
|
|
16
16
|
|
|
17
|
+
> **Optional and paid.** The default screenshot provider is the self-hosted, open-source
|
|
18
|
+
> [Gotenberg plugin](../gotenberg/README.md). ScreenshotOne is an opt-in alternative for users who
|
|
19
|
+
> want its hosted extras (ad, tracker and cookie-banner blocking, provider-side caching) and pay for
|
|
20
|
+
> them: enable it under Settings → Plugins with your own keys and pick it as a Work's screenshot
|
|
21
|
+
> provider. Nothing in the platform needs `PLUGIN_SCREENSHOTONE_*` to be set.
|
|
22
|
+
|
|
17
23
|
## What does ScreenshotOne do?
|
|
18
24
|
|
|
19
25
|
ScreenshotOne is a screenshot capture API. When work items include source URLs, this plugin automatically generates preview images by capturing a screenshot of each page.
|
|
@@ -70,7 +76,7 @@ pnpm --filter @ever-works/screenshotone-plugin test
|
|
|
70
76
|
## Documentation
|
|
71
77
|
|
|
72
78
|
- [Ever Works documentation](https://docs.ever.works)
|
|
73
|
-
- [Ever Works repository](https://github.com/ever-
|
|
79
|
+
- [Ever Works repository](https://github.com/ever-co/ever-works)
|
|
74
80
|
- [Plugin system](../../plugin/README.md)
|
|
75
81
|
- [ScreenshotOne homepage](https://screenshotone.com)
|
|
76
82
|
|
package/dist/index.cjs
CHANGED
|
@@ -137,6 +137,13 @@ function isPrivateIPv6(ip) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
// src/screenshotone.plugin.ts
|
|
140
|
+
function urlHostIs(url, host) {
|
|
141
|
+
try {
|
|
142
|
+
return new URL(String(url)).hostname === host;
|
|
143
|
+
} catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
140
147
|
var ScreenshotOnePlugin = class {
|
|
141
148
|
constructor() {
|
|
142
149
|
// ============================================================================
|
|
@@ -322,7 +329,7 @@ var ScreenshotOnePlugin = class {
|
|
|
322
329
|
const testOptions = screenshotone__namespace.TakeOptions.url("https://example.com");
|
|
323
330
|
const url = resolvedSettings.secretKey ? await Promise.resolve(client.generateSignedTakeURL(testOptions)) : await Promise.resolve(client.generateTakeURL(testOptions));
|
|
324
331
|
const urlString = String(url);
|
|
325
|
-
if (urlString
|
|
332
|
+
if (urlHostIs(urlString, "api.screenshotone.com")) {
|
|
326
333
|
return { success: true, message: "ScreenshotOne connection verified." };
|
|
327
334
|
}
|
|
328
335
|
return { success: false, message: "ScreenshotOne credentials appear invalid." };
|
|
@@ -356,7 +363,7 @@ var ScreenshotOnePlugin = class {
|
|
|
356
363
|
const testOptions = screenshotone__namespace.TakeOptions.url("https://example.com");
|
|
357
364
|
const url = resolvedSettings.secretKey ? await Promise.resolve(client.generateSignedTakeURL(testOptions)) : await Promise.resolve(client.generateTakeURL(testOptions));
|
|
358
365
|
const urlString = String(url);
|
|
359
|
-
if (urlString
|
|
366
|
+
if (urlHostIs(urlString, "api.screenshotone.com")) {
|
|
360
367
|
return {
|
|
361
368
|
valid: true,
|
|
362
369
|
message: "Credentials are valid"
|
|
@@ -501,7 +508,9 @@ var ScreenshotOnePlugin = class {
|
|
|
501
508
|
readme: [
|
|
502
509
|
"## What does ScreenshotOne do?",
|
|
503
510
|
"",
|
|
504
|
-
"ScreenshotOne is a screenshot capture API. When work items include source URLs, this plugin automatically generates preview images by capturing a screenshot of each page.",
|
|
511
|
+
"ScreenshotOne is a paid screenshot capture API. When work items include source URLs, this plugin automatically generates preview images by capturing a screenshot of each page.",
|
|
512
|
+
"",
|
|
513
|
+
"It is optional: the default screenshot provider is the self-hosted Gotenberg plugin, which costs nothing per screenshot. Enable ScreenshotOne only if you want its hosted extras and have a ScreenshotOne account.",
|
|
505
514
|
"",
|
|
506
515
|
"## Why use it?",
|
|
507
516
|
"",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { IPlugin, IScreenshotPlugin, PluginCategory, JsonSchema, ScreenshotOptions, ScreenshotResult, ConnectionValidationResult, ScreenshotValidationResult, ScreenshotFormat, PluginContext, PluginHealthCheck, PluginManifest } from '@ever-works/plugin';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* ScreenshotOne Plugin
|
|
5
|
-
*
|
|
6
|
-
* Provides screenshot capture capabilities using the ScreenshotOne API service.
|
|
7
|
-
* Supports configurable viewport sizes, formats, and advanced options like ad blocking.
|
|
8
|
-
*
|
|
9
|
-
* Settings Resolution:
|
|
10
|
-
* The API keys are resolved through the 4-level hierarchy:
|
|
11
|
-
* 1. Work settings (highest priority)
|
|
12
|
-
* 2. User settings
|
|
13
|
-
* 3. Admin settings
|
|
14
|
-
* 4. Environment variables: PLUGIN_SCREENSHOTONE_ACCESS_KEY, PLUGIN_SCREENSHOTONE_SECRET_KEY
|
|
15
|
-
* 5. Not configured (plugin unavailable)
|
|
16
|
-
*
|
|
17
|
-
* Configuration mode: hybrid - allows admin-level defaults with user/work overrides.
|
|
18
|
-
*/
|
|
19
3
|
declare class ScreenshotOnePlugin implements IPlugin, IScreenshotPlugin {
|
|
20
4
|
readonly id = "screenshotone";
|
|
21
5
|
readonly name = "ScreenshotOne";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { IPlugin, IScreenshotPlugin, PluginCategory, JsonSchema, ScreenshotOptions, ScreenshotResult, ConnectionValidationResult, ScreenshotValidationResult, ScreenshotFormat, PluginContext, PluginHealthCheck, PluginManifest } from '@ever-works/plugin';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* ScreenshotOne Plugin
|
|
5
|
-
*
|
|
6
|
-
* Provides screenshot capture capabilities using the ScreenshotOne API service.
|
|
7
|
-
* Supports configurable viewport sizes, formats, and advanced options like ad blocking.
|
|
8
|
-
*
|
|
9
|
-
* Settings Resolution:
|
|
10
|
-
* The API keys are resolved through the 4-level hierarchy:
|
|
11
|
-
* 1. Work settings (highest priority)
|
|
12
|
-
* 2. User settings
|
|
13
|
-
* 3. Admin settings
|
|
14
|
-
* 4. Environment variables: PLUGIN_SCREENSHOTONE_ACCESS_KEY, PLUGIN_SCREENSHOTONE_SECRET_KEY
|
|
15
|
-
* 5. Not configured (plugin unavailable)
|
|
16
|
-
*
|
|
17
|
-
* Configuration mode: hybrid - allows admin-level defaults with user/work overrides.
|
|
18
|
-
*/
|
|
19
3
|
declare class ScreenshotOnePlugin implements IPlugin, IScreenshotPlugin {
|
|
20
4
|
readonly id = "screenshotone";
|
|
21
5
|
readonly name = "ScreenshotOne";
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,13 @@ function isPrivateIPv6(ip) {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
// src/screenshotone.plugin.ts
|
|
116
|
+
function urlHostIs(url, host) {
|
|
117
|
+
try {
|
|
118
|
+
return new URL(String(url)).hostname === host;
|
|
119
|
+
} catch {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
116
123
|
var ScreenshotOnePlugin = class {
|
|
117
124
|
constructor() {
|
|
118
125
|
// ============================================================================
|
|
@@ -298,7 +305,7 @@ var ScreenshotOnePlugin = class {
|
|
|
298
305
|
const testOptions = screenshotone.TakeOptions.url("https://example.com");
|
|
299
306
|
const url = resolvedSettings.secretKey ? await Promise.resolve(client.generateSignedTakeURL(testOptions)) : await Promise.resolve(client.generateTakeURL(testOptions));
|
|
300
307
|
const urlString = String(url);
|
|
301
|
-
if (urlString
|
|
308
|
+
if (urlHostIs(urlString, "api.screenshotone.com")) {
|
|
302
309
|
return { success: true, message: "ScreenshotOne connection verified." };
|
|
303
310
|
}
|
|
304
311
|
return { success: false, message: "ScreenshotOne credentials appear invalid." };
|
|
@@ -332,7 +339,7 @@ var ScreenshotOnePlugin = class {
|
|
|
332
339
|
const testOptions = screenshotone.TakeOptions.url("https://example.com");
|
|
333
340
|
const url = resolvedSettings.secretKey ? await Promise.resolve(client.generateSignedTakeURL(testOptions)) : await Promise.resolve(client.generateTakeURL(testOptions));
|
|
334
341
|
const urlString = String(url);
|
|
335
|
-
if (urlString
|
|
342
|
+
if (urlHostIs(urlString, "api.screenshotone.com")) {
|
|
336
343
|
return {
|
|
337
344
|
valid: true,
|
|
338
345
|
message: "Credentials are valid"
|
|
@@ -477,7 +484,9 @@ var ScreenshotOnePlugin = class {
|
|
|
477
484
|
readme: [
|
|
478
485
|
"## What does ScreenshotOne do?",
|
|
479
486
|
"",
|
|
480
|
-
"ScreenshotOne is a screenshot capture API. When work items include source URLs, this plugin automatically generates preview images by capturing a screenshot of each page.",
|
|
487
|
+
"ScreenshotOne is a paid screenshot capture API. When work items include source URLs, this plugin automatically generates preview images by capturing a screenshot of each page.",
|
|
488
|
+
"",
|
|
489
|
+
"It is optional: the default screenshot provider is the self-hosted Gotenberg plugin, which costs nothing per screenshot. Enable ScreenshotOne only if you want its hosted extras and have a ScreenshotOne account.",
|
|
481
490
|
"",
|
|
482
491
|
"## Why use it?",
|
|
483
492
|
"",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ever-works/screenshotone-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "ScreenshotOne screenshot plugin for Ever Works - capture website screenshots using the ScreenshotOne API",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ever Co. LTD",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"screenshotone-api-sdk": "^1.1.6"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@ever-works/plugin": "^1.2.
|
|
38
|
+
"@ever-works/plugin": "^1.2.28"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ever-works/plugin": "^1.2.
|
|
41
|
+
"@ever-works/plugin": "^1.2.28",
|
|
42
42
|
"@types/node": "^26.6.4",
|
|
43
43
|
"tsup": "^8.4.0",
|
|
44
44
|
"typescript": "^5.7.3",
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
"private": false,
|
|
81
81
|
"repository": {
|
|
82
82
|
"type": "git",
|
|
83
|
-
"url": "git+https://github.com/ever-
|
|
83
|
+
"url": "git+https://github.com/ever-co/ever-works.git",
|
|
84
84
|
"directory": "packages/plugins/screenshotone"
|
|
85
85
|
},
|
|
86
|
-
"homepage": "https://github.com/ever-
|
|
86
|
+
"homepage": "https://github.com/ever-co/ever-works/tree/main/packages/plugins/screenshotone#readme",
|
|
87
87
|
"bugs": {
|
|
88
|
-
"url": "https://github.com/ever-
|
|
88
|
+
"url": "https://github.com/ever-co/ever-works/issues"
|
|
89
89
|
},
|
|
90
90
|
"everworksRelease": {
|
|
91
|
-
"contentHash": "sha256:
|
|
92
|
-
"commit": "
|
|
93
|
-
"source": "https://github.com/ever-
|
|
91
|
+
"contentHash": "sha256:bd11690b1a134e969b4e5a9e60f199b515bfbbd5c0e95497488b78c181c40458",
|
|
92
|
+
"commit": "2288ff7e91562b0f079c365348ba08ab3a16f1dd",
|
|
93
|
+
"source": "https://github.com/ever-co/ever-works/tree/2288ff7e91562b0f079c365348ba08ab3a16f1dd/packages/plugins/screenshotone"
|
|
94
94
|
}
|
|
95
95
|
}
|