step-node-agent 3.26.2 → 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.
- package/node_modules/object-inspect/CHANGELOG.md +12 -0
- package/node_modules/object-inspect/index.js +17 -3
- package/node_modules/object-inspect/package.json +6 -6
- package/node_modules/object-inspect/test/quoteStyle.js +9 -0
- package/node_modules/psl/README.md +84 -28
- package/node_modules/psl/data/rules.js +9771 -0
- package/node_modules/psl/dist/psl.cjs +1 -0
- package/node_modules/psl/dist/psl.mjs +9997 -0
- package/node_modules/psl/dist/psl.umd.cjs +1 -0
- package/node_modules/psl/index.js +16 -16
- package/node_modules/psl/package.json +27 -22
- package/node_modules/psl/types/index.d.ts +52 -0
- package/node_modules/psl/types/test.ts +14 -0
- package/node_modules/psl/types/tsconfig.json +22 -0
- package/node_modules/psl/vite.config.js +20 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +20 -11
- package/node_modules/yaml/dist/schema/json/schema.js +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/node_modules/yaml/dist/stringify/stringifyString.js +20 -11
- package/node_modules/yaml/package.json +1 -1
- package/package.json +1 -1
- package/node_modules/psl/.env +0 -0
- package/node_modules/psl/data/rules.json +0 -9376
- package/node_modules/psl/dist/psl.js +0 -10187
- package/node_modules/psl/dist/psl.min.js +0 -1
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
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
|
-
//
|
|
10
|
+
// Parse rules from file.
|
|
13
11
|
//
|
|
14
|
-
internals.rules =
|
|
12
|
+
internals.rules = rules.map(function (rule) {
|
|
15
13
|
|
|
16
14
|
return {
|
|
17
15
|
rule: rule,
|
|
@@ -24,7 +22,7 @@ internals.rules = require('./data/rules.json').map(function (rule) {
|
|
|
24
22
|
|
|
25
23
|
|
|
26
24
|
//
|
|
27
|
-
// Check
|
|
25
|
+
// Check if given string ends with `suffix`.
|
|
28
26
|
//
|
|
29
27
|
internals.endsWith = function (str, suffix) {
|
|
30
28
|
|
|
@@ -40,7 +38,7 @@ internals.findRule = function (domain) {
|
|
|
40
38
|
var punyDomain = Punycode.toASCII(domain);
|
|
41
39
|
return internals.rules.reduce(function (memo, rule) {
|
|
42
40
|
|
|
43
|
-
if (rule.punySuffix === -1){
|
|
41
|
+
if (rule.punySuffix === -1) {
|
|
44
42
|
rule.punySuffix = Punycode.toASCII(rule.suffix);
|
|
45
43
|
}
|
|
46
44
|
if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) {
|
|
@@ -63,7 +61,7 @@ internals.findRule = function (domain) {
|
|
|
63
61
|
//
|
|
64
62
|
// Error codes and messages.
|
|
65
63
|
//
|
|
66
|
-
|
|
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
|
-
|
|
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:
|
|
160
|
+
message: errorCodes[error],
|
|
163
161
|
code: error
|
|
164
162
|
}
|
|
165
163
|
};
|
|
@@ -237,7 +235,7 @@ exports.parse = function (input) {
|
|
|
237
235
|
}
|
|
238
236
|
|
|
239
237
|
parsed.sld = privateParts.pop();
|
|
240
|
-
parsed.domain = [parsed.sld,
|
|
238
|
+
parsed.domain = [parsed.sld, parsed.tld].join('.');
|
|
241
239
|
|
|
242
240
|
if (privateParts.length) {
|
|
243
241
|
parsed.subdomain = privateParts.join('.');
|
|
@@ -250,20 +248,22 @@ exports.parse = function (input) {
|
|
|
250
248
|
//
|
|
251
249
|
// Get domain.
|
|
252
250
|
//
|
|
253
|
-
|
|
251
|
+
export const get = function (domain) {
|
|
254
252
|
|
|
255
253
|
if (!domain) {
|
|
256
254
|
return null;
|
|
257
255
|
}
|
|
258
|
-
return
|
|
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
|
-
|
|
263
|
+
export const isValid = function (domain) {
|
|
266
264
|
|
|
267
|
-
var parsed =
|
|
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.
|
|
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
|
-
"
|
|
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
|
-
"test:browserstack": "node test
|
|
14
|
-
"watch": "mocha test --watch",
|
|
15
|
-
"
|
|
16
|
-
"build": "
|
|
17
|
-
"postbuild": "
|
|
18
|
-
"commit-and-pr": "commit-and-pr",
|
|
21
|
+
"test:browserstack": "browserstack-node-sdk playwright test",
|
|
22
|
+
"watch": "mocha test/*.spec.js --watch",
|
|
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": [
|
|
@@ -24,20 +31,18 @@
|
|
|
24
31
|
],
|
|
25
32
|
"author": "Lupo Montero <lupomontero@gmail.com> (https://lupomontero.com/)",
|
|
26
33
|
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"punycode": "^2.3.1"
|
|
36
|
+
},
|
|
27
37
|
"devDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"request": "^2.88.2",
|
|
38
|
-
"selenium-webdriver": "^4.3.0",
|
|
39
|
-
"serve-handler": "^6.1.3",
|
|
40
|
-
"uglify-js": "^3.16.2",
|
|
41
|
-
"watchify": "^4.0.0"
|
|
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",
|
|
43
|
+
"mocha": "^10.8.2",
|
|
44
|
+
"typescript": "^5.6.3",
|
|
45
|
+
"typescript-eslint": "^8.15.0",
|
|
46
|
+
"vite": "^5.4.11"
|
|
42
47
|
}
|
|
43
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
|
+
});
|
|
@@ -95,7 +95,7 @@ const timestamp = {
|
|
|
95
95
|
}
|
|
96
96
|
return new Date(date);
|
|
97
97
|
},
|
|
98
|
-
stringify: ({ value }) => value.toISOString().replace(/(
|
|
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
|
-
|
|
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
|
-
|
|
230
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -97,7 +97,7 @@ const timestamp = {
|
|
|
97
97
|
}
|
|
98
98
|
return new Date(date);
|
|
99
99
|
},
|
|
100
|
-
stringify: ({ value }) => value.toISOString().replace(/(
|
|
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
|
-
|
|
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
|
-
|
|
232
|
-
|
|
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
|
-
|
|
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;
|
package/package.json
CHANGED
package/node_modules/psl/.env
DELETED
|
File without changes
|