@botonic/core 0.56.0-alpha.0 → 0.57.0-rslib-esm.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.
Files changed (131) hide show
  1. package/lib/esm/constants.js +7 -7
  2. package/lib/esm/constants.js.map +1 -1
  3. package/lib/esm/core-bot.d.ts +3 -3
  4. package/lib/esm/core-bot.js +87 -50
  5. package/lib/esm/core-bot.js.map +1 -1
  6. package/lib/esm/debug/index.d.ts +1 -1
  7. package/lib/esm/debug/index.js +5 -4
  8. package/lib/esm/debug/index.js.map +1 -1
  9. package/lib/esm/debug/inspector.d.ts +1 -1
  10. package/lib/esm/debug/inspector.js +27 -21
  11. package/lib/esm/debug/inspector.js.map +1 -1
  12. package/lib/esm/handoff.d.ts +1 -1
  13. package/lib/esm/handoff.js +82 -53
  14. package/lib/esm/handoff.js.map +1 -1
  15. package/lib/esm/hubtype-service.d.ts +3 -3
  16. package/lib/esm/hubtype-service.js +100 -64
  17. package/lib/esm/hubtype-service.js.map +1 -1
  18. package/lib/esm/index.d.ts +9 -9
  19. package/lib/esm/index.js +21 -12
  20. package/lib/esm/index.js.map +1 -1
  21. package/lib/esm/models/ai-agents.d.ts +1 -8
  22. package/lib/esm/models/ai-agents.js +15 -16
  23. package/lib/esm/models/ai-agents.js.map +1 -1
  24. package/lib/esm/models/bot-config.js +6 -6
  25. package/lib/esm/models/bot-config.js.map +1 -1
  26. package/lib/esm/models/hubtype-analytics.d.ts +1 -1
  27. package/lib/esm/models/hubtype-analytics.js +10 -10
  28. package/lib/esm/models/hubtype-analytics.js.map +1 -1
  29. package/lib/esm/models/index.d.ts +4 -4
  30. package/lib/esm/models/index.js +11 -7
  31. package/lib/esm/models/index.js.map +1 -1
  32. package/lib/esm/models/legacy-types.js +24 -24
  33. package/lib/esm/models/legacy-types.js.map +1 -1
  34. package/lib/esm/package.json +3 -0
  35. package/lib/esm/plugins.d.ts +1 -1
  36. package/lib/esm/plugins.js +7 -8
  37. package/lib/esm/plugins.js.map +1 -1
  38. package/lib/esm/pusher-utils.js +15 -10
  39. package/lib/esm/pusher-utils.js.map +1 -1
  40. package/lib/esm/routing/index.d.ts +2 -2
  41. package/lib/esm/routing/index.js +7 -5
  42. package/lib/esm/routing/index.js.map +1 -1
  43. package/lib/esm/routing/router-utils.d.ts +1 -1
  44. package/lib/esm/routing/router-utils.js +37 -30
  45. package/lib/esm/routing/router-utils.js.map +1 -1
  46. package/lib/esm/routing/router.d.ts +2 -2
  47. package/lib/esm/routing/router.js +152 -149
  48. package/lib/esm/routing/router.js.map +1 -1
  49. package/lib/esm/testing/index.d.ts +1 -1
  50. package/lib/esm/testing/index.js +60 -94
  51. package/lib/esm/testing/index.js.map +1 -1
  52. package/lib/esm/utils/bot-config.d.ts +1 -1
  53. package/lib/esm/utils/bot-config.js +57 -28
  54. package/lib/esm/utils/bot-config.js.map +1 -1
  55. package/lib/esm/utils/check-providers.d.ts +1 -1
  56. package/lib/esm/utils/check-providers.js +14 -17
  57. package/lib/esm/utils/check-providers.js.map +1 -1
  58. package/lib/esm/utils/functional.js +19 -38
  59. package/lib/esm/utils/functional.js.map +1 -1
  60. package/lib/esm/utils/index.d.ts +3 -3
  61. package/lib/esm/utils/index.js +9 -6
  62. package/lib/esm/utils/index.js.map +1 -1
  63. package/package.json +12 -11
  64. package/src/hubtype-service.ts +4 -2
  65. package/src/models/ai-agents.ts +0 -9
  66. package/lib/cjs/constants.d.ts +0 -4
  67. package/lib/cjs/constants.js +0 -8
  68. package/lib/cjs/constants.js.map +0 -1
  69. package/lib/cjs/core-bot.d.ts +0 -43
  70. package/lib/cjs/core-bot.js +0 -205
  71. package/lib/cjs/core-bot.js.map +0 -1
  72. package/lib/cjs/debug/index.d.ts +0 -1
  73. package/lib/cjs/debug/index.js +0 -5
  74. package/lib/cjs/debug/index.js.map +0 -1
  75. package/lib/cjs/debug/inspector.d.ts +0 -24
  76. package/lib/cjs/debug/inspector.js +0 -70
  77. package/lib/cjs/debug/inspector.js.map +0 -1
  78. package/lib/cjs/handoff.d.ts +0 -110
  79. package/lib/cjs/handoff.js +0 -238
  80. package/lib/cjs/handoff.js.map +0 -1
  81. package/lib/cjs/hubtype-service.d.ts +0 -58
  82. package/lib/cjs/hubtype-service.js +0 -205
  83. package/lib/cjs/hubtype-service.js.map +0 -1
  84. package/lib/cjs/index.d.ts +0 -9
  85. package/lib/cjs/index.js +0 -13
  86. package/lib/cjs/index.js.map +0 -1
  87. package/lib/cjs/models/ai-agents.d.ts +0 -147
  88. package/lib/cjs/models/ai-agents.js +0 -31
  89. package/lib/cjs/models/ai-agents.js.map +0 -1
  90. package/lib/cjs/models/bot-config.d.ts +0 -24
  91. package/lib/cjs/models/bot-config.js +0 -10
  92. package/lib/cjs/models/bot-config.js.map +0 -1
  93. package/lib/cjs/models/hubtype-analytics.d.ts +0 -210
  94. package/lib/cjs/models/hubtype-analytics.js +0 -38
  95. package/lib/cjs/models/hubtype-analytics.js.map +0 -1
  96. package/lib/cjs/models/index.d.ts +0 -4
  97. package/lib/cjs/models/index.js +0 -8
  98. package/lib/cjs/models/index.js.map +0 -1
  99. package/lib/cjs/models/legacy-types.d.ts +0 -332
  100. package/lib/cjs/models/legacy-types.js +0 -84
  101. package/lib/cjs/models/legacy-types.js.map +0 -1
  102. package/lib/cjs/plugins.d.ts +0 -9
  103. package/lib/cjs/plugins.js +0 -24
  104. package/lib/cjs/plugins.js.map +0 -1
  105. package/lib/cjs/pusher-utils.d.ts +0 -7
  106. package/lib/cjs/pusher-utils.js +0 -18
  107. package/lib/cjs/pusher-utils.js.map +0 -1
  108. package/lib/cjs/routing/index.d.ts +0 -2
  109. package/lib/cjs/routing/index.js +0 -6
  110. package/lib/cjs/routing/index.js.map +0 -1
  111. package/lib/cjs/routing/router-utils.d.ts +0 -11
  112. package/lib/cjs/routing/router-utils.js +0 -96
  113. package/lib/cjs/routing/router-utils.js.map +0 -1
  114. package/lib/cjs/routing/router.d.ts +0 -54
  115. package/lib/cjs/routing/router.js +0 -330
  116. package/lib/cjs/routing/router.js.map +0 -1
  117. package/lib/cjs/testing/index.d.ts +0 -91
  118. package/lib/cjs/testing/index.js +0 -196
  119. package/lib/cjs/testing/index.js.map +0 -1
  120. package/lib/cjs/utils/bot-config.d.ts +0 -4
  121. package/lib/cjs/utils/bot-config.js +0 -94
  122. package/lib/cjs/utils/bot-config.js.map +0 -1
  123. package/lib/cjs/utils/check-providers.d.ts +0 -8
  124. package/lib/cjs/utils/check-providers.js +0 -34
  125. package/lib/cjs/utils/check-providers.js.map +0 -1
  126. package/lib/cjs/utils/functional.d.ts +0 -10
  127. package/lib/cjs/utils/functional.js +0 -88
  128. package/lib/cjs/utils/functional.js.map +0 -1
  129. package/lib/cjs/utils/index.d.ts +0 -3
  130. package/lib/cjs/utils/index.js +0 -7
  131. package/lib/cjs/utils/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"check-providers.js","sourceRoot":"","sources":["../../../src/utils/check-providers.ts"],"names":[],"mappings":";;AAGA,sBAEC;AAED,8BAGC;AAED,gCAEC;AAED,gCAEC;AAED,gCAEC;AAED,kCAEC;AAED,8BAEC;AA9BD,yDAA+D;AAE/D,+BAA+B;AAC/B,SAAgB,KAAK,CAAC,OAAgB;IACpC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,GAAG,CAAA;AAC/C,CAAC;AAED,SAAgB,SAAS,CAAC,OAAgB;IACxC,0EAA0E;IAC1E,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,OAAO,CAAA;AACnD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,QAAQ,CAAA;AACpD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,QAAQ,CAAA;AACpD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,QAAQ,CAAA;AACpD,CAAC;AAED,SAAgB,WAAW,CAAC,OAAgB;IAC1C,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,SAAS,CAAA;AACrD,CAAC;AAED,SAAgB,SAAS,CAAC,OAAgB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,OAAO,CAAA;AACnD,CAAC"}
