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

@dbpath/environments

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbpath/environments - npm Package Compare versions

Comparing version 0.3.16 to 0.3.17

0

dist/index.d.ts
export * from './src/environments';
export * from './src/environment.fixture';
export * from './src/prettyprint';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { Environment } from "./environments";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

5

dist/src/environments.d.ts

@@ -26,10 +26,11 @@ import { ErrorsAnd, NameAnd, NameAndValidator } from "@dbpath/utils";

export declare function sqlDialect(type: string): import("@dbpath/dal").DalDialect;
export declare function dalFor(env: CommonEnvironment): Promise<ErrorsAnd<Dal>>;
export declare function dalFor(env: CommonEnvironment, shortMessages?: boolean): Promise<ErrorsAnd<Dal>>;
export interface EnvStatus {
name: string;
up: boolean;
errors?: string[];
env: CleanEnvironment;
}
export declare function envIsUp(env: CleanEnvironment): Promise<boolean>;
export declare function envIsUp(env: CleanEnvironment): Promise<ErrorsAnd<true>>;
export declare function checkStatus(envs: NameAnd<CleanEnvironment>): Promise<NameAnd<EnvStatus>>;
export declare function mapEnv<T>(e: CommonEnvironment, postGes: (e: PostgresEnv) => T, oracleFn: (e: OracleEnv) => T): T;

@@ -138,3 +138,3 @@ "use strict";

exports.sqlDialect = sqlDialect;
function dalFor(env) {
function dalFor(env, shortMessages) {
return __awaiter(this, void 0, void 0, function* () {

@@ -148,3 +148,4 @@ try {

catch (e) {
return [`Could not get a dal for ${env.type}. Is it up? try 'dbpath admin status'`, e.message];
const msgs = shortMessages ? [] : [`Could not get a dal for ${env.type}. Is it up? try 'dbpath admin status'`];
return [...msgs, e.toString()];
}

@@ -159,5 +160,5 @@ throw new Error(`Unknown environment type ${env.type}. Currently on postgres is supported. ${JSON.stringify(env)}`);

try {
let dal = yield dalFor(env);
let dal = yield dalFor(env, true);
if ((0, utils_1.hasErrors)(dal))
return false;
return dal;
try {

@@ -173,3 +174,3 @@ const dialect = sqlDialect(env.type);

catch (e) {
return false;
return [e.toString()];
}

@@ -182,4 +183,6 @@ });

let result = {};
for (const [name, env] of Object.entries(envs))
result[name] = { name, env, up: yield envIsUp(env) };
for (const [name, env] of Object.entries(envs)) {
let up = yield envIsUp(env);
result[name] = up === true ? { name, env, up: up } : { name, env, up: false, errors: up };
}
return result;

@@ -186,0 +189,0 @@ });

@@ -0,0 +0,0 @@ import { ColumnDefn, NameAnd } from "@dbpath/utils";

@@ -26,2 +26,3 @@ "use strict";

"Connection": { dataFn: (t) => (0, environments_1.mapEnv)(t.env, e => '', e => e.connection) },
"Errors": { dataFn: (t) => (0, utils_1.safeArray)(t.errors).join(' ') },
};

@@ -28,0 +29,0 @@ function prettyPrintEnvironments(envs) {

{
"name": "@dbpath/environments",
"description": "",
"version": "0.3.16",
"version": "0.3.17",
"main": "dist/index",

@@ -20,7 +20,7 @@ "types": "dist/index",

"dependencies": {
"@dbpath/utils": "0.3.16",
"@dbpath/files": "0.3.16",
"@dbpath/postgres": "0.3.16",
"@dbpath/mysql": "0.3.16",
"@dbpath/oracle": "0.3.16"
"@dbpath/utils": "0.3.17",
"@dbpath/files": "0.3.17",
"@dbpath/postgres": "0.3.17",
"@dbpath/mysql": "0.3.17",
"@dbpath/oracle": "0.3.17"
},

@@ -27,0 +27,0 @@ "devDependencies": {

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