Initial commit - Dutchie dispensary scraper

This commit is contained in:
Kelly
2025-11-28 19:45:44 -07:00
commit 5757a8e9bd
23375 changed files with 3788799 additions and 0 deletions

22
backend/node_modules/pac-resolver/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

59
backend/node_modules/pac-resolver/README.md generated vendored Normal file
View File

@@ -0,0 +1,59 @@
pac-resolver
============
### Generates an asynchronous resolver function from a [PAC file][pac-wikipedia]
This module accepts a JavaScript String of code, which is meant to be a
[PAC proxy file][pac-wikipedia], and returns a generated asynchronous
`FindProxyForURL()` function.
Example
-------
Given the PAC proxy file named `proxy.pac`:
```js
function FindProxyForURL(url, host) {
if (isInNet(myIpAddress(), "10.1.10.0", "255.255.255.0")) {
return "PROXY 1.2.3.4:8080";
} else {
return "DIRECT";
}
}
```
You can consume this PAC file with `pac-resolver` like so:
```ts
import { readFileSync } from 'fs';
import { createPacResolver } from 'pac-resolver';
const FindProxyForURL = createPacResolver(readFileSync('proxy.pac'));
const res = await FindProxyForURL('http://foo.com/');
console.log(res);
// "DIRECT"
```
API
---
### pac(qjs: QuickJSWASMModule, pacFileContents: string | Buffer, options?: PacResolverOptions) → Function
Returns an asynchronous `FindProxyForURL()` function based off of the given JS
string `pacFileContents` PAC proxy file. An optional `options` object may be
passed in which respects the following options:
* `filename` - String - the filename to use in error stack traces. Defaults to `proxy.pac`.
* `sandbox` - Object - a map of functions to include in the sandbox of the
JavaScript environment where the JS code will be executed. i.e. if you wanted to
include the common `alert` function you could pass `alert: console.log`. For
async functions, you must set the `async = true` property on the function
instance, and the JS code will be able to invoke the function as if it were
synchronous.
The `qjs` parameter is a QuickJS module instance as returned from `getQuickJS()` from the `quickjs-emscripten` module.
[pac-file-docs]: https://web.archive.org/web/20070602031929/http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
[pac-wikipedia]: http://wikipedia.org/wiki/Proxy_auto-config

67
backend/node_modules/pac-resolver/dist/dateRange.d.ts generated vendored Normal file
View File

@@ -0,0 +1,67 @@
/**
* If only a single value is specified (from each category: day, month, year), the
* function returns a true value only on days that match that specification. If
* both values are specified, the result is true between those times, including
* bounds.
*
* Even though the examples don't show, the "GMT" parameter can be specified
* in any of the 9 different call profiles, always as the last parameter.
*
* Examples:
*
* ``` js
* dateRange(1)
* true on the first day of each month, local timezone.
*
* dateRange(1, "GMT")
* true on the first day of each month, GMT timezone.
*
* dateRange(1, 15)
* true on the first half of each month.
*
* dateRange(24, "DEC")
* true on 24th of December each year.
*
* dateRange(24, "DEC", 1995)
* true on 24th of December, 1995.
*
* dateRange("JAN", "MAR")
* true on the first quarter of the year.
*
* dateRange(1, "JUN", 15, "AUG")
* true from June 1st until August 15th, each year (including June 1st and August
* 15th).
*
* dateRange(1, "JUN", 15, 1995, "AUG", 1995)
* true from June 1st, 1995, until August 15th, same year.
*
* dateRange("OCT", 1995, "MAR", 1996)
* true from October 1995 until March 1996 (including the entire month of October
* 1995 and March 1996).
*
* dateRange(1995)
* true during the entire year 1995.
*
* dateRange(1995, 1997)
* true from beginning of year 1995 until the end of year 1997.
* ```
*
* dateRange(day)
* dateRange(day1, day2)
* dateRange(mon)
* dateRange(month1, month2)
* dateRange(year)
* dateRange(year1, year2)
* dateRange(day1, month1, day2, month2)
* dateRange(month1, year1, month2, year2)
* dateRange(day1, month1, year1, day2, month2, year2)
* dateRange(day1, month1, year1, day2, month2, year2, gmt)
*
* @param {String} day is the day of month between 1 and 31 (as an integer).
* @param {String} month is one of the month strings: JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
* @param {String} year is the full year number, for example 1995 (but not 95). Integer.
* @param {String} gmt is either the string "GMT", which makes time comparison occur in GMT timezone; if left unspecified, times are taken to be in the local timezone.
* @return {Boolean}
*/
export default function dateRange(): boolean;
//# sourceMappingURL=dateRange.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dateRange.d.ts","sourceRoot":"","sources":["../src/dateRange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,OAAO,CAG3C"}

73
backend/node_modules/pac-resolver/dist/dateRange.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
"use strict";
/**
* If only a single value is specified (from each category: day, month, year), the
* function returns a true value only on days that match that specification. If
* both values are specified, the result is true between those times, including
* bounds.
*
* Even though the examples don't show, the "GMT" parameter can be specified
* in any of the 9 different call profiles, always as the last parameter.
*
* Examples:
*
* ``` js
* dateRange(1)
* true on the first day of each month, local timezone.
*
* dateRange(1, "GMT")
* true on the first day of each month, GMT timezone.
*
* dateRange(1, 15)
* true on the first half of each month.
*
* dateRange(24, "DEC")
* true on 24th of December each year.
*
* dateRange(24, "DEC", 1995)
* true on 24th of December, 1995.
*
* dateRange("JAN", "MAR")
* true on the first quarter of the year.
*
* dateRange(1, "JUN", 15, "AUG")
* true from June 1st until August 15th, each year (including June 1st and August
* 15th).
*
* dateRange(1, "JUN", 15, 1995, "AUG", 1995)
* true from June 1st, 1995, until August 15th, same year.
*
* dateRange("OCT", 1995, "MAR", 1996)
* true from October 1995 until March 1996 (including the entire month of October
* 1995 and March 1996).
*
* dateRange(1995)
* true during the entire year 1995.
*
* dateRange(1995, 1997)
* true from beginning of year 1995 until the end of year 1997.
* ```
*
* dateRange(day)
* dateRange(day1, day2)
* dateRange(mon)
* dateRange(month1, month2)
* dateRange(year)
* dateRange(year1, year2)
* dateRange(day1, month1, day2, month2)
* dateRange(month1, year1, month2, year2)
* dateRange(day1, month1, year1, day2, month2, year2)
* dateRange(day1, month1, year1, day2, month2, year2, gmt)
*
* @param {String} day is the day of month between 1 and 31 (as an integer).
* @param {String} month is one of the month strings: JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
* @param {String} year is the full year number, for example 1995 (but not 95). Integer.
* @param {String} gmt is either the string "GMT", which makes time comparison occur in GMT timezone; if left unspecified, times are taken to be in the local timezone.
* @return {Boolean}
*/
Object.defineProperty(exports, "__esModule", { value: true });
function dateRange() {
// TODO: implement me!
return false;
}
exports.default = dateRange;
//# sourceMappingURL=dateRange.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dateRange.js","sourceRoot":"","sources":["../src/dateRange.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;;AAEH,SAAwB,SAAS;IAChC,sBAAsB;IACtB,OAAO,KAAK,CAAC;AACd,CAAC;AAHD,4BAGC"}

