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

@baseai/core

Package Overview
Dependencies
Maintainers
0
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@baseai/core - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

6

CHANGELOG.md
# `langbase` SDK
## 0.9.2
### Patch Changes
- 👌 IMPROVE: Error handling check if BaseAI dev is running
## 0.9.1

@@ -4,0 +10,0 @@

50

dist/index.js

@@ -121,7 +121,2 @@ "use strict";

this.status = void 0;
console.warn(
`
Please check if BaseAI dev server is running. If not, run 'npx baseai dev' in the root directory.
`
);
if (cause) this.cause = cause;

@@ -783,2 +778,37 @@ }

// src/utils/local-server-running.ts
async function isLocalServerRunning() {
try {
const endpoint = getApiUrl();
const response = await fetch(endpoint, {
mode: "no-cors",
cache: "no-cache"
// Prevents caching of the request
});
const portUseError = `
Port 9000 is already in use.
Terminate the process running on it.
Run npx baseai@latest dev in an new terminal to start the dev server.
`;
if (!response.ok) {
console.error(portUseError);
return false;
}
const res = await response.json();
if (!res.success) {
console.error(portUseError);
return false;
}
return true;
} catch (error) {
console.error(
`
BaseAI dev server is not running.
Please run npx baseai@latest dev in a new teriminal to start dev server.
`
);
return false;
}
}
// src/pipes/pipes.ts

@@ -849,2 +879,5 @@ var Pipe = class {

let response = await this.createRequest(endpoint, body);
if (Object.entries(response).length === 0) {
return {};
}
console.log("pipe.run.response");

@@ -914,3 +947,8 @@ console.dir(response, { depth: null, colors: true });

};
return this.request.post(isProd() ? prodOptions : localOptions);
const isProdEnv = isProd();
if (!isProdEnv) {
const isServerRunning = await isLocalServerRunning();
if (!isServerRunning) return {};
}
return this.request.post(isProdEnv ? prodOptions : localOptions);
}

@@ -917,0 +955,0 @@ };

@@ -105,7 +105,2 @@ "use strict";

this.status = void 0;
console.warn(
`
Please check if BaseAI dev server is running. If not, run 'npx baseai dev' in the root directory.
`
);
if (cause) this.cause = cause;

@@ -767,2 +762,37 @@ }

// src/utils/local-server-running.ts
async function isLocalServerRunning() {
try {
const endpoint = getApiUrl();
const response = await fetch(endpoint, {
mode: "no-cors",
cache: "no-cache"
// Prevents caching of the request
});
const portUseError = `
Port 9000 is already in use.
Terminate the process running on it.
Run npx baseai@latest dev in an new terminal to start the dev server.
`;
if (!response.ok) {
console.error(portUseError);
return false;
}
const res = await response.json();
if (!res.success) {
console.error(portUseError);
return false;
}
return true;
} catch (error) {
console.error(
`
BaseAI dev server is not running.
Please run npx baseai@latest dev in a new teriminal to start dev server.
`
);
return false;
}
}
// src/pipes/pipes.ts

@@ -833,2 +863,5 @@ var Pipe = class {

let response = await this.createRequest(endpoint, body);
if (Object.entries(response).length === 0) {
return {};
}
console.log("pipe.run.response");

@@ -898,3 +931,8 @@ console.dir(response, { depth: null, colors: true });

};
return this.request.post(isProd() ? prodOptions : localOptions);
const isProdEnv = isProd();
if (!isProdEnv) {
const isServerRunning = await isLocalServerRunning();
if (!isServerRunning) return {};
}
return this.request.post(isProdEnv ? prodOptions : localOptions);
}

@@ -901,0 +939,0 @@ };

2

package.json
{
"name": "@baseai/core",
"description": "The Web AI Framework's core - BaseAI.dev",
"version": "0.9.1",
"version": "0.9.2",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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