1
+ {"version":3,"file":"utils/check-providers.js","sources":["../../../src/utils/check-providers.ts"],"sourcesContent":["import { PROVIDER, type Session } from '../models/legacy-types'\n\n// To check Provider in session\nexport function isDev(session: Session) {\n return session.user.provider === PROVIDER.DEV\n}\n\nexport function isWebchat(session: Session) {\n // When the provider is DEV should we return true because it is a webchat?\n return session.user.provider === PROVIDER.WEBCHAT\n}\n\nexport function isWhatsapp(session: Session) {\n return session.user.provider === PROVIDER.WHATSAPP\n}\n\nexport function isTelegram(session: Session) {\n return session.user.provider === PROVIDER.TELEGRAM\n}\n\nexport function isFacebook(session: Session) {\n return session.user.provider === PROVIDER.FACEBOOK\n}\n\nexport function isInstagram(session: Session) {\n return session.user.provider === PROVIDER.INSTAGRAM\n}\n\nexport function isTwitter(session: Session) {\n return session.user.provider === PROVIDER.TWITTER\n}\n"],"names":["PROVIDER","isDev","session","isWebchat","isWhatsapp","isTelegram","isFacebook","isInstagram","isTwitter"],"mappings":";;;AAA+D;AAE/D,+BAA+B;AACxB,SAASC,KAAKA,CAACC,OAAgB;IACpC,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,YAAY;AAC/C;AAEO,SAASG,SAASA,CAACD,OAAgB;IACxC,0EAA0E;IAC1E,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,gBAAgB;AACnD;AAEO,SAASI,UAAUA,CAACF,OAAgB;IACzC,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,iBAAiB;AACpD;AAEO,SAASK,UAAUA,CAACH,OAAgB;IACzC,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,iBAAiB;AACpD;AAEO,SAASM,UAAUA,CAACJ,OAAgB;IACzC,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,iBAAiB;AACpD;AAEO,SAASO,WAAWA,CAACL,OAAgB;IAC1C,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,kBAAkB;AACrD;AAEO,SAASQ,SAASA,CAACN,OAAgB;IACxC,OAAOA,QAAQ,IAAI,CAAC,QAAQ,KAAKF,gBAAgB;AACnD"}
@@ -1,30 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dirname = exports.join = exports.params2queryString = exports.isMobile = exports.isBrowser = exports.isNode = void 0;
4
- exports.isFunction = isFunction;
5
- exports.cloneObject = cloneObject;
6
- const isNode = () => {
1
+ const isNode = ()=>{
7
2
  // @ts-expect-error
8
- return typeof IS_NODE !== 'undefined'
9
- ? // @ts-ignore
10
- IS_NODE
11
- : typeof process !== 'undefined' &&
12
- process.versions !== null &&
13
- process.versions.node !== null;
3
+ return typeof IS_NODE !== 'undefined' ? IS_NODE : typeof process !== 'undefined' && process.versions !== null && process.versions.node !== null;
14
4
  };
15
- exports.isNode = isNode;
16
- const isBrowser = () => {
5
+ const isBrowser = ()=>{
17
6
  // @ts-expect-error
18
- return typeof IS_BROWSER !== 'undefined'
19
- ? // @ts-ignore
20
- IS_BROWSER
21
- : typeof window !== 'undefined' &&
22
- typeof window.document !== 'undefined' &&
23
- !window.process?.versions?.node; // In Jest window.process?.versions?.node is defined
7
+ return typeof IS_BROWSER !== 'undefined' ? IS_BROWSER : typeof window !== 'undefined' && typeof window.document !== 'undefined' && !window.process?.versions?.node // In Jest window.process?.versions?.node is defined
8
+ ;
24
9
  };
25
- exports.isBrowser = isBrowser;
26
- const isMobile = (mobileBreakpoint = 460) => {
27
- if ((0, exports.isBrowser)()) {
10
+ const isMobile = (mobileBreakpoint = 460)=>{
11
+ if (isBrowser()) {
28
12
  const w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
29
13
  if (w < mobileBreakpoint) {
30
14
  return true;
@@ -32,7 +16,6 @@ const isMobile = (mobileBreakpoint = 460) => {
32
16
  }
33
17
  return false;
34
18
  };
35
- exports.isMobile = isMobile;
36
19
  function isFunction(o) {
37
20
  return typeof o === 'function';
38
21
  }
@@ -40,24 +23,23 @@ function cloneObject(object) {
40
23
  if (!object) {
41
24
  return {};
42
25
  }
43
- return { ...object };
26
+ return {
27
+ ...object
28
+ };
44
29
  }
45
- const params2queryString = (params) => Object.entries(params)
46
- .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
47
- .join('&');
48
- exports.params2queryString = params2queryString;
30
+ const params2queryString = (params)=>Object.entries(params).map(([k, v])=>`${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join('&');
49
31
  // Joins path segments. Preserves initial "/" and resolves ".." and "."
50
32
  // Does not support using ".." to go above/outside the root.
51
33
  // This means that join("foo", "../../bar") will not resolve to "../bar"
52
- const join = (...segments) => {
34
+ const join = (...segments)=>{
53
35
  // Split the inputs into a list of path commands.
54
36
  let parts = [];
55
- for (let i = 0, l = segments.length; i < l; i++) {
37
+ for(let i = 0, l = segments.length; i < l; i++){
56
38
  parts = parts.concat(segments[i].split('/'));
57
39
  }
58
40
  // Interpret the path commands to get the new resolved path.
59
41
  const newParts = [];
60
- for (let i = 0, l = parts.length; i < l; i++) {
42
+ for(let i = 0, l = parts.length; i < l; i++){
61
43
  const part = parts[i];
62
44
  // Remove leading and trailing slashes
63
45
  // Also remove "." segments
@@ -67,9 +49,7 @@ const join = (...segments) => {
67
49
  // Interpret ".." to pop the last segment
68
50
  if (part === '..') {
69
51
  newParts.pop();
70
- }
71
- // Push new path segments.
72
- else {
52
+ } else {
73
53
  newParts.push(part);
74
54
  }
75
55
  }
@@ -80,9 +60,10 @@ const join = (...segments) => {
80
60
  // Turn back into a single string path.
81
61
  return newParts.join('/') || (newParts.length ? '/' : '.');
82
62
  };
83
- exports.join = join;
84
63
  // A simple function to get the dirname of a path
85
64
  // Trailing slashes are ignored. Leading slash is preserved.
86
- const dirname = (path) => (0, exports.join)(path, '..');
87
- exports.dirname = dirname;
65
+ const dirname = (path)=>join(path, '..');
66
+
67
+ export { cloneObject, dirname, isBrowser, isFunction, isMobile, isNode, join, params2queryString };
68
+
88
69
  //# sourceMappingURL=functional.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"functional.js","sourceRoot":"","sources":["../../../src/utils/functional.ts"],"names":[],"mappings":";;;AAiCA,gCAEC;AAED,kCAKC;AA1CM,MAAM,MAAM,GAAG,GAAY,EAAE;IAClC,mBAAmB;IACnB,OAAO,OAAO,OAAO,KAAK,WAAW;QACnC,CAAC,CAAC,aAAa;YACb,OAAO;QACT,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW;YAC5B,OAAO,CAAC,QAAQ,KAAK,IAAI;YACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAA;AACtC,CAAC,CAAA;AARY,QAAA,MAAM,UAQlB;AAEM,MAAM,SAAS,GAAG,GAAY,EAAE;IACrC,mBAAmB;IACnB,OAAO,OAAO,UAAU,KAAK,WAAW;QACtC,CAAC,CAAC,aAAa;YACb,UAAU;QACZ,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW;YAC3B,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW;YACtC,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAA,CAAC,oDAAoD;AAC5F,CAAC,CAAA;AARY,QAAA,SAAS,aAQrB;AAEM,MAAM,QAAQ,GAAG,CAAC,gBAAgB,GAAG,GAAG,EAAW,EAAE;IAC1D,IAAI,IAAA,iBAAS,GAAE,EAAE,CAAC;QAChB,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG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AAE,CAAA;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,sCAAsC;QACtC,2BAA2B;QAC3B,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YAC1B,SAAQ;QACV,CAAC;QACD,yCAAyC;QACzC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,QAAQ,CAAC,GAAG,EAAE,CAAA;QAChB,CAAC;QACD,0BAA0B;aACrB,CAAC;YACJ,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IACD,+CAA+C;IAC/C,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QACpB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC;IACD,uCAAuC;IACvC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAC5D,CAAC,CAAA;AA9BY,QAAA,IAAI,QA8BhB;AAED,iDAAiD;AACjD,4DAA4D;AACrD,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAA,YAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAApD,QAAA,OAAO,WAA6C"}
1
+ {"version":3,"file":"utils/functional.js","sources":["../../../src/utils/functional.ts"],"sourcesContent":["export const isNode = (): boolean => {\n // @ts-expect-error\n return typeof IS_NODE !== 'undefined'\n ? // @ts-ignore\n IS_NODE\n : typeof process !== 'undefined' &&\n process.versions !== null &&\n process.versions.node !== null\n}\n\nexport const isBrowser = (): boolean => {\n // @ts-expect-error\n return typeof IS_BROWSER !== 'undefined'\n ? // @ts-ignore\n IS_BROWSER\n : typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n !window.process?.versions?.node // In Jest window.process?.versions?.node is defined\n}\n\nexport const isMobile = (mobileBreakpoint = 460): boolean => {\n if (isBrowser()) {\n const w = Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n )\n if (w < mobileBreakpoint) {\n return true\n }\n }\n return false\n}\n\nexport function isFunction(o: any): boolean {\n return typeof o === 'function'\n}\n\nexport function cloneObject(object: any): any {\n if (!object) {\n return {}\n }\n return { ...object }\n}\n\nexport const params2queryString = (params: { [key: string]: string }): string =>\n Object.entries(params)\n .map(([k, v]: any) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n .join('&')\n\n// Joins path segments. Preserves initial \"/\" and resolves \"..\" and \".\"\n// Does not support using \"..\" to go above/outside the root.\n// This means that join(\"foo\", \"../../bar\") will not resolve to \"../bar\"\nexport const join = (...segments: string[]): string => {\n // Split the inputs into a list of path commands.\n let parts: string[] = []\n for (let i = 0, l = segments.length; i < l; i++) {\n parts = parts.concat(segments[i].split('/'))\n }\n // Interpret the path commands to get the new resolved path.\n const newParts: string[] = []\n for (let i = 0, l = parts.length; i < l; i++) {\n const part = parts[i]\n // Remove leading and trailing slashes\n // Also remove \".\" segments\n if (!part || part === '.') {\n continue\n }\n // Interpret \"..\" to pop the last segment\n if (part === '..') {\n newParts.pop()\n }\n // Push new path segments.\n else {\n newParts.push(part)\n }\n }\n // Preserve the initial slash if there was one.\n if (parts[0] === '') {\n newParts.unshift('')\n }\n // Turn back into a single string path.\n return newParts.join('/') || (newParts.length ? '/' : '.')\n}\n\n// A simple function to get the dirname of a path\n// Trailing slashes are ignored. Leading slash is preserved.\nexport const dirname = (path: string): string => join(path, '..')\n"],"names":["isNode","IS_NODE","process","isBrowser","IS_BROWSER","window","isMobile","mobileBreakpoint","w","Math","document","isFunction","o","cloneObject","object","params2queryString","params","Object","k","v","encodeURI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,MAAM,CAACD,QAAQ,CAACE,EAAE,CAAC,KAAK,CAAC;IACzC;IACA,4DAA4D;IAC5D,MAAME,WAAqB,EAAE;IAC7B,IAAK,IAAIF,IAAI,GAAGC,IAAIF,MAAM,MAAM,EAAEC,IAAIC,GAAGD,IAAK;QAC5C,MAAMG,OAAOJ,KAAK,CAACC,EAAE;QACrB,sCAAsC;QACtC,2BAA2B;QAC3B,IAAI,CAACG,QAAQA,SAAS,KAAK;YACzB;QACF;QACA,yCAAyC;QACzC,IAAIA,SAAS,MAAM;YACjBD,SAAS,GAAG;QACd,OAEK;YACHA,SAAS,IAAI,CAACC;QAChB;IACF;IACA,+CAA+C;IAC/C,IAAIJ,KAAK,CAAC,EAAE,KAAK,IAAI;QACnBG,SAAS,OAAO,CAAC;IACnB;IACA,uCAAuC;IACvC,OAAOA,SAAS,IAAI,CAAC,QAASA,CAAAA,SAAS,MAAM,GAAG,MAAM,GAAE;AAC1D,EAAC;AAED,iDAAiD;AACjD,4DAA4D;AACrD,MAAME,OAAOA,GAAG,CAACC,OAAyBR,IAAIA,CAACQ,MAAM,MAAK"}
@@ -1,3 +1,3 @@
1
- export * from './bot-config';
2
- export * from './check-providers';
3
- export * from './functional';
1
+ export * from './bot-config.js';
2
+ export * from './check-providers.js';
3
+ export * from './functional.js';
@@ -1,7 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./bot-config"), exports);
5
- tslib_1.__exportStar(require("./check-providers"), exports);
6
- tslib_1.__exportStar(require("./functional"), exports);
1
+ export * from "./bot-config.js";
2
+ export * from "./check-providers.js";
3
+ export * from "./functional.js";
4
+
5
+
6
+
7
+
8
+ export {};
9
+
7
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,4DAAiC;AACjC,uDAA4B"}
1
+ {"version":3,"file":"utils/index.js","sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from './bot-config'\nexport * from './check-providers'\nexport * from './functional'\n"],"names":[],"mappings":";;;AAA4B;AACK;AACL"}
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "@botonic/core",
3
- "version": "0.56.0-alpha.0",
3
+ "version": "0.57.0-rslib-esm.0",
4
4
  "license": "MIT",
5
5
  "description": "Build Chatbots using React",
6
- "main": "./lib/cjs/index.js",
6
+ "main": "./lib/esm/index.js",
7
7
  "module": "./lib/esm/index.js",
8
8
  "exports": {
9
9
  ".": {
10
- "require": "./lib/cjs/index.js",
11
- "import": "./lib/esm/index.js"
10
+ "types": "./lib/esm/index.d.ts",
11
+ "default": "./lib/esm/index.js"
12
12
  },
13
13
  "./testing": {
14
- "require": "./lib/cjs/testing/index.js",
15
- "import": "./lib/esm/testing/index.js"
14
+ "types": "./lib/esm/testing/index.d.ts",
15
+ "default": "./lib/esm/testing/index.js"
16
16
  }
17
17
  },
18
18
  "scripts": {
19
19
  "test": "../../node_modules/.bin/jest --coverage",
20
- "prepublishOnly": "rm -rf lib && npm i && npm run build",
20
+ "prepublishOnly": "npm run build && npm run test && npm run lint",
21
21
  "lint": "biome check --write src/",
22
22
  "lint:check": "biome check src/",
23
23
  "format": "biome format --write src/",
24
- "build": "../../node_modules/.bin/tsc -p tsconfig.json && ../../node_modules/.bin/tsc -p tsconfig.esm.json",
25
- "build:watch": "npm run build -- --watch",
24
+ "build": "node ../../scripts/build/clean.mjs && rslib build --no-env",
25
+ "build:watch": "node ../../scripts/build/clean.mjs && rslib build --watch --no-env",
26
26
  "cloc": "../../scripts/qa/cloc-package.sh ."
27
27
  },
28
28
  "repository": {
@@ -42,7 +42,7 @@
42
42
  "typesVersions": {
43
43
  "*": {
44
44
  "testing": [
45
- "./lib/cjs/testing/index.d.ts"
45
+ "./lib/esm/testing/index.d.ts"
46
46
  ]
47
47
  }
48
48
  },
@@ -70,5 +70,6 @@
70
70
  "conversational-ui",
71
71
  "javascript"
72
72
  ],
73
- "sideEffects": false
73
+ "sideEffects": false,
74
+ "types": "./lib/esm/index.d.ts"
74
75
  }
@@ -1,5 +1,5 @@
1
1
  import axios, { type AxiosResponse } from 'axios'
2
- import Pusher, { type AuthOptions, type Channel } from 'pusher-js'
2
+ import Pusher, { type AuthOptions, type Channel, type Runtime } from 'pusher-js'
3
3
  import type Channels from 'pusher-js/types/src/core/channels/channels'
4
4
 
5
5
  import type { Input, SessionUser } from './models'
@@ -50,7 +50,9 @@ export class HubtypeService {
50
50
  public lastMessageUpdateDate?: string
51
51
  public onEvent: (event: any) => void
52
52
  public unsentInputs: () => UnsentInput[]
53
- public pusher: Pusher | null
53
+ // Pusher 5's CJS default is a namespace under NodeNext. Its named Runtime
54
+ // interface exposes the same constructor without that interop ambiguity.
55
+ public pusher: InstanceType<Parameters<Runtime['setup']>[0]> | null
54
56
  public channel: Channel
55
57
  public server?: ServerConfig
56
58
  public PUSHER_CONNECT_TIMEOUT_MS = 10000
@@ -5,7 +5,6 @@ export enum OutputMessageType {
5
5
  TextWithButtons = 'textWithButtons',
6
6
  BotExecutor = 'botExecutor',
7
7
  Carousel = 'carousel',
8
- RequestContactInfo = 'requestContactInfo',
9
8
  Exit = 'exit',
10
9
  }
11
10
 
@@ -62,13 +61,6 @@ export interface CarouselMessage extends BaseMessage {
62
61
  }
63
62
  }
64
63
 
65
- export interface RequestContactInfoMessage extends BaseMessage {
66
- type: OutputMessageType.RequestContactInfo
67
- content: {
68
- text: string
69
- }
70
- }
71
-
72
64
  export interface ExitMessage extends BaseMessage {
73
65
  type: OutputMessageType.Exit
74
66
  }
@@ -78,7 +70,6 @@ export type OutputMessage<Extra extends BaseMessage<string> = never> =
78
70
  | TextWithButtonsMessage
79
71
  | BotExecutorMessage
80
72
  | CarouselMessage
81
- | RequestContactInfoMessage
82
73
  | ExitMessage
83
74
  | Extra
84
75
 
@@ -1,4 +0,0 @@
1
- export declare const NOT_FOUND_PATH = "404";
2
- export declare const EMPTY_ACTION_PATH = "";
3
- export declare const PATH_PAYLOAD_IDENTIFIER = "__PATH_PAYLOAD__";
4
- export declare const PATH_PAYLOAD_REGEXP: RegExp;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PATH_PAYLOAD_REGEXP = exports.PATH_PAYLOAD_IDENTIFIER = exports.EMPTY_ACTION_PATH = exports.NOT_FOUND_PATH = void 0;
4
- exports.NOT_FOUND_PATH = '404';
5
- exports.EMPTY_ACTION_PATH = '';
6
- exports.PATH_PAYLOAD_IDENTIFIER = '__PATH_PAYLOAD__';
7
- exports.PATH_PAYLOAD_REGEXP = new RegExp(`\\b^${exports.PATH_PAYLOAD_IDENTIFIER}(.*)\\b`);
8
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,KAAK,CAAA;AACtB,QAAA,iBAAiB,GAAG,EAAE,CAAA;AACtB,QAAA,uBAAuB,GAAG,kBAAkB,CAAA;AAC5C,QAAA,mBAAmB,GAAG,IAAI,MAAM,CAC3C,OAAO,+BAAuB,SAAS,CACxC,CAAA"}
@@ -1,43 +0,0 @@
1
- import { Inspector } from './debug';
2
- import { type BotRequest, type BotResponse, type ResolvedPlugins, type Route, type Routes, type Session } from './models';
3
- import { Router } from './routing';
4
- export interface CoreBotConfig {
5
- appId?: string;
6
- defaultDelay?: number;
7
- defaultRoutes?: Route[];
8
- defaultTyping?: number;
9
- inspector?: Inspector;
10
- plugins?: ResolvedPlugins;
11
- renderer: any;
12
- routes: Routes;
13
- theme?: any;
14
- }
15
- export declare class CoreBot {
16
- appId?: string;
17
- defaultDelay: number;
18
- defaultRoutes: Route[];
19
- defaultTyping: number;
20
- inspector: Inspector;
21
- plugins: ResolvedPlugins;
22
- renderer: any;
23
- rootElement: any;
24
- router: Router | null;
25
- routes: Routes;
26
- theme?: any;
27
- constructor({ renderer, routes, theme, plugins, appId, defaultTyping, defaultDelay, defaultRoutes, inspector, }: CoreBotConfig);
28
- setSystemLocale(locale: string, session: Session): void;
29
- setUserLocale(locale: string, session: Session): void;
30
- setUserCountry(country: string, session: Session): void;
31
- input(request: BotRequest): Promise<BotResponse>;
32
- private getBotContext;
33
- private getSettings;
34
- private getSecrets;
35
- private runInput;
36
- private updateSession;
37
- private runPrePlugins;
38
- private getOutput;
39
- private setRouter;
40
- private updateRequestFromOutput;
41
- private runPostPlugins;
42
- private runRedirectAction;
43
- }
@@ -1,205 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CoreBot = void 0;
4
- const debug_1 = require("./debug");
5
- const models_1 = require("./models");
6
- const plugins_1 = require("./plugins");
7
- const routing_1 = require("./routing");
8
- class CoreBot {
9
- constructor({ renderer, routes, theme, plugins, appId, defaultTyping = 0.6, defaultDelay = 0.4, defaultRoutes, inspector, }) {
10
- this.renderer = renderer;
11
- this.plugins = plugins || {};
12
- this.theme = theme || {};
13
- this.defaultTyping = defaultTyping;
14
- this.defaultDelay = defaultDelay;
15
- this.appId = appId || undefined;
16
- this.rootElement = null;
17
- this.inspector = inspector || new debug_1.Inspector();
18
- this.routes = routes;
19
- this.defaultRoutes = defaultRoutes || [];
20
- this.router =
21
- this.routes instanceof Function
22
- ? null
23
- : new routing_1.Router([...this.routes, ...this.defaultRoutes], this.inspector.routeInspector);
24
- }
25
- setSystemLocale(locale, session) {
26
- session.user.system_locale = locale;
27
- }
28
- setUserLocale(locale, session) {
29
- session.user.locale = locale;
30
- }
31
- setUserCountry(country, session) {
32
- session.user.country = country;
33
- }
34
- async input(request) {
35
- const botContext = this.getBotContext(request);
36
- const output = await this.runInput(botContext);
37
- if (botContext.session._botonic_action?.startsWith(models_1.BotonicAction.Redirect)) {
38
- return await this.runRedirectAction(output, botContext);
39
- }
40
- return output;
41
- }
42
- getBotContext(request) {
43
- const { input, session, lastRoutePath } = request;
44
- const settings = this.getSettings(request);
45
- const secrets = this.getSecrets(request);
46
- return {
47
- input,
48
- session,
49
- lastRoutePath,
50
- params: {},
51
- plugins: this.plugins,
52
- defaultTyping: this.defaultTyping,
53
- defaultDelay: this.defaultDelay,
54
- getUserCountry: () => session.user.country,
55
- getUserLocale: () => session.user.locale,
56
- getSystemLocale: () => session.user.system_locale,
57
- setUserCountry: (country) => this.setUserCountry(country, session),
58
- setUserLocale: (locale) => this.setUserLocale(locale, session),
59
- setSystemLocale: (locale) => this.setSystemLocale(locale, session),
60
- settings,
61
- secrets,
62
- };
63
- }
64
- getSettings(request) {
65
- if (!request.settings) {
66
- // This only happens in local development
67
- return {
68
- HUBTYPE_API_URL: '',
69
- STATIC_URL: '',
70
- LITELLM_API_URL: '',
71
- AZURE_OPENAI_API_BASE: '',
72
- AZURE_OPENAI_API_VERSION: '',
73
- CUSTOM_SHORT_URL_HOST: '',
74
- LANGUAGE_DETECTION_ENABLED: false,
75
- custom: {},
76
- };
77
- }
78
- return request.settings;
79
- }
80
- getSecrets(request) {
81
- if (!request.secrets) {
82
- // This only happens in local development
83
- return {
84
- HUBTYPE_ACCESS_TOKEN: '',
85
- LITELLM_API_KEY: '',
86
- AZURE_OPENAI_API_KEY: '',
87
- custom: {},
88
- };
89
- }
90
- return request.secrets;
91
- }
92
- async runInput(botContext) {
93
- // After first updateSession, user country locale and system_locale are always defined
94
- this.updateSession(botContext.session);
95
- if (botContext.input.type === models_1.INPUT.CHAT_EVENT) {
96
- return {
97
- input: botContext.input,
98
- session: botContext.session,
99
- lastRoutePath: botContext.lastRoutePath,
100
- settings: botContext.settings,
101
- secrets: botContext.secrets,
102
- response: [],
103
- };
104
- }
105
- await this.runPrePlugins(botContext);
106
- const output = await this.getOutput(botContext);
107
- botContext = this.updateRequestFromOutput(botContext, output);
108
- const response = await this.renderer({
109
- request: botContext,
110
- actions: [output.fallbackAction, output.action, output.emptyAction],
111
- });
112
- await this.runPostPlugins(botContext, response);
113
- botContext.session.is_first_interaction = false;
114
- return {
115
- input: botContext.input,
116
- session: botContext.session,
117
- lastRoutePath: botContext.lastRoutePath,
118
- settings: botContext.settings,
119
- secrets: botContext.secrets,
120
- response,
121
- };
122
- }
123
- updateSession(session) {
124
- // set new user fields (country, locale, system_locale) from old fields in extra_data
125
- if (!session.user.country) {
126
- const country = session.user.extra_data?.country;
127
- this.setUserCountry(country, session);
128
- }
129
- if (!session.user.locale) {
130
- const language = session.user.extra_data?.language;
131
- this.setUserLocale(language, session);
132
- }
133
- if (!session.user.system_locale) {
134
- const locale = session.user.locale;
135
- if (locale) {
136
- this.setSystemLocale(locale, session);
137
- }
138
- }
139
- }
140
- async runPrePlugins(botContext) {
141
- if (this.plugins) {
142
- await (0, plugins_1.runPlugins)({ botContext, mode: 'pre' });
143
- }
144
- }
145
- async getOutput(botContext) {
146
- await this.setRouter(botContext);
147
- const output = this.router.processInput(botContext.input, botContext.session, botContext.lastRoutePath);
148
- return output;
149
- }
150
- async setRouter(botContext) {
151
- if (this.routes instanceof Function) {
152
- this.router = new routing_1.Router([
153
- ...(await (0, routing_1.getComputedRoutes)(this.routes, botContext)),
154
- ...this.defaultRoutes,
155
- ], this.inspector.routeInspector);
156
- }
157
- }
158
- updateRequestFromOutput(botContext, output) {
159
- return {
160
- ...botContext,
161
- params: output.params || {},
162
- lastRoutePath: output.lastRoutePath,
163
- };
164
- }
165
- async runPostPlugins(botContext, response) {
166
- if (this.plugins) {
167
- await (0, plugins_1.runPlugins)({
168
- botContext,
169
- mode: 'post',
170
- response,
171
- });
172
- }
173
- }
174
- async runRedirectAction(previousResponse, botContext, numOfRedirects = 0) {
175
- if (numOfRedirects > 10) {
176
- throw new Error('Maximum BotAction recursive calls reached (10)');
177
- }
178
- const nextPayload = botContext.session._botonic_action?.split(`${models_1.BotonicAction.Redirect}:`)[1];
179
- const inputWithBotActionPayload = {
180
- ...botContext.input,
181
- payload: nextPayload,
182
- type: models_1.INPUT.POSTBACK,
183
- data: undefined,
184
- text: undefined,
185
- };
186
- botContext.session._botonic_action = undefined;
187
- botContext.input = inputWithBotActionPayload;
188
- const followUp = await this.runInput(botContext);
189
- const response = {
190
- input: followUp.input,
191
- response: previousResponse.response.concat(followUp.response),
192
- session: botContext.session,
193
- lastRoutePath: followUp.lastRoutePath,
194
- settings: followUp.settings,
195
- secrets: followUp.secrets,
196
- };
197
- // Recursive call to handle multiple bot actions in a row
198
- if (response.session._botonic_action?.startsWith(models_1.BotonicAction.Redirect)) {
199
- return await this.runRedirectAction(response, botContext, numOfRedirects + 1);
200
- }
201
- return response;
202
- }
203
- }
204
- exports.CoreBot = CoreBot;
205
- //# sourceMappingURL=core-bot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-bot.js","sourceRoot":"","sources":["../../src/core-bot.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,qCAciB;AACjB,uCAAsC;AACtC,uCAAqD;AAcrD,MAAa,OAAO;IAalB,YAAY,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,EACL,aAAa,GAAG,GAAG,EACnB,YAAY,GAAG,GAAG,EAClB,aAAa,EACb,SAAS,GACK;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,IAAI,iBAAS,EAAE,CAAA;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,aAAa,GAAG,aAAa,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U,CAAC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAA;QAC9C,UAAU,CAAC,KAAK,GAAG,yBAAyB,CAAA;QAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;QAEhD,MAAM,QAAQ,GAAgB;YAC5B,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC7D,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B,CAAA;QAED,yDAAyD;QACzD,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,sBAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzE,OAAO,MAAM,IAAI,CAAC,iBAAiB,CACjC,QAAQ,EACR,UAAU,EACV,cAAc,GAAG,CAAC,CACnB,CAAA;QACH,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAzRD,0BAyRC"}
@@ -1 +0,0 @@
1
- export * from './inspector';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./inspector"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/debug/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B"}
@@ -1,24 +0,0 @@
1
- import type { Route, RouteMatcher } from '../models';
2
- export declare class RouteInspector {
3
- routeMatched(_route: Route, _routeKey: string, _routeValue: RouteMatcher, _input: any): void;
4
- routeNotMatched(_route: Route, _routeKey: string, _routeValue: RouteMatcher, _input: any): void;
5
- }
6
- export declare class FocusRouteInspector extends RouteInspector {
7
- focusRoutePaths: string[] | null;
8
- focusOnMatches: boolean;
9
- constructor();
10
- focusOnlyOnRoutes(focusRoutePaths: string[]): this;
11
- focusOnlyOnMatches(): this;
12
- _isOnFocus(route: Route): boolean;
13
- }
14
- export declare class LogRouteInspector extends FocusRouteInspector {
15
- routeMatched(route: Route, routeKey: string, routeValue: RouteMatcher, inputValue: string): void;
16
- routeNotMatched(route: Route, routeKey: string, routeValue: RouteMatcher, inputValue: string): void;
17
- _routeName(obj: Route): string;
18
- _log(message: string, ...optionalParams: string[]): void;
19
- }
20
- export declare class Inspector {
21
- routeInspector: RouteInspector;
22
- constructor(routeInspector?: RouteInspector | undefined);
23
- getRouteInspector(): RouteInspector;
24
- }