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

@libsql/client

Package Overview
Dependencies
Maintainers
3
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libsql/client - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

40

lib-cjs/migrations.js

@@ -39,14 +39,30 @@ "use strict";

async function getIsSchemaDatabase({ authToken, baseUrl, }) {
const url = normalizeURLScheme(baseUrl + "/v1/jobs");
console.log("url: ", url);
const result = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${authToken}`,
},
});
console.log("result: ", result);
const json = (await result.json());
const isChildDatabase = result.status === 400 && json.error === "Invalid namespace";
return !isChildDatabase;
let responseStatusCode;
try {
if (baseUrl.startsWith("http://127.0.0.1")) {
return false;
}
const url = normalizeURLScheme(baseUrl + "/v1/jobs");
const result = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${authToken}`,
},
});
if (result.status === 404 || result.status === 500) {
return false;
}
const json = (await result.json());
const isChildDatabase = result.status === 400 && json.error === "Invalid namespace";
return !isChildDatabase;
}
catch (e) {
console.error([
`There has been an error while retrieving the database type.`,
`Debug information:`,
`- URL: ${baseUrl}`,
`- Response Status Code: ${responseStatusCode ? responseStatusCode : "N/A"}`,
].join("\n"));
throw e;
}
}

@@ -53,0 +69,0 @@ exports.getIsSchemaDatabase = getIsSchemaDatabase;

@@ -36,14 +36,30 @@ const SCHEMA_MIGRATION_SLEEP_TIME_IN_MS = 1000;

export async function getIsSchemaDatabase({ authToken, baseUrl, }) {
const url = normalizeURLScheme(baseUrl + "/v1/jobs");
console.log("url: ", url);
const result = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${authToken}`,
},
});
console.log("result: ", result);
const json = (await result.json());
const isChildDatabase = result.status === 400 && json.error === "Invalid namespace";
return !isChildDatabase;
let responseStatusCode;
try {
if (baseUrl.startsWith("http://127.0.0.1")) {
return false;
}
const url = normalizeURLScheme(baseUrl + "/v1/jobs");
const result = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${authToken}`,
},
});
if (result.status === 404 || result.status === 500) {
return false;
}
const json = (await result.json());
const isChildDatabase = result.status === 400 && json.error === "Invalid namespace";
return !isChildDatabase;
}
catch (e) {
console.error([
`There has been an error while retrieving the database type.`,
`Debug information:`,
`- URL: ${baseUrl}`,
`- Response Status Code: ${responseStatusCode ? responseStatusCode : "N/A"}`,
].join("\n"));
throw e;
}
}

@@ -50,0 +66,0 @@ async function getLastMigrationJob({ authToken, baseUrl, }) {

{
"name": "@libsql/client",
"version": "0.6.1",
"version": "0.6.2",
"keywords": [

@@ -105,3 +105,3 @@ "libsql",

"dependencies": {
"@libsql/core": "^0.6.1",
"@libsql/core": "^0.6.2",
"@libsql/hrana-client": "^0.6.0",

@@ -108,0 +108,0 @@ "js-base64": "^3.7.5",

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