@epam/statgpt-shared-toolkit 0.3.0-rc.11 → 0.3.0-rc.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/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("date-fns"),_={CHAT:"/api/chat"},R="CUSTOM_PERIOD",l={decimal:"0.0",decimalSymbol:",",digitGroupingSymbol:" "},g="application/json",N="Content-Type",a="Api-Key",T="X-CONVERSATION-ID",u="Ocp-Apim-Subscription-Key",h={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,CONFLICT:409,TOO_MANY_REQUESTS:429,INTERNAL_SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},f="onboarding",S="share";class v extends Error{constructor(e){super(e.message),this.isHttpError=!0,this.name="HttpError",this.code=e.code,this.status=e.status,this.details=e.details,this.displayMessage=e.displayMessage}}function y(t){return typeof t=="object"&&t!==null&&t.isHttpError===!0&&typeof t.status=="number"&&typeof t.message=="string"&&(t.code===void 0||typeof t.code=="string")}var p=(t=>(t.MONTH="month",t.DAY="day",t))(p||{}),A=(t=>(t.UK="uk",t.EN="en",t))(A||{}),O=(t=>(t.IN="in",t.BETWEEN="between",t))(O||{});function D(t,e){const n=t.split("/")[0],r=e.split("/").pop();return`${n}/${r}`}const b=t=>t.messages.flatMap(e=>{const n=e.custom_content?.attachments??[],r=e.custom_content?.stages?.flatMap(({attachments:s})=>s??[])??[];return[...n,...r]}),C=t=>b(t),P=t=>[...new Set(C(t).map(e=>e.url).filter(e=>!!e))],m=t=>t?.split(/-\d+$/)[0]??"",U=t=>t?.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").replace(/-/g," ")||"";function H(t,e){return`${t?.[0]}/${e}/${t?.[1]}`}const M=(t,e)=>(Math.round(t*10**e)/10**e).toString(),B=(t,e)=>{const n=e?.decimal||l.decimal,r=e?.decimalSymbol||l.decimalSymbol,s=e?.digitGroupingSymbol??l.digitGroupingSymbol,o=Number(t);if(o==null||Number.isNaN(o)||t===null||t==="")return"";const i=n.replace("0.",""),E=`${n==="0"?Math.trunc(o):M(o,i.length)} `.split(".");return E[0]=E[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${s}`),`${E.join(r)}`},F=t=>{if(!t.includes("T")){for(const n of L){const r=c.parse(t,n,new Date);if(c.isValid(r))return r}return null}const e=c.parseISO(t);return c.isValid(e)?e:null},L=["yyyy-MM-dd","MM-dd-yyyy"],x=(t,e,n)=>{const r={[N]:e?.contentType||g};return e?.jwt?r.Authorization=`Bearer ${e.jwt}`:t&&(r[a]=t),e?.chatReference&&(r[T]=e.chatReference),{...r,...n}},$=t=>{const e={...t};return e[a]&&(e[a]=e[a].substring(0,8)+"...[REDACTED]"),e.Authorization&&(e.Authorization="Bearer [REDACTED]"),e[u]&&(e[u]=e[u].substring(0,8)+"...[REDACTED]"),e},w=t=>({"Content-Type":`multipart/form-data; boundary=${t}`}),G=t=>t?.toLowerCase()==="true",V=async(t,e,n)=>await fetch(t,{method:n.method||"GET",headers:e,body:n.body?JSON.stringify(n.body):void 0}),Y=(t,e)=>t?.split("/")?.filter(n=>n!==e)?.join("/"),j=t=>t.replace(/^conversations\//,""),z=t=>t.split("/").slice(0,-1).join("/"),K=t=>m(decodeURIComponent(t.split("/").at(-1)??"")),W=t=>t.map(e=>({...e,name:m(e.name)})),k=new Set([")","]","}",">",",",".","!","?",":",";"]);function I(t){let e=t.length;for(;e>0&&k.has(t[e-1]);)e--;return e===t.length?{cleanUrl:t,trailing:""}:{cleanUrl:t.slice(0,e),trailing:t.slice(e)}}function X(t){if(!t)return[{type:"text",value:""}];const e=[];let n=0;for(const r of t.matchAll(/\bhttps?:\/\/[^\s<>"']+/gi)){const s=r[0],o=r.index??0;o>n&&e.push({type:"text",value:t.slice(n,o)});const{cleanUrl:i,trailing:d}=I(s);i?e.push({type:"link",value:i}):e.push({type:"text",value:s}),d&&e.push({type:"text",value:d}),n=o+s.length}return n<t.length&&e.push({type:"text",value:t.slice(n)}),e.length?e:[{type:"text",value:t}]}exports.API_KEY_HEADER=a;exports.API_ROUTES=_;exports.APPLICATION_JSON=g;exports.CONTENT_TYPE_HEADER=N;exports.CUSTOM_PERIOD=R;exports.CalendarResolution=p;exports.HTTP_ERROR_CODES=h;exports.HttpError=v;exports.Locale=A;exports.OCP_APIM_SUBSCRIPTION_KEY_HEADER=u;exports.ONBOARDING_MODEL_POSTFIX=f;exports.QueryFilterType=O;exports.SHARE_CONVERSATION_ROUTE=S;exports.X_CONVERSATION_ID_HEADER=T;exports.cleanConversationNames=W;exports.defaultFormatNumbers=l;exports.deleteConversationNamePostfix=m;exports.formatNumberBySign=B;exports.getClearedConversationName=U;exports.getConversationAttachmentUrls=P;exports.getConversationAttachments=C;exports.getConversationFolderIdFromConversationId=z;exports.getConversationId=H;exports.getConversationIdFromResourceUrl=j;exports.getConversationNameFromConversationId=K;exports.getConversationNavPath=D;exports.getConversationUrlWithoutLocale=Y;exports.getHeaders=x;exports.getMultipartHeaders=w;exports.getTimePeriod=F;exports.isHttpError=y;exports.linkifyText=X;exports.parseBoolean=G;exports.sanitizeHeaders=$;exports.sendRequest=V;exports.splitTrailingPunctuation=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("date-fns"),R={CHAT:"/api/chat"},f="CUSTOM_PERIOD",l={decimal:"0.0",decimalSymbol:",",digitGroupingSymbol:" "},A="application/json",T="Content-Type",a="Api-Key",N="X-CONVERSATION-ID",u="Ocp-Apim-Subscription-Key",S={BAD_REQUEST:400,UNAUTHORIZED:401,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,CONFLICT:409,TOO_MANY_REQUESTS:429,INTERNAL_SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},v="onboarding",y="share";class D extends Error{constructor(e){super(e.message),this.isHttpError=!0,this.name="HttpError",this.code=e.code,this.status=e.status,this.details=e.details,this.displayMessage=e.displayMessage}}function U(t){return typeof t=="object"&&t!==null&&t.isHttpError===!0&&typeof t.status=="number"&&typeof t.message=="string"&&(t.code===void 0||typeof t.code=="string")}var g=(t=>(t.MONTH="month",t.DAY="day",t))(g||{}),C=(t=>(t.UK="uk",t.EN="en",t))(C||{}),_=(t=>(t.IN="in",t.BETWEEN="between",t))(_||{});function b(t,e){const n=t.split("/")[0],r=e.split("/").pop();return`${n}/${r}`}const O=t=>t.messages.flatMap(e=>{const n=e.custom_content?.attachments??[],r=e.custom_content?.stages?.flatMap(({attachments:s})=>s??[])??[];return[...n,...r]}),P=t=>t.endsWith("/"),H=t=>{const e=t.toLowerCase();return e.startsWith("http://")||e.startsWith("https://")},h=t=>!!t&&!H(t)&&!P(t),M=t=>[...new Set(O(t).map(e=>e.url).filter(e=>!!e).filter(e=>h(e)))],p=(t,e)=>t?.map(n=>({...n,url:n.url?e[n.url]??n.url:n.url})),F=(t,e)=>({...t,messages:t.messages.map(n=>({...n,custom_content:n.custom_content?{...n.custom_content,attachments:p(n.custom_content.attachments,e),stages:n.custom_content.stages?.map(r=>({...r,attachments:p(r.attachments,e)}))}:n.custom_content}))}),E=t=>t?.split(/-\d+$/)[0]??"",B=t=>t?.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").replace(/-/g," ")||"";function L(t,e){return`${t?.[0]}/${e}/${t?.[1]}`}const x=(t,e)=>(Math.round(t*10**e)/10**e).toString(),$=(t,e)=>{const n=e?.decimal||l.decimal,r=e?.decimalSymbol||l.decimalSymbol,s=e?.digitGroupingSymbol??l.digitGroupingSymbol,o=Number(t);if(o==null||Number.isNaN(o)||t===null||t==="")return"";const i=n.replace("0.",""),m=`${n==="0"?Math.trunc(o):x(o,i.length)} `.split(".");return m[0]=m[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${s}`),`${m.join(r)}`},w=t=>{if(!t.includes("T")){for(const n of G){const r=c.parse(t,n,new Date);if(c.isValid(r))return r}return null}const e=c.parseISO(t);return c.isValid(e)?e:null},G=["yyyy-MM-dd","MM-dd-yyyy"],V=(t,e,n)=>{const r={};return e?.contentType!==null&&(r[T]=e?.contentType||A),e?.jwt?r.Authorization=`Bearer ${e.jwt}`:t&&(r[a]=t),e?.chatReference&&(r[N]=e.chatReference),{...r,...n}},Y=t=>{const e={...t};return e[a]&&(e[a]=e[a].substring(0,8)+"...[REDACTED]"),e.Authorization&&(e.Authorization="Bearer [REDACTED]"),e[u]&&(e[u]=e[u].substring(0,8)+"...[REDACTED]"),e},W=t=>({"Content-Type":`multipart/form-data; boundary=${t}`}),j=t=>t?.toLowerCase()==="true",z=async(t,e,n)=>await fetch(t,{method:n.method||"GET",headers:e,body:n.body?JSON.stringify(n.body):void 0}),K=(t,e)=>t?.split("/")?.filter(n=>n!==e)?.join("/"),k=t=>t.replace(/^conversations\//,""),X=t=>t.split("/").slice(0,-1).join("/"),q=t=>E(decodeURIComponent(t.split("/").at(-1)??"")),J=t=>t.map(e=>({...e,name:E(e.name)})),Q=new Set([")","]","}",">",",",".","!","?",":",";"]);function I(t){let e=t.length;for(;e>0&&Q.has(t[e-1]);)e--;return e===t.length?{cleanUrl:t,trailing:""}:{cleanUrl:t.slice(0,e),trailing:t.slice(e)}}function Z(t){if(!t)return[{type:"text",value:""}];const e=[];let n=0;for(const r of t.matchAll(/\bhttps?:\/\/[^\s<>"']+/gi)){const s=r[0],o=r.index??0;o>n&&e.push({type:"text",value:t.slice(n,o)});const{cleanUrl:i,trailing:d}=I(s);i?e.push({type:"link",value:i}):e.push({type:"text",value:s}),d&&e.push({type:"text",value:d}),n=o+s.length}return n<t.length&&e.push({type:"text",value:t.slice(n)}),e.length?e:[{type:"text",value:t}]}exports.API_KEY_HEADER=a;exports.API_ROUTES=R;exports.APPLICATION_JSON=A;exports.CONTENT_TYPE_HEADER=T;exports.CUSTOM_PERIOD=f;exports.CalendarResolution=g;exports.HTTP_ERROR_CODES=S;exports.HttpError=D;exports.Locale=C;exports.OCP_APIM_SUBSCRIPTION_KEY_HEADER=u;exports.ONBOARDING_MODEL_POSTFIX=v;exports.QueryFilterType=_;exports.SHARE_CONVERSATION_ROUTE=y;exports.X_CONVERSATION_ID_HEADER=N;exports.cleanConversationNames=J;exports.defaultFormatNumbers=l;exports.deleteConversationNamePostfix=E;exports.formatNumberBySign=$;exports.getClearedConversationName=B;exports.getConversationAttachmentUrls=M;exports.getConversationAttachments=O;exports.getConversationFolderIdFromConversationId=X;exports.getConversationId=L;exports.getConversationIdFromResourceUrl=k;exports.getConversationNameFromConversationId=q;exports.getConversationNavPath=b;exports.getConversationUrlWithoutLocale=K;exports.getHeaders=V;exports.getMultipartHeaders=W;exports.getTimePeriod=w;exports.isDialFileAttachmentUrl=h;exports.isHttpError=U;exports.linkifyText=Z;exports.parseBoolean=j;exports.replaceConversationAttachmentUrls=F;exports.sanitizeHeaders=Y;exports.sendRequest=z;exports.splitTrailingPunctuation=I;
package/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { parse as p, isValid as m, parseISO as g } from "date-fns";
2
- const b = {
1
+ import { parse as h, isValid as d, parseISO as A } from "date-fns";
2
+ const M = {
3
3
  CHAT: "/api/chat"
4
- }, v = "CUSTOM_PERIOD", u = {
4
+ }, H = "CUSTOM_PERIOD", u = {
5
5
  decimal: "0.0",
6
6
  decimalSymbol: ",",
7
7
  digitGroupingSymbol: " "
8
- }, A = "application/json", N = "Content-Type", i = "Api-Key", T = "X-CONVERSATION-ID", d = "Ocp-Apim-Subscription-Key", U = {
8
+ }, T = "application/json", f = "Content-Type", c = "Api-Key", g = "X-CONVERSATION-ID", m = "Ocp-Apim-Subscription-Key", x = {
9
9
  BAD_REQUEST: 400,
10
10
  UNAUTHORIZED: 401,
11
11
  FORBIDDEN: 403,
@@ -17,17 +17,17 @@ const b = {
17
17
  BAD_GATEWAY: 502,
18
18
  SERVICE_UNAVAILABLE: 503,
19
19
  GATEWAY_TIMEOUT: 504
20
- }, M = "onboarding", H = "share";
21
- class P extends Error {
20
+ }, B = "onboarding", P = "share";
21
+ class L extends Error {
22
22
  constructor(e) {
23
23
  super(e.message), this.isHttpError = !0, this.name = "HttpError", this.code = e.code, this.status = e.status, this.details = e.details, this.displayMessage = e.displayMessage;
24
24
  }
25
25
  }
26
- function x(t) {
26
+ function $(t) {
27
27
  return typeof t == "object" && t !== null && t.isHttpError === !0 && typeof t.status == "number" && typeof t.message == "string" && (t.code === void 0 || typeof t.code == "string");
28
28
  }
29
- var h = /* @__PURE__ */ ((t) => (t.MONTH = "month", t.DAY = "day", t))(h || {}), f = /* @__PURE__ */ ((t) => (t.UK = "uk", t.EN = "en", t))(f || {}), O = /* @__PURE__ */ ((t) => (t.IN = "in", t.BETWEEN = "between", t))(O || {});
30
- function B(t, e) {
29
+ var N = /* @__PURE__ */ ((t) => (t.MONTH = "month", t.DAY = "day", t))(N || {}), _ = /* @__PURE__ */ ((t) => (t.UK = "uk", t.EN = "en", t))(_ || {}), O = /* @__PURE__ */ ((t) => (t.IN = "in", t.BETWEEN = "between", t))(O || {});
30
+ function w(t, e) {
31
31
  const n = t.split("/")[0], r = e.split("/").pop();
32
32
  return `${n}/${r}`;
33
33
  }
@@ -36,54 +36,77 @@ const I = (t) => t.messages.flatMap((e) => {
36
36
  ({ attachments: s }) => s ?? []
37
37
  ) ?? [];
38
38
  return [...n, ...r];
39
- }), R = (t) => I(t), $ = (t) => [
39
+ }), C = (t) => t.endsWith("/"), y = (t) => {
40
+ const e = t.toLowerCase();
41
+ return e.startsWith("http://") || e.startsWith("https://");
42
+ }, R = (t) => !!t && !y(t) && !C(t), F = (t) => [
40
43
  ...new Set(
41
- R(t).map((e) => e.url).filter((e) => !!e)
44
+ I(t).map((e) => e.url).filter((e) => !!e).filter((e) => R(e))
42
45
  )
43
- ], E = (t) => t?.split(/-\d+$/)[0] ?? "", L = (t) => t?.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").replace(/-/g, " ") || "";
44
- function w(t, e) {
46
+ ], p = (t, e) => t?.map((n) => ({
47
+ ...n,
48
+ url: n.url ? e[n.url] ?? n.url : n.url
49
+ })), G = (t, e) => ({
50
+ ...t,
51
+ messages: t.messages.map((n) => ({
52
+ ...n,
53
+ custom_content: n.custom_content ? {
54
+ ...n.custom_content,
55
+ attachments: p(
56
+ n.custom_content.attachments,
57
+ e
58
+ ),
59
+ stages: n.custom_content.stages?.map((r) => ({
60
+ ...r,
61
+ attachments: p(
62
+ r.attachments,
63
+ e
64
+ )
65
+ }))
66
+ } : n.custom_content
67
+ }))
68
+ }), E = (t) => t?.split(/-\d+$/)[0] ?? "", W = (t) => t?.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").replace(/-/g, " ") || "";
69
+ function j(t, e) {
45
70
  return `${t?.[0]}/${e}/${t?.[1]}`;
46
71
  }
47
- const y = (t, e) => (Math.round(t * 10 ** e) / 10 ** e).toString(), F = (t, e) => {
72
+ const S = (t, e) => (Math.round(t * 10 ** e) / 10 ** e).toString(), V = (t, e) => {
48
73
  const n = e?.decimal || u.decimal, r = e?.decimalSymbol || u.decimalSymbol, s = e?.digitGroupingSymbol ?? u.digitGroupingSymbol, o = Number(t);
49
74
  if (o == null || Number.isNaN(o) || t === null || t === "")
50
75
  return "";
51
- const a = n.replace("0.", ""), l = `${n === "0" ? Math.trunc(o) : y(o, a.length)} `.split(".");
76
+ const a = n.replace("0.", ""), l = `${n === "0" ? Math.trunc(o) : S(o, a.length)} `.split(".");
52
77
  return l[0] = l[0].replace(
53
78
  /(\d)(?=(\d\d\d)+(?!\d))/g,
54
79
  `$1${s}`
55
80
  ), `${l.join(r)}`;
56
- }, G = (t) => {
81
+ }, Y = (t) => {
57
82
  if (!t.includes("T")) {
58
- for (const n of C) {
59
- const r = p(t, n, /* @__PURE__ */ new Date());
60
- if (m(r))
83
+ for (const n of D) {
84
+ const r = h(t, n, /* @__PURE__ */ new Date());
85
+ if (d(r))
61
86
  return r;
62
87
  }
63
88
  return null;
64
89
  }
65
- const e = g(t);
66
- return m(e) ? e : null;
67
- }, C = ["yyyy-MM-dd", "MM-dd-yyyy"], j = (t, e, n) => {
68
- const r = {
69
- [N]: e?.contentType || A
70
- };
71
- return e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[i] = t), e?.chatReference && (r[T] = e.chatReference), { ...r, ...n };
72
- }, V = (t) => {
90
+ const e = A(t);
91
+ return d(e) ? e : null;
92
+ }, D = ["yyyy-MM-dd", "MM-dd-yyyy"], z = (t, e, n) => {
93
+ const r = {};
94
+ return e?.contentType !== null && (r[f] = e?.contentType || T), e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[c] = t), e?.chatReference && (r[g] = e.chatReference), { ...r, ...n };
95
+ }, k = (t) => {
73
96
  const e = { ...t };
74
- return e[i] && (e[i] = e[i].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[d] && (e[d] = e[d].substring(0, 8) + "...[REDACTED]"), e;
75
- }, Y = (t) => ({
97
+ return e[c] && (e[c] = e[c].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[m] && (e[m] = e[m].substring(0, 8) + "...[REDACTED]"), e;
98
+ }, K = (t) => ({
76
99
  "Content-Type": `multipart/form-data; boundary=${t}`
77
- }), z = (t) => t?.toLowerCase() === "true", W = async (t, e, n) => await fetch(t, {
100
+ }), X = (t) => t?.toLowerCase() === "true", J = async (t, e, n) => await fetch(t, {
78
101
  method: n.method || "GET",
79
102
  headers: e,
80
103
  body: n.body ? JSON.stringify(n.body) : void 0
81
- }), k = (t, e) => t?.split("/")?.filter((n) => n !== e)?.join("/"), K = (t) => t.replace(/^conversations\//, ""), X = (t) => t.split("/").slice(0, -1).join("/"), J = (t) => E(
104
+ }), q = (t, e) => t?.split("/")?.filter((n) => n !== e)?.join("/"), Q = (t) => t.replace(/^conversations\//, ""), Z = (t) => t.split("/").slice(0, -1).join("/"), tt = (t) => E(
82
105
  decodeURIComponent(t.split("/").at(-1) ?? "")
83
- ), q = (t) => t.map((e) => ({
106
+ ), et = (t) => t.map((e) => ({
84
107
  ...e,
85
108
  name: E(e.name)
86
- })), _ = /* @__PURE__ */ new Set([
109
+ })), b = /* @__PURE__ */ new Set([
87
110
  ")",
88
111
  "]",
89
112
  "}",
@@ -95,62 +118,64 @@ const y = (t, e) => (Math.round(t * 10 ** e) / 10 ** e).toString(), F = (t, e) =
95
118
  ":",
96
119
  ";"
97
120
  ]);
98
- function S(t) {
121
+ function v(t) {
99
122
  let e = t.length;
100
- for (; e > 0 && _.has(t[e - 1]); )
123
+ for (; e > 0 && b.has(t[e - 1]); )
101
124
  e--;
102
125
  return e === t.length ? { cleanUrl: t, trailing: "" } : {
103
126
  cleanUrl: t.slice(0, e),
104
127
  trailing: t.slice(e)
105
128
  };
106
129
  }
107
- function Q(t) {
130
+ function nt(t) {
108
131
  if (!t) return [{ type: "text", value: "" }];
109
132
  const e = [];
110
133
  let n = 0;
111
134
  for (const r of t.matchAll(/\bhttps?:\/\/[^\s<>"']+/gi)) {
112
135
  const s = r[0], o = r.index ?? 0;
113
136
  o > n && e.push({ type: "text", value: t.slice(n, o) });
114
- const { cleanUrl: a, trailing: c } = S(s);
115
- a ? e.push({ type: "link", value: a }) : e.push({ type: "text", value: s }), c && e.push({ type: "text", value: c }), n = o + s.length;
137
+ const { cleanUrl: a, trailing: i } = v(s);
138
+ a ? e.push({ type: "link", value: a }) : e.push({ type: "text", value: s }), i && e.push({ type: "text", value: i }), n = o + s.length;
116
139
  }
117
140
  return n < t.length && e.push({ type: "text", value: t.slice(n) }), e.length ? e : [{ type: "text", value: t }];
118
141
  }
119
142
  export {
120
- i as API_KEY_HEADER,
121
- b as API_ROUTES,
122
- A as APPLICATION_JSON,
123
- N as CONTENT_TYPE_HEADER,
124
- v as CUSTOM_PERIOD,
125
- h as CalendarResolution,
126
- U as HTTP_ERROR_CODES,
127
- P as HttpError,
128
- f as Locale,
129
- d as OCP_APIM_SUBSCRIPTION_KEY_HEADER,
130
- M as ONBOARDING_MODEL_POSTFIX,
143
+ c as API_KEY_HEADER,
144
+ M as API_ROUTES,
145
+ T as APPLICATION_JSON,
146
+ f as CONTENT_TYPE_HEADER,
147
+ H as CUSTOM_PERIOD,
148
+ N as CalendarResolution,
149
+ x as HTTP_ERROR_CODES,
150
+ L as HttpError,
151
+ _ as Locale,
152
+ m as OCP_APIM_SUBSCRIPTION_KEY_HEADER,
153
+ B as ONBOARDING_MODEL_POSTFIX,
131
154
  O as QueryFilterType,
132
- H as SHARE_CONVERSATION_ROUTE,
133
- T as X_CONVERSATION_ID_HEADER,
134
- q as cleanConversationNames,
155
+ P as SHARE_CONVERSATION_ROUTE,
156
+ g as X_CONVERSATION_ID_HEADER,
157
+ et as cleanConversationNames,
135
158
  u as defaultFormatNumbers,
136
159
  E as deleteConversationNamePostfix,
137
- F as formatNumberBySign,
138
- L as getClearedConversationName,
139
- $ as getConversationAttachmentUrls,
140
- R as getConversationAttachments,
141
- X as getConversationFolderIdFromConversationId,
142
- w as getConversationId,
143
- K as getConversationIdFromResourceUrl,
144
- J as getConversationNameFromConversationId,
145
- B as getConversationNavPath,
146
- k as getConversationUrlWithoutLocale,
147
- j as getHeaders,
148
- Y as getMultipartHeaders,
149
- G as getTimePeriod,
150
- x as isHttpError,
151
- Q as linkifyText,
152
- z as parseBoolean,
153
- V as sanitizeHeaders,
154
- W as sendRequest,
155
- S as splitTrailingPunctuation
160
+ V as formatNumberBySign,
161
+ W as getClearedConversationName,
162
+ F as getConversationAttachmentUrls,
163
+ I as getConversationAttachments,
164
+ Z as getConversationFolderIdFromConversationId,
165
+ j as getConversationId,
166
+ Q as getConversationIdFromResourceUrl,
167
+ tt as getConversationNameFromConversationId,
168
+ w as getConversationNavPath,
169
+ q as getConversationUrlWithoutLocale,
170
+ z as getHeaders,
171
+ K as getMultipartHeaders,
172
+ Y as getTimePeriod,
173
+ R as isDialFileAttachmentUrl,
174
+ $ as isHttpError,
175
+ nt as linkifyText,
176
+ X as parseBoolean,
177
+ G as replaceConversationAttachmentUrls,
178
+ k as sanitizeHeaders,
179
+ J as sendRequest,
180
+ v as splitTrailingPunctuation
156
181
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/statgpt-shared-toolkit",
3
- "version": "0.3.0-rc.11",
3
+ "version": "0.3.0-rc.12",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -1,3 +1,5 @@
1
1
  import { Attachment, Conversation } from '@epam/ai-dial-shared';
2
2
  export declare const getConversationAttachments: (conversation: Conversation) => Attachment[];
3
+ export declare const isDialFileAttachmentUrl: (url: string) => boolean;
3
4
  export declare const getConversationAttachmentUrls: (conversation: Conversation) => string[];
5
+ export declare const replaceConversationAttachmentUrls: (conversation: Conversation, attachmentUrlMap: Record<string, string>) => Conversation;
@@ -2,7 +2,7 @@ import { ApiHeaders } from '../models/api';
2
2
  export declare const getHeaders: (apiKey?: string, options?: {
3
3
  jwt?: string;
4
4
  chatReference?: string;
5
- contentType?: string;
5
+ contentType?: string | null;
6
6
  }, optionsHeaders?: Record<string, string>) => Record<string, string>;
7
7
  export declare const sanitizeHeaders: (headers: ApiHeaders) => Record<string, string>;
8
8
  export declare const getMultipartHeaders: (boundary: string) => Record<string, string>;