From 173ef7686006fefee899b9f00b8f91972c843931 Mon Sep 17 00:00:00 2001 From: "oly-agents[bot]" <312679908+oly-agents[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:47:24 +0000 Subject: [PATCH 1/2] api: add OpenAPI spec for /api/v1, generate web types, check drift - api/openapi.yaml: OpenAPI 3.1 spec for all 21 /api/v1 routes, written from the Go handlers, with lint rules in api/redocly.yaml. - internal/pkg/heimdall/openapi_test.go: fails when the spec and the registered routes, the Go JSON fields or the status enums differ. The routes move to apiRoutes() so the test reads the real list. - web: openapi-typescript makes src/common/api/schema.d.ts (pnpm gen:api). The hand-written API types are replaced by aliases in src/common/api/types.ts. - build.sh --test runs pnpm check:api, so the required build check fails when schema.d.ts is not the output of the spec. Co-Authored-By: Claude Opus 5.5 Co-authored-by: Gaurav Warale --- README.md | 2 + api/README.md | 44 + api/openapi.yaml | 1049 ++++++++++++++ api/redocly.yaml | 6 + build.sh | 2 + internal/pkg/heimdall/heimdall.go | 58 +- internal/pkg/heimdall/openapi_test.go | 265 ++++ web/.prettierignore | 1 + web/AGENTS.md | 10 + web/package.json | 3 + web/pnpm-lock.yaml | 439 ++++-- web/src/app/api/clusters/clusters.ts | 35 +- web/src/app/api/commands/commands.ts | 30 +- web/src/app/api/jobs/jobs.ts | 49 +- web/src/common/Services/index.test.ts | 4 + web/src/common/Services/index.ts | 3 +- web/src/common/Services/status.test.ts | 2 +- web/src/common/Services/status.ts | 6 +- web/src/common/api/context.ts | 23 + web/src/common/api/schema.d.ts | 1235 +++++++++++++++++ web/src/common/api/types.ts | 27 + web/src/modules/Clusters/Clusters.tsx | 14 +- .../ClusterInformationPane.tsx | 24 +- .../ClustersDetails/ClustersDetails.tsx | 3 +- web/src/modules/Clusters/Helper.tsx | 33 +- .../CommandDetails/CommandDetails.tsx | 3 +- .../CommandDetails/CommandInformationPane.tsx | 15 +- web/src/modules/Commands/Commands.tsx | 14 +- web/src/modules/Commands/Helper.tsx | 42 +- web/src/modules/Jobs/Helper.tsx | 56 +- .../Jobs/JobDetails/CancelJobButton.tsx | 10 +- .../modules/Jobs/JobDetails/JobDetails.tsx | 8 +- .../Jobs/JobDetails/JobInformationPane.tsx | 12 +- web/src/modules/Jobs/Jobs.tsx | 9 +- web/src/test/fixtures/clusters.ts | 10 +- web/src/test/fixtures/commands.ts | 16 +- web/src/test/fixtures/jobs.ts | 12 +- web/src/test/integration/jobs.test.tsx | 2 +- 38 files changed, 3176 insertions(+), 400 deletions(-) create mode 100644 api/README.md create mode 100644 api/openapi.yaml create mode 100644 api/redocly.yaml create mode 100644 internal/pkg/heimdall/openapi_test.go create mode 100644 web/src/common/api/context.ts create mode 100644 web/src/common/api/schema.d.ts create mode 100644 web/src/common/api/types.ts diff --git a/README.md b/README.md index c8f25c2..605d3eb 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ Heimdall includes a web interface running alongside the API. * **API**: `http://localhost:9090/api/v1` * **Web UI**: `http://localhost:9090/ui` +The API contract is the OpenAPI spec in [`api/openapi.yaml`](api/openapi.yaml). The web UI uses TypeScript types that are made from it. [`api/README.md`](api/README.md) tells you how to change the spec and make the types again. + --- ## 🚀 Getting Started diff --git a/api/README.md b/api/README.md new file mode 100644 index 0000000..3f75aaa --- /dev/null +++ b/api/README.md @@ -0,0 +1,44 @@ +# Heimdall API contract + +`openapi.yaml` is the OpenAPI 3.1 spec of the `/api/v1` routes of the Go service. +It is the contract between the Go API and the web UI in `web/`. + +> **Status: draft.** The spec was written by hand from the Go handlers. The Go API +> owners must confirm it. + +## Files + +| File | What it is | +| --- | --- | +| `api/openapi.yaml` | The spec. Edit this file by hand. | +| `api/redocly.yaml` | Lint rules for the spec (Redocly `recommended`). | +| `web/src/common/api/schema.d.ts` | TypeScript types made from the spec. Do not edit. | +| `web/src/common/api/types.ts` | Short type names that the web code imports. | +| `internal/pkg/heimdall/openapi_test.go` | Go test that compares the spec with the Go routes and structs. | + +## How to change the API + +1. Change the Go handler, route or struct. +2. Change `api/openapi.yaml` to match. +3. Make the web types again. Run this from `web/`: + + ```bash + pnpm gen:api + ``` + +4. Commit the spec and `web/src/common/api/schema.d.ts` together. + +## Checks + +`./build.sh --test` runs two checks. CI runs them in the required `build` check. + +- `go test ./internal/pkg/...` runs `openapi_test.go`. It fails when: + - a route in `apiRoutes()` is not in the spec, or a spec path has no route + - a spec path does not reach its own route (the router matches path prefixes in order) + - the properties of a schema are not the JSON fields of its Go struct + - the `JobStatus` or `ResourceStatus` enum is not the same as the Go status values +- `pnpm check:api` (from `web/`) lints the spec and fails when `schema.d.ts` is not + the output of `pnpm gen:api`. + +The Go test cannot check field types, which fields are required, or status codes. +Review those by hand when you change a handler. diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..3e96866 --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,1049 @@ +openapi: 3.1.0 +info: + title: Heimdall API + version: 1.0.0-draft + license: + name: Apache-2.0 + identifier: Apache-2.0 + description: | + REST API of the Heimdall service, served under `/api/v1`. + + This spec is written by hand from the Go handlers in `internal/pkg/heimdall`. + It is a draft. The Go API owners must confirm it. See `api/README.md`. + + Request rules that apply to every operation: + + - The server reads the caller from a request header. The auth plugin sets the + header name (`X-Heimdall-User` in `configs/local.yaml`). A request that is not + a `GET` and has no caller gets `401`. + - Path parameters and query parameters override fields with the same name in + the JSON body. The server always sets `user` to the caller. + - Every error body is an `Error` object. Most errors use status `500`, which + includes unknown IDs. The only other error codes are `401`, `403` and + `404` (job result not ready). + - Any other path under `/api/v1` gets `500` with + `{"error": "unknown endpoint: "}`. +servers: + - url: /api/v1 +security: + - HeimdallUser: [] + - {} +tags: + - name: jobs + description: Submit, read and cancel jobs. + - name: commands + description: Read and register commands. + - name: clusters + description: Read and register clusters, and run cluster health checks. +paths: + /jobs: + get: + tags: [jobs] + operationId: listJobs + summary: List jobs, one page at a time + description: | + Text filters use SQL `LIKE`, so `%` is a wildcard. The server sorts on + `order_by` and uses the internal row ID to break ties. To get the next + page, send `next_cursor` from the last page as `cursor`, with the same + filters and sort. + parameters: + - $ref: '#/components/parameters/UsernameFilter' + - $ref: '#/components/parameters/IdFilter' + - $ref: '#/components/parameters/NameFilter' + - $ref: '#/components/parameters/VersionFilter' + - name: command + in: query + description: Filter on the command name (SQL `LIKE`). + schema: + type: string + - name: cluster + in: query + description: Filter on the cluster name (SQL `LIKE`). + schema: + type: string + - $ref: '#/components/parameters/StatusFilter' + - name: tags + in: query + description: Job tags, for example `team:data`. A job must have all of the tags. + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: Page size. Values below 1 or that are not numbers use the default. Values above 101 use 101. + schema: + type: integer + minimum: 1 + maximum: 101 + default: 101 + - name: cursor + in: query + description: The `next_cursor` value from the last page. Do not send it for the first page. + schema: + type: string + - name: order_by + in: query + description: Sort column. Other values sort on the internal row ID. + schema: + type: string + enum: [id, created_at, updated_at] + - name: direction + in: query + description: Sort direction. Values other than `asc` sort descending. + schema: + type: string + enum: [asc, desc] + default: desc + responses: + '200': + description: One page of jobs. + content: + application/json: + schema: + $ref: '#/components/schemas/JobsPage' + '500': + $ref: '#/components/responses/ServerError' + /job: + post: + tags: [jobs] + operationId: submitJob + summary: Submit a job + description: | + The server selects an active command whose tags contain + `command_criteria`, and an active cluster whose tags contain the + command's `cluster_tags` and `cluster_criteria`. If more than one pair + matches, the server selects one at random. + + For an async command, the server stores the job and returns it with + status `NEW`. For a sync command, the server runs the job before it + responds, and the response can contain `result`. + security: + - HeimdallUser: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/JobInput' + responses: + '200': + description: The accepted job. For a sync job, the job after it ran. + content: + application/json: + schema: + $ref: '#/components/schemas/SubmittedJob' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: The caller is not in the `allowed_callers` list of the selected command. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + $ref: '#/components/responses/ServerError' + /job/statuses: + get: + tags: [jobs] + operationId: getJobStatuses + summary: List all job status names + responses: + '200': + description: All job status names, sorted. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/JobStatus' + '500': + $ref: '#/components/responses/ServerError' + /job/{id}: + get: + tags: [jobs] + operationId: getJob + summary: Get a job + parameters: + - $ref: '#/components/parameters/JobId' + responses: + '200': + description: The job. + content: + application/json: + schema: + $ref: '#/components/schemas/Job' + '500': + $ref: '#/components/responses/ServerError' + /job/{id}/status: + get: + tags: [jobs] + operationId: getJobStatus + summary: Get the status of a job + parameters: + - $ref: '#/components/parameters/JobId' + responses: + '200': + description: The status fields of the job. + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatusSnapshot' + '500': + $ref: '#/components/responses/ServerError' + /job/{id}/cancel: + post: + tags: [jobs] + operationId: cancelJob + summary: Cancel a job + description: | + Sets the job status to `CANCELING`. The job must not be in a final + status (`FAILED`, `KILLED`, `SUCCEEDED` or `CANCELED`). The server sends + no request body to the handler, so send an empty body. + security: + - HeimdallUser: [] + parameters: + - $ref: '#/components/parameters/JobId' + responses: + '200': + description: The job is now canceling. + content: + application/json: + schema: + $ref: '#/components/schemas/JobCancelResponse' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/ServerError' + /job/{id}/{file}: + get: + tags: [jobs] + operationId: getJobFile + summary: Get an output file of a job + description: | + `stdout` and `stderr` are plain text. `result` is JSON. Only the user + who submitted the job can get `result`, and only after the job + succeeded. + parameters: + - $ref: '#/components/parameters/JobId' + - name: file + in: path + required: true + schema: + type: string + enum: [stdout, stderr, result] + responses: + '200': + description: The file content. + content: + text/plain: + schema: + type: string + application/json: + schema: + $ref: '#/components/schemas/Result' + '403': + description: '`result` only. The caller did not submit the job.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: '`result` only. The job did not succeed.' + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '500': + $ref: '#/components/responses/ServerError' + /commands: + get: + tags: [commands] + operationId: listCommands + summary: List commands + description: Returns 101 commands or fewer, newest first. Text filters use SQL `LIKE`. + parameters: + - $ref: '#/components/parameters/UsernameFilter' + - $ref: '#/components/parameters/IdFilter' + - $ref: '#/components/parameters/NameFilter' + - $ref: '#/components/parameters/VersionFilter' + - name: plugin + in: query + description: Filter on the plugin name (SQL `LIKE`). + schema: + type: string + - $ref: '#/components/parameters/StatusFilter' + responses: + '200': + description: The commands that match the filters. + content: + application/json: + schema: + $ref: '#/components/schemas/CommandsPage' + '500': + $ref: '#/components/responses/ServerError' + /command/statuses: + get: + tags: [commands] + operationId: getCommandStatuses + summary: List all command status names + responses: + '200': + description: All command status names, sorted. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceStatus' + '500': + $ref: '#/components/responses/ServerError' + /command/{id}: + get: + tags: [commands] + operationId: getCommand + summary: Get a command + parameters: + - $ref: '#/components/parameters/CommandId' + responses: + '200': + description: The command. + content: + application/json: + schema: + $ref: '#/components/schemas/Command' + '500': + $ref: '#/components/responses/ServerError' + put: + tags: [commands] + operationId: upsertCommand + summary: Create or replace a command + description: | + Writes the command to the database. The running server does not load a + plugin handler for it, so jobs cannot use the command until the server + restarts with it in its config. + security: + - HeimdallUser: [] + parameters: + - $ref: '#/components/parameters/CommandId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CommandInput' + responses: + '200': + description: The stored command. + content: + application/json: + schema: + $ref: '#/components/schemas/Command' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/ServerError' + /command/{id}/status: + get: + tags: [commands] + operationId: getCommandStatus + summary: Get the status of a command + parameters: + - $ref: '#/components/parameters/CommandId' + responses: + '200': + description: The status fields of the command. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceStatusSnapshot' + '500': + $ref: '#/components/responses/ServerError' + put: + tags: [commands] + operationId: updateCommandStatus + summary: Set the status of a command + security: + - HeimdallUser: [] + parameters: + - $ref: '#/components/parameters/CommandId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StatusUpdate' + responses: + '200': + description: The status fields of the command after the update. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceStatusSnapshot' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/ServerError' + /clusters: + get: + tags: [clusters] + operationId: listClusters + summary: List clusters + description: Returns 101 clusters or fewer, newest first. Text filters use SQL `LIKE`. + parameters: + - $ref: '#/components/parameters/UsernameFilter' + - $ref: '#/components/parameters/IdFilter' + - $ref: '#/components/parameters/NameFilter' + - $ref: '#/components/parameters/VersionFilter' + - $ref: '#/components/parameters/StatusFilter' + responses: + '200': + description: The clusters that match the filters. + content: + application/json: + schema: + $ref: '#/components/schemas/ClustersPage' + '500': + $ref: '#/components/responses/ServerError' + /cluster/statuses: + get: + tags: [clusters] + operationId: getClusterStatuses + summary: List all cluster status names + responses: + '200': + description: All cluster status names, sorted. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ResourceStatus' + '500': + $ref: '#/components/responses/ServerError' + /clusters/health: + get: + tags: [clusters] + operationId: getClustersHealth + summary: Run health checks on all clusters + description: | + Checks each active cluster from the server config that has + `health_check` set and matches an active command. The status code is + `200` when no check has status `error`, and `503` when one or more do. + responses: + '200': + description: No check failed. + content: + application/json: + schema: + $ref: '#/components/schemas/HealthChecks' + '500': + $ref: '#/components/responses/ServerError' + '503': + description: One or more checks failed. + content: + application/json: + schema: + $ref: '#/components/schemas/HealthChecks' + /cluster/{id}/health: + get: + tags: [clusters] + operationId: getClusterHealth + summary: Run a health check on one cluster + description: | + The cluster must be in the server config and have `health_check` set. + The status code is `200` also when the check fails. Read `healthy`. + parameters: + - $ref: '#/components/parameters/ClusterId' + responses: + '200': + description: The result of the check. + content: + application/json: + schema: + $ref: '#/components/schemas/HealthChecks' + '500': + $ref: '#/components/responses/ServerError' + /cluster/{id}: + get: + tags: [clusters] + operationId: getCluster + summary: Get a cluster + parameters: + - $ref: '#/components/parameters/ClusterId' + responses: + '200': + description: The cluster. + content: + application/json: + schema: + $ref: '#/components/schemas/Cluster' + '500': + $ref: '#/components/responses/ServerError' + put: + tags: [clusters] + operationId: upsertCluster + summary: Create or replace a cluster + description: | + Writes the cluster to the database. The server does not store + `health_check`, `rbacs` or `attributes`, and health checks and job + routing use the server config, not this record. + security: + - HeimdallUser: [] + parameters: + - $ref: '#/components/parameters/ClusterId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterInput' + responses: + '200': + description: The stored cluster. + content: + application/json: + schema: + $ref: '#/components/schemas/Cluster' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/ServerError' + /cluster/{id}/status: + get: + tags: [clusters] + operationId: getClusterStatus + summary: Get the status of a cluster + parameters: + - $ref: '#/components/parameters/ClusterId' + responses: + '200': + description: The status fields of the cluster. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceStatusSnapshot' + '500': + $ref: '#/components/responses/ServerError' + put: + tags: [clusters] + operationId: updateClusterStatus + summary: Set the status of a cluster + security: + - HeimdallUser: [] + parameters: + - $ref: '#/components/parameters/ClusterId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/StatusUpdate' + responses: + '200': + description: The status fields of the cluster after the update. + content: + application/json: + schema: + $ref: '#/components/schemas/ResourceStatusSnapshot' + '401': + $ref: '#/components/responses/Unauthorized' + '500': + $ref: '#/components/responses/ServerError' +components: + securitySchemes: + HeimdallUser: + type: apiKey + in: header + name: X-Heimdall-User + description: | + The caller's user name. The auth plugin config sets the header name. + `X-Heimdall-User` is the value in `configs/local.yaml`. + parameters: + JobId: + name: id + in: path + required: true + description: Job ID (a UUID that the server issues). + schema: + type: string + CommandId: + name: id + in: path + required: true + description: Command ID. + schema: + type: string + ClusterId: + name: id + in: path + required: true + description: Cluster ID. + schema: + type: string + UsernameFilter: + name: username + in: query + description: Filter on the user name (SQL `LIKE`). + schema: + type: string + IdFilter: + name: id + in: query + description: Filter on the ID (SQL `LIKE`). + schema: + type: string + NameFilter: + name: name + in: query + description: Filter on the name (SQL `LIKE`). + schema: + type: string + VersionFilter: + name: version + in: query + description: Filter on the version (SQL `LIKE`). + schema: + type: string + StatusFilter: + name: status + in: query + description: Status names, for example `RUNNING,FAILED`. An item matches one of them. + style: form + explode: false + schema: + type: array + items: + type: string + responses: + Unauthorized: + description: The request has no caller. Only requests that are not `GET` need a caller. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + ServerError: + description: | + Any other error, for example an unknown ID, a body that is not valid + JSON, or a database error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + schemas: + Error: + type: object + description: Error body for every error response. + required: [error] + properties: + error: + type: string + description: The error message. + id: + type: string + description: ID of the object in the request, when the handler had one (for example the job ID of a sync job that failed). + JobStatus: + type: string + enum: [NEW, ACCEPTED, RUNNING, FAILED, KILLED, SUCCEEDED, CANCELING, CANCELED] + ResourceStatus: + type: string + description: Status of a command or a cluster. + enum: [ACTIVE, INACTIVE, DELETED] + StatusInput: + type: string + description: A `ResourceStatus` value. The server ignores case, so `Active` is also correct. + enum: [ACTIVE, INACTIVE, DELETED, active, inactive, deleted] + Context: + type: object + description: | + Free-form settings. The plugin sets the keys. The server replaces the + values of sensitive keys (`password`, `private_key`, `token` and the + keys in `sensitive_context_keys`) with `REDACTED`. + additionalProperties: true + Tags: + type: array + description: A set of strings, sorted, with no duplicates. + uniqueItems: true + items: + type: string + Timestamp: + type: integer + description: Unix time in seconds. + JobAttribute: + type: object + description: A value that the cluster `attributes` templates make for a job. + properties: + kind: + type: string + description: How the UI shows the value. Values are `link` and `text`. + value: + type: string + ResultColumn: + type: object + properties: + name: + type: string + type: + type: string + description: Column type name, for example `string`, `long` or a database type name. + Result: + type: object + description: Tabular result of a job. + properties: + columns: + type: array + items: + $ref: '#/components/schemas/ResultColumn' + data: + type: array + description: Rows. Each row has one value for each column. + items: + type: array + items: {} + Job: + type: object + description: | + A stored job, from `GET /job/{id}` and `GET /jobs`. The server leaves + out fields that are empty, zero or false. + required: [id, status, user, tags, command_criteria, cluster_criteria, created_at, updated_at] + properties: + id: + type: string + name: + type: string + version: + type: string + user: + type: string + description: The user who submitted the job. + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + created_at: + $ref: '#/components/schemas/Timestamp' + updated_at: + $ref: '#/components/schemas/Timestamp' + status: + $ref: '#/components/schemas/JobStatus' + is_sync: + type: boolean + description: The job ran in the request. The server leaves out `false`. + store_result_sync: + type: boolean + description: For a sync job, the server writes the result before it responds. The server leaves out `false`. + error: + type: string + description: Error message of a failed job. + command_criteria: + $ref: '#/components/schemas/Tags' + cluster_criteria: + $ref: '#/components/schemas/Tags' + command_id: + type: string + command_name: + type: string + cluster_id: + type: string + cluster_name: + type: string + canceled_by: + type: string + description: The user who canceled the job. + job_attributes: + type: object + additionalProperties: + $ref: '#/components/schemas/JobAttribute' + SubmittedJob: + type: object + description: | + The job from `POST /job`. It does not contain the command, cluster or + time fields. The server leaves out fields that are empty, zero or false. + required: [id, status, user, tags] + properties: + id: + type: string + name: + type: string + version: + type: string + user: + type: string + description: The user who submitted the job. + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + created_at: + $ref: '#/components/schemas/Timestamp' + updated_at: + $ref: '#/components/schemas/Timestamp' + status: + $ref: '#/components/schemas/JobStatus' + is_sync: + type: boolean + description: The job ran in the request. The server leaves out `false`. + store_result_sync: + type: boolean + description: For a sync job, the server writes the result before it responds. The server leaves out `false`. + error: + type: string + description: Error message of a failed job. + command_criteria: + $ref: '#/components/schemas/Tags' + cluster_criteria: + $ref: '#/components/schemas/Tags' + command_id: + type: string + command_name: + type: string + cluster_id: + type: string + cluster_name: + type: string + canceled_by: + type: string + description: The user who canceled the job. + job_attributes: + type: object + additionalProperties: + $ref: '#/components/schemas/JobAttribute' + result: + $ref: '#/components/schemas/Result' + JobInput: + type: object + description: Body of `POST /job`. The server issues the job ID and ignores other job fields. + required: [command_criteria, cluster_criteria] + properties: + name: + type: string + version: + type: string + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + command_criteria: + $ref: '#/components/schemas/Tags' + cluster_criteria: + $ref: '#/components/schemas/Tags' + store_result_sync: + type: boolean + JobStatusSnapshot: + type: object + required: [status, updated_at, user] + properties: + status: + $ref: '#/components/schemas/JobStatus' + error: + type: string + updated_at: + $ref: '#/components/schemas/Timestamp' + user: + type: string + JobCancelResponse: + type: object + required: [status] + properties: + status: + type: string + const: CANCELING + JobsPage: + type: object + required: [data] + properties: + data: + type: array + items: + $ref: '#/components/schemas/Job' + has_more: + type: boolean + description: More rows exist. The server leaves out `false`. + next_cursor: + type: string + description: Send as `cursor` to get the next page. Present only when `has_more` is true. + Command: + type: object + description: A stored command. The server leaves out fields that are empty, zero or false. + required: [id, status, user, tags, cluster_tags, created_at, updated_at] + properties: + id: + type: string + name: + type: string + version: + type: string + user: + type: string + description: The user who last wrote the command. + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + created_at: + $ref: '#/components/schemas/Timestamp' + updated_at: + $ref: '#/components/schemas/Timestamp' + status: + $ref: '#/components/schemas/ResourceStatus' + plugin: + type: string + is_sync: + type: boolean + description: Jobs run in the request. The server leaves out `false`. + cluster_tags: + $ref: '#/components/schemas/Tags' + CommandInput: + type: object + description: Body of `PUT /command/{id}`. The path sets the ID. + required: [status, plugin] + properties: + name: + type: string + version: + type: string + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + status: + $ref: '#/components/schemas/StatusInput' + plugin: + type: string + is_sync: + type: boolean + cluster_tags: + $ref: '#/components/schemas/Tags' + allowed_callers: + type: array + description: The server accepts this field but does not store it. + items: + type: string + CommandsPage: + type: object + required: [data] + properties: + data: + type: array + items: + $ref: '#/components/schemas/Command' + Cluster: + type: object + description: A stored cluster. The server leaves out fields that are empty or zero. + required: [id, status, user, tags, created_at, updated_at] + properties: + id: + type: string + name: + type: string + version: + type: string + user: + type: string + description: The user who last wrote the cluster. + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + created_at: + $ref: '#/components/schemas/Timestamp' + updated_at: + $ref: '#/components/schemas/Timestamp' + status: + $ref: '#/components/schemas/ResourceStatus' + ClusterInput: + type: object + description: Body of `PUT /cluster/{id}`. The path sets the ID. + required: [status] + properties: + name: + type: string + version: + type: string + description: + type: string + tags: + $ref: '#/components/schemas/Tags' + context: + $ref: '#/components/schemas/Context' + status: + $ref: '#/components/schemas/StatusInput' + health_check: + type: boolean + description: The server accepts this field but does not store it. + rbacs: + type: array + description: The server accepts this field but does not store it. + items: + type: string + attributes: + type: object + description: The server accepts this field but does not store it. + additionalProperties: + $ref: '#/components/schemas/JobAttribute' + ClustersPage: + type: object + required: [data] + properties: + data: + type: array + items: + $ref: '#/components/schemas/Cluster' + StatusUpdate: + type: object + required: [status] + properties: + status: + $ref: '#/components/schemas/StatusInput' + ResourceStatusSnapshot: + type: object + required: [status, updated_at] + properties: + status: + $ref: '#/components/schemas/ResourceStatus' + updated_at: + $ref: '#/components/schemas/Timestamp' + HealthCheckResult: + type: object + required: [cluster_id, cluster_name, plugin, status, latency_ms] + properties: + cluster_id: + type: string + cluster_name: + type: string + plugin: + type: string + description: Plugin of the command that the check used. + status: + type: string + enum: [ok, error, unchecked] + description: '`unchecked` means that the plugin has no health check.' + latency_ms: + type: integer + error: + type: string + HealthChecks: + type: object + required: [healthy, checks] + properties: + healthy: + type: boolean + description: No check has status `error`. + checks: + type: array + items: + $ref: '#/components/schemas/HealthCheckResult' diff --git a/api/redocly.yaml b/api/redocly.yaml new file mode 100644 index 0000000..d9a9cdb --- /dev/null +++ b/api/redocly.yaml @@ -0,0 +1,6 @@ +extends: + - recommended +rules: + operation-operationId-unique: error + # The server sends 500 for an unknown ID on GET routes, so these operations have no 4XX response to document. + operation-4xx-response: off diff --git a/build.sh b/build.sh index 92a9d78..ec108c0 100755 --- a/build.sh +++ b/build.sh @@ -43,6 +43,8 @@ if [ "${RUN_TESTS}" = "true" ]; then (cd ${WORKING_DIR} && go test ./internal/pkg/... && go test ./pkg/...) # unit, integration and snapshot tests; fails on a failing test or coverage below the threshold install_web_deps + # fails when web/src/common/api/schema.d.ts is not the output of `pnpm gen:api` for api/openapi.yaml (also lints the spec) + (cd ${WORKING_DIR}/web && pnpm check:api) (cd ${WORKING_DIR}/web && pnpm test) fi diff --git a/internal/pkg/heimdall/heimdall.go b/internal/pkg/heimdall/heimdall.go index 2534e8a..dc6c8a5 100644 --- a/internal/pkg/heimdall/heimdall.go +++ b/internal/pkg/heimdall/heimdall.go @@ -169,6 +169,39 @@ func (h *Heimdall) Init() error { } +type apiRoute struct { + method string + path string + handler http.HandlerFunc +} + +// apiRoutes lists the /api/v1 routes in match order: the router uses path prefixes, so a longer path must come before a shorter path that it starts with. +func (h *Heimdall) apiRoutes() []apiRoute { + return []apiRoute{ + {methodGET, `/job/statuses`, payloadHandler(h.getJobStatuses)}, + {methodGET, `/job/{id}/status`, payloadHandler(h.getJobStatus)}, + {methodPOST, `/job/{id}/cancel`, payloadHandler(h.cancelJob)}, + {methodGET, `/job/{id}/{file}`, h.getJobFile}, + {methodGET, `/job/{id}`, payloadHandler(h.getJob)}, + {methodGET, `/jobs`, payloadHandler(h.getJobs)}, + {methodPOST, `/job`, payloadHandler(h.submitJob)}, + {methodGET, `/command/statuses`, payloadHandler(h.getCommandStatuses)}, + {methodGET, `/command/{id}/status`, payloadHandler(h.getCommandStatus)}, + {methodPUT, `/command/{id}/status`, payloadHandler(h.updateCommandStatus)}, + {methodPUT, `/command/{id}`, payloadHandler(h.submitCommand)}, + {methodGET, `/command/{id}`, payloadHandler(h.getCommand)}, + {methodGET, `/commands`, payloadHandler(h.getCommands)}, + {methodGET, `/cluster/statuses`, payloadHandler(h.getClusterStatuses)}, + {methodGET, `/clusters/health`, h.getClustersHealth}, + {methodGET, `/cluster/{id}/health`, payloadHandler(h.getClusterHealth)}, + {methodGET, `/cluster/{id}/status`, payloadHandler(h.getClusterStatus)}, + {methodPUT, `/cluster/{id}/status`, payloadHandler(h.updateClusterStatus)}, + {methodPUT, `/cluster/{id}`, payloadHandler(h.submitCluster)}, + {methodGET, `/cluster/{id}`, payloadHandler(h.getCluster)}, + {methodGET, `/clusters`, payloadHandler(h.getClusters)}, + } +} + // Start serves the API until ctx is done, then drains in-flight work for up to ShutdownTimeout seconds. func (h *Heimdall) Start(ctx context.Context) error { // set routes @@ -180,28 +213,9 @@ func (h *Heimdall) Start(ctx context.Context) error { // set API routes apiRouter := router.PathPrefix(defaultAPIPrefix).Subrouter() - // job(s) endpoints... - apiRouter.Methods(methodGET).PathPrefix(`/job/statuses`).HandlerFunc(payloadHandler(h.getJobStatuses)) - apiRouter.Methods(methodGET).PathPrefix(`/job/{id}/status`).HandlerFunc(payloadHandler(h.getJobStatus)) - apiRouter.Methods(methodPOST).PathPrefix(`/job/{id}/cancel`).HandlerFunc(payloadHandler(h.cancelJob)) - apiRouter.Methods(methodGET).PathPrefix(`/job/{id}/{file}`).HandlerFunc(h.getJobFile) - apiRouter.Methods(methodGET).PathPrefix(`/job/{id}`).HandlerFunc(payloadHandler(h.getJob)) - apiRouter.Methods(methodGET).PathPrefix(`/jobs`).HandlerFunc(payloadHandler(h.getJobs)) - apiRouter.Methods(methodPOST).PathPrefix(`/job`).HandlerFunc(payloadHandler(h.submitJob)) - apiRouter.Methods(methodGET).PathPrefix(`/command/statuses`).HandlerFunc(payloadHandler(h.getCommandStatuses)) - apiRouter.Methods(methodGET).PathPrefix(`/command/{id}/status`).HandlerFunc(payloadHandler(h.getCommandStatus)) - apiRouter.Methods(methodPUT).PathPrefix(`/command/{id}/status`).HandlerFunc(payloadHandler(h.updateCommandStatus)) - apiRouter.Methods(methodPUT).PathPrefix(`/command/{id}`).HandlerFunc(payloadHandler(h.submitCommand)) - apiRouter.Methods(methodGET).PathPrefix(`/command/{id}`).HandlerFunc(payloadHandler(h.getCommand)) - apiRouter.Methods(methodGET).PathPrefix(`/commands`).HandlerFunc(payloadHandler(h.getCommands)) - apiRouter.Methods(methodGET).PathPrefix(`/cluster/statuses`).HandlerFunc(payloadHandler(h.getClusterStatuses)) - apiRouter.Methods(methodGET).PathPrefix(`/clusters/health`).HandlerFunc(h.getClustersHealth) - apiRouter.Methods(methodGET).PathPrefix(`/cluster/{id}/health`).HandlerFunc(payloadHandler(h.getClusterHealth)) - apiRouter.Methods(methodGET).PathPrefix(`/cluster/{id}/status`).HandlerFunc(payloadHandler(h.getClusterStatus)) - apiRouter.Methods(methodPUT).PathPrefix(`/cluster/{id}/status`).HandlerFunc(payloadHandler(h.updateClusterStatus)) - apiRouter.Methods(methodPUT).PathPrefix(`/cluster/{id}`).HandlerFunc(payloadHandler(h.submitCluster)) - apiRouter.Methods(methodGET).PathPrefix(`/cluster/{id}`).HandlerFunc(payloadHandler(h.getCluster)) - apiRouter.Methods(methodGET).PathPrefix(`/clusters`).HandlerFunc(payloadHandler(h.getClusters)) + for _, route := range h.apiRoutes() { + apiRouter.Methods(route.method).PathPrefix(route.path).HandlerFunc(route.handler) + } // metrics endpoint - proxy to metrics service router.Path(`/metrics`).HandlerFunc(metricsRouteHandler) diff --git a/internal/pkg/heimdall/openapi_test.go b/internal/pkg/heimdall/openapi_test.go new file mode 100644 index 0000000..124cea1 --- /dev/null +++ b/internal/pkg/heimdall/openapi_test.go @@ -0,0 +1,265 @@ +package heimdall + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "reflect" + "slices" + "sort" + "strings" + "testing" + + "github.com/gorilla/mux" + "gopkg.in/yaml.v3" + + "github.com/patterninc/heimdall/pkg/object/cluster" + "github.com/patterninc/heimdall/pkg/object/command" + "github.com/patterninc/heimdall/pkg/object/job" + jobStatus "github.com/patterninc/heimdall/pkg/object/job/status" + "github.com/patterninc/heimdall/pkg/object/status" + "github.com/patterninc/heimdall/pkg/result" + "github.com/patterninc/heimdall/pkg/result/column" +) + +const openAPISpecPath = `../../../api/openapi.yaml` + +var openAPIMethods = []string{`get`, `put`, `post`, `delete`, `patch`, `head`, `options`, `trace`} + +type openAPISchema struct { + Properties map[string]any `yaml:"properties"` + Enum []string `yaml:"enum"` +} + +type openAPISpec struct { + Servers []struct { + URL string `yaml:"url"` + } `yaml:"servers"` + Paths map[string]map[string]any `yaml:"paths"` + Components struct { + Schemas map[string]openAPISchema `yaml:"schemas"` + } `yaml:"components"` +} + +func loadOpenAPISpec(t *testing.T) *openAPISpec { + t.Helper() + data, err := os.ReadFile(openAPISpecPath) + if err != nil { + t.Fatalf("read %s: %v", openAPISpecPath, err) + } + spec := &openAPISpec{} + if err := yaml.Unmarshal(data, spec); err != nil { + t.Fatalf("parse %s: %v", openAPISpecPath, err) + } + return spec +} + +func specOperations(spec *openAPISpec) []string { + var ops []string + for path, item := range spec.Paths { + for key := range item { + if slices.Contains(openAPIMethods, key) { + ops = append(ops, strings.ToUpper(key)+` `+path) + } + } + } + sort.Strings(ops) + return ops +} + +func TestOpenAPISpecServerIsAPIPrefix(t *testing.T) { + spec := loadOpenAPISpec(t) + if len(spec.Servers) != 1 || spec.Servers[0].URL != defaultAPIPrefix { + t.Fatalf("spec servers = %+v, want one server with url %s", spec.Servers, defaultAPIPrefix) + } +} + +func TestOpenAPISpecListsEveryRoute(t *testing.T) { + spec := loadOpenAPISpec(t) + + var registered []string + for _, route := range (&Heimdall{}).apiRoutes() { + registered = append(registered, route.method+` `+route.path) + } + sort.Strings(registered) + + documented := specOperations(spec) + + for _, op := range registered { + if !slices.Contains(documented, op) { + t.Errorf("route %s is registered but not in %s", op, openAPISpecPath) + } + } + for _, op := range documented { + if !slices.Contains(registered, op) { + t.Errorf("operation %s is in %s but no route is registered for it", op, openAPISpecPath) + } + } +} + +// The API router matches path prefixes in registration order, so check that each documented path reaches its own route. +func TestOpenAPISpecPathsReachTheirRoute(t *testing.T) { + spec := loadOpenAPISpec(t) + + router := mux.NewRouter() + apiRouter := router.PathPrefix(defaultAPIPrefix).Subrouter() + for _, route := range (&Heimdall{}).apiRoutes() { + matched := route.method + ` ` + route.path + apiRouter.Methods(route.method).PathPrefix(route.path).HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Write([]byte(matched)) + }) + } + + pathValues := strings.NewReplacer(`{id}`, `some-id`, `{file}`, `stdout`) + for _, op := range specOperations(spec) { + method, path, _ := strings.Cut(op, ` `) + req := httptest.NewRequest(method, defaultAPIPrefix+pathValues.Replace(path), nil) + rec := httptest.NewRecorder() + router.ServeHTTP(rec, req) + if got := rec.Body.String(); got != op { + t.Errorf("%s %s reaches route %q, want %q", method, req.URL.Path, got, op) + } + } +} + +func jsonFieldNames(t reflect.Type) []string { + if t.Kind() == reflect.Pointer { + t = t.Elem() + } + var names []string + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + tag := field.Tag.Get(`json`) + name, _, _ := strings.Cut(tag, `,`) + if field.Anonymous && name == `` { + names = append(names, jsonFieldNames(field.Type)...) + continue + } + if !field.IsExported() || name == `-` { + continue + } + if name == `` { + name = field.Name + } + names = append(names, name) + } + sort.Strings(names) + return names +} + +func without(names []string, drop ...string) []string { + return slices.DeleteFunc(slices.Clone(names), func(n string) bool { return slices.Contains(drop, n) }) +} + +func schemaProperties(t *testing.T, spec *openAPISpec, name string) []string { + t.Helper() + schema, found := spec.Components.Schemas[name] + if !found { + t.Fatalf("schema %s is not in %s", name, openAPISpecPath) + } + var props []string + for p := range schema.Properties { + props = append(props, p) + } + sort.Strings(props) + return props +} + +func TestOpenAPISchemasMatchGoTypes(t *testing.T) { + spec := loadOpenAPISpec(t) + + jobFields := jsonFieldNames(reflect.TypeFor[job.Job]()) + commandFields := jsonFieldNames(reflect.TypeFor[command.Command]()) + clusterFields := jsonFieldNames(reflect.TypeFor[cluster.Cluster]()) + + // Each schema must list exactly the JSON fields of its Go type, less the fields that the handler never sets. + exact := map[string][]string{ + `Job`: without(jobFields, `result`), + `SubmittedJob`: jobFields, + `Command`: without(commandFields, `allowed_callers`), + `Cluster`: without(clusterFields, `health_check`, `rbacs`, `attributes`), + `JobsPage`: jsonFieldNames(reflect.TypeFor[resultset]()), + `JobAttribute`: jsonFieldNames(reflect.TypeFor[job.Attribute]()), + `Result`: jsonFieldNames(reflect.TypeFor[result.Result]()), + `ResultColumn`: jsonFieldNames(reflect.TypeFor[column.Column]()), + `HealthCheckResult`: jsonFieldNames(reflect.TypeFor[healthCheckResult]()), + `HealthChecks`: jsonFieldNames(reflect.TypeFor[healthChecksResponse]()), + `Error`: {idKey, errorKey}, + } + for name, want := range exact { + sort.Strings(want) + if got := schemaProperties(t, spec, name); !slices.Equal(got, want) { + t.Errorf("schema %s has properties %v, Go type has %v", name, got, want) + } + } + + // Request bodies and partial responses must only use fields that the Go type decodes or encodes. + subset := map[string][]string{ + `JobInput`: jobFields, + `CommandInput`: commandFields, + `ClusterInput`: clusterFields, + `JobStatusSnapshot`: jobFields, + `JobCancelResponse`: jobFields, + `ResourceStatusSnapshot`: commandFields, + `StatusUpdate`: commandFields, + `CommandsPage`: jsonFieldNames(reflect.TypeFor[resultset]()), + `ClustersPage`: jsonFieldNames(reflect.TypeFor[resultset]()), + } + for name, allowed := range subset { + for _, prop := range schemaProperties(t, spec, name) { + if !slices.Contains(allowed, prop) { + t.Errorf("schema %s has property %s, which the Go type does not have", name, prop) + } + } + } +} + +func marshalStatuses[T json.Marshaler](t *testing.T, values []T) []string { + t.Helper() + var names []string + for _, v := range values { + data, err := v.MarshalJSON() + if err != nil { + t.Fatalf("marshal status %v: %v", v, err) + } + var name string + if err := json.Unmarshal(data, &name); err != nil { + t.Fatalf("unmarshal status %s: %v", data, err) + } + names = append(names, name) + } + sort.Strings(names) + return names +} + +func TestOpenAPIStatusEnumsMatchGo(t *testing.T) { + spec := loadOpenAPISpec(t) + + jobStatuses := []jobStatus.Status{ + jobStatus.New, jobStatus.Accepted, jobStatus.Running, jobStatus.Failed, + jobStatus.Killed, jobStatus.Succeeded, jobStatus.Canceling, jobStatus.Canceled, + } + var jobMarshalers []*jobStatus.Status + for i := range jobStatuses { + jobMarshalers = append(jobMarshalers, &jobStatuses[i]) + } + + resourceStatuses := []status.Status{status.Active, status.Inactive, status.Deleted} + var resourceMarshalers []*status.Status + for i := range resourceStatuses { + resourceMarshalers = append(resourceMarshalers, &resourceStatuses[i]) + } + + want := map[string][]string{ + `JobStatus`: marshalStatuses(t, jobMarshalers), + `ResourceStatus`: marshalStatuses(t, resourceMarshalers), + } + for name, values := range want { + got := slices.Clone(spec.Components.Schemas[name].Enum) + sort.Strings(got) + if !slices.Equal(got, values) { + t.Errorf("schema %s has enum %v, Go has %v", name, got, values) + } + } +} diff --git a/web/.prettierignore b/web/.prettierignore index c1b9e4b..97e74b2 100644 --- a/web/.prettierignore +++ b/web/.prettierignore @@ -4,3 +4,4 @@ pnpm-lock.yaml **/.next/* **/tsconfig.json .prettierrc +src/common/api/schema.d.ts diff --git a/web/AGENTS.md b/web/AGENTS.md index c7f4b89..4da60d9 100644 --- a/web/AGENTS.md +++ b/web/AGENTS.md @@ -8,6 +8,16 @@ This block is written and re-added by `next dev` — verify at `node_modules/nex +## API types + +The API request and response types come from the OpenAPI spec in `../api/openapi.yaml`. Import them from `@/common/api/types`. Do not write API types by hand. + +- `pnpm gen:api` makes `src/common/api/schema.d.ts` again from the spec. Do not edit that file. +- `pnpm check:api` fails when `schema.d.ts` is not the output of the spec. `build.sh --test` runs it. +- `context` on jobs, commands and clusters is free-form (each plugin sets its keys). Read its keys with `contextString` and `contextEntries` from `@/common/api/context`. + +To change the API contract, read `../api/README.md`. + ## Tests Vitest, React Testing Library and MSW. Run from `web/`: diff --git a/web/package.json b/web/package.json index f067392..dbdd723 100644 --- a/web/package.json +++ b/web/package.json @@ -14,6 +14,8 @@ "lint-fix": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings=0 --fix", "format": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\"", "type-check": "next typegen && tsc --noEmit", + "gen:api": "openapi-typescript ../api/openapi.yaml --redocly ../api/redocly.yaml -o src/common/api/schema.d.ts", + "check:api": "openapi-typescript ../api/openapi.yaml --redocly ../api/redocly.yaml -o src/common/api/schema.d.ts --check", "test": "vitest run --coverage", "test:watch": "vitest" }, @@ -54,6 +56,7 @@ "eslint-plugin-prettier": "^5.2.3", "jsdom": "^31.0.1", "msw": "^3.0.7", + "openapi-typescript": "^7.13.0", "postcss": "^8", "prettier": "^3.5.2", "prettier-plugin-sort-json": "^4.1.1", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 5539f1d..7134d83 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -168,7 +168,7 @@ importers: dependencies: '@patterninc/pattern-ui': specifier: latest - version: 0.0.0-main.202610271737.65d5c2ce3a27(@lingui/core@6.10.1(@babel/core@7.29.7(supports-color@7.2.0)))(@lingui/react@6.10.1(@babel/core@7.29.7(supports-color@7.2.0))(react@19.3.1))(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + version: 0.0.0-main.202610271737.65d5c2ce3a27(@lingui/core@6.10.1(@babel/core@7.29.7(supports-color@10.2.2)))(@lingui/react@6.10.1(@babel/core@7.29.7(supports-color@10.2.2))(react@19.3.1))(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@tanstack/react-query': specifier: ^5.66.11 version: 5.105.0(@types/react@19.3.0)(react@19.3.1) @@ -186,10 +186,10 @@ importers: version: 0.6.5 next: specifier: 16.4.3 - version: 16.4.3(@babel/core@7.29.7(supports-color@7.2.0))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + version: 16.4.3(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) nuqs: specifier: ^2.4.1 - version: 2.10.2(next@16.4.3(@babel/core@7.29.7(supports-color@7.2.0))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(react@19.3.1) + version: 2.10.2(next@16.4.3(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(react@19.3.1) react: specifier: ^19.2.4 version: 19.3.1 @@ -253,22 +253,25 @@ importers: version: 1.0.0 eslint: specifier: ^10.13.0 - version: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + version: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) eslint-config-next: specifier: 16.4.3 - version: 16.4.3(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + version: 16.4.3(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint-config-prettier: specifier: ^10.0.2 - version: 10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) + version: 10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) eslint-plugin-prettier: specifier: ^5.2.3 - version: 5.5.7(eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)))(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(prettier@3.9.10) + version: 5.5.7(eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)))(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(prettier@3.9.10) jsdom: specifier: ^31.0.1 version: 31.0.1 msw: specifier: ^3.0.7 - version: 3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + version: 3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + openapi-typescript: + specifier: ^7.13.0 + version: 7.13.0(@typescript/typescript6@6.0.2) postcss: specifier: ^8 version: 8.5.31 @@ -289,7 +292,7 @@ importers: version: '@typescript/typescript6@6.0.2' vitest: specifier: ^5.1.1 - version: 5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + version: 5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) packages: @@ -1145,6 +1148,16 @@ packages: '@radix-ui/rect@1.1.3': resolution: {integrity: sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==} + '@redocly/ajv@8.11.2': + resolution: {integrity: sha512-io1JpnwtIcvojV7QKDUSIuMN/ikdOUd1ReEnUnMKGfDVridQZ31J0MmIuqwuRjWDZfmvr+Q0MqCcfHM2gTivOg==} + + '@redocly/config@0.22.0': + resolution: {integrity: sha512-gAy93Ddo01Z3bHuVdPWfCwzgfaYgMdaZPcfL7JZ7hWJoK9V0lXDbigTWkhiPFAaLWzbOJ+kbUQG1+XwIm0KRGQ==} + + '@redocly/openapi-core@1.34.24': + resolution: {integrity: sha512-jDFMu4zirFVOF9nEWCT31s7OzzVhkxZkb4lO3yZhkdPXAOspLo10ED9thVgm6gtI0dJBTLa+mNP0IYeZpVSYGA==} + engines: {node: '>=18.17.0', npm: '>=9.5.0'} + '@rolldown/binding-android-arm-eabi@1.2.19': resolution: {integrity: sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2070,9 +2083,17 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + agent-base@7.1.4: + resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} + engines: {node: '>= 14'} + ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + ansi-colors@4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -2192,6 +2213,9 @@ packages: brace-expansion@1.1.21: resolution: {integrity: sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==} + brace-expansion@2.1.8: + resolution: {integrity: sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==} + brace-expansion@5.0.12: resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==} engines: {node: 20 || >=22} @@ -2235,6 +2259,9 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + change-case@5.4.4: + resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} + character-entities-legacy@3.0.0: resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} @@ -2277,6 +2304,9 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + colorette@1.4.0: + resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} + comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} @@ -3000,6 +3030,10 @@ packages: resolution: {integrity: sha512-uka+0oVG/yB4B7U9M/+aJFF0aKZVmMWZKi4unemkQh537cLu3jXPvZtXakTuPl3taOI+O43RhuV6kn2igk1Z6g==} engines: {node: '>=24.0.0'} + https-proxy-agent@7.0.6: + resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} + engines: {node: '>= 14'} + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -3020,6 +3054,10 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + index-to-position@1.2.0: + resolution: {integrity: sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==} + engines: {node: '>=18'} + internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -3178,6 +3216,10 @@ packages: resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} hasBin: true + js-levenshtein@1.1.6: + resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} + engines: {node: '>=0.10.0'} + js-sha256@0.10.1: resolution: {integrity: sha512-5obBtsz9301ULlsgggLg542s/jqtddfOpV5KJc4hajc9JV8GeY2gZHSVpYBn4nWqAUTJ9v+xwtbJ1mIBgIH5Vw==} @@ -3187,6 +3229,10 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-yaml@4.3.2: + resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==} + hasBin: true + js-yaml@5.5.0: resolution: {integrity: sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==} hasBin: true @@ -3208,6 +3254,9 @@ packages: json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -3463,6 +3512,10 @@ packages: minimatch@3.1.5: resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} + minimatch@5.1.9: + resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} + engines: {node: '>=10'} + minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -3628,6 +3681,12 @@ packages: resolution: {integrity: sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==} engines: {node: '>=12.20.0'} + openapi-typescript@7.13.0: + resolution: {integrity: sha512-EFP392gcqXS7ntPvbhBzbF8TyBA+baIYEm791Hy5YkjDYKTnk/Tn5OQeKm5BIZvJihpp8Zzr4hzx0Irde1LNGQ==} + hasBin: true + peerDependencies: + typescript: ^5.x + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -3650,6 +3709,10 @@ packages: parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} + parse-json@8.3.0: + resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} + engines: {node: '>=18'} + parse5-parser-stream@8.1.1: resolution: {integrity: sha512-hMcVbbUJcQmP8rURWUdYrT1flRiBiBVjq/RYGguJpDUgIXSqdYKlE0CxthmdMWoSlBAuL5bUBa73g0pttSy7Hw==} @@ -3678,6 +3741,10 @@ packages: resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} engines: {node: '>=12'} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -3918,6 +3985,10 @@ packages: remove-accents@0.5.0: resolution: {integrity: sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A==} + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + reselect@5.3.0: resolution: {integrity: sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg==} @@ -4144,6 +4215,10 @@ packages: resolution: {integrity: sha512-H+ue8Zo4vJmV2nRjpx86P35lzwDT3nItnIsocgumgr0hHMQ+ZGq5vrERg9kJBo5AWGmxZDhzDo+WVIJqkB0cGA==} engines: {node: '>=16'} + supports-color@10.2.2: + resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==} + engines: {node: '>=18'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -4221,6 +4296,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + type-fest@5.10.0: resolution: {integrity: sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==} engines: {node: '>=20'} @@ -4281,6 +4360,9 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + uri-js-replace@1.0.3: + resolution: {integrity: sha512-MMvVPvWo7I8nHX2Qn3+cji4YPAvEqBKjBoUqt7Z0RpE5hLdDpRLqaNfJtTwf56m40EQt2fJfptnrQdL2LXR99A==} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -4471,6 +4553,13 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yaml-ast-parser@0.0.43: + resolution: {integrity: sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A==} + + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + yargs-parser@22.0.0: resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==} engines: {node: ^20.19.0 || ^22.12.0 || >=23} @@ -4509,20 +4598,20 @@ snapshots: '@babel/compat-data@7.29.7': {} - '@babel/core@7.29.7(supports-color@7.2.0)': + '@babel/core@7.29.7(supports-color@10.2.2)': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 '@babel/helper-compilation-targets': 7.29.7 - '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@7.2.0))(supports-color@7.2.0) + '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@babel/helpers': 7.29.10 '@babel/parser': 7.29.11 '@babel/template': 7.29.7 - '@babel/traverse': 7.29.10(supports-color@7.2.0) + '@babel/traverse': 7.29.10(supports-color@10.2.2) '@babel/types': 7.29.11 '@jridgewell/remapping': 2.3.5 convert-source-map: 2.0.0 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -4547,19 +4636,19 @@ snapshots: '@babel/helper-globals@7.29.7': {} - '@babel/helper-module-imports@7.29.7(supports-color@7.2.0)': + '@babel/helper-module-imports@7.29.7(supports-color@10.2.2)': dependencies: - '@babel/traverse': 7.29.10(supports-color@7.2.0) + '@babel/traverse': 7.29.10(supports-color@10.2.2) '@babel/types': 7.29.11 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7(supports-color@7.2.0))(supports-color@7.2.0)': + '@babel/helper-module-transforms@7.29.7(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) - '@babel/helper-module-imports': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7(supports-color@10.2.2) + '@babel/helper-module-imports': 7.29.7(supports-color@10.2.2) '@babel/helper-validator-identifier': 7.29.7 - '@babel/traverse': 7.29.10(supports-color@7.2.0) + '@babel/traverse': 7.29.10(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -4588,7 +4677,7 @@ snapshots: '@babel/parser': 7.29.11 '@babel/types': 7.29.11 - '@babel/traverse@7.29.10(supports-color@7.2.0)': + '@babel/traverse@7.29.10(supports-color@10.2.2)': dependencies: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 @@ -4596,7 +4685,7 @@ snapshots: '@babel/parser': 7.29.11 '@babel/template': 7.29.7 '@babel/types': 7.29.11 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -4681,22 +4770,22 @@ snapshots: tslib: 2.8.1 optional: true - '@eslint-community/eslint-utils@4.10.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))': + '@eslint-community/eslint-utils@4.10.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))': + '@eslint-community/eslint-utils@4.9.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.23.5(supports-color@7.2.0)': + '@eslint/config-array@0.23.5(supports-color@10.2.2)': dependencies: '@eslint/object-schema': 3.0.5 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.6 transitivePeerDependencies: - supports-color @@ -4851,12 +4940,12 @@ snapshots: '@solid-primitives/utils': 6.4.1(solid-js@1.9.17) solid-js: 1.9.17 - '@lingui/babel-plugin-lingui-macro@6.10.1(@babel/core@7.29.7(supports-color@7.2.0))': + '@lingui/babel-plugin-lingui-macro@6.10.1(@babel/core@7.29.7(supports-color@10.2.2))': dependencies: '@lingui/conf': 6.10.1 '@lingui/message-utils': 6.10.1 optionalDependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7(supports-color@10.2.2) '@lingui/conf@6.10.1': dependencies: @@ -4865,9 +4954,9 @@ snapshots: lilconfig: 3.1.4 normalize-path: 3.0.0 - '@lingui/core@6.10.1(@babel/core@7.29.7(supports-color@7.2.0))': + '@lingui/core@6.10.1(@babel/core@7.29.7(supports-color@10.2.2))': dependencies: - '@lingui/babel-plugin-lingui-macro': 6.10.1(@babel/core@7.29.7(supports-color@7.2.0)) + '@lingui/babel-plugin-lingui-macro': 6.10.1(@babel/core@7.29.7(supports-color@10.2.2)) '@lingui/message-utils': 6.10.1 transitivePeerDependencies: - '@babel/core' @@ -4878,10 +4967,10 @@ snapshots: '@messageformat/parser': 5.2.0 js-sha256: 0.10.1 - '@lingui/react@6.10.1(@babel/core@7.29.7(supports-color@7.2.0))(react@19.3.1)': + '@lingui/react@6.10.1(@babel/core@7.29.7(supports-color@10.2.2))(react@19.3.1)': dependencies: - '@lingui/babel-plugin-lingui-macro': 6.10.1(@babel/core@7.29.7(supports-color@7.2.0)) - '@lingui/core': 6.10.1(@babel/core@7.29.7(supports-color@7.2.0)) + '@lingui/babel-plugin-lingui-macro': 6.10.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@lingui/core': 6.10.1(@babel/core@7.29.7(supports-color@10.2.2)) react: 19.3.1 use-sync-external-store: 1.7.0(react@19.3.1) transitivePeerDependencies: @@ -4895,11 +4984,11 @@ snapshots: '@msw/url@0.1.3': {} - '@mswjs/interceptors@0.45.12(supports-color@7.2.0)': + '@mswjs/interceptors@0.45.12(supports-color@10.2.2)': dependencies: '@open-draft/until': 3.0.1 '@types/debug': 4.1.13 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) is-node-process: 1.2.0 outvariant: 1.4.3 rettime: 0.11.13 @@ -4922,9 +5011,9 @@ snapshots: '@next/env@16.4.3': {} - '@next/eslint-plugin-next@16.4.3(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))': + '@next/eslint-plugin-next@16.4.3(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) fast-glob: 3.3.1 transitivePeerDependencies: - eslint @@ -4978,12 +5067,12 @@ snapshots: '@oxc-project/types@0.156.0': {} - '@patterninc/pattern-ui@0.0.0-main.202610271737.65d5c2ce3a27(@lingui/core@6.10.1(@babel/core@7.29.7(supports-color@7.2.0)))(@lingui/react@6.10.1(@babel/core@7.29.7(supports-color@7.2.0))(react@19.3.1))(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + '@patterninc/pattern-ui@0.0.0-main.202610271737.65d5c2ce3a27(@lingui/core@6.10.1(@babel/core@7.29.7(supports-color@10.2.2)))(@lingui/react@6.10.1(@babel/core@7.29.7(supports-color@10.2.2))(react@19.3.1))(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': dependencies: '@base-ui/react': 1.9.0(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@iconicapp/iconic-react': 1.1.4(react-dom@19.3.1(react@19.3.1))(react@19.3.1) - '@lingui/core': 6.10.1(@babel/core@7.29.7(supports-color@7.2.0)) - '@lingui/react': 6.10.1(@babel/core@7.29.7(supports-color@7.2.0))(react@19.3.1) + '@lingui/core': 6.10.1(@babel/core@7.29.7(supports-color@10.2.2)) + '@lingui/react': 6.10.1(@babel/core@7.29.7(supports-color@10.2.2))(react@19.3.1) '@number-flow/react': 0.6.2(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@radix-ui/react-accordion': 1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@radix-ui/react-avatar': 1.3.1(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) @@ -5444,6 +5533,29 @@ snapshots: '@radix-ui/rect@1.1.3': {} + '@redocly/ajv@8.11.2': + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js-replace: 1.0.3 + + '@redocly/config@0.22.0': {} + + '@redocly/openapi-core@1.34.24(supports-color@10.2.2)': + dependencies: + '@redocly/ajv': 8.11.2 + '@redocly/config': 0.22.0 + colorette: 1.4.0 + https-proxy-agent: 7.0.6(supports-color@10.2.2) + js-levenshtein: 1.1.6 + js-yaml: 4.3.2 + minimatch: 5.1.9 + pluralize: 8.0.0 + yaml-ast-parser: 0.0.43 + transitivePeerDependencies: + - supports-color + '@rolldown/binding-android-arm-eabi@1.2.19': optional: true @@ -5713,7 +5825,7 @@ snapshots: picocolors: 1.1.1 redent: 3.0.0 optionalDependencies: - vitest: 5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + vitest: 5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) '@testing-library/react@16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': dependencies: @@ -5871,15 +5983,15 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)': + '@typescript-eslint/eslint-plugin@8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/scope-manager': 8.72.1 - '@typescript-eslint/type-utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@typescript-eslint/type-utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.72.1 - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) ignore: 7.0.14 natural-compare: 1.4.0 ts-api-utils: 2.5.0(@typescript/typescript6@6.0.2) @@ -5887,23 +5999,23 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)': + '@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@typescript-eslint/scope-manager': 8.72.1 '@typescript-eslint/types': 8.72.1 - '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0) + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.72.1 - debug: 4.4.3(supports-color@7.2.0) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0)': + '@typescript-eslint/project-service@8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: '@typescript-eslint/tsconfig-utils': 8.72.1(@typescript/typescript6@6.0.2) '@typescript-eslint/types': 8.72.1 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -5917,13 +6029,13 @@ snapshots: dependencies: typescript: '@typescript/typescript6@6.0.2' - '@typescript-eslint/type-utils@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)': + '@typescript-eslint/type-utils@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@typescript-eslint/types': 8.72.1 - '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0) - '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - debug: 4.4.3(supports-color@7.2.0) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + debug: 4.4.3(supports-color@10.2.2) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) ts-api-utils: 2.5.0(@typescript/typescript6@6.0.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: @@ -5931,13 +6043,13 @@ snapshots: '@typescript-eslint/types@8.72.1': {} - '@typescript-eslint/typescript-estree@8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0)': + '@typescript-eslint/typescript-estree@8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: - '@typescript-eslint/project-service': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0) + '@typescript-eslint/project-service': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@typescript-eslint/tsconfig-utils': 8.72.1(@typescript/typescript6@6.0.2) '@typescript-eslint/types': 8.72.1 '@typescript-eslint/visitor-keys': 8.72.1 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) minimatch: 10.2.6 semver: 7.8.5 tinyglobby: 0.2.17 @@ -5946,13 +6058,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)': + '@typescript-eslint/utils@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/scope-manager': 8.72.1 '@typescript-eslint/types': 8.72.1 - '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -6236,7 +6348,7 @@ snapshots: obug: 3.0.0 std-env: 4.3.0 tinyrainbow: 3.2.0 - vitest: 5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + vitest: 5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) '@vitest/istanbul-lib-coverage@2.1.1': {} @@ -6244,14 +6356,14 @@ snapshots: dependencies: '@vitest/istanbul-lib-coverage': 2.1.1 - '@vitest/mocker@5.1.1(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0))': + '@vitest/mocker@5.1.1(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.1.1 estree-walker: 3.0.3 magic-string: 1.4.5 optionalDependencies: - msw: 3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + msw: 3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) vite: 8.3.8(@types/node@26.6.5)(jiti@2.7.0) '@vitest/spy@5.1.1': {} @@ -6262,6 +6374,8 @@ snapshots: acorn@8.19.0: {} + agent-base@7.1.4: {} + ajv@6.15.0: dependencies: fast-deep-equal: 3.1.3 @@ -6269,6 +6383,8 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + ansi-colors@4.1.3: {} + ansi-regex@5.0.1: {} ansi-regex@6.6.0: {} @@ -6405,6 +6521,10 @@ snapshots: balanced-match: 1.0.2 concat-map: 0.0.1 + brace-expansion@2.1.8: + dependencies: + balanced-match: 1.0.2 + brace-expansion@5.0.12: dependencies: balanced-match: 4.0.4 @@ -6457,6 +6577,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + change-case@5.4.4: {} + character-entities-legacy@3.0.0: {} character-entities@2.0.2: {} @@ -6489,6 +6611,8 @@ snapshots: color-name@1.1.4: {} + colorette@1.4.0: {} + comma-separated-tokens@2.0.3: {} commander@11.1.0: {} @@ -6723,17 +6847,17 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 - debug@3.2.7(supports-color@7.2.0): + debug@3.2.7(supports-color@10.2.2): dependencies: ms: 2.1.3 optionalDependencies: - supports-color: 7.2.0 + supports-color: 10.2.2 - debug@4.4.3(supports-color@7.2.0): + debug@4.4.3(supports-color@10.2.2): dependencies: ms: 2.1.3 optionalDependencies: - supports-color: 7.2.0 + supports-color: 10.2.2 decimal.js-light@2.5.1: {} @@ -6918,18 +7042,18 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-next@16.4.3(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-config-next@16.4.3(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@next/eslint-plugin-next': 16.4.3(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-resolver-node: 0.3.10(supports-color@7.2.0) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint-plugin-jsx-a11y: 6.10.2(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) - eslint-plugin-react: 7.37.5(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) - eslint-plugin-react-hooks: 7.1.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@next/eslint-plugin-next': 16.4.3(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-import-resolver-node: 0.3.10(supports-color@10.2.2) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-jsx-a11y: 6.10.2(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint-plugin-react: 7.37.5(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint-plugin-react-hooks: 7.1.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) globals: 16.4.0 - typescript-eslint: 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + typescript-eslint: 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) optionalDependencies: typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: @@ -6938,56 +7062,56 @@ snapshots: - eslint-plugin-import-x - supports-color - eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)): + eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) - eslint-import-resolver-node@0.3.10(supports-color@7.2.0): + eslint-import-resolver-node@0.3.10(supports-color@10.2.2): dependencies: - debug: 3.2.7(supports-color@7.2.0) + debug: 3.2.7(supports-color@10.2.2) is-core-module: 2.17.0 resolve: 2.0.0-next.7 transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.3(supports-color@7.2.0) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) get-tsconfig: 4.14.3 is-bun-module: 2.0.0 stable-hash: 0.0.5 tinyglobby: 0.2.17 unrs-resolver: 1.12.2 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color - eslint-module-utils@2.14.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(eslint-import-resolver-node@0.3.10(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-module-utils@2.14.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint-import-resolver-node@0.3.10(supports-color@10.2.2))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - debug: 3.2.7(supports-color@7.2.0) + debug: 3.2.7(supports-color@10.2.2) optionalDependencies: - '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-resolver-node: 0.3.10(supports-color@7.2.0) - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-import-resolver-node: 0.3.10(supports-color@10.2.2) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.2.0 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 - debug: 3.2.7(supports-color@7.2.0) + debug: 3.2.7(supports-color@10.2.2) doctrine: 2.1.0 - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-resolver-node: 0.3.10(supports-color@7.2.0) - eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(eslint-import-resolver-node@0.3.10(supports-color@7.2.0))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-import-resolver-node: 0.3.10(supports-color@10.2.2) + eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint-import-resolver-node@0.3.10(supports-color@10.2.2))(eslint-import-resolver-typescript@3.10.1)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) hasown: 2.0.4 is-core-module: 2.17.0 is-glob: 4.0.3 @@ -6999,13 +7123,13 @@ snapshots: string.prototype.trimend: 1.0.10 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jsx-a11y@6.10.2(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)): + eslint-plugin-jsx-a11y@6.10.2(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: aria-query: 5.3.2 array-includes: 3.2.0 @@ -7015,7 +7139,7 @@ snapshots: axobject-query: 4.1.0 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) hasown: 2.0.4 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 @@ -7024,27 +7148,27 @@ snapshots: safe-regex-test: 1.1.0 string.prototype.includes: 2.0.1 - eslint-plugin-prettier@5.5.7(eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)))(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(prettier@3.9.10): + eslint-plugin-prettier@5.5.7(eslint-config-prettier@10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)))(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(prettier@3.9.10): dependencies: - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) prettier: 3.9.10 prettier-linter-helpers: 1.0.1 synckit: 0.12.3 optionalDependencies: - eslint-config-prettier: 10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint-config-prettier: 10.1.8(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) - eslint-plugin-react-hooks@7.1.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + eslint-plugin-react-hooks@7.1.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/parser': 7.29.11 - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) hermes-parser: 0.25.1 zod: 4.6.7 zod-validation-error: 4.0.2(zod@4.6.7) transitivePeerDependencies: - supports-color - eslint-plugin-react@7.37.5(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)): + eslint-plugin-react@7.37.5(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: array-includes: 3.2.0 array.prototype.findlast: 1.2.5 @@ -7052,7 +7176,7 @@ snapshots: array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 es-iterator-helpers: 1.4.0 - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) estraverse: 5.3.0 hasown: 2.0.4 jsx-ast-utils: 3.3.5 @@ -7077,11 +7201,11 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0): + eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2): dependencies: - '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.10.1(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2)) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.23.5(supports-color@7.2.0) + '@eslint/config-array': 0.23.5(supports-color@10.2.2) '@eslint/config-helpers': 0.7.0 '@eslint/core': 1.2.1 '@eslint/plugin-kit': 0.7.3 @@ -7091,7 +7215,7 @@ snapshots: '@types/estree': 1.0.9 ajv: 6.15.0 cross-spawn: 7.0.6 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) escape-string-regexp: 4.0.0 eslint-scope: 9.1.2 eslint-visitor-keys: 5.0.1 @@ -7363,6 +7487,13 @@ snapshots: html2canvas-pro@2.5.2: {} + https-proxy-agent@7.0.6(supports-color@10.2.2): + dependencies: + agent-base: 7.1.4 + debug: 4.4.3(supports-color@10.2.2) + transitivePeerDependencies: + - supports-color + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -7375,6 +7506,8 @@ snapshots: indent-string@4.0.0: {} + index-to-position@1.2.0: {} + internal-slot@1.1.0: dependencies: es-errors: 1.3.0 @@ -7542,12 +7675,18 @@ snapshots: jiti@2.7.0: {} + js-levenshtein@1.1.6: {} + js-sha256@0.10.1: {} js-tokens@10.0.1: {} js-tokens@4.0.0: {} + js-yaml@4.3.2: + dependencies: + argparse: 2.0.1 + js-yaml@5.5.0: dependencies: argparse: 3.0.4 @@ -7579,6 +7718,8 @@ snapshots: json-schema-traverse@0.4.1: {} + json-schema-traverse@1.0.0: {} + json-stable-stringify-without-jsonify@1.0.1: {} json5@1.0.2: @@ -7775,6 +7916,10 @@ snapshots: dependencies: brace-expansion: 1.1.21 + minimatch@5.1.9: + dependencies: + brace-expansion: 2.1.8 + minimist@1.2.8: {} moment-timezone@0.6.5: @@ -7801,11 +7946,11 @@ snapshots: ms@2.1.3: {} - msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)): + msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)): dependencies: '@inquirer/confirm': 6.4.1(@types/node@26.6.5) '@msw/url': 0.1.3 - '@mswjs/interceptors': 0.45.12(supports-color@7.2.0) + '@mswjs/interceptors': 0.45.12(supports-color@10.2.2) cookie: 2.0.2 headers-polyfill: 5.0.1 is-node-process: 1.2.0 @@ -7837,7 +7982,7 @@ snapshots: railroad-diagrams: 1.0.0 randexp: 0.4.6 - next@16.4.3(@babel/core@7.29.7(supports-color@7.2.0))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1): + next@16.4.3(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1): dependencies: '@next/env': 16.4.3 '@swc/helpers': 0.5.23 @@ -7846,7 +7991,7 @@ snapshots: postcss: 8.5.23 react: 19.3.1 react-dom: 19.3.1(react@19.3.1) - styled-jsx: 5.1.6(@babel/core@7.29.7(supports-color@7.2.0))(react@19.3.1) + styled-jsx: 5.1.6(@babel/core@7.29.7(supports-color@10.2.2))(react@19.3.1) optionalDependencies: '@next/swc-darwin-arm64': 16.4.3 '@next/swc-darwin-x64': 16.4.3 @@ -7876,12 +8021,12 @@ snapshots: dependencies: esm-env: 1.2.2 - nuqs@2.10.2(next@16.4.3(@babel/core@7.29.7(supports-color@7.2.0))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(react@19.3.1): + nuqs@2.10.2(next@16.4.3(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(react@19.3.1): dependencies: '@standard-schema/spec': 1.1.0 react: 19.3.1 optionalDependencies: - next: 16.4.3(@babel/core@7.29.7(supports-color@7.2.0))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + next: 16.4.3(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-react-compiler@1.0.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) object-assign@4.1.1: {} @@ -7927,6 +8072,16 @@ snapshots: obug@3.0.0: {} + openapi-typescript@7.13.0(@typescript/typescript6@6.0.2): + dependencies: + '@redocly/openapi-core': 1.34.24(supports-color@10.2.2) + ansi-colors: 4.1.3 + change-case: 5.4.4 + parse-json: 8.3.0 + supports-color: 10.2.2 + typescript: '@typescript/typescript6@6.0.2' + yargs-parser: 21.1.1 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -7963,6 +8118,12 @@ snapshots: is-decimal: 2.0.1 is-hexadecimal: 2.0.1 + parse-json@8.3.0: + dependencies: + '@babel/code-frame': 7.29.7 + index-to-position: 1.2.0 + type-fest: 4.41.0 + parse5-parser-stream@8.1.1: dependencies: parse5: 8.1.1 @@ -7983,6 +8144,8 @@ snapshots: picomatch@4.0.7: {} + pluralize@8.0.0: {} + possible-typed-array-names@1.1.0: {} postcss@8.5.23: @@ -8187,6 +8350,8 @@ snapshots: remove-accents@0.5.0: {} + require-from-string@2.0.2: {} + reselect@5.3.0: {} resolve-pkg-maps@1.0.0: {} @@ -8453,17 +8618,19 @@ snapshots: dependencies: min-indent: 1.0.1 - styled-jsx@5.1.6(@babel/core@7.29.7(supports-color@7.2.0))(react@19.3.1): + styled-jsx@5.1.6(@babel/core@7.29.7(supports-color@10.2.2))(react@19.3.1): dependencies: client-only: 0.0.1 react: 19.3.1 optionalDependencies: - '@babel/core': 7.29.7(supports-color@7.2.0) + '@babel/core': 7.29.7(supports-color@10.2.2) superjson@2.2.6: dependencies: copy-anything: 4.1.5 + supports-color@10.2.2: {} + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -8529,6 +8696,8 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-fest@4.41.0: {} + type-fest@5.10.0: dependencies: tagged-tag: 1.0.0 @@ -8565,13 +8734,13 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript-eslint@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + typescript-eslint@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@7.2.0) - '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint: 10.13.0(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/eslint-plugin': 8.72.1(@typescript-eslint/parser@8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/typescript-estree': 8.72.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) + '@typescript-eslint/utils': 8.72.1(@typescript/typescript6@6.0.2)(eslint@10.13.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 10.13.0(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -8647,6 +8816,8 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + uri-js-replace@1.0.3: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 @@ -8708,10 +8879,10 @@ snapshots: fsevents: 2.3.3 jiti: 2.7.0 - vitest@5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)): + vitest@5.1.1(@types/node@26.6.5)(@vitest/coverage-v8@5.1.1)(jsdom@31.0.1)(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)): dependencies: '@types/chai': 5.2.3 - '@vitest/mocker': 5.1.1(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) + '@vitest/mocker': 5.1.1(msw@3.0.7(@types/node@26.6.5)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)))(vite@8.3.8(@types/node@26.6.5)(jiti@2.7.0)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -8810,6 +8981,10 @@ snapshots: yallist@3.1.1: {} + yaml-ast-parser@0.0.43: {} + + yargs-parser@21.1.1: {} + yargs-parser@22.0.0: {} yargs@18.2.0: diff --git a/web/src/app/api/clusters/clusters.ts b/web/src/app/api/clusters/clusters.ts index 59553a9..f2d45de 100644 --- a/web/src/app/api/clusters/clusters.ts +++ b/web/src/app/api/clusters/clusters.ts @@ -1,21 +1,26 @@ -import { buildQueryString } from '@/common/Services' -import { ApiParams } from '@/modules/Clusters/Helper' +import type { + Cluster, + ClustersPage, + ClustersQuery, + ResourceStatus, +} from '@/common/api/types' +import { API_URL, buildQueryString } from '@/common/Services' -export const getClusters = async (params: ApiParams) => { +export const getClusters = async ( + params: ClustersQuery, +): Promise => { const queryString = buildQueryString(params) - const response = await fetch(`/api/v1/clusters?${queryString}`) - const data = await response.json() - return data?.data + const response = await fetch(`${API_URL}/clusters?${queryString}`) + if (!response.ok) return [] + const page: ClustersPage = await response.json() + return page.data ?? [] } -export const getClusterStatus = async () => { - const response = await fetch('/api/v1/cluster/statuses') - const data = await response.json() - return data +export const getClusterStatus = async (): Promise => { + const response = await fetch(`${API_URL}/cluster/statuses`) + if (!response.ok) return [] + return await response.json() } -export const getCluster = async (id: string) => { - const response = await fetch(`/api/v1/clusters?id=${id}`) - const data = await response.json() - return data.data -} +export const getCluster = (id: string): Promise => + getClusters({ id }) diff --git a/web/src/app/api/commands/commands.ts b/web/src/app/api/commands/commands.ts index 1fd16c2..7fc39ee 100644 --- a/web/src/app/api/commands/commands.ts +++ b/web/src/app/api/commands/commands.ts @@ -1,22 +1,26 @@ +import type { + Command, + CommandsPage, + CommandsQuery, + ResourceStatus, +} from '@/common/api/types' import { API_URL, buildQueryString } from '@/common/Services' -import { ApiParams } from '@/modules/Commands/Helper' -export const getCommands = async (params: ApiParams) => { +export const getCommands = async ( + params: CommandsQuery, +): Promise => { const queryString = buildQueryString(params) const response = await fetch(`${API_URL}/commands?${queryString}`) - const data = await response.json() - return data.data + if (!response.ok) return [] + const page: CommandsPage = await response.json() + return page.data ?? [] } -export const getCommandStatus = async () => { +export const getCommandStatus = async (): Promise => { const response = await fetch(`${API_URL}/command/statuses`) - const data = await response.json() - return data + if (!response.ok) return [] + return await response.json() } -export const getCommandDetails = async (id: string) => { - const queryString = buildQueryString({ id: id }) - const response = await fetch(`${API_URL}/commands?${queryString}`) - const data = await response.json() - return data.data -} +export const getCommandDetails = (id: string): Promise => + getCommands({ id }) diff --git a/web/src/app/api/jobs/jobs.ts b/web/src/app/api/jobs/jobs.ts index 37f3feb..a26089f 100644 --- a/web/src/app/api/jobs/jobs.ts +++ b/web/src/app/api/jobs/jobs.ts @@ -1,37 +1,66 @@ +import type { + ApiError, + Job, + JobCancelResponse, + JobStatus, + JobsPage, + JobsQuery, +} from '@/common/api/types' import { API_URL, buildQueryString } from '@/common/Services' -import { ApiParams, JOBS_PAGE_SIZE, JobsResponse } from '@/modules/Jobs/Helper' +import { JOBS_PAGE_SIZE } from '@/modules/Jobs/Helper' + +export type JobFilters = Omit< + JobsQuery, + 'limit' | 'cursor' | 'order_by' | 'direction' +> + +/** `order_by` values that the API sorts on. Other columns sort on the internal row ID. */ +const SORTABLE_COLUMNS: readonly string[] = [ + 'id', + 'created_at', + 'updated_at', +] satisfies NonNullable[] + +const isSortColumn = ( + prop: string, +): prop is NonNullable => SORTABLE_COLUMNS.includes(prop) export const fetchJobs = async ( - params: ApiParams, + params: JobFilters, cursor: string | null, sort: { prop: string; flip: boolean }, -): Promise => { - const queryParams: ApiParams = { +): Promise => { + const queryParams: JobsQuery = { ...params, - limit: JOBS_PAGE_SIZE.toString(), - order_by: sort.prop, + limit: JOBS_PAGE_SIZE, direction: sort.flip ? 'desc' : 'asc', } + if (isSortColumn(sort.prop)) queryParams.order_by = sort.prop // keyset: send the opaque cursor for the previous page (omitted on first page) if (cursor) queryParams.cursor = cursor const queryString = buildQueryString(queryParams) const response = await fetch(`${API_URL}/jobs?${queryString}`) - + if (!response.ok) return { data: [] } return await response.json() } -export const getJobDetails = async (id: string) => { +/** Resolves to `null` when the API returns an error (for example an unknown job ID). */ +export const getJobDetails = async (id: string): Promise => { const response = await fetch(`${API_URL}/job/${id}`) + if (!response.ok) return null return await response.json() } -export const getJobStatus = async () => { +export const getJobStatus = async (): Promise => { const response = await fetch(`${API_URL}/job/statuses`) + if (!response.ok) return [] return await response.json() } -export const cancelJob = async (id: string) => { +export const cancelJob = async ( + id: string, +): Promise => { const response = await fetch(`${API_URL}/job/${id}/cancel`, { method: 'POST', }) diff --git a/web/src/common/Services/index.test.ts b/web/src/common/Services/index.test.ts index 6c08b52..4a4a082 100644 --- a/web/src/common/Services/index.test.ts +++ b/web/src/common/Services/index.test.ts @@ -23,6 +23,10 @@ describe('buildQueryString', () => { ) }) + it('leaves out undefined values', () => { + expect(buildQueryString({ name: undefined, id: 'job-1' })).toBe('id=job-1') + }) + it('returns an empty string for no params', () => { expect(buildQueryString({})).toBe('') }) diff --git a/web/src/common/Services/index.ts b/web/src/common/Services/index.ts index 0b354b0..36f743c 100644 --- a/web/src/common/Services/index.ts +++ b/web/src/common/Services/index.ts @@ -13,11 +13,12 @@ export const noDataAvailableDescription = 'Please update the filters to find what you need.' export const buildQueryString = ( - params: Record, + params: Record, ): string => { const queryParams = new URLSearchParams() Object.entries(params).forEach(([key, value]) => { + if (value === undefined) return if (Array.isArray(value)) { queryParams.append(key, value.join(',')) } else { diff --git a/web/src/common/Services/status.test.ts b/web/src/common/Services/status.test.ts index 278daa1..ad41323 100644 --- a/web/src/common/Services/status.test.ts +++ b/web/src/common/Services/status.test.ts @@ -21,7 +21,7 @@ describe('resourceStatusVariant', () => { it.each([ ['ACTIVE', 'positive'], ['INACTIVE', 'weak'], - ['DEPRECATED', 'negative'], + ['DELETED', 'negative'], [undefined, 'negative'], ])('maps %s to %s', (status, variant) => { expect(resourceStatusVariant(status)).toBe(variant) diff --git a/web/src/common/Services/status.ts b/web/src/common/Services/status.ts index 6b2b340..dfdcfe7 100644 --- a/web/src/common/Services/status.ts +++ b/web/src/common/Services/status.ts @@ -1,6 +1,8 @@ import type { TagVariant } from '@patterninc/pattern-ui/tag' -const JOB_STATUS_VARIANTS: Record = { +import type { JobStatus } from '@/common/api/types' + +const JOB_STATUS_VARIANTS: Partial> = { SUCCEEDED: 'positive', FAILED: 'negative', RUNNING: 'caution', @@ -10,7 +12,7 @@ const JOB_STATUS_VARIANTS: Record = { } export const jobStatusVariant = (status?: string): TagVariant => - (status && JOB_STATUS_VARIANTS[status]) || 'weak' + (status && JOB_STATUS_VARIANTS[status as JobStatus]) || 'weak' /** Commands and clusters share the ACTIVE / INACTIVE / other lifecycle. */ export const resourceStatusVariant = (status?: string): TagVariant => { diff --git a/web/src/common/api/context.ts b/web/src/common/api/context.ts new file mode 100644 index 0000000..5d268d1 --- /dev/null +++ b/web/src/common/api/context.ts @@ -0,0 +1,23 @@ +import type { ApiContext } from './types' + +/** `context` is free-form in the API contract (each plugin sets its own keys), so read keys with a runtime check. */ +export const contextString = ( + context: ApiContext | undefined, + key: string, +): string | undefined => { + const value = context?.[key] + return typeof value === 'string' && value !== '' ? value : undefined +} + +/** Reads a flat key/value map, such as Spark `properties`, as display strings. */ +export const contextEntries = ( + context: ApiContext | undefined, + key: string, +): [string, string][] => { + const value = context?.[key] + if (!value || typeof value !== 'object' || Array.isArray(value)) return [] + return Object.entries(value).map(([k, v]): [string, string] => [ + k, + typeof v === 'string' ? v : JSON.stringify(v), + ]) +} diff --git a/web/src/common/api/schema.d.ts b/web/src/common/api/schema.d.ts new file mode 100644 index 0000000..5c62467 --- /dev/null +++ b/web/src/common/api/schema.d.ts @@ -0,0 +1,1235 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/jobs": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List jobs, one page at a time + * @description Text filters use SQL `LIKE`, so `%` is a wildcard. The server sorts on + * `order_by` and uses the internal row ID to break ties. To get the next + * page, send `next_cursor` from the last page as `cursor`, with the same + * filters and sort. + */ + get: operations["listJobs"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/job": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Submit a job + * @description The server selects an active command whose tags contain + * `command_criteria`, and an active cluster whose tags contain the + * command's `cluster_tags` and `cluster_criteria`. If more than one pair + * matches, the server selects one at random. + * + * For an async command, the server stores the job and returns it with + * status `NEW`. For a sync command, the server runs the job before it + * responds, and the response can contain `result`. + */ + post: operations["submitJob"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/job/statuses": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** List all job status names */ + get: operations["getJobStatuses"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/job/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a job */ + get: operations["getJob"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/job/{id}/status": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the status of a job */ + get: operations["getJobStatus"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/job/{id}/cancel": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Cancel a job + * @description Sets the job status to `CANCELING`. The job must not be in a final + * status (`FAILED`, `KILLED`, `SUCCEEDED` or `CANCELED`). The server sends + * no request body to the handler, so send an empty body. + */ + post: operations["cancelJob"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/job/{id}/{file}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get an output file of a job + * @description `stdout` and `stderr` are plain text. `result` is JSON. Only the user + * who submitted the job can get `result`, and only after the job + * succeeded. + */ + get: operations["getJobFile"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/commands": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List commands + * @description Returns 101 commands or fewer, newest first. Text filters use SQL `LIKE`. + */ + get: operations["listCommands"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/command/statuses": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** List all command status names */ + get: operations["getCommandStatuses"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/command/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a command */ + get: operations["getCommand"]; + /** + * Create or replace a command + * @description Writes the command to the database. The running server does not load a + * plugin handler for it, so jobs cannot use the command until the server + * restarts with it in its config. + */ + put: operations["upsertCommand"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/command/{id}/status": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the status of a command */ + get: operations["getCommandStatus"]; + /** Set the status of a command */ + put: operations["updateCommandStatus"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/clusters": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List clusters + * @description Returns 101 clusters or fewer, newest first. Text filters use SQL `LIKE`. + */ + get: operations["listClusters"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/cluster/statuses": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** List all cluster status names */ + get: operations["getClusterStatuses"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/clusters/health": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Run health checks on all clusters + * @description Checks each active cluster from the server config that has + * `health_check` set and matches an active command. The status code is + * `200` when no check has status `error`, and `503` when one or more do. + */ + get: operations["getClustersHealth"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/cluster/{id}/health": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Run a health check on one cluster + * @description The cluster must be in the server config and have `health_check` set. + * The status code is `200` also when the check fails. Read `healthy`. + */ + get: operations["getClusterHealth"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/cluster/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a cluster */ + get: operations["getCluster"]; + /** + * Create or replace a cluster + * @description Writes the cluster to the database. The server does not store + * `health_check`, `rbacs` or `attributes`, and health checks and job + * routing use the server config, not this record. + */ + put: operations["upsertCluster"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/cluster/{id}/status": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the status of a cluster */ + get: operations["getClusterStatus"]; + /** Set the status of a cluster */ + put: operations["updateClusterStatus"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + /** @description Error body for every error response. */ + Error: { + /** @description The error message. */ + error: string; + /** @description ID of the object in the request, when the handler had one (for example the job ID of a sync job that failed). */ + id?: string; + }; + /** @enum {string} */ + JobStatus: "NEW" | "ACCEPTED" | "RUNNING" | "FAILED" | "KILLED" | "SUCCEEDED" | "CANCELING" | "CANCELED"; + /** + * @description Status of a command or a cluster. + * @enum {string} + */ + ResourceStatus: "ACTIVE" | "INACTIVE" | "DELETED"; + /** + * @description A `ResourceStatus` value. The server ignores case, so `Active` is also correct. + * @enum {string} + */ + StatusInput: "ACTIVE" | "INACTIVE" | "DELETED" | "active" | "inactive" | "deleted"; + /** + * @description Free-form settings. The plugin sets the keys. The server replaces the + * values of sensitive keys (`password`, `private_key`, `token` and the + * keys in `sensitive_context_keys`) with `REDACTED`. + */ + Context: { + [key: string]: unknown; + }; + /** @description A set of strings, sorted, with no duplicates. */ + Tags: string[]; + /** @description Unix time in seconds. */ + Timestamp: number; + /** @description A value that the cluster `attributes` templates make for a job. */ + JobAttribute: { + /** @description How the UI shows the value. Values are `link` and `text`. */ + kind?: string; + value?: string; + }; + ResultColumn: { + name?: string; + /** @description Column type name, for example `string`, `long` or a database type name. */ + type?: string; + }; + /** @description Tabular result of a job. */ + Result: { + columns?: components["schemas"]["ResultColumn"][]; + /** @description Rows. Each row has one value for each column. */ + data?: unknown[][]; + }; + /** + * @description A stored job, from `GET /job/{id}` and `GET /jobs`. The server leaves + * out fields that are empty, zero or false. + */ + Job: { + id: string; + name?: string; + version?: string; + /** @description The user who submitted the job. */ + user: string; + description?: string; + tags: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + created_at: components["schemas"]["Timestamp"]; + updated_at: components["schemas"]["Timestamp"]; + status: components["schemas"]["JobStatus"]; + /** @description The job ran in the request. The server leaves out `false`. */ + is_sync?: boolean; + /** @description For a sync job, the server writes the result before it responds. The server leaves out `false`. */ + store_result_sync?: boolean; + /** @description Error message of a failed job. */ + error?: string; + command_criteria: components["schemas"]["Tags"]; + cluster_criteria: components["schemas"]["Tags"]; + command_id?: string; + command_name?: string; + cluster_id?: string; + cluster_name?: string; + /** @description The user who canceled the job. */ + canceled_by?: string; + job_attributes?: { + [key: string]: components["schemas"]["JobAttribute"]; + }; + }; + /** + * @description The job from `POST /job`. It does not contain the command, cluster or + * time fields. The server leaves out fields that are empty, zero or false. + */ + SubmittedJob: { + id: string; + name?: string; + version?: string; + /** @description The user who submitted the job. */ + user: string; + description?: string; + tags: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + created_at?: components["schemas"]["Timestamp"]; + updated_at?: components["schemas"]["Timestamp"]; + status: components["schemas"]["JobStatus"]; + /** @description The job ran in the request. The server leaves out `false`. */ + is_sync?: boolean; + /** @description For a sync job, the server writes the result before it responds. The server leaves out `false`. */ + store_result_sync?: boolean; + /** @description Error message of a failed job. */ + error?: string; + command_criteria?: components["schemas"]["Tags"]; + cluster_criteria?: components["schemas"]["Tags"]; + command_id?: string; + command_name?: string; + cluster_id?: string; + cluster_name?: string; + /** @description The user who canceled the job. */ + canceled_by?: string; + job_attributes?: { + [key: string]: components["schemas"]["JobAttribute"]; + }; + result?: components["schemas"]["Result"]; + }; + /** @description Body of `POST /job`. The server issues the job ID and ignores other job fields. */ + JobInput: { + name?: string; + version?: string; + description?: string; + tags?: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + command_criteria: components["schemas"]["Tags"]; + cluster_criteria: components["schemas"]["Tags"]; + store_result_sync?: boolean; + }; + JobStatusSnapshot: { + status: components["schemas"]["JobStatus"]; + error?: string; + updated_at: components["schemas"]["Timestamp"]; + user: string; + }; + JobCancelResponse: { + /** @constant */ + status: "CANCELING"; + }; + JobsPage: { + data: components["schemas"]["Job"][]; + /** @description More rows exist. The server leaves out `false`. */ + has_more?: boolean; + /** @description Send as `cursor` to get the next page. Present only when `has_more` is true. */ + next_cursor?: string; + }; + /** @description A stored command. The server leaves out fields that are empty, zero or false. */ + Command: { + id: string; + name?: string; + version?: string; + /** @description The user who last wrote the command. */ + user: string; + description?: string; + tags: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + created_at: components["schemas"]["Timestamp"]; + updated_at: components["schemas"]["Timestamp"]; + status: components["schemas"]["ResourceStatus"]; + plugin?: string; + /** @description Jobs run in the request. The server leaves out `false`. */ + is_sync?: boolean; + cluster_tags: components["schemas"]["Tags"]; + }; + /** @description Body of `PUT /command/{id}`. The path sets the ID. */ + CommandInput: { + name?: string; + version?: string; + description?: string; + tags?: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + status: components["schemas"]["StatusInput"]; + plugin: string; + is_sync?: boolean; + cluster_tags?: components["schemas"]["Tags"]; + /** @description The server accepts this field but does not store it. */ + allowed_callers?: string[]; + }; + CommandsPage: { + data: components["schemas"]["Command"][]; + }; + /** @description A stored cluster. The server leaves out fields that are empty or zero. */ + Cluster: { + id: string; + name?: string; + version?: string; + /** @description The user who last wrote the cluster. */ + user: string; + description?: string; + tags: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + created_at: components["schemas"]["Timestamp"]; + updated_at: components["schemas"]["Timestamp"]; + status: components["schemas"]["ResourceStatus"]; + }; + /** @description Body of `PUT /cluster/{id}`. The path sets the ID. */ + ClusterInput: { + name?: string; + version?: string; + description?: string; + tags?: components["schemas"]["Tags"]; + context?: components["schemas"]["Context"]; + status: components["schemas"]["StatusInput"]; + /** @description The server accepts this field but does not store it. */ + health_check?: boolean; + /** @description The server accepts this field but does not store it. */ + rbacs?: string[]; + /** @description The server accepts this field but does not store it. */ + attributes?: { + [key: string]: components["schemas"]["JobAttribute"]; + }; + }; + ClustersPage: { + data: components["schemas"]["Cluster"][]; + }; + StatusUpdate: { + status: components["schemas"]["StatusInput"]; + }; + ResourceStatusSnapshot: { + status: components["schemas"]["ResourceStatus"]; + updated_at: components["schemas"]["Timestamp"]; + }; + HealthCheckResult: { + cluster_id: string; + cluster_name: string; + /** @description Plugin of the command that the check used. */ + plugin: string; + /** + * @description `unchecked` means that the plugin has no health check. + * @enum {string} + */ + status: "ok" | "error" | "unchecked"; + latency_ms: number; + error?: string; + }; + HealthChecks: { + /** @description No check has status `error`. */ + healthy: boolean; + checks: components["schemas"]["HealthCheckResult"][]; + }; + }; + responses: { + /** @description The request has no caller. Only requests that are not `GET` need a caller. */ + Unauthorized: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** + * @description Any other error, for example an unknown ID, a body that is not valid + * JSON, or a database error. + */ + ServerError: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + parameters: { + /** @description Job ID (a UUID that the server issues). */ + JobId: string; + /** @description Command ID. */ + CommandId: string; + /** @description Cluster ID. */ + ClusterId: string; + /** @description Filter on the user name (SQL `LIKE`). */ + UsernameFilter: string; + /** @description Filter on the ID (SQL `LIKE`). */ + IdFilter: string; + /** @description Filter on the name (SQL `LIKE`). */ + NameFilter: string; + /** @description Filter on the version (SQL `LIKE`). */ + VersionFilter: string; + /** @description Status names, for example `RUNNING,FAILED`. An item matches one of them. */ + StatusFilter: string[]; + }; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + listJobs: { + parameters: { + query?: { + /** @description Filter on the user name (SQL `LIKE`). */ + username?: components["parameters"]["UsernameFilter"]; + /** @description Filter on the ID (SQL `LIKE`). */ + id?: components["parameters"]["IdFilter"]; + /** @description Filter on the name (SQL `LIKE`). */ + name?: components["parameters"]["NameFilter"]; + /** @description Filter on the version (SQL `LIKE`). */ + version?: components["parameters"]["VersionFilter"]; + /** @description Filter on the command name (SQL `LIKE`). */ + command?: string; + /** @description Filter on the cluster name (SQL `LIKE`). */ + cluster?: string; + /** @description Status names, for example `RUNNING,FAILED`. An item matches one of them. */ + status?: components["parameters"]["StatusFilter"]; + /** @description Job tags, for example `team:data`. A job must have all of the tags. */ + tags?: string[]; + /** @description Page size. Values below 1 or that are not numbers use the default. Values above 101 use 101. */ + limit?: number; + /** @description The `next_cursor` value from the last page. Do not send it for the first page. */ + cursor?: string; + /** @description Sort column. Other values sort on the internal row ID. */ + order_by?: "id" | "created_at" | "updated_at"; + /** @description Sort direction. Values other than `asc` sort descending. */ + direction?: "asc" | "desc"; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description One page of jobs. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["JobsPage"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + submitJob: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["JobInput"]; + }; + }; + responses: { + /** @description The accepted job. For a sync job, the job after it ran. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SubmittedJob"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + /** @description The caller is not in the `allowed_callers` list of the selected command. */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getJobStatuses: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All job status names, sorted. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["JobStatus"][]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Job ID (a UUID that the server issues). */ + id: components["parameters"]["JobId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The job. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Job"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getJobStatus: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Job ID (a UUID that the server issues). */ + id: components["parameters"]["JobId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The status fields of the job. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["JobStatusSnapshot"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + cancelJob: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Job ID (a UUID that the server issues). */ + id: components["parameters"]["JobId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The job is now canceling. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["JobCancelResponse"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 500: components["responses"]["ServerError"]; + }; + }; + getJobFile: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Job ID (a UUID that the server issues). */ + id: components["parameters"]["JobId"]; + file: "stdout" | "stderr" | "result"; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The file content. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "text/plain": string; + "application/json": components["schemas"]["Result"]; + }; + }; + /** @description `result` only. The caller did not submit the job. */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description `result` only. The job did not succeed. */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + listCommands: { + parameters: { + query?: { + /** @description Filter on the user name (SQL `LIKE`). */ + username?: components["parameters"]["UsernameFilter"]; + /** @description Filter on the ID (SQL `LIKE`). */ + id?: components["parameters"]["IdFilter"]; + /** @description Filter on the name (SQL `LIKE`). */ + name?: components["parameters"]["NameFilter"]; + /** @description Filter on the version (SQL `LIKE`). */ + version?: components["parameters"]["VersionFilter"]; + /** @description Filter on the plugin name (SQL `LIKE`). */ + plugin?: string; + /** @description Status names, for example `RUNNING,FAILED`. An item matches one of them. */ + status?: components["parameters"]["StatusFilter"]; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The commands that match the filters. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["CommandsPage"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getCommandStatuses: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All command status names, sorted. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceStatus"][]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getCommand: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Command ID. */ + id: components["parameters"]["CommandId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The command. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Command"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + upsertCommand: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Command ID. */ + id: components["parameters"]["CommandId"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["CommandInput"]; + }; + }; + responses: { + /** @description The stored command. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Command"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 500: components["responses"]["ServerError"]; + }; + }; + getCommandStatus: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Command ID. */ + id: components["parameters"]["CommandId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The status fields of the command. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceStatusSnapshot"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + updateCommandStatus: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Command ID. */ + id: components["parameters"]["CommandId"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["StatusUpdate"]; + }; + }; + responses: { + /** @description The status fields of the command after the update. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceStatusSnapshot"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 500: components["responses"]["ServerError"]; + }; + }; + listClusters: { + parameters: { + query?: { + /** @description Filter on the user name (SQL `LIKE`). */ + username?: components["parameters"]["UsernameFilter"]; + /** @description Filter on the ID (SQL `LIKE`). */ + id?: components["parameters"]["IdFilter"]; + /** @description Filter on the name (SQL `LIKE`). */ + name?: components["parameters"]["NameFilter"]; + /** @description Filter on the version (SQL `LIKE`). */ + version?: components["parameters"]["VersionFilter"]; + /** @description Status names, for example `RUNNING,FAILED`. An item matches one of them. */ + status?: components["parameters"]["StatusFilter"]; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The clusters that match the filters. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ClustersPage"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getClusterStatuses: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description All cluster status names, sorted. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceStatus"][]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getClustersHealth: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description No check failed. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HealthChecks"]; + }; + }; + 500: components["responses"]["ServerError"]; + /** @description One or more checks failed. */ + 503: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HealthChecks"]; + }; + }; + }; + }; + getClusterHealth: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cluster ID. */ + id: components["parameters"]["ClusterId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The result of the check. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["HealthChecks"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + getCluster: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cluster ID. */ + id: components["parameters"]["ClusterId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The cluster. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Cluster"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + upsertCluster: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cluster ID. */ + id: components["parameters"]["ClusterId"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ClusterInput"]; + }; + }; + responses: { + /** @description The stored cluster. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Cluster"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 500: components["responses"]["ServerError"]; + }; + }; + getClusterStatus: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cluster ID. */ + id: components["parameters"]["ClusterId"]; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The status fields of the cluster. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceStatusSnapshot"]; + }; + }; + 500: components["responses"]["ServerError"]; + }; + }; + updateClusterStatus: { + parameters: { + query?: never; + header?: never; + path: { + /** @description Cluster ID. */ + id: components["parameters"]["ClusterId"]; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["StatusUpdate"]; + }; + }; + responses: { + /** @description The status fields of the cluster after the update. */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ResourceStatusSnapshot"]; + }; + }; + 401: components["responses"]["Unauthorized"]; + 500: components["responses"]["ServerError"]; + }; + }; +} diff --git a/web/src/common/api/types.ts b/web/src/common/api/types.ts new file mode 100644 index 0000000..85252d1 --- /dev/null +++ b/web/src/common/api/types.ts @@ -0,0 +1,27 @@ +import type { components, operations } from './schema' + +type Schemas = components['schemas'] + +type QueryOf = NonNullable< + operations[Op]['parameters']['query'] +> + +export type ApiError = Schemas['Error'] +export type ApiContext = Schemas['Context'] + +export type JobStatus = Schemas['JobStatus'] +export type ResourceStatus = Schemas['ResourceStatus'] + +export type Job = Schemas['Job'] +export type JobAttribute = Schemas['JobAttribute'] +export type JobsPage = Schemas['JobsPage'] +export type JobCancelResponse = Schemas['JobCancelResponse'] +export type JobsQuery = QueryOf<'listJobs'> + +export type Command = Schemas['Command'] +export type CommandsPage = Schemas['CommandsPage'] +export type CommandsQuery = QueryOf<'listCommands'> + +export type Cluster = Schemas['Cluster'] +export type ClustersPage = Schemas['ClustersPage'] +export type ClustersQuery = QueryOf<'listClusters'> diff --git a/web/src/modules/Clusters/Clusters.tsx b/web/src/modules/Clusters/Clusters.tsx index dad0401..e9a2c7f 100644 --- a/web/src/modules/Clusters/Clusters.tsx +++ b/web/src/modules/Clusters/Clusters.tsx @@ -13,12 +13,8 @@ import { FilterMenu } from '@/components/FilterMenu/FilterMenu' import type { FilterDimension } from '@/components/FilterMenu/filterTypes' import ListEmptyState from '@/components/ListPage/ListEmptyState' import ListPage from '@/components/ListPage/ListPage' -import { - ApiParams, - CLUSTER_COLUMNS, - ClusterType, - toClusterRows, -} from './Helper' +import type { ClustersQuery } from '@/common/api/types' +import { CLUSTER_COLUMNS, toClusterRows } from './Helper' const FILTER_DEBOUNCE_MS = 300 @@ -45,7 +41,7 @@ const Clusters = (): React.JSX.Element => { serialize: (value) => value?.join(',') ?? '', }) - const filterParams: ApiParams = {} + const filterParams: ClustersQuery = {} if (clusterId) filterParams.id = clusterId if (user) filterParams.username = user if (clusterName) filterParams.name = clusterName @@ -56,14 +52,14 @@ const Clusters = (): React.JSX.Element => { equalityFn: isSameJson, }) - const { data, isPending, isPlaceholderData } = useQuery({ + const { data, isPending, isPlaceholderData } = useQuery({ queryKey: ['clusters', debouncedParams], queryFn: () => getClusters(debouncedParams), refetchInterval: refreshInterval.value, placeholderData: (prev) => prev, }) - const { data: statusData } = useQuery({ + const { data: statusData } = useQuery({ queryKey: ['clusterStatuses'], queryFn: getClusterStatus, }) diff --git a/web/src/modules/Clusters/ClustersDetails/ClusterInformationPane.tsx b/web/src/modules/Clusters/ClustersDetails/ClusterInformationPane.tsx index d0c3a75..0b2b6db 100644 --- a/web/src/modules/Clusters/ClustersDetails/ClusterInformationPane.tsx +++ b/web/src/modules/Clusters/ClustersDetails/ClusterInformationPane.tsx @@ -1,14 +1,15 @@ import DetailSection from '@/components/DetailPage/DetailSection' import React from 'react' +import { contextEntries, contextString } from '@/common/api/context' +import type { Cluster } from '@/common/api/types' import { formatDateWithTimeZone, myTimezone } from '@/common/Services' import DetailFields from '@/components/DetailPage/DetailFields' import KeyValueList from '@/components/DetailPage/KeyValueList' import TagList from '@/components/DetailPage/TagList' -import { ClusterType } from '../Helper' type ClusterInformationPaneProps = { - cluster?: ClusterType + cluster?: Cluster isLoading: boolean } @@ -17,14 +18,11 @@ const ClusterInformationPane = ({ isLoading, }: ClusterInformationPaneProps): React.JSX.Element => { const context = cluster?.context - const properties = Object.entries(context?.properties ?? {}).map( - ([key, value]): [string, string] => [key, String(value)], - ) - const hasRuntime = Boolean( - context?.emr_release_label || - context?.role_arn || - context?.execution_role_arn, - ) + const properties = contextEntries(context, 'properties') + const emrReleaseLabel = contextString(context, 'emr_release_label') + const roleArn = contextString(context, 'role_arn') + const executionRoleArn = contextString(context, 'execution_role_arn') + const hasRuntime = Boolean(emrReleaseLabel || roleArn || executionRoleArn) return ( <> @@ -58,13 +56,13 @@ const ClusterInformationPane = ({ fields={[ { label: 'EMR release', - value: context?.emr_release_label, + value: emrReleaseLabel, mono: true, }, - { label: 'Role ARN', value: context?.role_arn, mono: true }, + { label: 'Role ARN', value: roleArn, mono: true }, { label: 'Execution role ARN', - value: context?.execution_role_arn, + value: executionRoleArn, mono: true, }, ]} diff --git a/web/src/modules/Clusters/ClustersDetails/ClustersDetails.tsx b/web/src/modules/Clusters/ClustersDetails/ClustersDetails.tsx index bbfbc5b..8d16fc0 100644 --- a/web/src/modules/Clusters/ClustersDetails/ClustersDetails.tsx +++ b/web/src/modules/Clusters/ClustersDetails/ClustersDetails.tsx @@ -7,7 +7,6 @@ import { getCluster } from '@/app/api/clusters/clusters' import { resourceStatusVariant } from '@/common/Services/status' import DetailPage from '@/components/DetailPage/DetailPage' import ApiResponseButton from '@/components/ApiResponseButton/ApiResponseButton' -import { ClusterType } from '../Helper' import ClusterInformationPane from './ClusterInformationPane' type ClusterDetailsProps = { @@ -16,7 +15,7 @@ type ClusterDetailsProps = { } const ClustersDetails = ({ id }: ClusterDetailsProps): React.JSX.Element => { - const { data, isPending, isError } = useQuery({ + const { data, isPending, isError } = useQuery({ queryKey: ['cluster', id], queryFn: () => getCluster(id), }) diff --git a/web/src/modules/Clusters/Helper.tsx b/web/src/modules/Clusters/Helper.tsx index 43a5dd7..0c9456c 100644 --- a/web/src/modules/Clusters/Helper.tsx +++ b/web/src/modules/Clusters/Helper.tsx @@ -2,39 +2,12 @@ import type { TableColumn, TableDataRow } from '@patterninc/pattern-ui/table' import { Tag } from '@patterninc/pattern-ui/tag' import React from 'react' +import type { Cluster } from '@/common/api/types' import { formatDateWithTimeZone, myTimezone, orDash } from '@/common/Services' import { resourceStatusVariant } from '@/common/Services/status' import RowActionButton from '@/components/ListPage/RowActionButton' -export type ClusterContext = { - emr_release_label: string - execution_role_arn: string - properties: Record - role_arn: string -} - -export type ClusterType = { - id: string - name: string - version: string - user: string - description: string - tags: string[] - context: ClusterContext - created_at: number - updated_at: number - status: string -} - -export type ApiParams = { - id?: string - username?: string - name?: string - version?: string - status?: string[] -} - -/** Sorted client-side, so every column key must be a `ClusterType` field. */ +/** Sorted client-side, so every column key must be a `Cluster` field. */ export const CLUSTER_COLUMNS: TableColumn[] = [ { key: 'name', header: 'Name', sortable: true, minWidth: '200px' }, { key: 'version', header: 'Version', sortable: true }, @@ -45,7 +18,7 @@ export const CLUSTER_COLUMNS: TableColumn[] = [ { key: 'actions', header: '', minWidth: '88px' }, ] -export const toClusterRows = (clusters: ClusterType[]): TableDataRow[] => +export const toClusterRows = (clusters: Cluster[]): TableDataRow[] => clusters.map((cluster) => ({ name: cluster.name || cluster.id, version: orDash(cluster.version), diff --git a/web/src/modules/Commands/CommandDetails/CommandDetails.tsx b/web/src/modules/Commands/CommandDetails/CommandDetails.tsx index 471f898..c450efa 100644 --- a/web/src/modules/Commands/CommandDetails/CommandDetails.tsx +++ b/web/src/modules/Commands/CommandDetails/CommandDetails.tsx @@ -7,7 +7,6 @@ import { getCommandDetails } from '@/app/api/commands/commands' import { resourceStatusVariant } from '@/common/Services/status' import DetailPage from '@/components/DetailPage/DetailPage' import ApiResponseButton from '@/components/ApiResponseButton/ApiResponseButton' -import { CommandType } from '../Helper' import CommandInformationPane from './CommandInformationPane' type CommandDetailsProp = { @@ -18,7 +17,7 @@ type CommandDetailsProp = { export const CommandDetails = ({ id, }: CommandDetailsProp): React.JSX.Element => { - const { data, isPending, isError } = useQuery({ + const { data, isPending, isError } = useQuery({ queryKey: ['commandDetails', id], queryFn: () => getCommandDetails(id), }) diff --git a/web/src/modules/Commands/CommandDetails/CommandInformationPane.tsx b/web/src/modules/Commands/CommandDetails/CommandInformationPane.tsx index 6271afe..a4742d5 100644 --- a/web/src/modules/Commands/CommandDetails/CommandInformationPane.tsx +++ b/web/src/modules/Commands/CommandDetails/CommandInformationPane.tsx @@ -1,6 +1,8 @@ import DetailSection from '@/components/DetailPage/DetailSection' import React from 'react' +import { contextEntries, contextString } from '@/common/api/context' +import type { Command } from '@/common/api/types' import { formatDateWithTimeZone, myTimezone } from '@/common/Services' import DetailFields from '@/components/DetailPage/DetailFields' import ExternalLinkList, { @@ -8,10 +10,9 @@ import ExternalLinkList, { } from '@/components/DetailPage/ExternalLinkList' import KeyValueList from '@/components/DetailPage/KeyValueList' import TagList from '@/components/DetailPage/TagList' -import { CommandType } from '../Helper' type CommandInformationPaneProps = { - command?: CommandType + command?: Command isLoading: boolean } @@ -21,13 +22,11 @@ const CommandInformationPane = ({ }: CommandInformationPaneProps): React.JSX.Element => { const context = command?.context const links: ExternalLink[] = [ - { label: 'Logs', href: context?.logs_uri }, - { label: 'Queries', href: context?.queries_uri }, - { label: 'Results', href: context?.results_uri }, + { label: 'Logs', href: contextString(context, 'logs_uri') }, + { label: 'Queries', href: contextString(context, 'queries_uri') }, + { label: 'Results', href: contextString(context, 'results_uri') }, ].filter((link): link is ExternalLink => Boolean(link.href)) - const properties = Object.entries(context?.properties ?? {}).map( - ([key, value]): [string, string] => [key, String(value)], - ) + const properties = contextEntries(context, 'properties') return ( <> diff --git a/web/src/modules/Commands/Commands.tsx b/web/src/modules/Commands/Commands.tsx index 1d172dd..0a26d26 100644 --- a/web/src/modules/Commands/Commands.tsx +++ b/web/src/modules/Commands/Commands.tsx @@ -13,12 +13,8 @@ import { FilterMenu } from '@/components/FilterMenu/FilterMenu' import type { FilterDimension } from '@/components/FilterMenu/filterTypes' import ListEmptyState from '@/components/ListPage/ListEmptyState' import ListPage from '@/components/ListPage/ListPage' -import { - ApiParams, - COMMAND_COLUMNS, - CommandType, - toCommandRows, -} from './Helper' +import type { CommandsQuery } from '@/common/api/types' +import { COMMAND_COLUMNS, toCommandRows } from './Helper' const FILTER_DEBOUNCE_MS = 300 @@ -46,7 +42,7 @@ const Commands = (): React.JSX.Element => { serialize: (value) => value?.join(',') ?? '', }) - const filterParams: ApiParams = {} + const filterParams: CommandsQuery = {} if (commandId) filterParams.id = commandId if (user) filterParams.username = user if (commandName) filterParams.name = commandName @@ -58,14 +54,14 @@ const Commands = (): React.JSX.Element => { equalityFn: isSameJson, }) - const { data, isPending, isPlaceholderData } = useQuery({ + const { data, isPending, isPlaceholderData } = useQuery({ queryKey: ['commands', debouncedParams], queryFn: () => getCommands(debouncedParams), refetchInterval: refreshInterval.value, placeholderData: (prev) => prev, }) - const { data: statusData } = useQuery({ + const { data: statusData } = useQuery({ queryKey: ['commandStatuses'], queryFn: getCommandStatus, }) diff --git a/web/src/modules/Commands/Helper.tsx b/web/src/modules/Commands/Helper.tsx index 4d8bd9d..b501a79 100644 --- a/web/src/modules/Commands/Helper.tsx +++ b/web/src/modules/Commands/Helper.tsx @@ -2,49 +2,13 @@ import type { TableColumn, TableDataRow } from '@patterninc/pattern-ui/table' import { Tag } from '@patterninc/pattern-ui/tag' import React from 'react' +import type { Command } from '@/common/api/types' import { formatDateWithTimeZone, myTimezone, orDash } from '@/common/Services' import { resourceStatusVariant } from '@/common/Services/status' import RowActionButton from '@/components/ListPage/RowActionButton' import TruncatedText from '@/components/TruncatedText/TruncatedText' -export type ApiParams = { - id?: string - username?: string - name?: string - plugin?: string - version?: string - status?: string[] -} - -export type CommandContext = { - logs_uri?: string - properties?: { - 'spark.driver.cores'?: string - 'spark.executor.cores'?: string - 'spark.executor.instances'?: string - 'spark.executor.memory'?: string - } - queries_uri?: string - results_uri?: string -} - -export type CommandType = { - id: string - name: string - version: string - user: string - description: string - tags: string[] - created_at: number - updated_at: number - status: string - plugin: string - cluster_tags?: string[] - is_sync?: boolean - context?: CommandContext -} - -/** Sorted client-side, so every column key must be a `CommandType` field. */ +/** Sorted client-side, so every column key must be a `Command` field. */ export const COMMAND_COLUMNS: TableColumn[] = [ { key: 'name', header: 'Name', sortable: true, minWidth: '200px' }, { key: 'version', header: 'Version', sortable: true }, @@ -62,7 +26,7 @@ export const COMMAND_COLUMNS: TableColumn[] = [ { key: 'actions', header: '', minWidth: '88px' }, ] -export const toCommandRows = (commands: CommandType[]): TableDataRow[] => +export const toCommandRows = (commands: Command[]): TableDataRow[] => commands.map((command) => ({ name: command.name || command.id, version: orDash(command.version), diff --git a/web/src/modules/Jobs/Helper.tsx b/web/src/modules/Jobs/Helper.tsx index 7b20a25..d10ee0d 100644 --- a/web/src/modules/Jobs/Helper.tsx +++ b/web/src/modules/Jobs/Helper.tsx @@ -2,34 +2,14 @@ import type { TableColumn, TableDataRow } from '@patterninc/pattern-ui/table' import { Tag } from '@patterninc/pattern-ui/tag' import React from 'react' +import type { Job } from '@/common/api/types' import { formatDateWithTimeZone, myTimezone, orDash } from '@/common/Services' import { jobStatusVariant } from '@/common/Services/status' import RowActionButton from '@/components/ListPage/RowActionButton' import TruncatedText from '@/components/TruncatedText/TruncatedText' -export type ApiParams = { - id?: string - username?: string - name?: string - version?: string - cluster?: string - command?: string - status?: string[] - tags?: string - limit?: string - cursor?: string - order_by?: string - direction?: string -} - export const JOBS_PAGE_SIZE = 20 -export type JobsResponse = { - data: JobType[] - has_more?: boolean - next_cursor?: string -} - export type TagPair = { key: string value: string @@ -56,38 +36,6 @@ export const parseTags = (value: string): TagPair[] => return acc }, []) -export type JobType = { - id: string - name: string - version: string - user: string - tags: string[] - created_at: number - updated_at: number - status: string - is_sync: boolean - command_criteria: string[] - cluster_criteria: string[] - command_id: string - command_name: string - cluster_id: string - cluster_name: string - canceled_by?: string - job_attributes?: Record - error?: string - context?: { - properties: { - 'spark.driver.cores': string - 'spark.driver.memory': string - 'spark.executor.cores': string - 'spark.executor.instances': string - 'spark.executor.memory': string - } - query: string - return_result?: boolean - } -} - /** Column keys double as the server's `order_by` values for sortable columns. */ export const JOB_COLUMNS: TableColumn[] = [ { key: 'id', header: 'Job ID', sortable: true, wrap: 'nowrap' }, @@ -102,7 +50,7 @@ export const JOB_COLUMNS: TableColumn[] = [ { key: 'actions', header: '', minWidth: '88px' }, ] -export const toJobRows = (jobs: JobType[]): TableDataRow[] => +export const toJobRows = (jobs: Job[]): TableDataRow[] => jobs.map((job) => ({ id: job.id, name: job.name ? ( diff --git a/web/src/modules/Jobs/JobDetails/CancelJobButton.tsx b/web/src/modules/Jobs/JobDetails/CancelJobButton.tsx index 787a6cd..769f5fa 100644 --- a/web/src/modules/Jobs/JobDetails/CancelJobButton.tsx +++ b/web/src/modules/Jobs/JobDetails/CancelJobButton.tsx @@ -8,13 +8,13 @@ import { useMutation, useQueryClient } from '@tanstack/react-query' import React, { useState } from 'react' import { cancelJob } from '@/app/api/jobs/jobs' +import type { Job, JobStatus } from '@/common/api/types' import { useIsSmUp } from '@/common/hooks/useIsSmUp' -import { JobType } from '../Helper' -const CANCELABLE_STATUSES = ['NEW', 'ACCEPTED', 'RUNNING'] +const CANCELABLE_STATUSES: JobStatus[] = ['NEW', 'ACCEPTED', 'RUNNING'] type CancelJobButtonProps = { - job: JobType + job: Job } const CancelJobButton = ({ job }: CancelJobButtonProps): React.JSX.Element => { @@ -26,13 +26,13 @@ const CancelJobButton = ({ job }: CancelJobButtonProps): React.JSX.Element => { mutationFn: (id: string) => cancelJob(id), onSuccess: (response) => { setConfirmOpen(false) - if (response.status === 'CANCELING') { + if ('status' in response && response.status === 'CANCELING') { pulse.info({ title: 'Job is being canceled…' }) queryClient.invalidateQueries({ queryKey: ['job', job.id] }) } else { pulse.error({ title: 'Failed to cancel job', - description: response.error, + description: 'error' in response ? response.error : undefined, }) } }, diff --git a/web/src/modules/Jobs/JobDetails/JobDetails.tsx b/web/src/modules/Jobs/JobDetails/JobDetails.tsx index 2cbbf51..e07acab 100644 --- a/web/src/modules/Jobs/JobDetails/JobDetails.tsx +++ b/web/src/modules/Jobs/JobDetails/JobDetails.tsx @@ -7,7 +7,6 @@ import { getJobDetails } from '@/app/api/jobs/jobs' import { jobStatusVariant } from '@/common/Services/status' import DetailPage from '@/components/DetailPage/DetailPage' import ApiResponseButton from '@/components/ApiResponseButton/ApiResponseButton' -import { JobType } from '../Helper' import CancelJobButton from './CancelJobButton' import JobInformationPane from './JobInformationPane' @@ -20,7 +19,7 @@ const JobDetails = ({ id }: JobDetailsProp): React.JSX.Element => { data: jobData, isPending, isError, - } = useQuery({ + } = useQuery({ queryKey: ['job', id], queryFn: () => getJobDetails(id), }) @@ -46,7 +45,10 @@ const JobDetails = ({ id }: JobDetailsProp): React.JSX.Element => { } > - + ) } diff --git a/web/src/modules/Jobs/JobDetails/JobInformationPane.tsx b/web/src/modules/Jobs/JobDetails/JobInformationPane.tsx index 41cbcee..bdb389a 100644 --- a/web/src/modules/Jobs/JobDetails/JobInformationPane.tsx +++ b/web/src/modules/Jobs/JobDetails/JobInformationPane.tsx @@ -4,6 +4,8 @@ import DetailSection from '@/components/DetailPage/DetailSection' import Link from 'next/link' import React from 'react' +import { contextEntries, contextString } from '@/common/api/context' +import type { Job } from '@/common/api/types' import { formatDateWithTimeZone, myTimezone } from '@/common/Services' import DetailFields from '@/components/DetailPage/DetailFields' import ExternalLinkList, { @@ -11,10 +13,9 @@ import ExternalLinkList, { } from '@/components/DetailPage/ExternalLinkList' import KeyValueList from '@/components/DetailPage/KeyValueList' import TagList from '@/components/DetailPage/TagList' -import { JobType } from '../Helper' type JobInformationPaneProps = { - jobData?: JobType + jobData?: Job isLoading: boolean } @@ -38,7 +39,8 @@ const JobInformationPane = ({ const textAttributes: [string, string][] = attributes .filter(([, attr]) => attr?.kind !== 'link') .map(([label, attr]) => [label, attr?.value ?? '—']) - const properties = Object.entries(jobData?.context?.properties ?? {}) + const properties = contextEntries(jobData?.context, 'properties') + const query = contextString(jobData?.context, 'query') return ( <> @@ -123,12 +125,12 @@ const JobInformationPane = ({ ) : null} - {jobData?.context?.query ? ( + {query ? ( {/* The theme sets inline `white-space: pre` on pre/code, hence the important modifiers to wrap long lines. */}
diff --git a/web/src/modules/Jobs/Jobs.tsx b/web/src/modules/Jobs/Jobs.tsx index 1c3eaf5..90b7710 100644 --- a/web/src/modules/Jobs/Jobs.tsx +++ b/web/src/modules/Jobs/Jobs.tsx @@ -5,7 +5,7 @@ import { useQueryState } from 'nuqs' import React, { useContext, useState } from 'react' import { useDebounceValue } from 'usehooks-ts' -import { fetchJobs, getJobStatus } from '@/app/api/jobs/jobs' +import { type JobFilters, fetchJobs, getJobStatus } from '@/app/api/jobs/jobs' import { AutoRefreshContext } from '@/common/AutoRefreshProvider/context' import { SortBy, toggleSort } from '@/common/Services' import { FilterMenu } from '@/components/FilterMenu/FilterMenu' @@ -13,7 +13,6 @@ import type { FilterDimension } from '@/components/FilterMenu/filterTypes' import ListEmptyState from '@/components/ListPage/ListEmptyState' import ListPage from '@/components/ListPage/ListPage' import { - ApiParams, JOB_COLUMNS, JOBS_PAGE_SIZE, TagPair, @@ -60,7 +59,7 @@ const Jobs = (): React.JSX.Element => { serialize: (value) => serializeTags(value), }) - const filterParams: ApiParams = {} + const filterParams: JobFilters = {} if (jobId) filterParams.id = jobId if (name) filterParams.name = name if (user) filterParams.username = user @@ -69,7 +68,7 @@ const Jobs = (): React.JSX.Element => { if (commandId) filterParams.command = commandId if (status.length > 0) filterParams.status = status const serializedTags = serializeTags(tags) - if (serializedTags) filterParams.tags = serializedTags + if (serializedTags) filterParams.tags = serializedTags.split(',') // Text filters apply as you type; debounce so each keystroke doesn't hit the API. const [debouncedParams] = useDebounceValue(filterParams, FILTER_DEBOUNCE_MS, { @@ -104,7 +103,7 @@ const Jobs = (): React.JSX.Element => { placeholderData: (prev) => prev, }) - const { data: jobStatuses } = useQuery({ + const { data: jobStatuses } = useQuery({ queryKey: ['jobStatuses'], queryFn: getJobStatus, }) diff --git a/web/src/test/fixtures/clusters.ts b/web/src/test/fixtures/clusters.ts index 83b751b..171e462 100644 --- a/web/src/test/fixtures/clusters.ts +++ b/web/src/test/fixtures/clusters.ts @@ -1,9 +1,7 @@ -import type { ClusterType } from '@/modules/Clusters/Helper' +import type { Cluster, ResourceStatus } from '@/common/api/types' import { FIXTURE_CREATED_AT, FIXTURE_UPDATED_AT } from './jobs' -export const buildCluster = ( - overrides: Partial = {}, -): ClusterType => ({ +export const buildCluster = (overrides: Partial = {}): Cluster => ({ id: 'cluster-emr', name: 'emr-prod', version: '7.1.0', @@ -22,7 +20,7 @@ export const buildCluster = ( ...overrides, }) -export const clusters: ClusterType[] = [ +export const clusters: Cluster[] = [ buildCluster(), buildCluster({ id: 'cluster-local', @@ -41,4 +39,4 @@ export const clusters: ClusterType[] = [ }), ] -export const clusterStatuses = ['ACTIVE', 'INACTIVE'] +export const clusterStatuses: ResourceStatus[] = ['ACTIVE', 'INACTIVE'] diff --git a/web/src/test/fixtures/commands.ts b/web/src/test/fixtures/commands.ts index a21de95..7bf5eee 100644 --- a/web/src/test/fixtures/commands.ts +++ b/web/src/test/fixtures/commands.ts @@ -1,9 +1,7 @@ -import type { CommandType } from '@/modules/Commands/Helper' +import type { Command, ResourceStatus } from '@/common/api/types' import { FIXTURE_CREATED_AT, FIXTURE_UPDATED_AT } from './jobs' -export const buildCommand = ( - overrides: Partial = {}, -): CommandType => ({ +export const buildCommand = (overrides: Partial = {}): Command => ({ id: 'cmd-spark', name: 'spark-sql', version: '3.5.0', @@ -25,7 +23,7 @@ export const buildCommand = ( ...overrides, }) -export const commands: CommandType[] = [ +export const commands: Command[] = [ buildCommand(), buildCommand({ id: 'cmd-shell', @@ -46,8 +44,12 @@ export const commands: CommandType[] = [ user: 'carol', description: '', plugin: 'ping', - status: 'DEPRECATED', + status: 'DELETED', }), ] -export const commandStatuses = ['ACTIVE', 'INACTIVE', 'DEPRECATED'] +export const commandStatuses: ResourceStatus[] = [ + 'ACTIVE', + 'INACTIVE', + 'DELETED', +] diff --git a/web/src/test/fixtures/jobs.ts b/web/src/test/fixtures/jobs.ts index a5c012a..78f27d1 100644 --- a/web/src/test/fixtures/jobs.ts +++ b/web/src/test/fixtures/jobs.ts @@ -1,11 +1,11 @@ -import type { JobType, JobsResponse } from '@/modules/Jobs/Helper' +import type { Job, JobStatus, JobsPage } from '@/common/api/types' /** 2026-01-15 10:30:00 UTC */ export const FIXTURE_CREATED_AT = 1768473000 /** 2026-01-15 10:45:00 UTC */ export const FIXTURE_UPDATED_AT = 1768473900 -export const buildJob = (overrides: Partial = {}): JobType => ({ +export const buildJob = (overrides: Partial = {}): Job => ({ id: 'job-0001', name: 'daily-revenue-rollup', version: '1.2.0', @@ -38,7 +38,7 @@ export const buildJob = (overrides: Partial = {}): JobType => ({ ...overrides, }) -export const jobs: JobType[] = [ +export const jobs: Job[] = [ buildJob(), buildJob({ id: 'job-0002', @@ -58,15 +58,15 @@ export const jobs: JobType[] = [ ] export const jobsPage = ( - data: JobType[] = jobs, + data: Job[] = jobs, next_cursor?: string, -): JobsResponse => ({ +): JobsPage => ({ data, has_more: Boolean(next_cursor), next_cursor, }) -export const jobStatuses = [ +export const jobStatuses: JobStatus[] = [ 'NEW', 'ACCEPTED', 'RUNNING', diff --git a/web/src/test/integration/jobs.test.tsx b/web/src/test/integration/jobs.test.tsx index 20892c3..7a2af7b 100644 --- a/web/src/test/integration/jobs.test.tsx +++ b/web/src/test/integration/jobs.test.tsx @@ -16,7 +16,7 @@ describe('Jobs list page', () => { expect(await screen.findByText('3 results')).toBeInTheDocument() for (const job of jobs) { const row = screen.getByTestId(`job-row-${job.id}`) - expect(within(row).getByText(job.name)).toBeInTheDocument() + expect(within(row).getByText(job.name!)).toBeInTheDocument() expect(within(row).getByText(job.status)).toBeInTheDocument() expect(within(row).getByRole('button', { name: 'View' })).toHaveAttribute( 'href', From 6129ec8435b9498f27585f695f605f111d58601f Mon Sep 17 00:00:00 2001 From: "oly-agents[bot]" <312679908+oly-agents[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:01:48 +0000 Subject: [PATCH 2/2] api: require the tag sets that the command and cluster upserts read commandUpsert and clusterUpsert call SliceAny on tags (and cluster_tags for commands) with no nil check, so a PUT body without these keys panics and the client gets no response. The spec now marks them as required in CommandInput and ClusterInput, and schema.d.ts is regenerated. TestOpenAPIInputsRequireTheSetsTheHandlerReads fails when an input schema does not require a set field of its Go type, except the sets that the handler fills itself (job tags) or never reads (allowed_callers). Co-Authored-By: Claude Opus 5.5 Co-authored-by: Gaurav Warale --- api/openapi.yaml | 4 +-- internal/pkg/heimdall/openapi_test.go | 44 +++++++++++++++++++++++++++ web/src/common/api/schema.d.ts | 6 ++-- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 3e96866..bb481ba 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -906,7 +906,7 @@ components: CommandInput: type: object description: Body of `PUT /command/{id}`. The path sets the ID. - required: [status, plugin] + required: [status, plugin, tags, cluster_tags] properties: name: type: string @@ -968,7 +968,7 @@ components: ClusterInput: type: object description: Body of `PUT /cluster/{id}`. The path sets the ID. - required: [status] + required: [status, tags] properties: name: type: string diff --git a/internal/pkg/heimdall/openapi_test.go b/internal/pkg/heimdall/openapi_test.go index 124cea1..74da9a4 100644 --- a/internal/pkg/heimdall/openapi_test.go +++ b/internal/pkg/heimdall/openapi_test.go @@ -11,6 +11,7 @@ import ( "strings" "testing" + "github.com/babourine/x/pkg/set" "github.com/gorilla/mux" "gopkg.in/yaml.v3" @@ -29,6 +30,7 @@ var openAPIMethods = []string{`get`, `put`, `post`, `delete`, `patch`, `head`, ` type openAPISchema struct { Properties map[string]any `yaml:"properties"` + Required []string `yaml:"required"` Enum []string `yaml:"enum"` } @@ -215,6 +217,48 @@ func TestOpenAPISchemasMatchGoTypes(t *testing.T) { } } +func setFieldNames(t reflect.Type) []string { + if t.Kind() == reflect.Pointer { + t = t.Elem() + } + var names []string + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + name, _, _ := strings.Cut(field.Tag.Get(`json`), `,`) + if field.Anonymous && name == `` { + names = append(names, setFieldNames(field.Type)...) + continue + } + if field.Type == reflect.TypeFor[*set.Set[string]]() { + names = append(names, name) + } + } + sort.Strings(names) + return names +} + +func TestOpenAPIInputsRequireTheSetsTheHandlerReads(t *testing.T) { + spec := loadOpenAPISpec(t) + + inputs := []struct { + schema string + goType reflect.Type + notRead []string + }{ + {`JobInput`, reflect.TypeFor[job.Job](), []string{`tags`}}, + {`CommandInput`, reflect.TypeFor[command.Command](), []string{`allowed_callers`}}, + {`ClusterInput`, reflect.TypeFor[cluster.Cluster](), nil}, + } + for _, input := range inputs { + required := spec.Components.Schemas[input.schema].Required + for _, name := range without(setFieldNames(input.goType), input.notRead...) { + if !slices.Contains(required, name) { + t.Errorf("schema %s does not require %s, but the handler dereferences this set without a nil check", input.schema, name) + } + } + } +} + func marshalStatuses[T json.Marshaler](t *testing.T, values []T) []string { t.Helper() var names []string diff --git a/web/src/common/api/schema.d.ts b/web/src/common/api/schema.d.ts index 5c62467..13895a3 100644 --- a/web/src/common/api/schema.d.ts +++ b/web/src/common/api/schema.d.ts @@ -520,12 +520,12 @@ export interface components { name?: string; version?: string; description?: string; - tags?: components["schemas"]["Tags"]; + tags: components["schemas"]["Tags"]; context?: components["schemas"]["Context"]; status: components["schemas"]["StatusInput"]; plugin: string; is_sync?: boolean; - cluster_tags?: components["schemas"]["Tags"]; + cluster_tags: components["schemas"]["Tags"]; /** @description The server accepts this field but does not store it. */ allowed_callers?: string[]; }; @@ -551,7 +551,7 @@ export interface components { name?: string; version?: string; description?: string; - tags?: components["schemas"]["Tags"]; + tags: components["schemas"]["Tags"]; context?: components["schemas"]["Context"]; status: components["schemas"]["StatusInput"]; /** @description The server accepts this field but does not store it. */