@epam/statgpt-shared-toolkit 0.3.0-rc.1 → 0.3.0-rc.11

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 p={CHAT:"/api/chat"},R="CUSTOM_PERIOD",c={decimal:"0.0",decimalSymbol:",",digitGroupingSymbol:" "},N="application/json",T="Content-Type",i="Api-Key",d="X-CONVERSATION-ID",l="Ocp-Apim-Subscription-Key",m={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},I="onboarding",S="share";class C 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 h(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 O=(t=>(t.MONTH="month",t.DAY="day",t))(O||{}),A=(t=>(t.UK="uk",t.EN="en",t))(A||{}),_=(t=>(t.IN="in",t.BETWEEN="between",t))(_||{});function f(t,e){const n=t.split("/")[0],r=e.split("/").pop();return`${n}/${r}`}const D=t=>t?.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").replace(/-/g," ")||"";function y(t,e){return`${t?.[0]}/${e}/${t?.[1]}`}const b=(t,e)=>(Math.round(t*10**e)/10**e).toString(),H=(t,e)=>{const n=e?.decimal||c.decimal,r=e?.decimalSymbol||c.decimalSymbol,s=e?.digitGroupingSymbol??c.digitGroupingSymbol,o=Number(t);if(o==null||Number.isNaN(o)||t===null||t==="")return"";const a=n.replace("0.",""),u=`${n==="0"?Math.trunc(o):b(o,a.length)} `.split(".");return u[0]=u[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${s}`),`${u.join(r)}`},P=t=>isNaN(Date.parse(t))?null:new Date(t),v=(t,e,n)=>{const r={[T]:e?.contentType||N};return e?.jwt?r.Authorization=`Bearer ${e.jwt}`:t&&(r[i]=t),e?.chatReference&&(r[d]=e.chatReference),{...r,...n}},U=t=>{const e={...t};return e[i]&&(e[i]=e[i].substring(0,8)+"...[REDACTED]"),e.Authorization&&(e.Authorization="Bearer [REDACTED]"),e[l]&&(e[l]=e[l].substring(0,8)+"...[REDACTED]"),e},M=t=>({"Content-Type":`multipart/form-data; boundary=${t}`}),B=t=>t?.toLowerCase()==="true",L=async(t,e,n)=>await fetch(t,{method:n.method||"GET",headers:e,body:n.body?JSON.stringify(n.body):void 0}),$=(t,e)=>t?.split("/")?.filter(n=>n!==e)?.join("/"),x=t=>t.map(e=>({...e,name:e.name.split(/-\d+$/)[0]})),w=new Set([")","]","}",">",",",".","!","?",":",";"]);function g(t){let e=t.length;for(;e>0&&w.has(t[e-1]);)e--;return e===t.length?{cleanUrl:t,trailing:""}:{cleanUrl:t.slice(0,e),trailing:t.slice(e)}}function G(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:a,trailing:E}=g(s);a?e.push({type:"link",value:a}):e.push({type:"text",value:s}),E&&e.push({type:"text",value:E}),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=i;exports.API_ROUTES=p;exports.APPLICATION_JSON=N;exports.CONTENT_TYPE_HEADER=T;exports.CUSTOM_PERIOD=R;exports.CalendarResolution=O;exports.HTTP_ERROR_CODES=m;exports.HttpError=C;exports.Locale=A;exports.OCP_APIM_SUBSCRIPTION_KEY_HEADER=l;exports.ONBOARDING_MODEL_POSTFIX=I;exports.QueryFilterType=_;exports.SHARE_CONVERSATION_ROUTE=S;exports.X_CONVERSATION_ID_HEADER=d;exports.cleanConversationNames=x;exports.defaultFormatNumbers=c;exports.formatNumberBySign=H;exports.getClearedConversationName=D;exports.getConversationId=y;exports.getConversationNavPath=f;exports.getConversationUrlWithoutLocale=$;exports.getHeaders=v;exports.getMultipartHeaders=M;exports.getTimePeriod=P;exports.isHttpError=h;exports.linkifyText=G;exports.parseBoolean=B;exports.sanitizeHeaders=U;exports.sendRequest=L;exports.splitTrailingPunctuation=g;
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;
package/index.mjs CHANGED
@@ -1,10 +1,11 @@
1
- const f = {
1
+ import { parse as p, isValid as m, parseISO as g } from "date-fns";
2
+ const b = {
2
3
  CHAT: "/api/chat"
3
- }, R = "CUSTOM_PERIOD", u = {
4
+ }, v = "CUSTOM_PERIOD", u = {
4
5
  decimal: "0.0",
5
6
  decimalSymbol: ",",
6
7
  digitGroupingSymbol: " "
7
- }, d = "application/json", p = "Content-Type", a = "Api-Key", N = "X-CONVERSATION-ID", E = "Ocp-Apim-Subscription-Key", _ = {
8
+ }, A = "application/json", N = "Content-Type", i = "Api-Key", T = "X-CONVERSATION-ID", d = "Ocp-Apim-Subscription-Key", U = {
8
9
  BAD_REQUEST: 400,
9
10
  UNAUTHORIZED: 401,
10
11
  FORBIDDEN: 403,
@@ -16,51 +17,73 @@ const f = {
16
17
  BAD_GATEWAY: 502,
17
18
  SERVICE_UNAVAILABLE: 503,
18
19
  GATEWAY_TIMEOUT: 504
19
- }, I = "onboarding", S = "share";
20
- class y extends Error {
20
+ }, M = "onboarding", H = "share";
21
+ class P extends Error {
21
22
  constructor(e) {
22
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;
23
24
  }
24
25
  }
25
- function D(t) {
26
+ function x(t) {
26
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");
27
28
  }
28
- var T = /* @__PURE__ */ ((t) => (t.MONTH = "month", t.DAY = "day", t))(T || {}), g = /* @__PURE__ */ ((t) => (t.UK = "uk", t.EN = "en", t))(g || {}), m = /* @__PURE__ */ ((t) => (t.IN = "in", t.BETWEEN = "between", t))(m || {});
29
- function b(t, e) {
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) {
30
31
  const n = t.split("/")[0], r = e.split("/").pop();
31
32
  return `${n}/${r}`;
32
33
  }
33
- const C = (t) => t?.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").replace(/-/g, " ") || "";
34
- function U(t, e) {
34
+ const I = (t) => t.messages.flatMap((e) => {
35
+ const n = e.custom_content?.attachments ?? [], r = e.custom_content?.stages?.flatMap(
36
+ ({ attachments: s }) => s ?? []
37
+ ) ?? [];
38
+ return [...n, ...r];
39
+ }), R = (t) => I(t), $ = (t) => [
40
+ ...new Set(
41
+ R(t).map((e) => e.url).filter((e) => !!e)
42
+ )
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) {
35
45
  return `${t?.[0]}/${e}/${t?.[1]}`;
36
46
  }
37
- const A = (t, e) => (Math.round(t * 10 ** e) / 10 ** e).toString(), v = (t, e) => {
38
- const n = e?.decimal || u.decimal, r = e?.decimalSymbol || u.decimalSymbol, o = e?.digitGroupingSymbol ?? u.digitGroupingSymbol, s = Number(t);
39
- if (s == null || Number.isNaN(s) || t === null || t === "")
47
+ const y = (t, e) => (Math.round(t * 10 ** e) / 10 ** e).toString(), F = (t, e) => {
48
+ const n = e?.decimal || u.decimal, r = e?.decimalSymbol || u.decimalSymbol, s = e?.digitGroupingSymbol ?? u.digitGroupingSymbol, o = Number(t);
49
+ if (o == null || Number.isNaN(o) || t === null || t === "")
40
50
  return "";
41
- const i = n.replace("0.", ""), l = `${n === "0" ? Math.trunc(s) : A(s, i.length)} `.split(".");
51
+ const a = n.replace("0.", ""), l = `${n === "0" ? Math.trunc(o) : y(o, a.length)} `.split(".");
42
52
  return l[0] = l[0].replace(
43
53
  /(\d)(?=(\d\d\d)+(?!\d))/g,
44
- `$1${o}`
54
+ `$1${s}`
45
55
  ), `${l.join(r)}`;
46
- }, H = (t) => isNaN(Date.parse(t)) ? null : new Date(t), P = (t, e, n) => {
56
+ }, G = (t) => {
57
+ if (!t.includes("T")) {
58
+ for (const n of C) {
59
+ const r = p(t, n, /* @__PURE__ */ new Date());
60
+ if (m(r))
61
+ return r;
62
+ }
63
+ return null;
64
+ }
65
+ const e = g(t);
66
+ return m(e) ? e : null;
67
+ }, C = ["yyyy-MM-dd", "MM-dd-yyyy"], j = (t, e, n) => {
47
68
  const r = {
48
- [p]: e?.contentType || d
69
+ [N]: e?.contentType || A
49
70
  };
50
- return e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[a] = t), e?.chatReference && (r[N] = e.chatReference), { ...r, ...n };
51
- }, M = (t) => {
71
+ return e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[i] = t), e?.chatReference && (r[T] = e.chatReference), { ...r, ...n };
72
+ }, V = (t) => {
52
73
  const e = { ...t };
53
- return e[a] && (e[a] = e[a].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[E] && (e[E] = e[E].substring(0, 8) + "...[REDACTED]"), e;
54
- }, $ = (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) => ({
55
76
  "Content-Type": `multipart/form-data; boundary=${t}`
56
- }), x = (t) => t?.toLowerCase() === "true", B = async (t, e, n) => await fetch(t, {
77
+ }), z = (t) => t?.toLowerCase() === "true", W = async (t, e, n) => await fetch(t, {
57
78
  method: n.method || "GET",
58
79
  headers: e,
59
80
  body: n.body ? JSON.stringify(n.body) : void 0
60
- }), L = (t, e) => t?.split("/")?.filter((n) => n !== e)?.join("/"), w = (t) => t.map((e) => ({
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(
82
+ decodeURIComponent(t.split("/").at(-1) ?? "")
83
+ ), q = (t) => t.map((e) => ({
61
84
  ...e,
62
- name: e.name.split(/-\d+$/)[0]
63
- })), O = /* @__PURE__ */ new Set([
85
+ name: E(e.name)
86
+ })), _ = /* @__PURE__ */ new Set([
64
87
  ")",
65
88
  "]",
66
89
  "}",
@@ -72,56 +95,62 @@ const A = (t, e) => (Math.round(t * 10 ** e) / 10 ** e).toString(), v = (t, e) =
72
95
  ":",
73
96
  ";"
74
97
  ]);
75
- function h(t) {
98
+ function S(t) {
76
99
  let e = t.length;
77
- for (; e > 0 && O.has(t[e - 1]); )
100
+ for (; e > 0 && _.has(t[e - 1]); )
78
101
  e--;
79
102
  return e === t.length ? { cleanUrl: t, trailing: "" } : {
80
103
  cleanUrl: t.slice(0, e),
81
104
  trailing: t.slice(e)
82
105
  };
83
106
  }
84
- function G(t) {
107
+ function Q(t) {
85
108
  if (!t) return [{ type: "text", value: "" }];
86
109
  const e = [];
87
110
  let n = 0;
88
111
  for (const r of t.matchAll(/\bhttps?:\/\/[^\s<>"']+/gi)) {
89
- const o = r[0], s = r.index ?? 0;
90
- s > n && e.push({ type: "text", value: t.slice(n, s) });
91
- const { cleanUrl: i, trailing: c } = h(o);
92
- i ? e.push({ type: "link", value: i }) : e.push({ type: "text", value: o }), c && e.push({ type: "text", value: c }), n = s + o.length;
112
+ const s = r[0], o = r.index ?? 0;
113
+ 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;
93
116
  }
94
117
  return n < t.length && e.push({ type: "text", value: t.slice(n) }), e.length ? e : [{ type: "text", value: t }];
95
118
  }
96
119
  export {
97
- a as API_KEY_HEADER,
98
- f as API_ROUTES,
99
- d as APPLICATION_JSON,
100
- p as CONTENT_TYPE_HEADER,
101
- R as CUSTOM_PERIOD,
102
- T as CalendarResolution,
103
- _ as HTTP_ERROR_CODES,
104
- y as HttpError,
105
- g as Locale,
106
- E as OCP_APIM_SUBSCRIPTION_KEY_HEADER,
107
- I as ONBOARDING_MODEL_POSTFIX,
108
- m as QueryFilterType,
109
- S as SHARE_CONVERSATION_ROUTE,
110
- N as X_CONVERSATION_ID_HEADER,
111
- w as cleanConversationNames,
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,
131
+ O as QueryFilterType,
132
+ H as SHARE_CONVERSATION_ROUTE,
133
+ T as X_CONVERSATION_ID_HEADER,
134
+ q as cleanConversationNames,
112
135
  u as defaultFormatNumbers,
113
- v as formatNumberBySign,
114
- C as getClearedConversationName,
115
- U as getConversationId,
116
- b as getConversationNavPath,
117
- L as getConversationUrlWithoutLocale,
118
- P as getHeaders,
119
- $ as getMultipartHeaders,
120
- H as getTimePeriod,
121
- D as isHttpError,
122
- G as linkifyText,
123
- x as parseBoolean,
124
- M as sanitizeHeaders,
125
- B as sendRequest,
126
- h as splitTrailingPunctuation
136
+ 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
127
156
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/statgpt-shared-toolkit",
3
- "version": "0.3.0-rc.1",
3
+ "version": "0.3.0-rc.11",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {
@@ -14,6 +14,7 @@
14
14
  "module": "./index.mjs",
15
15
  "types": "./index.d.ts",
16
16
  "dependencies": {
17
- "@epam/ai-dial-shared": "^0.43.3"
17
+ "@epam/ai-dial-shared": "^0.43.3",
18
+ "date-fns": "^4.1.0"
18
19
  }
19
20
  }
@@ -0,0 +1,3 @@
1
+ import { Attachment, Conversation } from '@epam/ai-dial-shared';
2
+ export declare const getConversationAttachments: (conversation: Conversation) => Attachment[];
3
+ export declare const getConversationAttachmentUrls: (conversation: Conversation) => string[];
@@ -1 +1,2 @@
1
+ export declare const deleteConversationNamePostfix: (conversationName?: string) => string;
1
2
  export declare const getClearedConversationName: (conversationName?: string) => string;
@@ -1 +1,4 @@
1
1
  export declare const getConversationUrlWithoutLocale: (resourceUrl: string, locale: string) => string;
2
+ export declare const getConversationIdFromResourceUrl: (resourceUrl: string) => string;
3
+ export declare const getConversationFolderIdFromConversationId: (conversationId: string) => string;
4
+ export declare const getConversationNameFromConversationId: (conversationId: string) => string;
package/utils/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './conversation-id-to-navigation';
2
+ export * from './conversation-attachments';
2
3
  export * from './conversation-name';
3
4
  export * from './conversation-navigation-to-id';
4
5
  export * from './format-numbers';