@bonnard/sdk 0.1.3 → 0.2.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.
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bonnard SDK — Client for querying semantic layer
3
3
  */
4
- import type { BonnardConfig, QueryOptions, QueryResult, SqlResult, CubeQuery, ExploreMeta, ExploreOptions } from './types.js';
4
+ import type { BonnardConfig, QueryOptions, QueryResult, SqlResult, CubeQuery, ExploreMeta, ExploreOptions, DashboardResult, DashboardListResult } from './types.js';
5
5
  export declare function createClient(config: BonnardConfig): {
6
6
  /**
7
7
  * Execute a JSON query against the semantic layer.
@@ -25,4 +25,12 @@ export declare function createClient(config: BonnardConfig): {
25
25
  * By default returns only views (viewsOnly: true).
26
26
  */
27
27
  explore(options?: ExploreOptions): Promise<ExploreMeta>;
28
+ /**
29
+ * Fetch a single dashboard by slug.
30
+ */
31
+ getDashboard(slug: string): Promise<DashboardResult>;
32
+ /**
33
+ * List all dashboards for the current organization.
34
+ */
35
+ listDashboards(): Promise<DashboardListResult>;
28
36
  };
package/dist/client.js CHANGED
@@ -158,5 +158,17 @@ export function createClient(config) {
158
158
  }
159
159
  return meta;
160
160
  },
161
+ /**
162
+ * Fetch a single dashboard by slug.
163
+ */
164
+ async getDashboard(slug) {
165
+ return requestGet(`/api/dashboards/${encodeURIComponent(slug)}`);
166
+ },
167
+ /**
168
+ * List all dashboards for the current organization.
169
+ */
170
+ async listDashboards() {
171
+ return requestGet('/api/dashboards');
172
+ },
161
173
  };
162
174
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { createClient } from './client.js';
2
2
  export { buildCubeQuery, simplifyResult, isCubeNativeFormat } from './query.js';
3
- export type { BonnardConfig, QueryOptions, QueryResult, SqlResult, Filter, TimeDimension, InferQueryResult, CubeQuery, ExploreMeta, CubeMetaItem, CubeFieldMeta, CubeSegmentMeta, ExploreOptions, } from './types.js';
3
+ export type { BonnardConfig, QueryOptions, QueryResult, SqlResult, Filter, TimeDimension, InferQueryResult, CubeQuery, ExploreMeta, CubeMetaItem, CubeFieldMeta, CubeSegmentMeta, ExploreOptions, DashboardResult, DashboardListResult, } from './types.js';
package/dist/types.d.ts CHANGED
@@ -95,3 +95,23 @@ export interface ExploreOptions {
95
95
  export type InferQueryResult<C extends string, M extends string[], D extends string[]> = {
96
96
  [K in M[number] | D[number]]: K extends M[number] ? number : string;
97
97
  };
98
+ export interface DashboardResult {
99
+ dashboard: {
100
+ slug: string;
101
+ title: string;
102
+ description: string | null;
103
+ content: string;
104
+ version: number;
105
+ created_at: string;
106
+ updated_at: string;
107
+ };
108
+ }
109
+ export interface DashboardListResult {
110
+ dashboards: Array<{
111
+ slug: string;
112
+ title: string;
113
+ description: string | null;
114
+ version: number;
115
+ updated_at: string;
116
+ }>;
117
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonnard/sdk",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "description": "Bonnard SDK - query your semantic layer from any JavaScript or TypeScript app",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",