View File

@@ -0,0 +1,23 @@
/**
* Returns true iff the domain of hostname matches.
*
* Examples:
*
* ``` js
* dnsDomainIs("www.netscape.com", ".netscape.com")
* // is true.
*
* dnsDomainIs("www", ".netscape.com")
* // is false.
*
* dnsDomainIs("www.mcom.com", ".netscape.com")
* // is false.
* ```
*
*
* @param {String} host is the hostname from the URL.
* @param {String} domain is the domain name to test the hostname against.
* @return {Boolean} true iff the domain of the hostname matches.
*/
export default function dnsDomainIs(host: string, domain: string): boolean;
//# sourceMappingURL=dnsDomainIs.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dnsDomainIs.d.ts","sourceRoot":"","sources":["../src/dnsDomainIs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAIzE"}

30
backend/node_modules/pac-resolver/dist/dnsDomainIs.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Returns true iff the domain of hostname matches.
*
* Examples:
*
* ``` js
* dnsDomainIs("www.netscape.com", ".netscape.com")
* // is true.
*
* dnsDomainIs("www", ".netscape.com")
* // is false.
*
* dnsDomainIs("www.mcom.com", ".netscape.com")
* // is false.
* ```
*
*
* @param {String} host is the hostname from the URL.
* @param {String} domain is the domain name to test the hostname against.
* @return {Boolean} true iff the domain of the hostname matches.
*/
function dnsDomainIs(host, domain) {
host = String(host);
domain = String(domain);
return host.substr(domain.length * -1) === domain;
}
exports.default = dnsDomainIs;
//# sourceMappingURL=dnsDomainIs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dnsDomainIs.js","sourceRoot":"","sources":["../src/dnsDomainIs.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAwB,WAAW,CAAC,IAAY,EAAE,MAAc;IAC/D,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AACnD,CAAC;AAJD,8BAIC"}

View File

@@ -0,0 +1,18 @@
/**
* Returns the number (integer) of DNS domain levels (number of dots) in the
* hostname.
*
* Examples:
*
* ``` js
* dnsDomainLevels("www")
* // returns 0.
* dnsDomainLevels("www.netscape.com")
* // returns 2.
* ```
*
* @param {String} host is the hostname from the URL.
* @return {Number} number of domain levels
*/
export default function dnsDomainLevels(host: string): number;
//# sourceMappingURL=dnsDomainLevels.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dnsDomainLevels.d.ts","sourceRoot":"","sources":["../src/dnsDomainLevels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5D"}

View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Returns the number (integer) of DNS domain levels (number of dots) in the
* hostname.
*
* Examples:
*
* ``` js
* dnsDomainLevels("www")
* // returns 0.
* dnsDomainLevels("www.netscape.com")
* // returns 2.
* ```
*
* @param {String} host is the hostname from the URL.
* @return {Number} number of domain levels
*/
function dnsDomainLevels(host) {
const match = String(host).match(/\./g);
let levels = 0;
if (match) {
levels = match.length;
}
return levels;
}
exports.default = dnsDomainLevels;
//# sourceMappingURL=dnsDomainLevels.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dnsDomainLevels.js","sourceRoot":"","sources":["../src/dnsDomainLevels.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;GAeG;AACH,SAAwB,eAAe,CAAC,IAAY;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,KAAK,EAAE;QACV,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;KACtB;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAPD,kCAOC"}

16
backend/node_modules/pac-resolver/dist/dnsResolve.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* Resolves the given DNS hostname into an IP address, and returns it in the dot
* separated format as a string.
*
* Example:
*
* ``` js
* dnsResolve("home.netscape.com")
* // returns the string "198.95.249.79".
* ```
*
* @param {String} host hostname to resolve
* @return {String} resolved IP address
*/
export default function dnsResolve(host: string): Promise<string | null>;
//# sourceMappingURL=dnsResolve.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dnsResolve.d.ts","sourceRoot":"","sources":["../src/dnsResolve.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,wBAA8B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAW7E"}

32
backend/node_modules/pac-resolver/dist/dnsResolve.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("./util");
/**
* Resolves the given DNS hostname into an IP address, and returns it in the dot
* separated format as a string.
*
* Example:
*
* ``` js
* dnsResolve("home.netscape.com")
* // returns the string "198.95.249.79".
* ```
*
* @param {String} host hostname to resolve
* @return {String} resolved IP address
*/
async function dnsResolve(host) {
const family = 4;
try {
const r = await (0, util_1.dnsLookup)(host, { family });
if (typeof r === 'string') {
return r;
}
}
catch (err) {
// @ignore
}
return null;
}
exports.default = dnsResolve;
//# sourceMappingURL=dnsResolve.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"dnsResolve.js","sourceRoot":"","sources":["../src/dnsResolve.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;;;;;;;;;;;;;GAaG;AAEY,KAAK,UAAU,UAAU,CAAC,IAAY;IACpD,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,IAAI;QACH,MAAM,CAAC,GAAG,MAAM,IAAA,gBAAS,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC1B,OAAO,CAAC,CAAC;SACT;KACD;IAAC,OAAO,GAAG,EAAE;QACb,UAAU;KACV;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAXD,6BAWC"}

