@promptbook/markitdown 0.85.0-9 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
<blockquote style="color: #ff8811">
|
|
28
|
-
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
29
|
-
</blockquote>
|
|
30
|
-
|
|
31
27
|
## 📦 Package `@promptbook/markitdown`
|
|
32
28
|
|
|
33
29
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
package/esm/index.es.js
CHANGED
|
@@ -26,7 +26,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
26
26
|
* @generated
|
|
27
27
|
* @see https://github.com/webgptorg/promptbook
|
|
28
28
|
*/
|
|
29
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-
|
|
29
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-16';
|
|
30
30
|
/**
|
|
31
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
32
32
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1638,57 +1638,6 @@ function isValidPromptbookVersion(version) {
|
|
|
1638
1638
|
return true;
|
|
1639
1639
|
}
|
|
1640
1640
|
|
|
1641
|
-
/**
|
|
1642
|
-
* Checks if an URL is reserved for private networks or localhost.
|
|
1643
|
-
*
|
|
1644
|
-
* Note: There are two simmilar functions:
|
|
1645
|
-
* - `isUrlOnPrivateNetwork` which tests full URL
|
|
1646
|
-
* - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
|
|
1647
|
-
*
|
|
1648
|
-
* @public exported from `@promptbook/utils`
|
|
1649
|
-
*/
|
|
1650
|
-
function isHostnameOnPrivateNetwork(hostname) {
|
|
1651
|
-
if (hostname === 'example.com' ||
|
|
1652
|
-
hostname === 'localhost' ||
|
|
1653
|
-
hostname.endsWith('.localhost') ||
|
|
1654
|
-
hostname.endsWith('.local') ||
|
|
1655
|
-
hostname.endsWith('.test') ||
|
|
1656
|
-
hostname === '127.0.0.1' ||
|
|
1657
|
-
hostname === '::1') {
|
|
1658
|
-
return true;
|
|
1659
|
-
}
|
|
1660
|
-
if (hostname.includes(':')) {
|
|
1661
|
-
// IPv6
|
|
1662
|
-
var ipParts = hostname.split(':');
|
|
1663
|
-
return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
|
|
1664
|
-
}
|
|
1665
|
-
else {
|
|
1666
|
-
// IPv4
|
|
1667
|
-
var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
|
|
1668
|
-
return (ipParts[0] === 10 ||
|
|
1669
|
-
(ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
|
|
1670
|
-
(ipParts[0] === 192 && ipParts[1] === 168));
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
/**
|
|
1675
|
-
* Checks if an IP address or hostname is reserved for private networks or localhost.
|
|
1676
|
-
*
|
|
1677
|
-
* Note: There are two simmilar functions:
|
|
1678
|
-
* - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
|
|
1679
|
-
* - `isHostnameOnPrivateNetwork` which tests just hostname
|
|
1680
|
-
*
|
|
1681
|
-
* @param {string} ipAddress - The IP address to check.
|
|
1682
|
-
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
1683
|
-
* @public exported from `@promptbook/utils`
|
|
1684
|
-
*/
|
|
1685
|
-
function isUrlOnPrivateNetwork(url) {
|
|
1686
|
-
if (typeof url === 'string') {
|
|
1687
|
-
url = new URL(url);
|
|
1688
|
-
}
|
|
1689
|
-
return isHostnameOnPrivateNetwork(url.hostname);
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
1641
|
/**
|
|
1693
1642
|
* Tests if given string is valid pipeline URL URL.
|
|
1694
1643
|
*
|
|
@@ -1702,16 +1651,19 @@ function isValidPipelineUrl(url) {
|
|
|
1702
1651
|
if (!isValidUrl(url)) {
|
|
1703
1652
|
return false;
|
|
1704
1653
|
}
|
|
1705
|
-
if (!url.startsWith('https://')) {
|
|
1654
|
+
if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
|
|
1706
1655
|
return false;
|
|
1707
1656
|
}
|
|
1708
1657
|
if (url.includes('#')) {
|
|
1709
1658
|
// TODO: [🐠]
|
|
1710
1659
|
return false;
|
|
1711
1660
|
}
|
|
1661
|
+
/*
|
|
1662
|
+
Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
|
|
1712
1663
|
if (isUrlOnPrivateNetwork(url)) {
|
|
1713
1664
|
return false;
|
|
1714
1665
|
}
|
|
1666
|
+
*/
|
|
1715
1667
|
return true;
|
|
1716
1668
|
}
|
|
1717
1669
|
/**
|