@promptbook/remote-client 0.84.0-10 → 0.84.0-12

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/esm/index.es.js CHANGED
@@ -19,7 +19,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
19
19
  * @generated
20
20
  * @see https://github.com/webgptorg/promptbook
21
21
  */
22
- var PROMPTBOOK_ENGINE_VERSION = '0.84.0-9';
22
+ var PROMPTBOOK_ENGINE_VERSION = '0.84.0-11';
23
23
  /**
24
24
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
25
25
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -4508,6 +4508,21 @@ var HIGH_LEVEL_ABSTRACTIONS = [
4508
4508
  * Note: [💞] Ignore a discrepancy between file name and entity name
4509
4509
  */
4510
4510
 
4511
+ /**
4512
+ * Checks if value is valid email
4513
+ *
4514
+ * @public exported from `@promptbook/utils`
4515
+ */
4516
+ function isValidEmail(email) {
4517
+ if (typeof email !== 'string') {
4518
+ return false;
4519
+ }
4520
+ if (email.split('\n').length > 1) {
4521
+ return false;
4522
+ }
4523
+ return /^.+@.+\..+$/.test(email);
4524
+ }
4525
+
4511
4526
  /**
4512
4527
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
4513
4528
  * It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
@@ -4521,6 +4536,15 @@ function validatePipelineString(pipelineString) {
4521
4536
  if (isValidJsonString(pipelineString)) {
4522
4537
  throw new ParseError('Expected a book, but got a JSON string');
4523
4538
  }
4539
+ else if (isValidUrl(pipelineString)) {
4540
+ throw new ParseError("Expected a book, but got just the URL \"".concat(pipelineString, "\""));
4541
+ }
4542
+ else if (isValidFilePath(pipelineString)) {
4543
+ throw new ParseError("Expected a book, but got just the file path \"".concat(pipelineString, "\""));
4544
+ }
4545
+ else if (isValidEmail(pipelineString)) {
4546
+ throw new ParseError("Expected a book, but got just the email \"".concat(pipelineString, "\""));
4547
+ }
4524
4548
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
4525
4549
  return pipelineString;
4526
4550
  }