50
backend/node_modules/pac-resolver/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
/// <reference types="node" />
/// <reference types="node" />
import { CompileOptions } from 'degenerator';
/**
* Built-in PAC functions.
*/
import dateRange from './dateRange';
import dnsDomainIs from './dnsDomainIs';
import dnsDomainLevels from './dnsDomainLevels';
import dnsResolve from './dnsResolve';
import isInNet from './isInNet';
import isPlainHostName from './isPlainHostName';
import isResolvable from './isResolvable';
import localHostOrDomainIs from './localHostOrDomainIs';
import myIpAddress from './myIpAddress';
import shExpMatch from './shExpMatch';
import timeRange from './timeRange';
import weekdayRange from './weekdayRange';
import type { QuickJSWASMModule } from '@tootallnate/quickjs-emscripten';
/**
* Returns an asynchronous `FindProxyForURL()` function
* from the given JS string (from a PAC file).
*/
export declare function createPacResolver(qjs: QuickJSWASMModule, _str: string | Buffer, _opts?: PacResolverOptions): (url: string | URL, _host?: string) => Promise<string>;
export type GMT = 'GMT';
export type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
export type Day = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
export type Weekday = 'SUN' | 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT';
export type Month = 'JAN' | 'FEB' | 'MAR' | 'APR' | 'MAY' | 'JUN' | 'JUL' | 'AUG' | 'SEP' | 'OCT' | 'NOV' | 'DEC';
export type PacResolverOptions = CompileOptions;
export interface FindProxyForURLCallback {
(err?: Error | null, result?: string): void;
}
export type FindProxyForURL = ReturnType<typeof createPacResolver>;
export declare const sandbox: Readonly<{
alert: (message?: string) => void;
dateRange: typeof dateRange;
dnsDomainIs: typeof dnsDomainIs;
dnsDomainLevels: typeof dnsDomainLevels;
dnsResolve: typeof dnsResolve;
isInNet: typeof isInNet;
isPlainHostName: typeof isPlainHostName;
isResolvable: typeof isResolvable;
localHostOrDomainIs: typeof localHostOrDomainIs;
myIpAddress: typeof myIpAddress;
shExpMatch: typeof shExpMatch;
timeRange: typeof timeRange;
weekdayRange: typeof weekdayRange;
}>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,cAAc,EAAW,MAAM,aAAa,CAAC;AAEtD;;GAEG;AACH,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,KAAK,GAAE,kBAAuB,SA+BxB,MAAM,GAAG,GAAG,UACT,MAAM,KACZ,QAAQ,MAAM,CAAC,CAiBlB;AAED,MAAM,MAAM,GA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;EAclB,CAAC"}

87
backend/node_modules/pac-resolver/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,87 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.sandbox = exports.createPacResolver = void 0;
const degenerator_1 = require("degenerator");
/**
* Built-in PAC functions.
*/
const dateRange_1 = __importDefault(require("./dateRange"));
const dnsDomainIs_1 = __importDefault(require("./dnsDomainIs"));
const dnsDomainLevels_1 = __importDefault(require("./dnsDomainLevels"));
const dnsResolve_1 = __importDefault(require("./dnsResolve"));
const isInNet_1 = __importDefault(require("./isInNet"));
const isPlainHostName_1 = __importDefault(require("./isPlainHostName"));
const isResolvable_1 = __importDefault(require("./isResolvable"));
const localHostOrDomainIs_1 = __importDefault(require("./localHostOrDomainIs"));
const myIpAddress_1 = __importDefault(require("./myIpAddress"));
const shExpMatch_1 = __importDefault(require("./shExpMatch"));
const timeRange_1 = __importDefault(require("./timeRange"));
const weekdayRange_1 = __importDefault(require("./weekdayRange"));
/**
* Returns an asynchronous `FindProxyForURL()` function
* from the given JS string (from a PAC file).
*/
function createPacResolver(qjs, _str, _opts = {}) {
const str = Buffer.isBuffer(_str) ? _str.toString('utf8') : _str;
// The sandbox to use for the `vm` context.
const context = {
...exports.sandbox,
..._opts.sandbox,
};
// Construct the array of async function names to add `await` calls to.
const names = Object.keys(context).filter((k) => isAsyncFunction(context[k]));
const opts = {
filename: 'proxy.pac',
names,
..._opts,
sandbox: context,
};
// Compile the JS `FindProxyForURL()` function into an async function.
const resolver = (0, degenerator_1.compile)(qjs, str, 'FindProxyForURL', opts);
function FindProxyForURL(url, _host) {
const urlObj = typeof url === 'string' ? new URL(url) : url;
const host = _host || urlObj.hostname;
if (!host) {
throw new TypeError('Could not determine `host`');
}
return resolver(urlObj.href, host);
}
Object.defineProperty(FindProxyForURL, 'toString', {
value: () => resolver.toString(),
enumerable: false,
});
return FindProxyForURL;
}
exports.createPacResolver = createPacResolver;
exports.sandbox = Object.freeze({
alert: (message = '') => console.log('%s', message),
dateRange: dateRange_1.default,
dnsDomainIs: dnsDomainIs_1.default,
dnsDomainLevels: dnsDomainLevels_1.default,
dnsResolve: dnsResolve_1.default,
isInNet: isInNet_1.default,
isPlainHostName: isPlainHostName_1.default,
isResolvable: isResolvable_1.default,
localHostOrDomainIs: localHostOrDomainIs_1.default,
myIpAddress: myIpAddress_1.default,
shExpMatch: shExpMatch_1.default,
timeRange: timeRange_1.default,
weekdayRange: weekdayRange_1.default,
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function isAsyncFunction(v) {
if (typeof v !== 'function')
return false;
// Native `AsyncFunction`
if (v.constructor.name === 'AsyncFunction')
return true;
// TypeScript compiled
if (String(v).indexOf('__awaiter(') !== -1)
return true;
// Legacy behavior - set `async` property on the function
return Boolean(v.async);
}
//# sourceMappingURL=index.js.map

1
backend/node_modules/pac-resolver/dist/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,6CAAsD;AAEtD;;GAEG;AACH,4DAAoC;AACpC,gEAAwC;AACxC,wEAAgD;AAChD,8DAAsC;AACtC,wDAAgC;AAChC,wEAAgD;AAChD,kEAA0C;AAC1C,gFAAwD;AACxD,gEAAwC;AACxC,8DAAsC;AACtC,4DAAoC;AACpC,kEAA0C;AAG1C;;;GAGG;AACH,SAAgB,iBAAiB,CAChC,GAAsB,EACtB,IAAqB,EACrB,QAA4B,EAAE;IAE9B,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEjE,2CAA2C;IAC3C,MAAM,OAAO,GAAY;QACxB,GAAG,eAAO;QACV,GAAG,KAAK,CAAC,OAAO;KAChB,CAAC;IA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f,yBAAe;IACf,UAAU,EAAV,oBAAU;IACV,OAAO,EAAP,iBAAO;IACP,eAAe,EAAf,yBAAe;IACf,YAAY,EAAZ,sBAAY;IACZ,mBAAmB,EAAnB,6BAAmB;IACnB,WAAW,EAAX,qBAAW;IACX,UAAU,EAAV,oBAAU;IACV,SAAS,EAAT,mBAAS;IACT,YAAY,EAAZ,sBAAY;CACZ,CAAC,CAAC;AAEH,8DAA8D;AAC9D,SAAS,eAAe,CAAC,CAAM;IAC9B,IAAI,OAAO,CAAC,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC1C,yBAAyB;IACzB,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,eAAe;QAAE,OAAO,IAAI,CAAC;IACxD,sBAAsB;IACtB,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,yDAAyD;IACzD,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC"}

8
backend/node_modules/pac-resolver/dist/ip.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
export declare const ip: {
address(): string;
isLoopback(addr: string): boolean;
loopback(family: IpFamily): string;
};
type IpFamily = 'ipv4' | 'ipv6';
export {};
//# sourceMappingURL=ip.d.ts.map

1
backend/node_modules/pac-resolver/dist/ip.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ip.d.ts","sourceRoot":"","sources":["../src/ip.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,EAAE;eACH,MAAM;qBAsBA,MAAM,GAAG,OAAO;qBAQhB,QAAQ,GAAG,MAAM;CAWlC,CAAC;AAYF,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA"}

50
backend/node_modules/pac-resolver/dist/ip.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ip = void 0;
const os_1 = __importDefault(require("os"));
exports.ip = {
address() {
const interfaces = os_1.default.networkInterfaces();
// Default to `ipv4`
const family = normalizeFamily();
const all = Object.values(interfaces).map((addrs = []) => {
const addresses = addrs.filter((details) => {
const detailsFamily = normalizeFamily(details.family);
if (detailsFamily !== family || exports.ip.isLoopback(details.address)) {
return false;
}
return true;
});
return addresses.length ? addresses[0].address : undefined;
}).filter(Boolean);
return !all.length ? exports.ip.loopback(family) : all[0];
},
isLoopback(addr) {
return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/
.test(addr)
|| /^fe80::1$/.test(addr)
|| /^::1$/.test(addr)
|| /^::$/.test(addr);
},
loopback(family) {
// Default to `ipv4`
family = normalizeFamily(family);
if (family !== 'ipv4' && family !== 'ipv6') {
throw new Error('family must be ipv4 or ipv6');
}
return family === 'ipv4' ? '127.0.0.1' : 'fe80::1';
}
};
function normalizeFamily(family) {
if (family === 4) {
return 'ipv4';
}
if (family === 6) {
return 'ipv6';
}
return family ? family.toLowerCase() : 'ipv4';
}
//# sourceMappingURL=ip.js.map

1
backend/node_modules/pac-resolver/dist/ip.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ip.js","sourceRoot":"","sources":["../src/ip.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAEP,QAAA,EAAE,GAAG;IACjB,OAAO;QACN,MAAM,UAAU,GAAG,YAAE,CAAC,iBAAiB,EAAE,CAAC;QAE1C,oBAAoB;QACpB,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;QAEjC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAA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jB,OAAO,MAAM,CAAC;KACd;IACD,OAAO,MAAM,CAAC,CAAC,CAAE,MAAiB,CAAC,WAAW,EAAc,CAAC,CAAC,CAAC,MAAM,CAAC;AACvE,CAAC"}

24
backend/node_modules/pac-resolver/dist/isInNet.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/**
* True iff the IP address of the host matches the specified IP address pattern.
*
* Pattern and mask specification is done the same way as for SOCKS configuration.
*
* Examples:
*
* ``` js
* isInNet(host, "198.95.249.79", "255.255.255.255")
* // is true iff the IP address of host matches exactly 198.95.249.79.
*
* isInNet(host, "198.95.0.0", "255.255.0.0")
* // is true iff the IP address of the host matches 198.95.*.*.
* ```
*
* @param {String} host a DNS hostname, or IP address. If a hostname is passed,
* it will be resoved into an IP address by this function.
* @param {String} pattern an IP address pattern in the dot-separated format mask.
* @param {String} mask for the IP address pattern informing which parts of the
* IP address should be matched against. 0 means ignore, 255 means match.
* @return {Boolean}
*/
export default function isInNet(host: string, pattern: string, mask: string): Promise<boolean>;
//# sourceMappingURL=isInNet.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isInNet.d.ts","sourceRoot":"","sources":["../src/isInNet.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAA8B,OAAO,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACV,OAAO,CAAC,OAAO,CAAC,CAYlB"}

42
backend/node_modules/pac-resolver/dist/isInNet.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const netmask_1 = require("netmask");
const util_1 = require("./util");
/**
* True iff the IP address of the host matches the specified IP address pattern.
*
* Pattern and mask specification is done the same way as for SOCKS configuration.
*
* Examples:
*
* ``` js
* isInNet(host, "198.95.249.79", "255.255.255.255")
* // is true iff the IP address of host matches exactly 198.95.249.79.
*
* isInNet(host, "198.95.0.0", "255.255.0.0")
* // is true iff the IP address of the host matches 198.95.*.*.
* ```
*
* @param {String} host a DNS hostname, or IP address. If a hostname is passed,
* it will be resoved into an IP address by this function.
* @param {String} pattern an IP address pattern in the dot-separated format mask.
* @param {String} mask for the IP address pattern informing which parts of the
* IP address should be matched against. 0 means ignore, 255 means match.
* @return {Boolean}
*/
async function isInNet(host, pattern, mask) {
const family = 4;
try {
const ip = await (0, util_1.dnsLookup)(host, { family });
if (typeof ip === 'string') {
const netmask = new netmask_1.Netmask(pattern, mask);
return netmask.contains(ip);
}
}
catch (err) {
// ignore
}
return false;
}
exports.default = isInNet;
//# sourceMappingURL=isInNet.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isInNet.js","sourceRoot":"","sources":["../src/isInNet.ts"],"names":[],"mappings":";;AAAA,qCAAkC;AAClC,iCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEY,KAAK,UAAU,OAAO,CACpC,IAAY,EACZ,OAAe,EACf,IAAY;IAEZ,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,IAAI;QACH,MAAM,EAAE,GAAG,MAAM,IAAA,gBAAS,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7C,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;YAC3B,MAAM,OAAO,GAAG,IAAI,iBAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC3C,OAAO,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;SAC5B;KACD;IAAC,OAAO,GAAG,EAAE;QACb,SAAS;KACT;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAhBD,0BAgBC"}

View File

@@ -0,0 +1,18 @@
/**
* True iff there is no domain name in the hostname (no dots).
*
* Examples:
*
* ``` js
* isPlainHostName("www")
* // is true.
*
* isPlainHostName("www.netscape.com")
* // is false.
* ```
*
* @param {String} host The hostname from the URL (excluding port number).
* @return {Boolean}
*/
export default function isPlainHostName(host: string): boolean;
//# sourceMappingURL=isPlainHostName.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isPlainHostName.d.ts","sourceRoot":"","sources":["../src/isPlainHostName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D"}

View File

@@ -0,0 +1,23 @@
"use strict";
/**
* True iff there is no domain name in the hostname (no dots).
*
* Examples:
*
* ``` js
* isPlainHostName("www")
* // is true.
*
* isPlainHostName("www.netscape.com")
* // is false.
* ```
*
* @param {String} host The hostname from the URL (excluding port number).
* @return {Boolean}
*/
Object.defineProperty(exports, "__esModule", { value: true });
function isPlainHostName(host) {
return !/\./.test(host);
}
exports.default = isPlainHostName;
//# sourceMappingURL=isPlainHostName.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isPlainHostName.js","sourceRoot":"","sources":["../src/isPlainHostName.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,SAAwB,eAAe,CAAC,IAAY;IACnD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAFD,kCAEC"}

View File

@@ -0,0 +1,8 @@
/**
* Tries to resolve the hostname. Returns true if succeeds.
*
* @param {String} host is the hostname from the URL.
* @return {Boolean}
*/
export default function isResolvable(host: string): Promise<boolean>;
//# sourceMappingURL=isResolvable.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isResolvable.d.ts","sourceRoot":"","sources":["../src/isResolvable.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,wBAA8B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUzE"}

23
backend/node_modules/pac-resolver/dist/isResolvable.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("./util");
/**
* Tries to resolve the hostname. Returns true if succeeds.
*
* @param {String} host is the hostname from the URL.
* @return {Boolean}
*/
async function isResolvable(host) {
const family = 4;
try {
if (await (0, util_1.dnsLookup)(host, { family })) {
return true;
}
}
catch (err) {
// ignore
}
return false;
}
exports.default = isResolvable;
//# sourceMappingURL=isResolvable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isResolvable.js","sourceRoot":"","sources":["../src/isResolvable.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;;;;;GAKG;AAEY,KAAK,UAAU,YAAY,CAAC,IAAY;IACtD,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,IAAI;QACH,IAAI,MAAM,IAAA,gBAAS,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC;SACZ;KACD;IAAC,OAAO,GAAG,EAAE;QACb,SAAS;KACT;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAVD,+BAUC"}

View File

@@ -0,0 +1,26 @@
/**
* Is true if the hostname matches exactly the specified hostname, or if there is
* no domain name part in the hostname, but the unqualified hostname matches.
*
* Examples:
*
* ``` js
* localHostOrDomainIs("www.netscape.com", "www.netscape.com")
* // is true (exact match).
*
* localHostOrDomainIs("www", "www.netscape.com")
* // is true (hostname match, domain not specified).
*
* localHostOrDomainIs("www.mcom.com", "www.netscape.com")
* // is false (domain name mismatch).
*
* localHostOrDomainIs("home.netscape.com", "www.netscape.com")
* // is false (hostname mismatch).
* ```
*
* @param {String} host the hostname from the URL.
* @param {String} hostdom fully qualified hostname to match against.
* @return {Boolean}
*/
export default function localHostOrDomainIs(host: string, hostdom: string): boolean;
//# sourceMappingURL=localHostOrDomainIs.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"localHostOrDomainIs.d.ts","sourceRoot":"","sources":["../src/localHostOrDomainIs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACb,OAAO,CAaT"}

View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Is true if the hostname matches exactly the specified hostname, or if there is
* no domain name part in the hostname, but the unqualified hostname matches.
*
* Examples:
*
* ``` js
* localHostOrDomainIs("www.netscape.com", "www.netscape.com")
* // is true (exact match).
*
* localHostOrDomainIs("www", "www.netscape.com")
* // is true (hostname match, domain not specified).
*
* localHostOrDomainIs("www.mcom.com", "www.netscape.com")
* // is false (domain name mismatch).
*
* localHostOrDomainIs("home.netscape.com", "www.netscape.com")
* // is false (hostname mismatch).
* ```
*
* @param {String} host the hostname from the URL.
* @param {String} hostdom fully qualified hostname to match against.
* @return {Boolean}
*/
function localHostOrDomainIs(host, hostdom) {
const parts = host.split('.');
const domparts = hostdom.split('.');
let matches = true;
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== domparts[i]) {
matches = false;
break;
}
}
return matches;
}
exports.default = localHostOrDomainIs;
//# sourceMappingURL=localHostOrDomainIs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"localHostOrDomainIs.js","sourceRoot":"","sources":["../src/localHostOrDomainIs.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAwB,mBAAmB,CAC1C,IAAY,EACZ,OAAe;IAEf,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC7B,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM;SACN;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAhBD,sCAgBC"}

