New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@foundationui/react-hooks

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foundationui/react-hooks - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

dist/cjs/bundle.js

@@ -1,1 +0,1 @@

"use strict";var e=require("react");exports.useFoundationModel=function(o){var t=e.useState("undefined"!=typeof crypto?crypto.randomUUID():"".concat((new Date).getTime()))[0],n=o.dev?"http://localhost:7777/smartinput":"https://api.foundation-ui.com/smartinput",r=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/sessions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify([{model:o.model,user:o.user,session:t,input:e,context:r}])}).then((function(e){return e.json()})).catch((function(e){return console.error(e)}))}}),[o.model,o.user,n]),c=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/completions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.model,user:o.user,safeMode:o.safeMode,session:t,input:e,context:r})}).then((function(e){return 200!==e.status&&console.error("Error getting completion"),e.json()})).catch((function(e){return console.error(e),null}))}}),[o.model,o.user,o.dev,o.safeMode]),s=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,seen:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to seen")})).catch((function(e){return console.error(e)}))}}),[n]),i=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,accepted:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to accepted")})).catch((function(e){return console.error(e)}))}}),[n]);return{model:o.model,user:o.user,saveCompletion:r,getCompletion:c,markCompletionSeen:s,markCompletionAccepted:i}};
"use strict";var e=require("react");exports.useFoundationModel=function(o){var t=e.useState("undefined"!=typeof crypto?crypto.randomUUID():"".concat((new Date).getTime()))[0],n=o.dev?"http://localhost:7777/platform":"https://api.foundation-ui.com/platform",r=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/sessions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify([{model:o.model,user:o.user,session:t,input:e,context:r}])}).then((function(e){return e.json()})).catch((function(e){return console.error(e)}))}}),[o.model,o.user,n]),c=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/completions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.model,user:o.user,safeMode:o.safeMode,session:t,input:e,context:r})}).then((function(e){return 200!==e.status&&console.error("Error getting completion"),e.json()})).catch((function(e){return console.error(e),null}))}}),[o.model,o.user,o.dev,o.safeMode]),s=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,seen:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to seen")})).catch((function(e){return console.error(e)}))}}),[n]),i=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,accepted:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to accepted")})).catch((function(e){return console.error(e)}))}}),[n]);return{model:o.model,user:o.user,saveCompletion:r,getCompletion:c,markCompletionSeen:s,markCompletionAccepted:i}};

@@ -1,1 +0,1 @@

import e from"react";function o(o){var t=e.useState("undefined"!=typeof crypto?crypto.randomUUID():"".concat((new Date).getTime()))[0],n=o.dev?"http://localhost:7777/smartinput":"https://api.foundation-ui.com/smartinput",r=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/sessions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify([{model:o.model,user:o.user,session:t,input:e,context:r}])}).then((function(e){return e.json()})).catch((function(e){return console.error(e)}))}}),[o.model,o.user,n]),c=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/completions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.model,user:o.user,safeMode:o.safeMode,session:t,input:e,context:r})}).then((function(e){return 200!==e.status&&console.error("Error getting completion"),e.json()})).catch((function(e){return console.error(e),null}))}}),[o.model,o.user,o.dev,o.safeMode]),s=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,seen:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to seen")})).catch((function(e){return console.error(e)}))}}),[n]),i=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,accepted:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to accepted")})).catch((function(e){return console.error(e)}))}}),[n]);return{model:o.model,user:o.user,saveCompletion:r,getCompletion:c,markCompletionSeen:s,markCompletionAccepted:i}}export{o as useFoundationModel};
import e from"react";function o(o){var t=e.useState("undefined"!=typeof crypto?crypto.randomUUID():"".concat((new Date).getTime()))[0],n=o.dev?"http://localhost:7777/platform":"https://api.foundation-ui.com/platform",r=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/sessions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify([{model:o.model,user:o.user,session:t,input:e,context:r}])}).then((function(e){return e.json()})).catch((function(e){return console.error(e)}))}}),[o.model,o.user,n]),c=e.useMemo((function(){return function(e,r){return fetch("".concat(n,"/completions"),{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.model,user:o.user,safeMode:o.safeMode,session:t,input:e,context:r})}).then((function(e){return 200!==e.status&&console.error("Error getting completion"),e.json()})).catch((function(e){return console.error(e),null}))}}),[o.model,o.user,o.dev,o.safeMode]),s=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,seen:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to seen")})).catch((function(e){return console.error(e)}))}}),[n]),i=e.useMemo((function(){return function(e){fetch("".concat(n,"/completions"),{method:"PUT",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({completionSid:e,accepted:!0})}).then((function(e){200!==e.status&&console.error("Couldn't update completion to accepted")})).catch((function(e){return console.error(e)}))}}),[n]);return{model:o.model,user:o.user,saveCompletion:r,getCompletion:c,markCompletionSeen:s,markCompletionAccepted:i}}export{o as useFoundationModel};
{
"name": "@foundationui/react-hooks",
"version": "0.0.4",
"version": "0.0.5",
"description": "Use a foundation model in your app. It gets smarter the more your users use it.",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc