@niledatabase/server 4.1.1 → 4.2.0-alpha.0
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.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -4
package/dist/index.mjs
CHANGED
|
@@ -319,12 +319,12 @@ var getPassword = (cfg) => {
|
|
|
319
319
|
const log = logProtector(logger);
|
|
320
320
|
const { info } = Logger(config, "[password]");
|
|
321
321
|
if (stringCheck(config?.password)) {
|
|
322
|
-
log && info(`${logger}[config]
|
|
322
|
+
log && info(`${logger}[config] ***`);
|
|
323
323
|
return String(config?.password);
|
|
324
324
|
}
|
|
325
325
|
const pass = stringCheck(process.env.NILEDB_PASSWORD);
|
|
326
326
|
if (pass) {
|
|
327
|
-
logger && info(`${logger}[NILEDB_PASSWORD]
|
|
327
|
+
logger && info(`${logger}[NILEDB_PASSWORD] ***`);
|
|
328
328
|
return pass;
|
|
329
329
|
}
|
|
330
330
|
const pg2 = stringCheck(process.env.NILEDB_POSTGRES_URL);
|
|
@@ -613,7 +613,9 @@ var Config = class {
|
|
|
613
613
|
database: this.databaseName,
|
|
614
614
|
...dbConfig
|
|
615
615
|
};
|
|
616
|
-
|
|
616
|
+
const cloned = { ...this.db };
|
|
617
|
+
cloned.password = "***";
|
|
618
|
+
info("[config set]", { db: cloned, api: this.api });
|
|
617
619
|
return this;
|
|
618
620
|
} else {
|
|
619
621
|
const msg = [];
|
|
@@ -801,7 +803,9 @@ var NileDatabase = class {
|
|
|
801
803
|
const { afterCreate, ...remaining } = poolConfig;
|
|
802
804
|
config.db = poolConfig;
|
|
803
805
|
this.config = config;
|
|
804
|
-
|
|
806
|
+
const cloned = { ...this.config.db };
|
|
807
|
+
cloned.password = "***";
|
|
808
|
+
debug(`Connection pool config ${JSON.stringify(cloned)}`);
|
|
805
809
|
this.pool = createProxyForPool(new pg.Pool(remaining), this.config);
|
|
806
810
|
if (typeof afterCreate === "function") {
|
|
807
811
|
warn(
|
|
@@ -2299,6 +2303,14 @@ var Tenants = class extends Config {
|
|
|
2299
2303
|
"content-type": "application/json"
|
|
2300
2304
|
}
|
|
2301
2305
|
});
|
|
2306
|
+
} else if ("name" in req || "id" in req) {
|
|
2307
|
+
_req = new Request(`${this.api.basePath}${this.tenantsUrl}`, {
|
|
2308
|
+
body: JSON.stringify(req),
|
|
2309
|
+
method: "POST",
|
|
2310
|
+
headers: {
|
|
2311
|
+
"content-type": "application/json"
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2302
2314
|
} else {
|
|
2303
2315
|
_req = req;
|
|
2304
2316
|
}
|