View File

@@ -0,0 +1,16 @@
/**
* Returns the IP address of the host that the Navigator is running on, as
* a string in the dot-separated integer format.
*
* Example:
*
* ``` js
* myIpAddress()
* // would return the string "198.95.249.79" if you were running the
* // Navigator on that host.
* ```
*
* @return {String} external IP address
*/
export default function myIpAddress(): Promise<string>;
//# sourceMappingURL=myIpAddress.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"myIpAddress.d.ts","sourceRoot":"","sources":["../src/myIpAddress.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,wBAA8B,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAwB3D"}

50
backend/node_modules/pac-resolver/dist/myIpAddress.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const ip_1 = require("./ip");
const net_1 = __importDefault(require("net"));
/**
* Returns the IP address of the host that the Navigator is running on, as
* a string in the dot-separated integer format.
*
* Example:
*
* ``` js
* myIpAddress()
* // would return the string "198.95.249.79" if you were running the
* // Navigator on that host.
* ```
*
* @return {String} external IP address
*/
async function myIpAddress() {
return new Promise((resolve, reject) => {
// 8.8.8.8:53 is "Google Public DNS":
// https://developers.google.com/speed/public-dns/
const socket = net_1.default.connect({ host: '8.8.8.8', port: 53 });
const onError = () => {
// if we fail to access Google DNS (as in firewall blocks access),
// fallback to querying IP locally
resolve(ip_1.ip.address());
};
socket.once('error', onError);
socket.once('connect', () => {
socket.removeListener('error', onError);
const addr = socket.address();
socket.destroy();
if (typeof addr === 'string') {
resolve(addr);
}
else if (addr.address) {
resolve(addr.address);
}
else {
reject(new Error('Expected a `string`'));
}
});
});
}
exports.default = myIpAddress;
//# sourceMappingURL=myIpAddress.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"myIpAddress.js","sourceRoot":"","sources":["../src/myIpAddress.ts"],"names":[],"mappings":";;;;;AAAA,6BAA0B;AAC1B,8CAAuC;AAEvC;;;;;;;;;;;;;GAaG;AACY,KAAK,UAAU,WAAW;IACxC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,qCAAqC;QACrC,kDAAkD;QAClD,MAAM,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,kEAAkE;YAClE,kCAAkC;YAClC,OAAO,CAAC,OAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QACvB,CAAC,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;YAC3B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC7B,OAAO,CAAC,IAAI,CAAC,CAAC;aACd;iBAAM,IAAK,IAAoB,CAAC,OAAO,EAAE;gBACzC,OAAO,CAAE,IAAoB,CAAC,OAAO,CAAC,CAAC;aACvC;iBAAM;gBACN,MAAM,CAAC,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;aACzC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAxBD,8BAwBC"}

