@promptbook/editable 0.85.0-8 → 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 +0 -4
- package/esm/index.es.js +5 -53
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/cli/cli-commands/about.d.ts +0 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +3 -3
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -2
- package/package.json +3 -3
- package/umd/index.umd.js +5 -53
- package/umd/index.umd.js.map +1 -1
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/editable`
|
|
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
|
@@ -17,7 +17,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-
|
|
20
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-16';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3353,57 +3353,6 @@ var sectionCommandParser = {
|
|
|
3353
3353
|
* ```
|
|
3354
3354
|
*/
|
|
3355
3355
|
|
|
3356
|
-
/**
|
|
3357
|
-
* Checks if an URL is reserved for private networks or localhost.
|
|
3358
|
-
*
|
|
3359
|
-
* Note: There are two simmilar functions:
|
|
3360
|
-
* - `isUrlOnPrivateNetwork` which tests full URL
|
|
3361
|
-
* - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
|
|
3362
|
-
*
|
|
3363
|
-
* @public exported from `@promptbook/utils`
|
|
3364
|
-
*/
|
|
3365
|
-
function isHostnameOnPrivateNetwork(hostname) {
|
|
3366
|
-
if (hostname === 'example.com' ||
|
|
3367
|
-
hostname === 'localhost' ||
|
|
3368
|
-
hostname.endsWith('.localhost') ||
|
|
3369
|
-
hostname.endsWith('.local') ||
|
|
3370
|
-
hostname.endsWith('.test') ||
|
|
3371
|
-
hostname === '127.0.0.1' ||
|
|
3372
|
-
hostname === '::1') {
|
|
3373
|
-
return true;
|
|
3374
|
-
}
|
|
3375
|
-
if (hostname.includes(':')) {
|
|
3376
|
-
// IPv6
|
|
3377
|
-
var ipParts = hostname.split(':');
|
|
3378
|
-
return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
|
|
3379
|
-
}
|
|
3380
|
-
else {
|
|
3381
|
-
// IPv4
|
|
3382
|
-
var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
|
|
3383
|
-
return (ipParts[0] === 10 ||
|
|
3384
|
-
(ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
|
|
3385
|
-
(ipParts[0] === 192 && ipParts[1] === 168));
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
|
-
/**
|
|
3390
|
-
* Checks if an IP address or hostname is reserved for private networks or localhost.
|
|
3391
|
-
*
|
|
3392
|
-
* Note: There are two simmilar functions:
|
|
3393
|
-
* - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
|
|
3394
|
-
* - `isHostnameOnPrivateNetwork` which tests just hostname
|
|
3395
|
-
*
|
|
3396
|
-
* @param {string} ipAddress - The IP address to check.
|
|
3397
|
-
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
3398
|
-
* @public exported from `@promptbook/utils`
|
|
3399
|
-
*/
|
|
3400
|
-
function isUrlOnPrivateNetwork(url) {
|
|
3401
|
-
if (typeof url === 'string') {
|
|
3402
|
-
url = new URL(url);
|
|
3403
|
-
}
|
|
3404
|
-
return isHostnameOnPrivateNetwork(url.hostname);
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
3356
|
/**
|
|
3408
3357
|
* Tests if given string is valid pipeline URL URL.
|
|
3409
3358
|
*
|
|
@@ -3417,16 +3366,19 @@ function isValidPipelineUrl(url) {
|
|
|
3417
3366
|
if (!isValidUrl(url)) {
|
|
3418
3367
|
return false;
|
|
3419
3368
|
}
|
|
3420
|
-
if (!url.startsWith('https://')) {
|
|
3369
|
+
if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
|
|
3421
3370
|
return false;
|
|
3422
3371
|
}
|
|
3423
3372
|
if (url.includes('#')) {
|
|
3424
3373
|
// TODO: [🐠]
|
|
3425
3374
|
return false;
|
|
3426
3375
|
}
|
|
3376
|
+
/*
|
|
3377
|
+
Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
|
|
3427
3378
|
if (isUrlOnPrivateNetwork(url)) {
|
|
3428
3379
|
return false;
|
|
3429
3380
|
}
|
|
3381
|
+
*/
|
|
3430
3382
|
return true;
|
|
3431
3383
|
}
|
|
3432
3384
|
/**
|