|
1 | 1 | import { Static, Type } from '@sinclair/typebox'; |
2 | 2 |
|
3 | | -export const TestRunLimit = Type.Object({ |
4 | | - blockName: Type.String(), |
5 | | - actionName: Type.String(), |
6 | | - isEnabled: Type.Boolean(), |
7 | | - limit: Type.Number(), |
8 | | -}); |
| 3 | +export const TestRunLimit = Type.Object( |
| 4 | + { |
| 5 | + blockName: Type.String({ |
| 6 | + description: |
| 7 | + "The block's full package name that owns the action (e.g., '@scope/block').", |
| 8 | + }), |
| 9 | + actionName: Type.String({ |
| 10 | + description: |
| 11 | + 'The exact action name within the block for which the limit applies.', |
| 12 | + }), |
| 13 | + isEnabled: Type.Boolean({ |
| 14 | + description: |
| 15 | + 'Whether this specific action limit is active during test runs.', |
| 16 | + }), |
| 17 | + limit: Type.Number({ |
| 18 | + description: |
| 19 | + 'Maximum number of times this action will be executed in a single test run.', |
| 20 | + }), |
| 21 | + }, |
| 22 | + { |
| 23 | + description: |
| 24 | + 'Per-action write safety limit used when executing workflows in test mode.', |
| 25 | + }, |
| 26 | +); |
9 | 27 |
|
10 | 28 | export type TestRunLimit = Static<typeof TestRunLimit>; |
11 | 29 |
|
12 | | -export const TestRunLimitSettings = Type.Object({ |
13 | | - isEnabled: Type.Boolean(), |
14 | | - limits: Type.Array(TestRunLimit), |
15 | | -}); |
| 30 | +export const TestRunLimitSettings = Type.Object( |
| 31 | + { |
| 32 | + isEnabled: Type.Boolean({ |
| 33 | + description: |
| 34 | + 'Master switch to enable or disable all test run action limits for the workflow.', |
| 35 | + }), |
| 36 | + limits: Type.Array(TestRunLimit, { |
| 37 | + description: |
| 38 | + 'List of per-action limits that restrict write operations during test runs.', |
| 39 | + }), |
| 40 | + }, |
| 41 | + { |
| 42 | + description: |
| 43 | + 'Global test run safety configuration combining a master toggle and per-action limits.', |
| 44 | + }, |
| 45 | +); |
16 | 46 |
|
17 | 47 | export type TestRunLimitSettings = Static<typeof TestRunLimitSettings>; |
18 | 48 |
|
|
0 commit comments