@bonnard/sdk 0.3.0 → 0.4.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/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, DashboardResult, DashboardListResult } from './types.js';
4
+ import type { BonnardConfig, QueryOptions, QueryResult, SqlResult, CubeQuery, ExploreMeta, ExploreOptions, DashboardResult, DashboardListResult, DocsOptions, DocsTopicListResult, DocsTopicResult } from './types.js';
5
5
  export declare function createClient(config: BonnardConfig): {
6
6
  /**
7
7
  * Execute a JSON query against the semantic layer.
@@ -30,4 +30,11 @@ export declare function createClient(config: BonnardConfig): {
30
30
  * List all dashboards for the current organization.
31
31
  */
32
32
  listDashboards(): Promise<DashboardListResult>;
33
+ /**
34
+ * Access Bonnard documentation.
35
+ * - `docs()` — list all topics
36
+ * - `docs({ category: 'dashboards' })` — list topics in a category
37
+ * - `docs({ topic: 'dashboards.components' })` — get full markdown content
38
+ */
39
+ docs(options?: DocsOptions): Promise<DocsTopicListResult | DocsTopicResult>;
33
40
  };
package/dist/client.js CHANGED
@@ -122,5 +122,20 @@ export function createClient(config) {
122
122
  async listDashboards() {
123
123
  return requestGet('/api/dashboards');
124
124
  },
125
+ /**
126
+ * Access Bonnard documentation.
127
+ * - `docs()` — list all topics
128
+ * - `docs({ category: 'dashboards' })` — list topics in a category
129
+ * - `docs({ topic: 'dashboards.components' })` — get full markdown content
130
+ */
131
+ async docs(options) {
132
+ const params = new URLSearchParams();
133
+ if (options?.topic)
134
+ params.set('topic', options.topic);
135
+ else if (options?.category)
136
+ params.set('category', options.category);
137
+ const qs = params.toString();
138
+ return requestGet(`/api/docs${qs ? `?${qs}` : ''}`);
139
+ },
125
140
  };
126
141
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { createClient } from './client.js';
2
2
  export { toCubeQuery } from './query.js';
3
- export type { BonnardConfig, QueryOptions, QueryResult, SqlResult, Filter, TimeDimension, InferQueryResult, CubeQuery, ExploreMeta, CubeMetaItem, CubeFieldMeta, CubeSegmentMeta, ExploreOptions, DashboardResult, DashboardListResult, } from './types.js';
3
+ export type { BonnardConfig, QueryOptions, QueryResult, SqlResult, Filter, TimeDimension, InferQueryResult, CubeQuery, ExploreMeta, CubeMetaItem, CubeFieldMeta, CubeSegmentMeta, ExploreOptions, DashboardResult, DashboardListResult, DocsOptions, DocsTopicSummary, DocsTopicListResult, DocsTopicResult, } from './types.js';
package/dist/types.d.ts CHANGED
@@ -114,3 +114,23 @@ export interface DashboardListResult {
114
114
  updated_at: string;
115
115
  }>;
116
116
  }
117
+ export interface DocsOptions {
118
+ topic?: string;
119
+ category?: string;
120
+ }
121
+ export interface DocsTopicSummary {
122
+ id: string;
123
+ title: string;
124
+ description: string | null;
125
+ category: string;
126
+ }
127
+ export interface DocsTopicListResult {
128
+ topics: DocsTopicSummary[];
129
+ }
130
+ export interface DocsTopicResult {
131
+ topic: {
132
+ id: string;
133
+ title: string;
134
+ content: string;
135
+ };
136
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonnard/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
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",