23
backend/node_modules/pac-resolver/dist/shExpMatch.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
/**
* Returns true if the string matches the specified shell
* expression.
*
* Actually, currently the patterns are shell expressions,
* not regular expressions.
*
* Examples:
*
* ``` js
* shExpMatch("http://home.netscape.com/people/ari/index.html", "*\/ari/*")
* // is true.
*
* shExpMatch("http://home.netscape.com/people/montulli/index.html", "*\/ari/*")
* // is false.
* ```
*
* @param {String} str is any string to compare (e.g. the URL, or the hostname).
* @param {String} shexp is a shell expression to compare against.
* @return {Boolean} true if the string matches the shell expression.
*/
export default function shExpMatch(str: string, shexp: string): boolean;
//# sourceMappingURL=shExpMatch.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"shExpMatch.d.ts","sourceRoot":"","sources":["../src/shExpMatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAGtE"}

41
backend/node_modules/pac-resolver/dist/shExpMatch.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"use strict";
/**
* Returns true if the string matches the specified shell
* expression.
*
* Actually, currently the patterns are shell expressions,
* not regular expressions.
*
* Examples:
*
* ``` js
* shExpMatch("http://home.netscape.com/people/ari/index.html", "*\/ari/*")
* // is true.
*
* shExpMatch("http://home.netscape.com/people/montulli/index.html", "*\/ari/*")
* // is false.
* ```
*
* @param {String} str is any string to compare (e.g. the URL, or the hostname).
* @param {String} shexp is a shell expression to compare against.
* @return {Boolean} true if the string matches the shell expression.
*/
Object.defineProperty(exports, "__esModule", { value: true });
function shExpMatch(str, shexp) {
const re = toRegExp(shexp);
return re.test(str);
}
exports.default = shExpMatch;
/**
* Converts a "shell expression" to a JavaScript RegExp.
*
* @api private
*/
function toRegExp(str) {
str = String(str)
.replace(/\./g, '\\.')
.replace(/\?/g, '.')
.replace(/\*/g, '.*');
return new RegExp(`^${str}$`);
}
//# sourceMappingURL=shExpMatch.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"shExpMatch.js","sourceRoot":"","sources":["../src/shExpMatch.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAEH,SAAwB,UAAU,CAAC,GAAW,EAAE,KAAa;IAC5D,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAHD,6BAGC;AAED;;;;GAIG;AAEH,SAAS,QAAQ,CAAC,GAAW;IAC5B,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;SACf,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvB,OAAO,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AAC/B,CAAC"}

43
backend/node_modules/pac-resolver/dist/timeRange.d.ts generated vendored Normal file
View File

@@ -0,0 +1,43 @@
/**
* True during (or between) the specified time(s).
*
* Even though the examples don't show it, this parameter may be present in
* each of the different parameter profiles, always as the last parameter.
*
*
* Examples:
*
* ``` js
* timerange(12)
* true from noon to 1pm.
*
* timerange(12, 13)
* same as above.
*
* timerange(12, "GMT")
* true from noon to 1pm, in GMT timezone.
*
* timerange(9, 17)
* true from 9am to 5pm.
*
* timerange(8, 30, 17, 00)
* true from 8:30am to 5:00pm.
*
* timerange(0, 0, 0, 0, 0, 30)
* true between midnight and 30 seconds past midnight.
* ```
*
* timeRange(hour)
* timeRange(hour1, hour2)
* timeRange(hour1, min1, hour2, min2)
* timeRange(hour1, min1, sec1, hour2, min2, sec2)
* timeRange(hour1, min1, sec1, hour2, min2, sec2, gmt)
*
* @param {String} hour is the hour from 0 to 23. (0 is midnight, 23 is 11 pm.)
* @param {String} min minutes from 0 to 59.
* @param {String} sec seconds from 0 to 59.
* @param {String} gmt either the string "GMT" for GMT timezone, or not specified, for local timezone.
* @return {Boolean}
*/
export default function timeRange(): boolean;
//# sourceMappingURL=timeRange.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeRange.d.ts","sourceRoot":"","sources":["../src/timeRange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,MAAM,CAAC,OAAO,UAAU,SAAS,IAAI,OAAO,CAkD3C"}

