@liip/liipgpt 3.9.1 → 3.9.2

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.
Files changed (28) hide show
  1. package/chat/liipgpt-chat.iife.js +20 -20
  2. package/configurator/_app/env.js +1 -1
  3. package/configurator/_app/immutable/chunks/{Z70hfwyo.js → B7iNpEKB.js} +1 -1
  4. package/configurator/_app/immutable/chunks/B9Sj_kOF.js +2 -0
  5. package/configurator/_app/immutable/chunks/{DPni1rWl.js → Bo_I9OnC.js} +1 -1
  6. package/configurator/_app/immutable/chunks/C4jvtK34.js +1 -0
  7. package/configurator/_app/immutable/chunks/{DAn_q4l-.js → C5QUeOT4.js} +4 -4
  8. package/configurator/_app/immutable/chunks/{p7ChcveW.js → D1JxtiVt.js} +1 -1
  9. package/configurator/_app/immutable/chunks/{DfXcv-Ak.js → DY91rqbt.js} +3 -3
  10. package/configurator/_app/immutable/chunks/{BDbfujSm.js → Qr3QoTpa.js} +1 -1
  11. package/configurator/_app/immutable/chunks/{CKhT1xS_.js → ZVK8Dk3M.js} +1 -1
  12. package/configurator/_app/immutable/entry/{app.ft0cgG-t.js → app.CNOaE4a-.js} +2 -2
  13. package/configurator/_app/immutable/entry/start.Dt2jlaUG.js +1 -0
  14. package/configurator/_app/immutable/nodes/{0.CXGLTbqu.js → 0.5_GG2VVz.js} +1 -1
  15. package/configurator/_app/immutable/nodes/{1.DJw369ut.js → 1.CC4YG4vs.js} +1 -1
  16. package/configurator/_app/immutable/nodes/{2.Dx5eSBWM.js → 2.Bsn6JT-r.js} +3 -3
  17. package/configurator/_app/immutable/nodes/{3.CjC17y9u.js → 3.BGFB6L4G.js} +1 -1
  18. package/configurator/_app/version.json +1 -1
  19. package/configurator/index.html +6 -6
  20. package/configurator/sidebar.html +6 -6
  21. package/index.cjs +62 -0
  22. package/index.d.ts +34 -0
  23. package/index.js +62 -0
  24. package/package.json +1 -1
  25. package/search-summary/liipgpt-search-summary.iife.js +5 -5
  26. package/configurator/_app/immutable/chunks/BDHUTFW9.js +0 -2
  27. package/configurator/_app/immutable/chunks/C6m1Wdl1.js +0 -1
  28. package/configurator/_app/immutable/entry/start.BxzUuOt1.js +0 -1
package/index.js CHANGED
@@ -3617,6 +3617,66 @@ class ChatResultBuilder {
3617
3617
  return this.content.toPromise();
3618
3618
  }
3619
3619
  }
3620
+ // src/chat/utils/pii-checks.ts
3621
+ var PiiChecks = [
3622
+ {
3623
+ type: "email",
3624
+ check: (input) => {
3625
+ const pattern = /\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/;
3626
+ return pattern.test(input);
3627
+ }
3628
+ },
3629
+ {
3630
+ type: "creditCard",
3631
+ check: (input) => {
3632
+ const pattern = /\b(?:\d[ -]*?){13,16}\b/;
3633
+ return pattern.test(input);
3634
+ }
3635
+ },
3636
+ {
3637
+ type: "ahv",
3638
+ check: (input) => {
3639
+ const pattern = /\b756\.\d{4}\.\d{4}\.\d{2}\b/;
3640
+ return pattern.test(input);
3641
+ }
3642
+ },
3643
+ {
3644
+ type: "phoneSwiss",
3645
+ check: (input) => {
3646
+ const pattern = /\b0(?:\s*\d){2}(?:\s*\/\s*)?(?:\s*\d){7,}\b/;
3647
+ return pattern.test(input);
3648
+ }
3649
+ },
3650
+ {
3651
+ type: "phoneInternational",
3652
+ check: (input) => {
3653
+ const pattern = /(?:\+|00)(?:\s*\d){10,}\b/;
3654
+ return pattern.test(input);
3655
+ }
3656
+ },
3657
+ {
3658
+ type: "swissPassport",
3659
+ check: (input) => {
3660
+ const pattern = /\b[A-HJ-NP-Z](?=.*\d)[A-HJ-NP-Z0-9]{7}\b/;
3661
+ return pattern.test(input);
3662
+ }
3663
+ },
3664
+ {
3665
+ type: "longNumber",
3666
+ check: (input) => {
3667
+ const pattern = /\b\d{9,}\b/;
3668
+ return pattern.test(input);
3669
+ }
3670
+ }
3671
+ ];
3672
+ var checkForPii = (input) => {
3673
+ for (const check of PiiChecks) {
3674
+ if (check.check(input)) {
3675
+ return check.type;
3676
+ }
3677
+ }
3678
+ return;
3679
+ };
3620
3680
  // src/lib/client/conversation.ts
3621
3681
  class Conversation {
3622
3682
  clientPrimitive;
@@ -18969,6 +19029,7 @@ export {
18969
19029
  ChatResultBuilder,
18970
19030
  LiipGPTClient,
18971
19031
  MarkdownRenderer,
19032
+ PiiChecks,
18972
19033
  answerFormFieldSchema,
18973
19034
  answerFormSchema,
18974
19035
  chatConfigSchema,
@@ -18978,6 +19039,7 @@ export {
18978
19039
  chatMessageBotStreamingSchema,
18979
19040
  chatMessageSchema,
18980
19041
  chatMessageUserSchema,
19042
+ checkForPii,
18981
19043
  classificationConfigSchema,
18982
19044
  classificationResponseSchema,
18983
19045
  completeChatConfigSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liip/liipgpt",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "description": "LiipGPT Chat and Library",
5
5
  "type": "module",
6
6
  "exports": {