@sendsafely/sendsafely 1.1.10 → 2.0.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/lib/Dropzone.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const URL = require('url').URL;
2
- const Window = require('window');
2
+ const Window = require('./window');
3
3
  const window = new Window();
4
4
  const $ = require('jquery')(window);
5
5
  const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
package/lib/SendSafely.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const URL = require('url').URL;
2
- const Window = require('window');
2
+ const Window = require('./window');
3
3
  const window = new Window();
4
4
  const self = window;
5
5
  const sjcl = require("sjcl");
package/lib/window.js ADDED
@@ -0,0 +1,16 @@
1
+ const {ResourceLoader, JSDOM} = require("jsdom");
2
+ // Class to return a window instance.
3
+ // Accepts a jsdom config object.
4
+ module.exports = class Window {
5
+ constructor(jsdomConfig = {}) {
6
+ const { proxy, strictSSL, userAgent } = jsdomConfig;
7
+ const resources = new ResourceLoader({
8
+ proxy,
9
+ strictSSL,
10
+ userAgent
11
+ });
12
+ return (new JSDOM('', Object.assign(jsdomConfig, {
13
+ resources
14
+ }))).window;
15
+ }
16
+ };
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@sendsafely/sendsafely",
3
- "version": "1.1.10",
3
+ "version": "2.0.0",
4
4
  "main": "./lib/SendSafely.js",
5
+ "engines": {
6
+ "node": ">=18"
7
+ },
5
8
  "scripts": {
6
9
  "test": "echo \"Error: no test specified\" && exit 1"
7
10
  },
@@ -10,10 +13,10 @@
10
13
  "description": "The SendSafely JavaScript SDK for Node.js lets you integrate SendSafely secure data transfer capabilities directly into your Node.js application.",
11
14
  "dependencies": {
12
15
  "jquery": "^3.4.1",
16
+ "jsdom": "^26.0.0",
13
17
  "make-fetch-happen": "^11.1.1",
14
18
  "openpgp": "4.10.11",
15
19
  "sjcl": "1.0.8",
16
- "window": "^4.2.7",
17
20
  "xmlhttprequest": "^1.8.0"
18
21
  },
19
22
  "repository": {