From 2b13fa25ef3b07bd8b3537e2889374156e5b5a94 Mon Sep 17 00:00:00 2001 From: Abel Toledano Date: Mon, 9 Dec 2024 14:30:31 +0100 Subject: [PATCH] changes from CR --- ... playroom-patch-296f85d480-4519b01e0b.zip} | Bin 1881387 -> 1881384 bytes .../playroom-npm-0.39.0-24448abd08.patch | 52 +++++++++--------- package.json | 3 +- yarn.lock | 4 +- 4 files changed, 30 insertions(+), 29 deletions(-) rename .yarn/cache/{playroom-patch-4adfcfbe79-afc8c31a5a.zip => playroom-patch-296f85d480-4519b01e0b.zip} (99%) diff --git a/.yarn/cache/playroom-patch-4adfcfbe79-afc8c31a5a.zip b/.yarn/cache/playroom-patch-296f85d480-4519b01e0b.zip similarity index 99% rename from .yarn/cache/playroom-patch-4adfcfbe79-afc8c31a5a.zip rename to .yarn/cache/playroom-patch-296f85d480-4519b01e0b.zip index ca9946ea0fa3d5189118275be9b3e47735544295..5a4c13f4a0b94fba5460c293f0a5acfd2c87e6d5 100644 GIT binary patch delta 4565 zcmV;`5i0Jh>T;;+a)5*ZgaU*Egam{Iga(8Mgb0KQgbIWUgbaiYgbsucgb;)ggc5`k zgcO7ogcgJsgcyVwgc^h!v>eQ33VCnViZ&4d08BrZaF`n@m%w2h2$u@A91DN#JNj#N@7cvs@Zp4z5`Q4PoksI&H*S(8iwdQe3 zz9w!$-Z9rp$s*<}(u(nW>zjXU{y-MtCRx7UM;y#6lfKA1^&<$QOj9`!yri!3!R3S)90Oz@xV; zN!)wZf!X&dj~UFR>>=%3Xw>0HpDR6-^uptno4(*aBW3JO8iYwtPN#n*k%Y37bRXtw zqP^=tuui=MHFe?fC`rk66a|3I{FgjU$eb8$GQSc+$@vdHjCV-FQUv%25Mm4ICSmVW zz%yF3)dp&$7=N``FfTO#hTug7JcdbbWuerODQ#_?d1%=70wL zQ*I6mmU_$Ub%2(zcGKk)j3@@Y4&iGw>*U!KHu|RxIQdN!r0psB4y-Fk*vyUgSD+FQ zSI{s(t2uYa-yM+H@lz+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vRW!(s|E!F z`lz7)Zb-+?GPtG;PENwjWtcR}pfMzMA;cKs7LXxq2Y?LWC+8S!jZWM?9l0a?pL6E| zu05DUUD!KtD%=PI5%$BKfZ2@2_P~Tao(TQ)fes8uIiBl)5!o)qd7vo#Cy)bi z+?^CV!2IO#!9vBS^F=Y$2H!8JDEyNfVpLFW`ztLw<~*^);8lCj(WCRUnhB!e!&Ys;xD}zFMDeAT0i59x&g1htNUCB zE;UkklxFBxz3N4Zd};AN0GDBb92~b~cN|(h35a-*N;we#0GyY{v>aOoOLrUq008V} B$>sn6 diff --git a/.yarn/patches/playroom-npm-0.39.0-24448abd08.patch b/.yarn/patches/playroom-npm-0.39.0-24448abd08.patch index 6ab6c10e1..acd67d325 100644 --- a/.yarn/patches/playroom-npm-0.39.0-24448abd08.patch +++ b/.yarn/patches/playroom-npm-0.39.0-24448abd08.patch @@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..21d14ae14f317c051123f269242ee58d +]); diff --git a/src/Playroom/AiPanel/AiPanel.tsx b/src/Playroom/AiPanel/AiPanel.tsx new file mode 100644 -index 0000000000000000000000000000000000000000..dd60b29783442680768eba84b600c2f5a90b6a5d +index 0000000000000000000000000000000000000000..57e123e4dfc28dbd4154d2c7bb62d47596ecbf25 --- /dev/null +++ b/src/Playroom/AiPanel/AiPanel.tsx @@ -0,0 +1,506 @@ @@ -187,7 +187,7 @@ index 0000000000000000000000000000000000000000..dd60b29783442680768eba84b600c2f5 +// export const aiBaseUrl = `http://localhost:3000`; +export const aiBaseUrl = `https://mistica-playroom-api.tooling-dev.svc.dev.tuenti.io`; + -+const fetchApi = (path: string, options?: RequestInit): Promise => ++const fetchApi = (path: string, options?: RequestInit): Promise => + fetch(`${aiBaseUrl}${path}`, { + credentials: 'include', + method: 'POST', @@ -202,42 +202,42 @@ index 0000000000000000000000000000000000000000..dd60b29783442680768eba84b600c2f5 + window.location.assign('/oauth2/sign_in'); + return new Promise(() => {}); // never resolve, as we are redirecting to login + } -+ return response; ++ return response.json(); + }); + -+const sendMessageToAi = (conversationId: string, message: string) => ++const sendMessageToAi = ( ++ conversationId: string, ++ message: string ++): Promise => + fetchApi('/send-message', { + body: JSON.stringify({ conversationId, message }), -+ }) -+ .then((response) => response.json()) -+ .then((data) => { -+ if (!data.success) { -+ throw new Error(data.error); -+ } -+ return data.source; -+ }); ++ }).then((data) => { ++ if (!data.success) { ++ throw new Error(data.error); ++ } ++ return data.source; ++ }); + +const createConversation = (): Promise => -+ fetchApi('/create-conversation') -+ .then((response) => response.json()) -+ .then((data) => data.conversationId); ++ fetchApi('/create-conversation').then((data) => data.conversationId); + -+const deleteConversation = (conversationId: string) => ++const deleteConversation = (conversationId: string): Promise => + fetchApi('/delete-conversation', { + body: JSON.stringify({ conversationId }), -+ }); ++ }).then(() => {}); + -+const regenerateMessage = (conversationId: string, messageIndex: number) => ++const regenerateMessage = ( ++ conversationId: string, ++ messageIndex: number ++): Promise => + fetchApi('/regenerate-message', { + body: JSON.stringify({ conversationId, messageIndex }), -+ }) -+ .then((response) => response.json()) -+ .then((data) => { -+ if (!data.success) { -+ throw new Error(data.error); -+ } -+ return data.source; -+ }); ++ }).then((data) => { ++ if (!data.success) { ++ throw new Error(data.error); ++ } ++ return data.source; ++ }); + +export const EmptyState = ({ + onImagePaste, diff --git a/package.json b/package.json index 5e66c852d..84522eb35 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,8 @@ "detect-circular-dependencies": "npx dpdm --circular src/index.tsx", "audit-accessibility": "node .github/actions/audit-accessibility/main.js", "circular-dependencies": "yarn dpdm src/index.tsx --tree=false --warning=false --exit-code circular:1", - "prepare": "husky install" + "prepare": "husky install", + "edit-playroom-patch": "playroom/patch-playroom.sh" }, "browserslist": [ "chrome >= 51", diff --git a/yarn.lock b/yarn.lock index 0d59b9699..90a277102 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17966,7 +17966,7 @@ __metadata: "playroom@patch:playroom@npm%3A0.39.0#./.yarn/patches/playroom-npm-0.39.0-24448abd08.patch::locator=%40telefonica%2Fmistica%40workspace%3A.": version: 0.39.0 - resolution: "playroom@patch:playroom@npm%3A0.39.0#./.yarn/patches/playroom-npm-0.39.0-24448abd08.patch::version=0.39.0&hash=bc8505&locator=%40telefonica%2Fmistica%40workspace%3A." + resolution: "playroom@patch:playroom@npm%3A0.39.0#./.yarn/patches/playroom-npm-0.39.0-24448abd08.patch::version=0.39.0&hash=2ce33c&locator=%40telefonica%2Fmistica%40workspace%3A." dependencies: "@babel/core": ^7.20.5 "@babel/parser": ^7.23.4 @@ -18028,7 +18028,7 @@ __metadata: react-dom: ^17 || ^18 bin: playroom: bin/cli.cjs - checksum: afc8c31a5a94c624f9011f0c825f8ae0e7a3958139c750f0d7f55c2e95c60ed492b2b31a40261eeea2f9bae5d6bd1c544f53f5e6985e36c522c3a857b6f80ac3 + checksum: 4519b01e0bbf62650671841a75c935e0f26e91f55380816d6f9f85e843c25672c039d43f7eb1a0f289cd19253bb08e7fb73f9f5b214e76b20d8636fe219c5bf1 languageName: node linkType: hard