@scriptdb/server 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -4358,7 +4358,7 @@ import { spawn } from "node:child_process";
4358
4358
  import Storage from "@scriptdb/storage";
4359
4359
  var pkgData = `{
4360
4360
  "name": "scriptdb-workspace",
4361
- "version": "1.0.4",
4361
+ "version": "1.0.5",
4362
4362
  "description": "ScriptDB workspace for custom scripts, services, and databases",
4363
4363
  "private": true,
4364
4364
  "devDependencies": {
@@ -4651,14 +4651,16 @@ class ScriptDBClient {
4651
4651
  this.retries = Number.isFinite(this.options.retries) ? this.options.retries : 3;
4652
4652
  this.retryDelay = Number.isFinite(this.options.retryDelay) ? this.options.retryDelay : 1000;
4653
4653
  this.frame = this.options.frame === "length-prefix" || this.options.preferLengthPrefix ? "length-prefix" : "ndjson";
4654
- const normalized = uri.replace(/^https?:\/\//i, "scriptdb://");
4655
4654
  let parsed;
4656
4655
  try {
4657
- parsed = new URL(normalized);
4656
+ parsed = new URL(uri);
4658
4657
  } catch (e) {
4659
4658
  throw new Error("Invalid uri");
4660
4659
  }
4661
- this.uri = normalized;
4660
+ if (parsed.protocol !== "scriptdb:") {
4661
+ throw new Error("URI must use scriptdb:// protocol");
4662
+ }
4663
+ this.uri = uri;
4662
4664
  this.protocolName = parsed.protocol ? parsed.protocol.replace(":", "") : "scriptdb";
4663
4665
  this.username = (typeof this.options.username === "string" ? this.options.username : parsed.username) || null;
4664
4666
  this.password = (typeof this.options.password === "string" ? this.options.password : parsed.password) || null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scriptdb/server",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "server module resolver for script database",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -41,10 +41,10 @@
41
41
  "typescript": "^5.0.0"
42
42
  },
43
43
  "dependencies": {
44
- "@scriptdb/client": "^1.0.4",
45
- "@scriptdb/storage": "^1.0.4",
46
- "@scriptdb/system-modules": "^1.0.4",
47
- "@scriptdb/vm": "^1.0.4",
44
+ "@scriptdb/client": "^1.0.5",
45
+ "@scriptdb/storage": "^1.0.5",
46
+ "@scriptdb/system-modules": "^1.0.5",
47
+ "@scriptdb/vm": "^1.0.5",
48
48
  "@types/ws": "^8.18.1",
49
49
  "bcryptjs": "^3.0.3",
50
50
  "bottleneck": "^2.19.5",