mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
167 lines
7.6 KiB
TypeScript
Generated
167 lines
7.6 KiB
TypeScript
Generated
/**
|
|
* Auto-generated Zod validation schemas from the Django backend OpenAPI schema.
|
|
* To modify these schemas, update the Django serializers or views, then run:
|
|
* insightscli build:openapi
|
|
* Questions or issues? #team-devex on Slack
|
|
*
|
|
* Insights API - generated
|
|
* OpenAPI spec version: 1.0.0
|
|
*/
|
|
import * as zod from 'zod'
|
|
|
|
/**
|
|
* Create, Read, Update and Delete annotations. [See docs](https://hanzo.ai/docs/data/annotations) for more information on annotations.
|
|
*/
|
|
export const annotationsCreateBodyContentMax = 8192
|
|
|
|
export const annotationsCreateBodyEmojiMax = 16
|
|
|
|
export const AnnotationsCreateBody = /* @__PURE__ */ zod.object({
|
|
content: zod
|
|
.string()
|
|
.max(annotationsCreateBodyContentMax)
|
|
.nullish()
|
|
.describe('Annotation text shown on charts to describe the change, release, or incident.'),
|
|
date_marker: zod.iso
|
|
.datetime({ offset: true })
|
|
.nullish()
|
|
.describe('When this annotation happened (ISO 8601 timestamp). Used to position it on charts.'),
|
|
creation_type: zod
|
|
.enum(['USR', 'GIT'])
|
|
.describe('\* `USR` - user\n\* `GIT` - GitHub')
|
|
.optional()
|
|
.describe(
|
|
'Who created this annotation. Use `USR` for user-created notes and `GIT` for bot\/deployment notes.\n\n\* `USR` - user\n\* `GIT` - GitHub'
|
|
),
|
|
dashboard_item: zod.number().nullish(),
|
|
dashboard_id: zod.number().nullish(),
|
|
deleted: zod
|
|
.boolean()
|
|
.optional()
|
|
.describe('Soft-delete flag. Set to true to hide the annotation, or false to restore it.'),
|
|
scope: zod
|
|
.enum(['dashboard_item', 'dashboard', 'project', 'organization', 'recording'])
|
|
.describe(
|
|
'\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
|
|
)
|
|
.optional()
|
|
.describe(
|
|
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
|
|
),
|
|
emoji: zod
|
|
.string()
|
|
.max(annotationsCreateBodyEmojiMax)
|
|
.nullish()
|
|
.describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
|
|
hidden_in_user_interface: zod
|
|
.boolean()
|
|
.nullish()
|
|
.describe(
|
|
'When true, the annotation is hidden from the Insights UI (charts and the annotations list) but still readable over the API and MCP. Use for high-frequency markers like deployments that would otherwise crowd the UI. Null (the default) means the annotation is shown.'
|
|
),
|
|
})
|
|
|
|
/**
|
|
* Create, Read, Update and Delete annotations. [See docs](https://hanzo.ai/docs/data/annotations) for more information on annotations.
|
|
*/
|
|
export const annotationsUpdateBodyContentMax = 8192
|
|
|
|
export const annotationsUpdateBodyEmojiMax = 16
|
|
|
|
export const AnnotationsUpdateBody = /* @__PURE__ */ zod.object({
|
|
content: zod
|
|
.string()
|
|
.max(annotationsUpdateBodyContentMax)
|
|
.nullish()
|
|
.describe('Annotation text shown on charts to describe the change, release, or incident.'),
|
|
date_marker: zod.iso
|
|
.datetime({ offset: true })
|
|
.nullish()
|
|
.describe('When this annotation happened (ISO 8601 timestamp). Used to position it on charts.'),
|
|
creation_type: zod
|
|
.enum(['USR', 'GIT'])
|
|
.describe('\* `USR` - user\n\* `GIT` - GitHub')
|
|
.optional()
|
|
.describe(
|
|
'Who created this annotation. Use `USR` for user-created notes and `GIT` for bot\/deployment notes.\n\n\* `USR` - user\n\* `GIT` - GitHub'
|
|
),
|
|
dashboard_item: zod.number().nullish(),
|
|
dashboard_id: zod.number().nullish(),
|
|
deleted: zod
|
|
.boolean()
|
|
.optional()
|
|
.describe('Soft-delete flag. Set to true to hide the annotation, or false to restore it.'),
|
|
scope: zod
|
|
.enum(['dashboard_item', 'dashboard', 'project', 'organization', 'recording'])
|
|
.describe(
|
|
'\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
|
|
)
|
|
.optional()
|
|
.describe(
|
|
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
|
|
),
|
|
emoji: zod
|
|
.string()
|
|
.max(annotationsUpdateBodyEmojiMax)
|
|
.nullish()
|
|
.describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
|
|
hidden_in_user_interface: zod
|
|
.boolean()
|
|
.nullish()
|
|
.describe(
|
|
'When true, the annotation is hidden from the Insights UI (charts and the annotations list) but still readable over the API and MCP. Use for high-frequency markers like deployments that would otherwise crowd the UI. Null (the default) means the annotation is shown.'
|
|
),
|
|
})
|
|
|
|
/**
|
|
* Create, Read, Update and Delete annotations. [See docs](https://hanzo.ai/docs/data/annotations) for more information on annotations.
|
|
*/
|
|
export const annotationsPartialUpdateBodyContentMax = 8192
|
|
|
|
export const annotationsPartialUpdateBodyEmojiMax = 16
|
|
|
|
export const AnnotationsPartialUpdateBody = /* @__PURE__ */ zod.object({
|
|
content: zod
|
|
.string()
|
|
.max(annotationsPartialUpdateBodyContentMax)
|
|
.nullish()
|
|
.describe('Annotation text shown on charts to describe the change, release, or incident.'),
|
|
date_marker: zod.iso
|
|
.datetime({ offset: true })
|
|
.nullish()
|
|
.describe('When this annotation happened (ISO 8601 timestamp). Used to position it on charts.'),
|
|
creation_type: zod
|
|
.enum(['USR', 'GIT'])
|
|
.describe('\* `USR` - user\n\* `GIT` - GitHub')
|
|
.optional()
|
|
.describe(
|
|
'Who created this annotation. Use `USR` for user-created notes and `GIT` for bot\/deployment notes.\n\n\* `USR` - user\n\* `GIT` - GitHub'
|
|
),
|
|
dashboard_item: zod.number().nullish(),
|
|
dashboard_id: zod.number().nullish(),
|
|
deleted: zod
|
|
.boolean()
|
|
.optional()
|
|
.describe('Soft-delete flag. Set to true to hide the annotation, or false to restore it.'),
|
|
scope: zod
|
|
.enum(['dashboard_item', 'dashboard', 'project', 'organization', 'recording'])
|
|
.describe(
|
|
'\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
|
|
)
|
|
.optional()
|
|
.describe(
|
|
'Annotation visibility scope: `project`, `organization`, `dashboard`, or `dashboard_item`. `recording` is deprecated and rejected.\n\n\* `dashboard_item` - insight\n\* `dashboard` - dashboard\n\* `project` - project\n\* `organization` - organization\n\* `recording` - recording'
|
|
),
|
|
emoji: zod
|
|
.string()
|
|
.max(annotationsPartialUpdateBodyEmojiMax)
|
|
.nullish()
|
|
.describe('Optional emoji shown in place of the default badge when this annotation is surfaced on a chart.'),
|
|
hidden_in_user_interface: zod
|
|
.boolean()
|
|
.nullish()
|
|
.describe(
|
|
'When true, the annotation is hidden from the Insights UI (charts and the annotations list) but still readable over the API and MCP. Use for high-frequency markers like deployments that would otherwise crowd the UI. Null (the default) means the annotation is shown.'
|
|
),
|
|
})
|