92
backend/node_modules/pac-resolver/dist/timeRange.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
"use strict";
/**
* True during (or between) the specified time(s).
*
* Even though the examples don't show it, this parameter may be present in
* each of the different parameter profiles, always as the last parameter.
*
*
* Examples:
*
* ``` js
* timerange(12)
* true from noon to 1pm.
*
* timerange(12, 13)
* same as above.
*
* timerange(12, "GMT")
* true from noon to 1pm, in GMT timezone.
*
* timerange(9, 17)
* true from 9am to 5pm.
*
* timerange(8, 30, 17, 00)
* true from 8:30am to 5:00pm.
*
* timerange(0, 0, 0, 0, 0, 30)
* true between midnight and 30 seconds past midnight.
* ```
*
* timeRange(hour)
* timeRange(hour1, hour2)
* timeRange(hour1, min1, hour2, min2)
* timeRange(hour1, min1, sec1, hour2, min2, sec2)
* timeRange(hour1, min1, sec1, hour2, min2, sec2, gmt)
*
* @param {String} hour is the hour from 0 to 23. (0 is midnight, 23 is 11 pm.)
* @param {String} min minutes from 0 to 59.
* @param {String} sec seconds from 0 to 59.
* @param {String} gmt either the string "GMT" for GMT timezone, or not specified, for local timezone.
* @return {Boolean}
*/
Object.defineProperty(exports, "__esModule", { value: true });
function timeRange() {
// eslint-disable-next-line prefer-rest-params
const args = Array.prototype.slice.call(arguments);
const lastArg = args.pop();
const useGMTzone = lastArg === 'GMT';
const currentDate = new Date();
if (!useGMTzone) {
args.push(lastArg);
}
let result = false;
const noOfArgs = args.length;
const numericArgs = args.map((n) => parseInt(n, 10));
// timeRange(hour)
if (noOfArgs === 1) {
result = getCurrentHour(useGMTzone, currentDate) === numericArgs[0];
// timeRange(hour1, hour2)
}
else if (noOfArgs === 2) {
const currentHour = getCurrentHour(useGMTzone, currentDate);
result = numericArgs[0] <= currentHour && currentHour < numericArgs[1];
// timeRange(hour1, min1, hour2, min2)
}
else if (noOfArgs === 4) {
result = valueInRange(secondsElapsedToday(numericArgs[0], numericArgs[1], 0), secondsElapsedToday(getCurrentHour(useGMTzone, currentDate), getCurrentMinute(useGMTzone, currentDate), 0), secondsElapsedToday(numericArgs[2], numericArgs[3], 59));
// timeRange(hour1, min1, sec1, hour2, min2, sec2)
}
else if (noOfArgs === 6) {
result = valueInRange(secondsElapsedToday(numericArgs[0], numericArgs[1], numericArgs[2]), secondsElapsedToday(getCurrentHour(useGMTzone, currentDate), getCurrentMinute(useGMTzone, currentDate), getCurrentSecond(useGMTzone, currentDate)), secondsElapsedToday(numericArgs[3], numericArgs[4], numericArgs[5]));
}
return result;
}
exports.default = timeRange;
function secondsElapsedToday(hh, mm, ss) {
return hh * 3600 + mm * 60 + ss;
}
function getCurrentHour(gmt, currentDate) {
return gmt ? currentDate.getUTCHours() : currentDate.getHours();
}
function getCurrentMinute(gmt, currentDate) {
return gmt ? currentDate.getUTCMinutes() : currentDate.getMinutes();
}
function getCurrentSecond(gmt, currentDate) {
return gmt ? currentDate.getUTCSeconds() : currentDate.getSeconds();
}
// start <= value <= finish
function valueInRange(start, value, finish) {
return start <= value && value <= finish;
}
//# sourceMappingURL=timeRange.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeRange.js","sourceRoot":"","sources":["../src/timeRange.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;;AAEH,SAAwB,SAAS;IAChC,8CAA8C;IAC9C,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,UAAU,GAAG,OAAO,KAAK,KAAK,CAAC;IACrC,MAAM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1,6 @@
/// <reference types="node" />
import { LookupAddress, LookupOptions } from 'dns';
import { GMT } from './index';
export declare function dnsLookup(host: string, opts: LookupOptions): Promise<string | LookupAddress[]>;
export declare function isGMT(v?: string): v is GMT;
//# sourceMappingURL=util.d.ts.map

1
backend/node_modules/pac-resolver/dist/util.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAU,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9B,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC,CAUnC;AAED,wBAAgB,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,GAAG,CAE1C"}

22
backend/node_modules/pac-resolver/dist/util.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isGMT = exports.dnsLookup = void 0;
const dns_1 = require("dns");
function dnsLookup(host, opts) {
return new Promise((resolve, reject) => {
(0, dns_1.lookup)(host, opts, (err, res) => {
if (err) {
reject(err);
}
else {
resolve(res);
}
});
});
}
exports.dnsLookup = dnsLookup;
function isGMT(v) {
return v === 'GMT';
}
exports.isGMT = isGMT;
//# sourceMappingURL=util.js.map

1
backend/node_modules/pac-resolver/dist/util.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAAA,6BAA2D;AAG3D,SAAgB,SAAS,CACxB,IAAY,EACZ,IAAmB;IAEnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,IAAA,YAAM,EAAC,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC/B,IAAI,GAAG,EAAE;gBACR,MAAM,CAAC,GAAG,CAAC,CAAC;aACZ;iBAAM;gBACN,OAAO,CAAC,GAAG,CAAC,CAAC;aACb;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAbD,8BAaC;AAED,SAAgB,KAAK,CAAC,CAAU;IAC/B,OAAO,CAAC,KAAK,KAAK,CAAC;AACpB,CAAC;AAFD,sBAEC"}

View File

