@ever-works/screenshotone-plugin 1.0.4 → 1.0.5

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/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 && urlString.includes("api.screenshotone.com")) {
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 && urlString.includes("api.screenshotone.com")) {
366
+ if (urlHostIs(urlString, "api.screenshotone.com")) {
360
367
  return {
361
368
  valid: true,
362
369
  message: "Credentials are valid"
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 && urlString.includes("api.screenshotone.com")) {
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 && urlString.includes("api.screenshotone.com")) {
342
+ if (urlHostIs(urlString, "api.screenshotone.com")) {
336
343
  return {
337
344
  valid: true,
338
345
  message: "Credentials are valid"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ever-works/screenshotone-plugin",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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.9"
38
+ "@ever-works/plugin": "^1.2.16"
39
39
  },
40
40
  "devDependencies": {
41
- "@ever-works/plugin": "^1.2.9",
41
+ "@ever-works/plugin": "^1.2.16",
42
42
  "@types/node": "^26.6.4",
43
43
  "tsup": "^8.4.0",
44
44
  "typescript": "^5.7.3",
@@ -88,8 +88,8 @@
88
88
  "url": "https://github.com/ever-works/ever-works/issues"
89
89
  },
90
90
  "everworksRelease": {
91
- "contentHash": "sha256:50e2f83ecaa3486c072f8d5e62f899dcbb80b595e91d9432a68706257421a67c",
92
- "commit": "5b5a17e1cdc02e06383d508a6424a863521fc3e0",
93
- "source": "https://github.com/ever-works/ever-works/tree/5b5a17e1cdc02e06383d508a6424a863521fc3e0/packages/plugins/screenshotone"
91
+ "contentHash": "sha256:16633fda835f523051b2149cf86bef81f8336a4f7cc1461701306222f6600389",
92
+ "commit": "89cee44a662034ea957b07ec5e1230ecf340b107",
93
+ "source": "https://github.com/ever-works/ever-works/tree/89cee44a662034ea957b07ec5e1230ecf340b107/packages/plugins/screenshotone"
94
94
  }
95
95
  }