@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/editable",
3
- "version": "0.85.0-8",
3
+ "version": "0.85.0",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -42,12 +42,12 @@
42
42
  "bugs": {
43
43
  "url": "https://github.com/webgptorg/promptbook/issues"
44
44
  },
45
- "homepage": "https://www.npmjs.com/package/@promptbook/core",
45
+ "homepage": "https://ptbk.io/",
46
46
  "main": "./umd/index.umd.js",
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/editable.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.85.0-8"
50
+ "@promptbook/core": "0.85.0"
51
51
  },
52
52
  "dependencies": {
53
53
  "crypto-js": "4.2.0",
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- var PROMPTBOOK_ENGINE_VERSION = '0.85.0-7';
26
+ var PROMPTBOOK_ENGINE_VERSION = '0.85.0-16';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -3359,57 +3359,6 @@
3359
3359
  * ```
3360
3360
  */
3361
3361
 
3362
- /**
3363
- * Checks if an URL is reserved for private networks or localhost.
3364
- *
3365
- * Note: There are two simmilar functions:
3366
- * - `isUrlOnPrivateNetwork` which tests full URL
3367
- * - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
3368
- *
3369
- * @public exported from `@promptbook/utils`
3370
- */
3371
- function isHostnameOnPrivateNetwork(hostname) {
3372
- if (hostname === 'example.com' ||
3373
- hostname === 'localhost' ||
3374
- hostname.endsWith('.localhost') ||
3375
- hostname.endsWith('.local') ||
3376
- hostname.endsWith('.test') ||
3377
- hostname === '127.0.0.1' ||
3378
- hostname === '::1') {
3379
- return true;
3380
- }
3381
- if (hostname.includes(':')) {
3382
- // IPv6
3383
- var ipParts = hostname.split(':');
3384
- return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
3385
- }
3386
- else {
3387
- // IPv4
3388
- var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
3389
- return (ipParts[0] === 10 ||
3390
- (ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
3391
- (ipParts[0] === 192 && ipParts[1] === 168));
3392
- }
3393
- }
3394
-
3395
- /**
3396
- * Checks if an IP address or hostname is reserved for private networks or localhost.
3397
- *
3398
- * Note: There are two simmilar functions:
3399
- * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
3400
- * - `isHostnameOnPrivateNetwork` which tests just hostname
3401
- *
3402
- * @param {string} ipAddress - The IP address to check.
3403
- * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
3404
- * @public exported from `@promptbook/utils`
3405
- */
3406
- function isUrlOnPrivateNetwork(url) {
3407
- if (typeof url === 'string') {
3408
- url = new URL(url);
3409
- }
3410
- return isHostnameOnPrivateNetwork(url.hostname);
3411
- }
3412
-
3413
3362
  /**
3414
3363
  * Tests if given string is valid pipeline URL URL.
3415
3364
  *
@@ -3423,16 +3372,19 @@
3423
3372
  if (!isValidUrl(url)) {
3424
3373
  return false;
3425
3374
  }
3426
- if (!url.startsWith('https://')) {
3375
+ if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
3427
3376
  return false;
3428
3377
  }
3429
3378
  if (url.includes('#')) {
3430
3379
  // TODO: [🐠]
3431
3380
  return false;
3432
3381
  }
3382
+ /*
3383
+ Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
3433
3384
  if (isUrlOnPrivateNetwork(url)) {
3434
3385
  return false;
3435
3386
  }
3387
+ */
3436
3388
  return true;
3437
3389
  }
3438
3390
  /**