@@ -0,0 +1,45 @@
import { GMT, Weekday } from './index';
/**
* Only the first parameter is mandatory. Either the second, the third, or both
* may be left out.
*
* If only one parameter is present, the function yeilds a true value on the
* weekday that the parameter represents. If the string "GMT" is specified as
* a second parameter, times are taken to be in GMT, otherwise in local timezone.
*
* If both wd1 and wd1 are defined, the condition is true if the current weekday
* is in between those two weekdays. Bounds are inclusive. If the "GMT" parameter
* is specified, times are taken to be in GMT, otherwise the local timezone is
* used.
*
* Valid "weekday strings" are:
*
* SUN MON TUE WED THU FRI SAT
*
* Examples:
*
* ``` js
* weekdayRange("MON", "FRI")
* true Monday trhough Friday (local timezone).
*
* weekdayRange("MON", "FRI", "GMT")
* same as above, but GMT timezone.
*
* weekdayRange("SAT")
* true on Saturdays local time.
*
* weekdayRange("SAT", "GMT")
* true on Saturdays GMT time.
*
* weekdayRange("FRI", "MON")
* true Friday through Monday (note, order does matter!).
* ```
*
*
* @param {String} wd1 one of the weekday strings.
* @param {String} wd2 one of the weekday strings.
* @param {String} gmt is either the string: GMT or is left out.
* @return {Boolean}
*/
export default function weekdayRange(wd1: Weekday, wd2?: Weekday | GMT, gmt?: GMT): boolean;
//# sourceMappingURL=weekdayRange.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"weekdayRange.d.ts","sourceRoot":"","sources":["../src/weekdayRange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,CAAC,OAAO,UAAU,YAAY,CACnC,GAAG,EAAE,OAAO,EACZ,GAAG,CAAC,EAAE,OAAO,GAAG,GAAG,EACnB,GAAG,CAAC,EAAE,GAAG,GACP,OAAO,CAiCT"}

91
backend/node_modules/pac-resolver/dist/weekdayRange.js generated vendored Normal file
View File

@@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("./util");
const weekdays = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
/**
* Only the first parameter is mandatory. Either the second, the third, or both
* may be left out.
*
* If only one parameter is present, the function yeilds a true value on the
* weekday that the parameter represents. If the string "GMT" is specified as
* a second parameter, times are taken to be in GMT, otherwise in local timezone.
*
* If both wd1 and wd1 are defined, the condition is true if the current weekday
* is in between those two weekdays. Bounds are inclusive. If the "GMT" parameter
* is specified, times are taken to be in GMT, otherwise the local timezone is
* used.
*
* Valid "weekday strings" are:
*
* SUN MON TUE WED THU FRI SAT
*
* Examples:
*
* ``` js
* weekdayRange("MON", "FRI")
* true Monday trhough Friday (local timezone).
*
* weekdayRange("MON", "FRI", "GMT")
* same as above, but GMT timezone.
*
* weekdayRange("SAT")
* true on Saturdays local time.
*
* weekdayRange("SAT", "GMT")
* true on Saturdays GMT time.
*
* weekdayRange("FRI", "MON")
* true Friday through Monday (note, order does matter!).
* ```
*
*
* @param {String} wd1 one of the weekday strings.
* @param {String} wd2 one of the weekday strings.
* @param {String} gmt is either the string: GMT or is left out.
* @return {Boolean}
*/
function weekdayRange(wd1, wd2, gmt) {
let useGMTzone = false;
let wd1Index = -1;
let wd2Index = -1;
let wd2IsGmt = false;
if ((0, util_1.isGMT)(gmt)) {
useGMTzone = true;
}
else if ((0, util_1.isGMT)(wd2)) {
useGMTzone = true;
wd2IsGmt = true;
}
wd1Index = weekdays.indexOf(wd1);
if (!wd2IsGmt && isWeekday(wd2)) {
wd2Index = weekdays.indexOf(wd2);
}
const todaysDay = getTodaysDay(useGMTzone);
let result;
if (wd2Index < 0) {
result = todaysDay === wd1Index;
}
else if (wd1Index <= wd2Index) {
result = valueInRange(wd1Index, todaysDay, wd2Index);
}
else {
result =
valueInRange(wd1Index, todaysDay, 6) ||
valueInRange(0, todaysDay, wd2Index);
}
return result;
}
exports.default = weekdayRange;
function getTodaysDay(gmt) {
return gmt ? new Date().getUTCDay() : new Date().getDay();
}
// start <= value <= finish
function valueInRange(start, value, finish) {
return start <= value && value <= finish;
}
function isWeekday(v) {
if (!v)
return false;
return weekdays.includes(v);
}
//# sourceMappingURL=weekdayRange.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"weekdayRange.js","sourceRoot":"","sources":["../src/weekdayRange.ts"],"names":[],"mappings":";;AAAA,iCAA+B;AAG/B,MAAM,QAAQ,GAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,SAAwB,YAAY,CACnC,GAAY,EACZ,GAAmB,EACnB,GAAS;IAET,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,IAAI,IAAA,YAAK,EAAC,GAAG,CAAC,EAAE;QACf,UAAU,GAAG,IAAI,CAAC;KAClB;SAAM,IAAI,IAAA,YAAK,EAAC,GAAG,CAAC,EAAE;QACtB,UAAU,GAAG,IAAI,CAAC;QAClB,QAAQ,GAAG,IAAI,CAAC;KAChB;IAED,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEjC,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE;QAChC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KACjC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAI,MAAe,CAAC;IAEpB,IAAI,QAAQ,GAAG,CAAC,EAAE;QACjB,MAAM,GAAG,SAAS,KAAK,QAAQ,CAAC;KAChC;SAAM,IAAI,QAAQ,IAAI,QAAQ,EAAE;QAChC,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;KACrD;SAAM;QACN,MAAM;YACL,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;gBACpC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;KACtC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AArCD,+BAqCC;AAED,SAAS,YAAY,CAAC,GAAY;IACjC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;AAC3D,CAAC;AAED,2BAA2B;AAC3B,SAAS,YAAY,CAAC,KAAa,EAAE,KAAa,EAAE,MAAc;IACjE,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC;AAC1C,CAAC;AAED,SAAS,SAAS,CAAC,CAAU;IAC5B,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAQ,QAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC"}

47
backend/node_modules/pac-resolver/package.json generated vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "pac-resolver",
"version": "7.0.1",
"description": "Generates an asynchronous resolver function from a PAC file",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"degenerator": "^5.0.0",
"netmask": "^2.0.2"
},
"devDependencies": {
"@tootallnate/quickjs-emscripten": "^0.23.0",
"@types/jest": "^29.5.2",
"@types/netmask": "^1.0.30",
"@types/node": "^14.18.52",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"typescript": "^5.1.6",
"tsconfig": "0.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/TooTallNate/proxy-agents.git",
"directory": "packages/pac-resolver"
},
"engines": {
"node": ">= 14"
},
"keywords": [
"pac",
"file",
"proxy",
"resolve",
"dns"
],
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
"license": "MIT",
"scripts": {
"build": "tsc",
"test": "jest --env node --verbose --bail",
"lint": "eslint . --ext .ts",
"pack": "node ../../scripts/pack.mjs"
}
}