@o-lang/bank-account-lookup 1.0.0 → 1.0.1

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/index.js +7 -1
  2. package/package.json +10 -3
package/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  // This resolver ONLY reads data - no mutations allowed
3
3
 
4
4
  const Database = require('better-sqlite3');
5
+ const path = require('path'); // ✅ Add this
5
6
 
6
7
  /**
7
8
  * Bank account balance lookup resolver
@@ -16,11 +17,16 @@ module.exports = async (action, context) => {
16
17
  }
17
18
 
18
19
  // Require database path (from context or env var)
19
- const dbPath = context.bank_db_path || process.env.BANK_DB_PATH;
20
+ let dbPath = context.bank_db_path || process.env.BANK_DB_PATH;
20
21
  if (!dbPath) {
21
22
  throw new Error('bank-account-lookup requires "bank_db_path" in context or BANK_DB_PATH environment variable');
22
23
  }
23
24
 
25
+ // ✅ Resolve relative paths relative to the current working directory
26
+ if (!path.isAbsolute(dbPath)) {
27
+ dbPath = path.resolve(process.cwd(), dbPath);
28
+ }
29
+
24
30
  // Validate customer ID
25
31
  const customerId = context.customer_id;
26
32
  if (!customerId || typeof customerId !== 'string') {
package/package.json CHANGED
@@ -1,13 +1,20 @@
1
1
  {
2
2
  "name": "@o-lang/bank-account-lookup",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "O-Lang resolver for secure bank balance lookups",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "init-bank-db": "./bin/init-bank-db.js"
8
8
  },
9
9
  "type": "commonjs",
10
- "keywords": ["olang", "resolver", "bank", "sqlite", "security", "read-only"],
10
+ "keywords": [
11
+ "olang",
12
+ "resolver",
13
+ "bank",
14
+ "sqlite",
15
+ "security",
16
+ "read-only"
17
+ ],
11
18
  "author": "Your Name <your.email@example.com>",
12
19
  "license": "MIT",
13
20
  "repository": {
@@ -24,4 +31,4 @@
24
31
  "engines": {
25
32
  "node": ">=18.0.0"
26
33
  }
27
- }
34
+ }