Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@bonnard/cli

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bonnard/cli - npm Package Compare versions

Comparing version
0.2.3
to
0.2.4
+35
dist/bin/push-Bv9AFGc2.mjs
import { n as resolveEnvVarsInCredentials, r as post, t as getLocalDatasource } from "./bon.mjs";
import pc from "picocolors";
import "@inquirer/prompts";
//#region src/commands/datasource/push.ts
/**
* Push a datasource programmatically (for use by deploy command)
* Returns true on success, false on failure
*/
async function pushDatasource(name, options = {}) {
const datasource = getLocalDatasource(name);
if (!datasource) {
if (!options.silent) console.error(pc.red(`Datasource "${name}" not found locally`));
return false;
}
const { resolved, missing } = resolveEnvVarsInCredentials(datasource.credentials);
if (missing.length > 0) {
if (!options.silent) console.error(pc.red(`Missing env vars for "${name}": ${missing.join(", ")}`));
return false;
}
try {
await post("/api/datasources", {
name: datasource.name,
warehouse_type: datasource.type,
config: datasource.config,
credentials: resolved
});
return true;
} catch {
return false;
}
}
//#endregion
export { pushDatasource };
+2
-2

@@ -38,6 +38,6 @@ # CLI

```bash
bon deploy --ci --push-datasources -m "CI deploy"
bon deploy --ci -m "CI deploy"
```
Non-interactive mode with automatic datasource sync. Fails fast if anything is misconfigured.
Non-interactive mode. Datasources are synced automatically. Fails fast if anything is misconfigured.

@@ -44,0 +44,0 @@ ## Deployment versioning

@@ -22,11 +22,12 @@ # Deploy

| `-m "message"` | **Required.** Deployment description |
| `--ci` | Non-interactive mode (fails on missing datasources) |
| `--push-datasources` | Auto-push missing datasources to Bonnard |
| `--ci` | Non-interactive mode |
Datasources are always synced automatically during deploy.
### CI/CD
For automated pipelines, combine `--ci` with `--push-datasources`:
For automated pipelines, use `--ci` for non-interactive mode:
```bash
bon deploy --ci --push-datasources -m "CI deploy"
bon deploy --ci -m "CI deploy"
```

@@ -33,0 +34,0 @@

@@ -33,3 +33,3 @@ ---

Supported types: `postgres` (also works for Redshift), `snowflake`, `bigquery`, `databricks`.
Supported types: `postgres`, `redshift`, `snowflake`, `bigquery`, `databricks`.

@@ -36,0 +36,0 @@ The demo option adds a read-only Contoso retail dataset with tables like

@@ -68,3 +68,3 @@ ---

Supported types: `postgres` (also works for Redshift), `snowflake`, `bigquery`, `databricks`.
Supported types: `postgres`, `redshift`, `snowflake`, `bigquery`, `databricks`.

@@ -71,0 +71,0 @@ The connection will be tested automatically during `bon deploy`.

@@ -68,3 +68,3 @@ # Bonnard Semantic Layer

| `bon deploy -m "message"` | Deploy to Bonnard (requires login, message required) |
| `bon deploy --ci` | Non-interactive deploy (fails on missing datasources) |
| `bon deploy --ci` | Non-interactive deploy |
| `bon deployments` | List recent deployments (add `--all` for full history) |

@@ -121,3 +121,3 @@ | `bon diff <deployment-id>` | Show changes in a deployment (`--breaking` for breaking only) |

For CI/CD pipelines, use `bon deploy --ci -m "message"` (non-interactive, fails on issues) or `bon deploy --push-datasources -m "message"` to auto-push missing datasources.
For CI/CD pipelines, use `bon deploy --ci -m "message"` (non-interactive, fails on issues). Datasources are always synced automatically during deploy.

@@ -124,0 +124,0 @@ ## Best Practices

{
"name": "@bonnard/cli",
"version": "0.2.3",
"version": "0.2.4",
"type": "module",

@@ -5,0 +5,0 @@ "bin": {

import { n as resolveEnvVarsInCredentials, r as post, t as getLocalDatasource } from "./bon.mjs";
import pc from "picocolors";
import { confirm } from "@inquirer/prompts";
//#region src/commands/datasource/push.ts
/**
* Push a datasource programmatically (for use by deploy command)
* Returns true on success, false on failure
*/
async function pushDatasource(name, options = {}) {
const datasource = getLocalDatasource(name);
if (!datasource) {
if (!options.silent) console.error(pc.red(`Datasource "${name}" not found locally`));
return false;
}
const { resolved, missing } = resolveEnvVarsInCredentials(datasource.credentials);
if (missing.length > 0) {
if (!options.silent) console.error(pc.red(`Missing env vars for "${name}": ${missing.join(", ")}`));
return false;
}
try {
await post("/api/datasources", {
name: datasource.name,
warehouse_type: datasource.type,
config: datasource.config,
credentials: resolved
});
return true;
} catch {
return false;
}
}
//#endregion
export { pushDatasource };

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet