UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

67 lines 3.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TestListItemPaginatedResultSchema = exports.TestListItemSchema = exports.TestsQuerySchema = exports.TestMetadataSchema = void 0; const v4_1 = require("zod/v4"); const FlowMetadata_1 = require("./FlowMetadata"); const PaginatedResult_1 = require("./PaginatedResult"); const Provenance_1 = require("./Provenance"); const RunConfig_1 = require("./RunConfig"); const RunMode_1 = require("./RunMode"); const SortOrder_1 = require("./SortOrder"); /** * Test metadata — the reusable configuration from which flows (individual * runs) are created. Contains everything needed to start a flow except * execution-specific fields like state, result, and token counts. */ exports.TestMetadataSchema = RunConfig_1.RunConfigSchema.extend({ id: v4_1.z.string().describe('The unique ID of this test.'), metadataVersion: v4_1.z .number() .optional() .describe('Schema version of this metadata object.'), name: v4_1.z.string().nullable().describe('The name of this test.'), createdWithDonobuVersion: v4_1.z .string() .optional() .describe('The version of Donobu that created the test.'), suiteId: v4_1.z .string() .nullable() .describe('The ID of the suite this test belongs to, or null if the test has not been added to a test suite (or was orphaned when the suite was deleted).'), nextRunMode: RunMode_1.RunModeSchema.describe('The run mode to use when creating the next flow from this test.'), provenance: Provenance_1.ProvenanceSchema.optional().describe('Records how this test came into existence (Studio vs. code-first). ' + 'Absent on rows written before provenance tracking was introduced.'), }); const TestSortBySchema = v4_1.z.enum([ 'created_at', 'name', 'suite_id', 'next_run_mode', 'flow_count', 'latest_flow_created_at', ]); /** * Query parameters for filtering and paginating test results. */ exports.TestsQuerySchema = v4_1.z.object({ /** Filter tests by exact name match. */ name: v4_1.z.string().optional(), /** Filter tests by partial name (case-insensitive substring match). Mutually exclusive with `name`. */ partialName: v4_1.z.string().optional(), /** Filter tests by suite ID. */ suiteId: v4_1.z.string().optional(), /** Column to sort results by. Defaults to `created_at`. */ sortBy: TestSortBySchema.optional(), /** Sort direction. Defaults to `desc`. */ sortOrder: SortOrder_1.SortOrderSchema.optional(), /** Maximum number of tests to return per page (1-100). Defaults to 100. */ limit: v4_1.z.coerce.number().min(1).max(100).optional(), /** Opaque pagination token for fetching the next page. */ pageToken: v4_1.z.string().optional(), }); exports.TestListItemSchema = exports.TestMetadataSchema.extend({ flowCount: v4_1.z.number().describe('The number of flows created from this test.'), latestFlow: FlowMetadata_1.FlowMetadataSchema.nullable().describe('Most recently-created flow belonging to this test'), }); exports.TestListItemPaginatedResultSchema = (0, PaginatedResult_1.createPaginatedResultSchema)(exports.TestListItemSchema); //# sourceMappingURL=TestMetadata.js.map