Dhalang 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4bd71cb9e8eb643b85d2d2e68909db725b088b10ef29cd717634bc5429067ed4
4
- data.tar.gz: 77b10c45d0c30132e3888c2cc04998502b34ae24a0e363e70b971987ec6a722c
3
+ metadata.gz: a2357c5cdfe5dd841c64329fdab12478c719c6839fce8567520916eefc487f4e
4
+ data.tar.gz: c2507de8a15eed19c3807ad43c4f64d58cd7f1a6c32a1a61a37f828fed08cab3
5
5
  SHA512:
6
- metadata.gz: d36638644a8b02e167b76f4b943b527fd06dd20cdc6ef4c77ce37af1e41bb24f4f03f13549b0b3cfcd9a1693b7aad535448ebbfd01b6a54cb53be39d32bbd063
7
- data.tar.gz: e31806a5c74557130c558eda263a0b72045814db398c1554fe5bfaa5ce0240f14b22b52ce1afd1d8c488936097a8c407ff255c53c166cf346054d57cff749c80
6
+ metadata.gz: d127ec4402220b31566af6ef16a12e375329515c60d7d6070663379e8f90315340cc0cadf9c0aa89604b5cea371c75a6f8f90af0f87ba98535125e59a614e965
7
+ data.tar.gz: '055953f266b9ad18c24405e1cd8d9c455722d8dfc23ca20e0c0a3224710b5bf91e0d0b31a555403cb7f70ddd20e927de1d325e3d477b56ced98112a6a7fa2f88'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Dhalang (0.3.1)
4
+ Dhalang (0.6.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -72,8 +72,11 @@ Below table lists all possible configuration parameters that can be set:
72
72
  | Key | Description | Default |
73
73
  |--------------------|-----------------------------------------------------------------------------------------|---------------------------------|
74
74
  | navigationTimeout | Amount of milliseconds until Puppeteer while timeout when navigating to the given page | 10000 |
75
+ | navigationWaitForSelector | If set, Dhalang will wait for the specified selector to appear before creating the screenshot or PDF | None |
76
+ | navigationWaitForXPath | If set, Dhalang will wait for the specified XPath to appear before creating the screenshot or PDF | None |
75
77
  | userAgent | User agent to send with the request | Default Puppeteer one |
76
78
  | isHeadless | Indicates if Chromium should be launched headless | true |
79
+ | isAutoHeight | When set to true the height of generated PDFs will be based on the scrollHeight property of the document body | false |
77
80
  | viewPort | Custom viewport to use for the request | Default Puppeteer one |
78
81
  | httpAuthenticationCredentials | Custom HTTP authentication credentials to use for the request | None |
79
82
 
@@ -7,10 +7,13 @@ module Dhalang
7
7
  USER_OPTIONS = {
8
8
  navigationTimeout: 10000,
9
9
  navigationWaitUntil: 'load',
10
+ navigationWaitForSelector: '',
11
+ navigationWaitForXPath: '',
10
12
  userAgent: '',
11
13
  isHeadless: true,
12
14
  viewPort: '',
13
- httpAuthenticationCredentials: ''
15
+ httpAuthenticationCredentials: '',
16
+ isAutoHeight: false
14
17
  }
15
18
  private_constant :USER_OPTIONS
16
19
 
@@ -1,3 +1,3 @@
1
1
  module Dhalang
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -5,7 +5,7 @@
5
5
  * @property {string} puppeteerModulePath - The path of the Puppeteer module.
6
6
  * @property {string} imageType - The type of image to save ( undefined for pdfgenerator ).
7
7
  * @property {UserOptions} userOptions - User defined and default parameters to use when navigating to pages.
8
- * @property {Object} pdfOptions - User defined and default parameters to use when creating PDFs.
8
+ * @property {Object} pdfOptions - User defined and default parameters to use when creating PDFs. Note: Do not use directly, rather use {@link getConfiguredPdfOptions}.
9
9
  * @property {Object} pngOptions - User defined and default parameters to use when creating PNGs.
10
10
  * @property {Object} jpegOptions - User defined and default parameters to use when creating JPEGs.
11
11
  */
@@ -14,10 +14,13 @@
14
14
  * @typedef {Object} UserOptions
15
15
  * @property {number} navigationTimeout - Maximum in milliseconds until navigation times out, we use a default of 10 seconds as timeout.
16
16
  * @property {string} navigationWaitUntil - Determines when the navigation was finished, we wait here until the Window.load event is fired ( meaning all images, stylesheet, etc was loaded ).
17
+ * @property {string} navigationWaitForSelector - If set, specifies the selector Puppeteer should wait for to appear before continuing.
18
+ * @property {string} navigationWaitForXPath - If set, specifies the XPath Puppeteer should wait for to appear before continuing.
17
19
  * @property {string} userAgent - The user agent to send with requests.
18
20
  * @property {boolean} isHeadless - Indicates if Puppeteer should launch Chromium in headless mode.
19
21
  * @property {Object} viewPort - The view port to use.
20
22
  * @property {Object} httpAuthenticationCredentials - The credentials to use for HTTP authentication.
23
+ * @property {boolean} isAutoHeight - The height is automatically set
21
24
  */
22
25
 
23
26
  /**
@@ -26,6 +29,11 @@
26
29
  * @property {string} waituntil - Determines when the navigation was finished, we wait here until the Window.load event is fired ( meaning all images, stylesheet, etc was loaded ).
27
30
  */
28
31
 
32
+ /**
33
+ * @typedef {Object} WaitingParameters
34
+ * @property {number} timeout - Maximum in milliseconds until navigation times out, we use a default of 10 seconds as timeout.
35
+ */
36
+
29
37
  /**
30
38
  * Parses the given configuration process argument from Ruby to a JS object.
31
39
  * @returns {Configuration}
@@ -38,7 +46,7 @@ exports.getConfiguration = function () {
38
46
  /**
39
47
  * Launches Puppeteer and returns its instance.
40
48
  * @param {UserOptions} configuration - The configuration to use.
41
- * @returns {Promise<Object>}
49
+ * @returns {Promise<Object>}
42
50
  * The launched instance of Puppeteer.
43
51
  */
44
52
  exports.launchPuppeteer = async function (configuration) {
@@ -52,28 +60,69 @@ exports.launchPuppeteer = async function (configuration) {
52
60
  }
53
61
 
54
62
  /**
55
- * Configures the given Puppeteer page.
56
- * @param {Object} page - The Puppeteer page to configure.
57
- * @param {UserOptions} configuration - The configuration to use.
63
+ * Configures the given Puppeteer page object.
64
+ * @param {Object} page - The Puppeteer page object to configure.
65
+ * @param {UserOptions} userOptions - The user options to use.
58
66
  */
59
- exports.configurePage = async function (page, configuration) {
60
- if (configuration.userAgent !== "") {
61
- await page.setUserAgent(configuration.userAgent)
67
+ exports.configure = async function (page, userOptions) {
68
+ if (userOptions.userAgent !== "") {
69
+ await page.setUserAgent(userOptions.userAgent)
62
70
  }
63
71
 
64
- if (configuration.viewPort !== "") {
65
- await page.setViewport(configuration.viewPort)
72
+ if (userOptions.viewPort !== "") {
73
+ await page.setViewport(userOptions.viewPort)
66
74
  }
67
75
 
68
- if (configuration.httpAuthenticationCredentials !== "") {
69
- await page.authenticate(configuration.authenticationCredentials)
76
+ if (userOptions.httpAuthenticationCredentials !== "") {
77
+ await page.authenticate(userOptions.authenticationCredentials)
70
78
  }
71
79
  }
72
80
 
81
+ /**
82
+ * Makes the Puppeteer page object open the url with the specified navigation logic as specified in the given configuration.
83
+ * @param {Object} page - The Puppeteer page object to use for navigation.
84
+ * @param {Configuration} configuration - The configuration to use.
85
+ */
86
+ exports.navigate = async function (page, configuration) {
87
+ const navigationWaitForSelector = configuration.userOptions.navigationWaitForSelector;
88
+ const navigationWaitForXPath = configuration.userOptions.navigationWaitForXPath;
89
+
90
+ await page.goto(configuration.webPageUrl, this.getNavigationParameters(configuration));
91
+
92
+ if (navigationWaitForSelector !== "") {
93
+ await page.waitForSelector(navigationWaitForSelector, this.getWaitingParameters(configuration));
94
+ } else if (navigationWaitForXPath !== "") {
95
+ await page.waitForXPath(navigationWaitForXPath, this.getWaitingParameters(configuration));
96
+ } else {
97
+ await page.waitForTimeout(250);
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Returns the PDF options to pass to Puppeteer based on the set user options and the documents body.
103
+ * @param {Object} page - The Puppeteer page to configure.
104
+ * @param {UserOptions} configuration - The configuration to use.
105
+ * @returns {Object} - pdfOptions
106
+ */
107
+ exports.getConfiguredPdfOptions = async function (page, configuration) {
108
+ const pdfOptions = configuration.pdfOptions
109
+
110
+ if (configuration.userOptions.isAutoHeight === true) {
111
+ const pageHeight = await page.evaluate(() => {
112
+ return Math.max(document.body.scrollHeight, document.body.offsetHeight);
113
+ })
114
+ if (pageHeight) {
115
+ pdfOptions['height'] = pageHeight + 1 + 'px'
116
+ }
117
+ }
118
+
119
+ return pdfOptions
120
+ }
121
+
73
122
  /**
74
123
  * Extracts the navigation parameters from the configuration in a format that is usable by Puppeteer.
75
124
  * @param {Configuration} configuration - The configuration to extract the navigation parameters from.
76
- * @returns {NavigationParameters}
125
+ * @returns {NavigationParameters}
77
126
  * The extracted navigation parameters.
78
127
  */
79
128
  exports.getNavigationParameters = function (configuration) {
@@ -81,4 +130,17 @@ exports.getNavigationParameters = function (configuration) {
81
130
  timeout: configuration.userOptions.navigationTimeout,
82
131
  waituntil: configuration.userOptions.navigationWaitUntil
83
132
  }
133
+ }
134
+
135
+
136
+ /**
137
+ * Extracts the waiting parameters from the configuration in a format that is usable by Puppeteer.
138
+ * @param {Configuration} configuration - The configuration to extract the waiting parameters from.
139
+ * @returns {WaitingParameters}
140
+ * The extracted waiting parameters.
141
+ */
142
+ exports.getWaitingParameters = function (configuration) {
143
+ return {
144
+ timeout: configuration.userOptions.navigationTimeout
145
+ }
84
146
  }
@@ -8,14 +8,14 @@ const createPdf = async () => {
8
8
  try {
9
9
  browser = await dhalang.launchPuppeteer(configuration);
10
10
  const page = await browser.newPage();
11
- await dhalang.configurePage(page, configuration.userOptions);
12
- await page.goto(configuration.webPageUrl, dhalang.getNavigationParameters(configuration));
13
- await page.waitForTimeout(250);
11
+ await dhalang.configure(page, configuration.userOptions);
12
+ await dhalang.navigate(page, configuration);
13
+ const pdfOptions = await dhalang.getConfiguredPdfOptions(page, configuration);
14
14
  await page.pdf({
15
15
  ...{
16
16
  path: configuration.tempFilePath
17
17
  },
18
- ...configuration.pdfOptions
18
+ ...pdfOptions
19
19
  });
20
20
  } catch (error) {
21
21
  console.error(error.message);
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
  const dhalang = require('./dhalang')
3
3
 
4
- const createPdf = async () => {
4
+ const createScreenshot = async () => {
5
5
  const configuration = dhalang.getConfiguration();
6
6
 
7
7
  let browser;
8
8
  try {
9
9
  browser = await dhalang.launchPuppeteer(configuration);
10
10
  const page = await browser.newPage();
11
- await dhalang.configurePage(page, configuration.userOptions);
12
- await page.goto(configuration.webPageUrl, dhalang.getNavigationParameters(configuration));
13
- await page.waitForTimeout(250);
11
+ await dhalang.configure(page, configuration.userOptions);
12
+ await dhalang.navigate(page, configuration);
13
+
14
14
  const screenshotOptions = configuration.imageType === "png" ? configuration.pngOptions : configuration.jpegOptions
15
15
  await page.screenshot({
16
16
  ...{
@@ -29,4 +29,4 @@ const createPdf = async () => {
29
29
  process.exit();
30
30
  }
31
31
  };
32
- createPdf();
32
+ createScreenshot();
@@ -1,8 +1,542 @@
1
1
  {
2
2
  "name": "dhalang",
3
- "version": "1.0.0",
4
- "lockfileVersion": 1,
3
+ "version": "0.6.0",
4
+ "lockfileVersion": 2,
5
5
  "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "dhalang",
9
+ "version": "0.6.0",
10
+ "license": "MIT",
11
+ "devDependencies": {
12
+ "puppeteer": "^5.5.0"
13
+ }
14
+ },
15
+ "node_modules/@types/node": {
16
+ "version": "14.14.2",
17
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz",
18
+ "integrity": "sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==",
19
+ "dev": true,
20
+ "optional": true
21
+ },
22
+ "node_modules/@types/yauzl": {
23
+ "version": "2.9.1",
24
+ "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz",
25
+ "integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==",
26
+ "dev": true,
27
+ "optional": true,
28
+ "dependencies": {
29
+ "@types/node": "*"
30
+ }
31
+ },
32
+ "node_modules/agent-base": {
33
+ "version": "5.1.1",
34
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz",
35
+ "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==",
36
+ "dev": true,
37
+ "engines": {
38
+ "node": ">= 6.0.0"
39
+ }
40
+ },
41
+ "node_modules/balanced-match": {
42
+ "version": "1.0.0",
43
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
44
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
45
+ "dev": true
46
+ },
47
+ "node_modules/base64-js": {
48
+ "version": "1.3.1",
49
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
50
+ "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
51
+ "dev": true
52
+ },
53
+ "node_modules/bl": {
54
+ "version": "4.0.3",
55
+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz",
56
+ "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==",
57
+ "dev": true,
58
+ "dependencies": {
59
+ "buffer": "^5.5.0",
60
+ "inherits": "^2.0.4",
61
+ "readable-stream": "^3.4.0"
62
+ }
63
+ },
64
+ "node_modules/brace-expansion": {
65
+ "version": "1.1.11",
66
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
67
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
68
+ "dev": true,
69
+ "dependencies": {
70
+ "balanced-match": "^1.0.0",
71
+ "concat-map": "0.0.1"
72
+ }
73
+ },
74
+ "node_modules/buffer": {
75
+ "version": "5.6.0",
76
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
77
+ "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
78
+ "dev": true,
79
+ "dependencies": {
80
+ "base64-js": "^1.0.2",
81
+ "ieee754": "^1.1.4"
82
+ }
83
+ },
84
+ "node_modules/buffer-crc32": {
85
+ "version": "0.2.13",
86
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
87
+ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
88
+ "dev": true,
89
+ "engines": {
90
+ "node": "*"
91
+ }
92
+ },
93
+ "node_modules/chownr": {
94
+ "version": "1.1.4",
95
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
96
+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
97
+ "dev": true
98
+ },
99
+ "node_modules/concat-map": {
100
+ "version": "0.0.1",
101
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
102
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
103
+ "dev": true
104
+ },
105
+ "node_modules/debug": {
106
+ "version": "4.2.0",
107
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
108
+ "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
109
+ "dev": true,
110
+ "dependencies": {
111
+ "ms": "2.1.2"
112
+ },
113
+ "engines": {
114
+ "node": ">=6.0"
115
+ }
116
+ },
117
+ "node_modules/devtools-protocol": {
118
+ "version": "0.0.818844",
119
+ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.818844.tgz",
120
+ "integrity": "sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==",
121
+ "dev": true
122
+ },
123
+ "node_modules/end-of-stream": {
124
+ "version": "1.4.4",
125
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
126
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
127
+ "dev": true,
128
+ "dependencies": {
129
+ "once": "^1.4.0"
130
+ }
131
+ },
132
+ "node_modules/extract-zip": {
133
+ "version": "2.0.1",
134
+ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz",
135
+ "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==",
136
+ "dev": true,
137
+ "dependencies": {
138
+ "@types/yauzl": "^2.9.1",
139
+ "debug": "^4.1.1",
140
+ "get-stream": "^5.1.0",
141
+ "yauzl": "^2.10.0"
142
+ },
143
+ "bin": {
144
+ "extract-zip": "cli.js"
145
+ },
146
+ "engines": {
147
+ "node": ">= 10.17.0"
148
+ },
149
+ "optionalDependencies": {
150
+ "@types/yauzl": "^2.9.1"
151
+ }
152
+ },
153
+ "node_modules/fd-slicer": {
154
+ "version": "1.1.0",
155
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
156
+ "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
157
+ "dev": true,
158
+ "dependencies": {
159
+ "pend": "~1.2.0"
160
+ }
161
+ },
162
+ "node_modules/find-up": {
163
+ "version": "4.1.0",
164
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
165
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
166
+ "dev": true,
167
+ "dependencies": {
168
+ "locate-path": "^5.0.0",
169
+ "path-exists": "^4.0.0"
170
+ },
171
+ "engines": {
172
+ "node": ">=8"
173
+ }
174
+ },
175
+ "node_modules/fs-constants": {
176
+ "version": "1.0.0",
177
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
178
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==",
179
+ "dev": true
180
+ },
181
+ "node_modules/fs.realpath": {
182
+ "version": "1.0.0",
183
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
184
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
185
+ "dev": true
186
+ },
187
+ "node_modules/get-stream": {
188
+ "version": "5.2.0",
189
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
190
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
191
+ "dev": true,
192
+ "dependencies": {
193
+ "pump": "^3.0.0"
194
+ },
195
+ "engines": {
196
+ "node": ">=8"
197
+ }
198
+ },
199
+ "node_modules/glob": {
200
+ "version": "7.1.6",
201
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
202
+ "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
203
+ "dev": true,
204
+ "dependencies": {
205
+ "fs.realpath": "^1.0.0",
206
+ "inflight": "^1.0.4",
207
+ "inherits": "2",
208
+ "minimatch": "^3.0.4",
209
+ "once": "^1.3.0",
210
+ "path-is-absolute": "^1.0.0"
211
+ },
212
+ "engines": {
213
+ "node": "*"
214
+ }
215
+ },
216
+ "node_modules/https-proxy-agent": {
217
+ "version": "4.0.0",
218
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz",
219
+ "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==",
220
+ "dev": true,
221
+ "dependencies": {
222
+ "agent-base": "5",
223
+ "debug": "4"
224
+ },
225
+ "engines": {
226
+ "node": ">= 6.0.0"
227
+ }
228
+ },
229
+ "node_modules/ieee754": {
230
+ "version": "1.1.13",
231
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
232
+ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
233
+ "dev": true
234
+ },
235
+ "node_modules/inflight": {
236
+ "version": "1.0.6",
237
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
238
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
239
+ "dev": true,
240
+ "dependencies": {
241
+ "once": "^1.3.0",
242
+ "wrappy": "1"
243
+ }
244
+ },
245
+ "node_modules/inherits": {
246
+ "version": "2.0.4",
247
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
248
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
249
+ "dev": true
250
+ },
251
+ "node_modules/locate-path": {
252
+ "version": "5.0.0",
253
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
254
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
255
+ "dev": true,
256
+ "dependencies": {
257
+ "p-locate": "^4.1.0"
258
+ },
259
+ "engines": {
260
+ "node": ">=8"
261
+ }
262
+ },
263
+ "node_modules/minimatch": {
264
+ "version": "3.0.4",
265
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
266
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
267
+ "dev": true,
268
+ "dependencies": {
269
+ "brace-expansion": "^1.1.7"
270
+ },
271
+ "engines": {
272
+ "node": "*"
273
+ }
274
+ },
275
+ "node_modules/mkdirp-classic": {
276
+ "version": "0.5.3",
277
+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
278
+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
279
+ "dev": true
280
+ },
281
+ "node_modules/ms": {
282
+ "version": "2.1.2",
283
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
284
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
285
+ "dev": true
286
+ },
287
+ "node_modules/node-fetch": {
288
+ "version": "2.6.1",
289
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
290
+ "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
291
+ "dev": true,
292
+ "engines": {
293
+ "node": "4.x || >=6.0.0"
294
+ }
295
+ },
296
+ "node_modules/once": {
297
+ "version": "1.4.0",
298
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
299
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
300
+ "dev": true,
301
+ "dependencies": {
302
+ "wrappy": "1"
303
+ }
304
+ },
305
+ "node_modules/p-limit": {
306
+ "version": "2.3.0",
307
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
308
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
309
+ "dev": true,
310
+ "dependencies": {
311
+ "p-try": "^2.0.0"
312
+ },
313
+ "engines": {
314
+ "node": ">=6"
315
+ }
316
+ },
317
+ "node_modules/p-locate": {
318
+ "version": "4.1.0",
319
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
320
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
321
+ "dev": true,
322
+ "dependencies": {
323
+ "p-limit": "^2.2.0"
324
+ },
325
+ "engines": {
326
+ "node": ">=8"
327
+ }
328
+ },
329
+ "node_modules/p-try": {
330
+ "version": "2.2.0",
331
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
332
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
333
+ "dev": true,
334
+ "engines": {
335
+ "node": ">=6"
336
+ }
337
+ },
338
+ "node_modules/path-exists": {
339
+ "version": "4.0.0",
340
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
341
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
342
+ "dev": true,
343
+ "engines": {
344
+ "node": ">=8"
345
+ }
346
+ },
347
+ "node_modules/path-is-absolute": {
348
+ "version": "1.0.1",
349
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
350
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
351
+ "dev": true,
352
+ "engines": {
353
+ "node": ">=0.10.0"
354
+ }
355
+ },
356
+ "node_modules/pend": {
357
+ "version": "1.2.0",
358
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
359
+ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
360
+ "dev": true
361
+ },
362
+ "node_modules/pkg-dir": {
363
+ "version": "4.2.0",
364
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
365
+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
366
+ "dev": true,
367
+ "dependencies": {
368
+ "find-up": "^4.0.0"
369
+ },
370
+ "engines": {
371
+ "node": ">=8"
372
+ }
373
+ },
374
+ "node_modules/progress": {
375
+ "version": "2.0.3",
376
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
377
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
378
+ "dev": true,
379
+ "engines": {
380
+ "node": ">=0.4.0"
381
+ }
382
+ },
383
+ "node_modules/proxy-from-env": {
384
+ "version": "1.1.0",
385
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
386
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
387
+ "dev": true
388
+ },
389
+ "node_modules/pump": {
390
+ "version": "3.0.0",
391
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
392
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
393
+ "dev": true,
394
+ "dependencies": {
395
+ "end-of-stream": "^1.1.0",
396
+ "once": "^1.3.1"
397
+ }
398
+ },
399
+ "node_modules/puppeteer": {
400
+ "version": "5.5.0",
401
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.5.0.tgz",
402
+ "integrity": "sha512-OM8ZvTXAhfgFA7wBIIGlPQzvyEETzDjeRa4mZRCRHxYL+GNH5WAuYUQdja3rpWZvkX/JKqmuVgbsxDNsDFjMEg==",
403
+ "dev": true,
404
+ "hasInstallScript": true,
405
+ "dependencies": {
406
+ "debug": "^4.1.0",
407
+ "devtools-protocol": "0.0.818844",
408
+ "extract-zip": "^2.0.0",
409
+ "https-proxy-agent": "^4.0.0",
410
+ "node-fetch": "^2.6.1",
411
+ "pkg-dir": "^4.2.0",
412
+ "progress": "^2.0.1",
413
+ "proxy-from-env": "^1.0.0",
414
+ "rimraf": "^3.0.2",
415
+ "tar-fs": "^2.0.0",
416
+ "unbzip2-stream": "^1.3.3",
417
+ "ws": "^7.2.3"
418
+ },
419
+ "engines": {
420
+ "node": ">=10.18.1"
421
+ }
422
+ },
423
+ "node_modules/readable-stream": {
424
+ "version": "3.6.0",
425
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
426
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
427
+ "dev": true,
428
+ "dependencies": {
429
+ "inherits": "^2.0.3",
430
+ "string_decoder": "^1.1.1",
431
+ "util-deprecate": "^1.0.1"
432
+ },
433
+ "engines": {
434
+ "node": ">= 6"
435
+ }
436
+ },
437
+ "node_modules/rimraf": {
438
+ "version": "3.0.2",
439
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
440
+ "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
441
+ "dev": true,
442
+ "dependencies": {
443
+ "glob": "^7.1.3"
444
+ },
445
+ "bin": {
446
+ "rimraf": "bin.js"
447
+ }
448
+ },
449
+ "node_modules/safe-buffer": {
450
+ "version": "5.2.1",
451
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
452
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
453
+ "dev": true
454
+ },
455
+ "node_modules/string_decoder": {
456
+ "version": "1.3.0",
457
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
458
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
459
+ "dev": true,
460
+ "dependencies": {
461
+ "safe-buffer": "~5.2.0"
462
+ }
463
+ },
464
+ "node_modules/tar-fs": {
465
+ "version": "2.1.0",
466
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.0.tgz",
467
+ "integrity": "sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==",
468
+ "dev": true,
469
+ "dependencies": {
470
+ "chownr": "^1.1.1",
471
+ "mkdirp-classic": "^0.5.2",
472
+ "pump": "^3.0.0",
473
+ "tar-stream": "^2.0.0"
474
+ }
475
+ },
476
+ "node_modules/tar-stream": {
477
+ "version": "2.1.4",
478
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.4.tgz",
479
+ "integrity": "sha512-o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw==",
480
+ "dev": true,
481
+ "dependencies": {
482
+ "bl": "^4.0.3",
483
+ "end-of-stream": "^1.4.1",
484
+ "fs-constants": "^1.0.0",
485
+ "inherits": "^2.0.3",
486
+ "readable-stream": "^3.1.1"
487
+ },
488
+ "engines": {
489
+ "node": ">=6"
490
+ }
491
+ },
492
+ "node_modules/through": {
493
+ "version": "2.3.8",
494
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
495
+ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
496
+ "dev": true
497
+ },
498
+ "node_modules/unbzip2-stream": {
499
+ "version": "1.4.3",
500
+ "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
501
+ "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==",
502
+ "dev": true,
503
+ "dependencies": {
504
+ "buffer": "^5.2.1",
505
+ "through": "^2.3.8"
506
+ }
507
+ },
508
+ "node_modules/util-deprecate": {
509
+ "version": "1.0.2",
510
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
511
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
512
+ "dev": true
513
+ },
514
+ "node_modules/wrappy": {
515
+ "version": "1.0.2",
516
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
517
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
518
+ "dev": true
519
+ },
520
+ "node_modules/ws": {
521
+ "version": "7.3.1",
522
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz",
523
+ "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==",
524
+ "dev": true,
525
+ "engines": {
526
+ "node": ">=8.3.0"
527
+ }
528
+ },
529
+ "node_modules/yauzl": {
530
+ "version": "2.10.0",
531
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
532
+ "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
533
+ "dev": true,
534
+ "dependencies": {
535
+ "buffer-crc32": "~0.2.3",
536
+ "fd-slicer": "~1.1.0"
537
+ }
538
+ }
539
+ },
6
540
  "dependencies": {
7
541
  "@types/node": {
8
542
  "version": "14.14.2",
@@ -98,9 +632,9 @@
98
632
  }
99
633
  },
100
634
  "devtools-protocol": {
101
- "version": "0.0.799653",
102
- "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.799653.tgz",
103
- "integrity": "sha512-t1CcaZbvm8pOlikqrsIM9GOa7Ipp07+4h/q9u0JXBWjPCjHdBl9KkddX87Vv9vBHoBGtwV79sYQNGnQM6iS5gg==",
635
+ "version": "0.0.818844",
636
+ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.818844.tgz",
637
+ "integrity": "sha512-AD1hi7iVJ8OD0aMLQU5VK0XH9LDlA1+BcPIgrAxPfaibx2DbWucuyOhc4oyQCbnvDDO68nN6/LcKfqTP343Jjg==",
104
638
  "dev": true
105
639
  },
106
640
  "end-of-stream": {
@@ -240,6 +774,12 @@
240
774
  "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
241
775
  "dev": true
242
776
  },
777
+ "node-fetch": {
778
+ "version": "2.6.1",
779
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
780
+ "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
781
+ "dev": true
782
+ },
243
783
  "once": {
244
784
  "version": "1.4.0",
245
785
  "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -323,15 +863,16 @@
323
863
  }
324
864
  },
325
865
  "puppeteer": {
326
- "version": "5.3.1",
327
- "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.3.1.tgz",
328
- "integrity": "sha512-YTM1RaBeYrj6n7IlRXRYLqJHF+GM7tasbvrNFx6w1S16G76NrPq7oYFKLDO+BQsXNtS8kW2GxWCXjIMPvfDyaQ==",
866
+ "version": "5.5.0",
867
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-5.5.0.tgz",
868
+ "integrity": "sha512-OM8ZvTXAhfgFA7wBIIGlPQzvyEETzDjeRa4mZRCRHxYL+GNH5WAuYUQdja3rpWZvkX/JKqmuVgbsxDNsDFjMEg==",
329
869
  "dev": true,
330
870
  "requires": {
331
871
  "debug": "^4.1.0",
332
- "devtools-protocol": "0.0.799653",
872
+ "devtools-protocol": "0.0.818844",
333
873
  "extract-zip": "^2.0.0",
334
874
  "https-proxy-agent": "^4.0.0",
875
+ "node-fetch": "^2.6.1",
335
876
  "pkg-dir": "^4.2.0",
336
877
  "progress": "^2.0.1",
337
878
  "proxy-from-env": "^1.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhalang",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "homepage": "https://github.com/NielsSteensma/Dhalang#readme",
22
22
  "devDependencies": {
23
- "puppeteer": "^5.3.0"
23
+ "puppeteer": "^5.5.0"
24
24
  }
25
- }
25
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Dhalang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niels Steensma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2021-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler