Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@n8n_io/ai-assistant-sdk

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@n8n_io/ai-assistant-sdk - npm Package Compare versions

Comparing version 1.10.2 to 1.10.3

7

CHANGELOG.md
# Changelog
## [1.10.3](https://github.com/n8n-io/ai-assistant-service/compare/ai-assistant-sdk-v1.10.2...ai-assistant-sdk-v1.10.3) (2024-10-03)
### Bug Fixes
* Add type assertion to `askAi` method ([#176](https://github.com/n8n-io/ai-assistant-service/issues/176)) ([96e5673](https://github.com/n8n-io/ai-assistant-service/commit/96e5673276c06f9a912991276a5f58d161c125e0))
## [1.10.2](https://github.com/n8n-io/ai-assistant-service/compare/ai-assistant-sdk-v1.10.1...ai-assistant-sdk-v1.10.2) (2024-10-02)

@@ -4,0 +11,0 @@

17

dist/index.js

@@ -30,3 +30,3 @@ "use strict";

name: "@n8n_io/ai-assistant-sdk",
version: "1.10.2",
version: "1.10.3",
description: "n8n AI assistant SDK",

@@ -64,5 +64,2 @@ author: "",

typescript: "^5.5.3"
},
dependencies: {
undici: "^6.19.8"
}

@@ -112,3 +109,3 @@ };

const data = await response.json();
if (isValidResponse(data)) {
if (isValidApplySuggestionResponse(data)) {
return data;

@@ -122,3 +119,6 @@ }

const data = await response.json();
return data;
if (isValidAskAiResponse(data)) {
return data;
}
throw new Error("Invalid response from assistant service");
}

@@ -186,5 +186,8 @@ }

}
function isValidResponse(response) {
function isValidApplySuggestionResponse(response) {
return typeof response === "object" && !!response && "parameters" in response && "sessionId" in response;
}
function isValidAskAiResponse(response) {
return typeof response === "object" && !!response && "code" in response;
}
// Annotate the CommonJS export names for ESM import in node:

@@ -191,0 +194,0 @@ 0 && (module.exports = {

{
"name": "@n8n_io/ai-assistant-sdk",
"version": "1.10.2",
"version": "1.10.3",
"description": "n8n AI assistant SDK",

@@ -27,5 +27,2 @@ "author": "",

},
"dependencies": {
"undici": "^6.19.8"
},
"scripts": {

@@ -32,0 +29,0 @@ "typecheck": "tsc --noEmit",

@@ -113,3 +113,3 @@ import packageJson from '../package.json';

const data = await response.json();
if (isValidResponse(data)) {
if (isValidApplySuggestionResponse(data)) {
return data;

@@ -130,3 +130,7 @@ }

return data;
if (isValidAskAiResponse(data)) {
return data;
}
throw new Error('Invalid response from assistant service');
}

@@ -220,3 +224,5 @@ }

function isValidResponse(response: unknown): response is AiAssistantSDK.ApplySuggestionResponse {
function isValidApplySuggestionResponse(
response: unknown,
): response is AiAssistantSDK.ApplySuggestionResponse {
return (

@@ -229,1 +235,5 @@ typeof response === 'object' &&

}
function isValidAskAiResponse(response: unknown): response is AiAssistantSDK.AskAiResponsePayload {
return typeof response === 'object' && !!response && 'code' in response;
}

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