Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions integrations/attio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
},
"devDependencies": {
"@botpress/cli": "workspace:*",
"@botpress/sdk": "workspace:*",
"@types/node": "^22.16.4",
"typescript": "^5.6.3"
"@botpress/sdk": "workspace:*"
}
}
4 changes: 1 addition & 3 deletions integrations/bamboohr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
"@botpress/common": "workspace:*",
"@botpress/sdk": "workspace:*",
"@types/jsonwebtoken": "^9.0.3",
"@types/lodash": "^4.14.191",
"@types/node": "^22.16.4",
"typescript": "^5.6.3"
"@types/lodash": "^4.14.191"
}
}
4 changes: 1 addition & 3 deletions integrations/feature-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
},
"devDependencies": {
"@botpress/cli": "workspace:*",
"@botpress/sdk": "workspace:*",
"@types/node": "^22.16.4",
"typescript": "^5.6.3"
"@botpress/sdk": "workspace:*"
}
}
2 changes: 0 additions & 2 deletions integrations/grafana/.gitignore

This file was deleted.

5 changes: 2 additions & 3 deletions integrations/grafana/definitions/dashboard-schemas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { z } from '@botpress/sdk'
import type { TextPanel, TimeSeriesPanel } from '../src/gen/types/GrafanaDashboard'

export const gridPosSchema = z.object({
h: z.number().optional().title('Height').describe('Panel height in grid units'),
Expand All @@ -20,7 +19,7 @@ export const textPanelSchema = z.object({
.describe('Rendering mode for the content'),
id: z.number().optional().title('ID').describe('Numeric panel ID (assigned by Grafana)'),
gridPos: gridPosSchema.optional().title('Grid Position').describe('Position and size of the panel in the grid'),
}) satisfies z.ZodType<Partial<TextPanel>>
})

export const datasourceSchema = z.object({
type: z.string().title('Type').describe('Datasource type (e.g. "prometheus")'),
Expand All @@ -47,7 +46,7 @@ export const timeSeriesPanelSchema = z.object({
.describe('Query targets for this panel'),
fieldConfig: z.any().optional().title('Field Config').describe('Field display configuration'),
options: z.any().optional().title('Options').describe('Panel display options'),
}) satisfies z.ZodType<Partial<TimeSeriesPanel>>
})

export const panelSchema = z.discriminatedUnion('type', [textPanelSchema, timeSeriesPanelSchema])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Grafana's Kubernetes-style API (`/apis/...`). These must be fetched from a live
"https://your-stack.grafana.net/openapi/v3" | python3 -m json.tool | grep "grafana.app"
```
- **Re-fetch**:

```sh
TOKEN="your-grafana-service-account-token"
BASE="https://your-stack.grafana.net"
Expand Down
1,154 changes: 1,154 additions & 0 deletions integrations/grafana/grafana-api/grafana-dashboard-k8s.json

Large diffs are not rendered by default.

1,244 changes: 1,244 additions & 0 deletions integrations/grafana/grafana-api/grafana-folder-k8s.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions integrations/grafana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"check:type": "tsc --noEmit",
"check:bplint": "bp lint",
"test": "vitest --run",
"generate:k8s": "openapi-ts -i ./src/gen/specs/grafana-dashboard-k8s.json ./src/gen/specs/grafana-folder-k8s.json -o ./src/gen/grafana-k8s-client -c @hey-api/client-fetch",
"generate:legacy": "openapi-ts -i ./src/gen/specs/grafana-legacy.json -o ./src/gen/grafana-legacy-client -c @hey-api/client-fetch",
"generate:k8s": "openapi-ts -i ./grafana-api/grafana-dashboard-k8s.json ./grafana-api/grafana-folder-k8s.json -o ./src/gen/grafana-k8s-client -c @hey-api/client-fetch",
"generate:legacy": "openapi-ts -i ./grafana-api/grafana-legacy.json -o ./src/gen/grafana-legacy-client -c @hey-api/client-fetch",
"generate": "pnpm run generate:k8s && pnpm run generate:legacy"
},
"private": true,
Expand All @@ -16,8 +16,6 @@
"devDependencies": {
"@botpress/cli": "workspace:*",
"@hey-api/client-fetch": "^0.13.1",
"@hey-api/openapi-ts": "^0.97.1",
"@types/node": "^22.16.4",
"typescript": "^5.6.3"
"@hey-api/openapi-ts": "^0.97.1"
}
}
43 changes: 42 additions & 1 deletion integrations/grafana/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
createClient as createLegacyClient,
createConfig as createLegacyConfig,
} from './gen/grafana-legacy-client/client'
import type { Panel } from './gen/types/GrafanaDashboard'

export type GrafanaConfig = {
grafanaUsername: string
Expand All @@ -43,6 +42,48 @@ type CreateFolderInput = z.infer<typeof createFolderSchema>
type PolicyMatcher = z.infer<typeof matcherSchema>
type NotificationPolicyInput = z.infer<typeof notificationPolicySchema>

type Datasource = {
type: string
uid: string
}

type Target = {
refId: string
datasource?: Datasource
expr?: string
}

type GridPos = {
h?: number
w?: number
x?: number
y?: number
}

type TextPanel = {
type: 'text'
title: string
description?: string
content?: string
mode?: 'markdown' | 'html' | 'code'
gridPos?: GridPos
id?: number
}

type TimeSeriesPanel = {
type: 'timeseries'
title: string
description?: string
datasource?: Datasource
gridPos?: GridPos
id?: number
targets?: Target[]
fieldConfig?: any
options?: any
}

type Panel = TextPanel | TimeSeriesPanel

type CreateDashboardInput = {
uid: string
title: string
Expand Down
Binary file removed integrations/grafana/src/gen/.DS_Store
Binary file not shown.
16 changes: 0 additions & 16 deletions integrations/grafana/src/gen/grafana-k8s-client/client.gen.ts

This file was deleted.

Loading
Loading