step-node-agent 3.26.3 → 3.26.4

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.
@@ -1,17 +1,15 @@
1
- /*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */
2
- 'use strict';
1
+ import Punycode from 'punycode/punycode.js';
3
2
 
4
-
5
- var Punycode = require('punycode/');
3
+ import rules from './data/rules.js';
6
4
 
7
5
 
8
6
  var internals = {};
9
7
 
10
8
 
11
9
  //
12
- // Read rules from file.
10
+ // Parse rules from file.
13
11
  //
14
- internals.rules = require('./data/rules.json').map(function (rule) {
12
+ internals.rules = rules.map(function (rule) {
15
13
 
16
14
  return {
17
15
  rule: rule,
@@ -63,7 +61,7 @@ internals.findRule = function (domain) {
63
61
  //
64
62
  // Error codes and messages.
65
63
  //
66
- exports.errorCodes = {
64
+ export const errorCodes = {
67
65
  DOMAIN_TOO_SHORT: 'Domain name too short.',
68
66
  DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.',
69
67
  LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.',
@@ -138,7 +136,7 @@ internals.validate = function (input) {
138
136
  //
139
137
  // Parse domain.
140
138
  //
141
- exports.parse = function (input) {
139
+ export const parse = function (input) {
142
140
 
143
141
  if (typeof input !== 'string') {
144
142
  throw new TypeError('Domain name must be a string.');
@@ -159,7 +157,7 @@ exports.parse = function (input) {
159
157
  return {
160
158
  input: input,
161
159
  error: {
162
- message: exports.errorCodes[error],
160
+ message: errorCodes[error],
163
161
  code: error
164
162
  }
165
163
  };
@@ -250,20 +248,22 @@ exports.parse = function (input) {
250
248
  //
251
249
  // Get domain.
252
250
  //
253
- exports.get = function (domain) {
251
+ export const get = function (domain) {
254
252
 
255
253
  if (!domain) {
256
254
  return null;
257
255
  }
258
- return exports.parse(domain).domain || null;
256
+ return parse(domain).domain || null;
259
257
  };
260
258
 
261
259
 
262
260
  //
263
261
  // Check whether domain belongs to a known public suffix.
264
262
  //
265
- exports.isValid = function (domain) {
263
+ export const isValid = function (domain) {
266
264
 
267
- var parsed = exports.parse(domain);
265
+ var parsed = parse(domain);
268
266
  return Boolean(parsed.domain && parsed.listed);
269
267
  };
268
+
269
+ export default { parse, get, isValid };
@@ -1,21 +1,28 @@
1
1
  {
2
2
  "name": "psl",
3
- "version": "1.10.0",
3
+ "version": "1.13.0",
4
4
  "description": "Domain name parser based on the Public Suffix List",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git@github.com:lupomontero/psl.git"
8
8
  },
9
- "main": "index.js",
9
+ "type": "module",
10
+ "main": "./dist/psl.cjs",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/psl.mjs",
14
+ "require": "./dist/psl.cjs"
15
+ }
16
+ },
17
+ "types": "types/index.d.ts",
10
18
  "scripts": {
11
19
  "lint": "eslint .",
12
20
  "test": "mocha test/*.spec.js",
13
21
  "test:browserstack": "browserstack-node-sdk playwright test",
14
22
  "watch": "mocha test/*.spec.js --watch",
15
- "prebuild": "./scripts/update-rules.js",
16
- "build": "browserify ./index.js --standalone=psl > ./dist/psl.js",
17
- "postbuild": "cat ./dist/psl.js | uglifyjs -c -m > ./dist/psl.min.js",
18
- "commit-and-pr": "commit-and-pr",
23
+ "update-rules": "./scripts/update-rules.js",
24
+ "build": "vite build",
25
+ "postbuild": "ln -s ./psl.umd.cjs dist/psl.js && ln -s ./psl.umd.cjs dist/psl.min.js",
19
26
  "changelog": "git log $(git describe --tags --abbrev=0)..HEAD --oneline --format=\"%h %s (%an <%ae>)\""
20
27
  },
21
28
  "keywords": [
@@ -28,15 +35,14 @@
28
35
  "punycode": "^2.3.1"
29
36
  },
30
37
  "devDependencies": {
31
- "@playwright/test": "^1.48.2",
32
- "browserify": "^17.0.1",
33
- "browserstack-node-sdk": "^1.34.21",
34
- "chai": "^5.1.2",
35
- "commit-and-pr": "^1.0.4",
36
- "eslint": "^9.14.0",
37
- "JSONStream": "^1.3.5",
38
+ "@eslint/js": "^9.15.0",
39
+ "@playwright/test": "^1.49.0",
40
+ "@types/eslint__js": "^8.42.3",
41
+ "browserstack-node-sdk": "^1.34.23",
42
+ "eslint": "^9.15.0",
38
43
  "mocha": "^10.8.2",
39
- "request": "^2.88.2",
40
- "uglify-js": "^3.19.3"
44
+ "typescript": "^5.6.3",
45
+ "typescript-eslint": "^8.15.0",
46
+ "vite": "^5.4.11"
41
47
  }
42
48
  }
@@ -0,0 +1,52 @@
1
+ // TypeScript Version: 2.4
2
+
3
+ /**
4
+ * Result returned when a given domain name was not parsable (not exported)
5
+ */
6
+ export type ErrorResult<T extends keyof errorCodes> = {
7
+ input: string;
8
+ error: {
9
+ code: T;
10
+ message: errorCodes[T];
11
+ };
12
+ }
13
+
14
+ /**
15
+ * Error codes and descriptions for domain name parsing errors
16
+ */
17
+ export const enum errorCodes {
18
+ DOMAIN_TOO_SHORT = 'Domain name too short',
19
+ DOMAIN_TOO_LONG = 'Domain name too long. It should be no more than 255 chars.',
20
+ LABEL_STARTS_WITH_DASH = 'Domain name label can not start with a dash.',
21
+ LABEL_ENDS_WITH_DASH = 'Domain name label can not end with a dash.',
22
+ LABEL_TOO_LONG = 'Domain name label should be at most 63 chars long.',
23
+ LABEL_TOO_SHORT = 'Domain name label should be at least 1 character long.',
24
+ LABEL_INVALID_CHARS = 'Domain name label can only contain alphanumeric characters or dashes.'
25
+ }
26
+
27
+ // Export the browser global variable name additionally to the CJS/AMD exports below
28
+ export as namespace psl;
29
+
30
+ export type ParsedDomain = {
31
+ input: string;
32
+ tld: string | null;
33
+ sld: string | null;
34
+ domain: string | null;
35
+ subdomain: string | null;
36
+ listed: boolean;
37
+ }
38
+
39
+ /**
40
+ * Parse a domain name and return its components
41
+ */
42
+ export function parse(input: string): ParsedDomain | ErrorResult<keyof errorCodes>;
43
+
44
+ /**
45
+ * Get the base domain for full domain name
46
+ */
47
+ export function get(domain: string): string | null;
48
+
49
+ /**
50
+ * Check whether the given domain belongs to a known public suffix
51
+ */
52
+ export function isValid(domain: string): boolean;
@@ -0,0 +1,14 @@
1
+ import * as psl from 'psl';
2
+ import type { ParsedDomain, ErrorResult, errorCodes } from './index.d.ts';
3
+
4
+ const x = (a: ParsedDomain | ErrorResult<keyof errorCodes>) => {
5
+ return a;
6
+ };
7
+
8
+ console.log(x(psl.parse('')));
9
+
10
+ // $ExpectType string | null
11
+ console.log(psl.get('example.com'));
12
+
13
+ // $ExpectType boolean
14
+ console.log(psl.isValid('example.com'));
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "commonjs",
5
+ "lib": [
6
+ "es5"
7
+ ],
8
+ "strict": true,
9
+ "noEmit": false,
10
+ "noImplicitAny": true,
11
+ "noImplicitThis": true,
12
+ "strictNullChecks": true,
13
+ "strictFunctionTypes": true,
14
+ // Expose module under its CJS/AMD name
15
+ "baseUrl": ".",
16
+ "paths": {
17
+ "psl": [
18
+ "./index.d.ts"
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,20 @@
1
+ import { resolve } from 'node:path';
2
+ import { defineConfig } from 'vite';
3
+
4
+ export default defineConfig({
5
+ build: {
6
+ target: 'es2015',
7
+ lib: {
8
+ entry: resolve(__dirname, 'index.js'),
9
+ name: 'psl',
10
+ formats: ['es', 'cjs', 'umd'],
11
+ fileName: format => (
12
+ format === 'umd'
13
+ ? 'psl.umd.cjs'
14
+ : format === 'cjs'
15
+ ? 'psl.cjs'
16
+ : 'psl.mjs'
17
+ ),
18
+ },
19
+ },
20
+ });
@@ -27,7 +27,7 @@ const jsonScalars = [
27
27
  identify: value => typeof value === 'boolean',
28
28
  default: true,
29
29
  tag: 'tag:yaml.org,2002:bool',
30
- test: /^true|false$/,
30
+ test: /^true$|^false$/,
31
31
  resolve: str => str === 'true',
32
32
  stringify: stringifyJSON
33
33
  },
@@ -95,7 +95,7 @@ const timestamp = {
95
95
  }
96
96
  return new Date(date);
97
97
  },
98
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
98
+ stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '')
99
99
  };
100
100
 
101
101
  export { floatTime, intTime, timestamp };
@@ -219,23 +219,32 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
219
219
  start = start.replace(/\n+/g, `$&${indent}`);
220
220
  }
221
221
  const indentSize = indent ? '2' : '1'; // root is at -1
222
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
222
+ // Leading | or > is added later
223
+ let header = (startWithSpace ? indentSize : '') + chomp;
223
224
  if (comment) {
224
225
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
225
226
  if (onComment)
226
227
  onComment();
227
228
  }
228
- if (literal) {
229
- value = value.replace(/\n+/g, `$&${indent}`);
230
- return `${header}\n${indent}${start}${value}${end}`;
229
+ if (!literal) {
230
+ const foldedValue = value
231
+ .replace(/\n+/g, '\n$&')
232
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
233
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
234
+ .replace(/\n+/g, `$&${indent}`);
235
+ let literalFallback = false;
236
+ const foldOptions = getFoldOptions(ctx, true);
237
+ if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
238
+ foldOptions.onOverflow = () => {
239
+ literalFallback = true;
240
+ };
241
+ }
242
+ const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
243
+ if (!literalFallback)
244
+ return `>${header}\n${indent}${body}`;
231
245
  }
232
- value = value
233
- .replace(/\n+/g, '\n$&')
234
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
235
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
236
- .replace(/\n+/g, `$&${indent}`);
237
- const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
238
- return `${header}\n${indent}${body}`;
246
+ value = value.replace(/\n+/g, `$&${indent}`);
247
+ return `|${header}\n${indent}${start}${value}${end}`;
239
248
  }
240
249
  function plainString(item, ctx, onComment, onChompKeep) {
241
250
  const { type, value } = item;
@@ -29,7 +29,7 @@ const jsonScalars = [
29
29
  identify: value => typeof value === 'boolean',
30
30
  default: true,
31
31
  tag: 'tag:yaml.org,2002:bool',
32
- test: /^true|false$/,
32
+ test: /^true$|^false$/,
33
33
  resolve: str => str === 'true',
34
34
  stringify: stringifyJSON
35
35
  },
@@ -97,7 +97,7 @@ const timestamp = {
97
97
  }
98
98
  return new Date(date);
99
99
  },
100
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
100
+ stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '')
101
101
  };
102
102
 
103
103
  exports.floatTime = floatTime;
@@ -221,23 +221,32 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
221
221
  start = start.replace(/\n+/g, `$&${indent}`);
222
222
  }
223
223
  const indentSize = indent ? '2' : '1'; // root is at -1
224
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
224
+ // Leading | or > is added later
225
+ let header = (startWithSpace ? indentSize : '') + chomp;
225
226
  if (comment) {
226
227
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
227
228
  if (onComment)
228
229
  onComment();
229
230
  }
230
- if (literal) {
231
- value = value.replace(/\n+/g, `$&${indent}`);
232
- return `${header}\n${indent}${start}${value}${end}`;
231
+ if (!literal) {
232
+ const foldedValue = value
233
+ .replace(/\n+/g, '\n$&')
234
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
235
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
236
+ .replace(/\n+/g, `$&${indent}`);
237
+ let literalFallback = false;
238
+ const foldOptions = getFoldOptions(ctx, true);
239
+ if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {
240
+ foldOptions.onOverflow = () => {
241
+ literalFallback = true;
242
+ };
243
+ }
244
+ const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
245
+ if (!literalFallback)
246
+ return `>${header}\n${indent}${body}`;
233
247
  }
234
- value = value
235
- .replace(/\n+/g, '\n$&')
236
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
237
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
238
- .replace(/\n+/g, `$&${indent}`);
239
- const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
240
- return `${header}\n${indent}${body}`;
248
+ value = value.replace(/\n+/g, `$&${indent}`);
249
+ return `|${header}\n${indent}${start}${value}${end}`;
241
250
  }
242
251
  function plainString(item, ctx, onComment, onChompKeep) {
243
252
  const { type, value } = item;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "license": "ISC",
5
5
  "author": "Eemeli Aro <eemeli@gmail.com>",
6
6
  "repository": "github:eemeli/yaml",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "step-node-agent",
3
- "version": "3.26.3",
3
+ "version": "3.26.4",
4
4
  "description": "The official STEP Agent implementation for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,73 +0,0 @@
1
- # ======================
2
- # BrowserStack Reporting
3
- # ======================
4
- # The following capabilities are used to set up reporting on BrowserStack:
5
- # Set 'projectName' to the name of your project. Example, Marketing Website
6
- projectName: psl
7
- # Set `buildName` as the name of the job / testsuite being run
8
- buildName: browserstack build
9
- # `buildIdentifier` is a unique id to differentiate every execution that gets appended to
10
- # buildName. Choose your buildIdentifier format from the available expressions:
11
- # ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
12
- # ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
13
- # Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
14
- buildIdentifier: "#${BUILD_NUMBER}" # Supports strings along with either/both ${expression}
15
-
16
- # =======================================
17
- # Platforms (Browsers / Devices to test)
18
- # =======================================
19
- # Platforms object contains all the browser / device combinations you want to test on.
20
- # Entire list available here -> (https://www.browserstack.com/list-of-browsers-and-platforms/automate)
21
- platforms:
22
- - os: Windows
23
- osVersion: 11
24
- browserName: chrome
25
- browserVersion: latest
26
- - os: OS X
27
- osVersion: Ventura
28
- browserName: playwright-webkit
29
- browserVersion: latest
30
- - os: Windows
31
- osVersion: 11
32
- browserName: playwright-firefox
33
- browserVersion: latest
34
-
35
- # =======================
36
- # Parallels per Platform
37
- # =======================
38
- # The number of parallel threads to be used for each platform set.
39
- # BrowserStack's SDK runner will select the best strategy based on the configured value
40
- #
41
- # Example 1 - If you have configured 3 platforms and set `parallelsPerPlatform` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack
42
- #
43
- # Example 2 - If you have configured 1 platform and set `parallelsPerPlatform` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
44
- parallelsPerPlatform: 1
45
-
46
- # ==========================================
47
- # BrowserStack Local
48
- # (For localhost, staging/private websites)
49
- # ==========================================
50
- # Set browserStackLocal to true if your website under test is not accessible publicly over the internet
51
- # Learn more about how BrowserStack Local works here -> https://www.browserstack.com/docs/automate/selenium/local-testing-introduction
52
- browserstackLocal: true # <boolean> (Default false)
53
- # browserStackLocalOptions:
54
- # Options to be passed to BrowserStack local in-case of advanced configurations
55
- # localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
56
- # forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
57
- # Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections
58
-
59
- framework: playwright
60
- source: node-js-playwright-sample-sdk:v1
61
-
62
- # ===================
63
- # Debugging features
64
- # ===================
65
- debug: false # <boolean> # Set to true if you need screenshots for every selenium command ran
66
- networkLogs: false # <boolean> Set to true to enable HAR logs capturing
67
- consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Default: errors)
68
- # Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)
69
- # CUSTOM_TAG_<INT>: # <string> (Default: parent folder name of the test file) Custom tag for your test suite
70
-
71
- # Test Observability is an intelligent test reporting & debugging product. It collects data using the SDK. Read more about what data is collected at https://www.browserstack.com/docs/test-observability/references/terms-and-conditions
72
- # Visit observability.browserstack.com to see your test reports and insights. To disable test observability, specify `testObservability: false` in the key below.
73
- testObservability: true