@vcp-dev/contracts 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ import { z } from "zod";
2
+ export declare const TemplateUpgradeOutcomeSchema: z.ZodEnum<{
3
+ paused: "paused";
4
+ blocked: "blocked";
5
+ validation_failed: "validation_failed";
6
+ eligible: "eligible";
7
+ fast_path: "fast_path";
8
+ upgraded: "upgraded";
9
+ skipped: "skipped";
10
+ lock_skipped: "lock_skipped";
11
+ cas_aborted: "cas_aborted";
12
+ }>;
13
+ export type TemplateUpgradeOutcome = z.infer<typeof TemplateUpgradeOutcomeSchema>;
14
+ export declare const TemplateUpgradeValidationStageSchema: z.ZodEnum<{
15
+ typecheck: "typecheck";
16
+ build: "build";
17
+ health: "health";
18
+ validation: "validation";
19
+ }>;
20
+ export type TemplateUpgradeValidationStage = z.infer<typeof TemplateUpgradeValidationStageSchema>;
21
+ export declare const TemplateUpgradeCasOutcomeSchema: z.ZodEnum<{
22
+ not_attempted: "not_attempted";
23
+ promoted: "promoted";
24
+ aborted: "aborted";
25
+ }>;
26
+ export type TemplateUpgradeCasOutcome = z.infer<typeof TemplateUpgradeCasOutcomeSchema>;
27
+ export declare const RecordTemplateUpgradeEventRequestSchema: z.ZodObject<{
28
+ template_id: z.ZodString;
29
+ from_version: z.ZodNullable<z.ZodString>;
30
+ to_version: z.ZodString;
31
+ outcome: z.ZodEnum<{
32
+ paused: "paused";
33
+ blocked: "blocked";
34
+ validation_failed: "validation_failed";
35
+ eligible: "eligible";
36
+ fast_path: "fast_path";
37
+ upgraded: "upgraded";
38
+ skipped: "skipped";
39
+ lock_skipped: "lock_skipped";
40
+ cas_aborted: "cas_aborted";
41
+ }>;
42
+ attempt: z.ZodNumber;
43
+ duration_ms: z.ZodNumber;
44
+ replaced_group_count: z.ZodNumber;
45
+ skipped_group_count: z.ZodNumber;
46
+ validation_stage: z.ZodNullable<z.ZodEnum<{
47
+ typecheck: "typecheck";
48
+ build: "build";
49
+ health: "health";
50
+ validation: "validation";
51
+ }>>;
52
+ cas_outcome: z.ZodNullable<z.ZodEnum<{
53
+ not_attempted: "not_attempted";
54
+ promoted: "promoted";
55
+ aborted: "aborted";
56
+ }>>;
57
+ }, z.core.$strict>;
58
+ export type RecordTemplateUpgradeEventRequest = z.infer<typeof RecordTemplateUpgradeEventRequestSchema>;
59
+ export declare const RecordTemplateUpgradeEventResponseSchema: z.ZodObject<{
60
+ recorded: z.ZodLiteral<true>;
61
+ }, z.core.$strict>;
62
+ export type RecordTemplateUpgradeEventResponse = z.infer<typeof RecordTemplateUpgradeEventResponseSchema>;
63
+ export declare const GetTemplateUpgradeReportQuerySchema: z.ZodObject<{
64
+ from: z.ZodISODateTime;
65
+ to: z.ZodISODateTime;
66
+ }, z.core.$strict>;
67
+ export type GetTemplateUpgradeReportQuery = z.infer<typeof GetTemplateUpgradeReportQuerySchema>;
68
+ export declare const TemplateUpgradeOutcomeCountsSchema: z.ZodObject<{
69
+ eligible: z.ZodNumber;
70
+ fast_path: z.ZodNumber;
71
+ upgraded: z.ZodNumber;
72
+ skipped: z.ZodNumber;
73
+ lock_skipped: z.ZodNumber;
74
+ cas_aborted: z.ZodNumber;
75
+ validation_failed: z.ZodNumber;
76
+ blocked: z.ZodNumber;
77
+ paused: z.ZodNumber;
78
+ }, z.core.$strict>;
79
+ export type TemplateUpgradeOutcomeCounts = z.infer<typeof TemplateUpgradeOutcomeCountsSchema>;
80
+ export declare const GetTemplateUpgradeReportResponseSchema: z.ZodObject<{
81
+ window: z.ZodObject<{
82
+ from: z.ZodISODateTime;
83
+ to: z.ZodISODateTime;
84
+ }, z.core.$strict>;
85
+ outcome_counts: z.ZodObject<{
86
+ eligible: z.ZodNumber;
87
+ fast_path: z.ZodNumber;
88
+ upgraded: z.ZodNumber;
89
+ skipped: z.ZodNumber;
90
+ lock_skipped: z.ZodNumber;
91
+ cas_aborted: z.ZodNumber;
92
+ validation_failed: z.ZodNumber;
93
+ blocked: z.ZodNumber;
94
+ paused: z.ZodNumber;
95
+ }, z.core.$strict>;
96
+ current_state_counts: z.ZodObject<{
97
+ blocked: z.ZodNumber;
98
+ paused: z.ZodNumber;
99
+ }, z.core.$strict>;
100
+ duration_ms: z.ZodObject<{
101
+ p50: z.ZodNullable<z.ZodNumber>;
102
+ p95: z.ZodNullable<z.ZodNumber>;
103
+ sample_count: z.ZodNumber;
104
+ }, z.core.$strict>;
105
+ }, z.core.$strict>;
106
+ export type GetTemplateUpgradeReportResponse = z.infer<typeof GetTemplateUpgradeReportResponseSchema>;
107
+ export declare const ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema: z.ZodObject<{
108
+ older_than: z.ZodISODateTime;
109
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
110
+ include_candidates: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
111
+ true: "true";
112
+ false: "false";
113
+ }>>, z.ZodTransform<boolean, "true" | "false">>;
114
+ }, z.core.$strict>;
115
+ export type ListTemplateUpgradeSnapshotDeletionCandidatesQuery = z.input<typeof ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema>;
116
+ export declare const TemplateUpgradeSnapshotDeletionCandidateSchema: z.ZodObject<{
117
+ site_id: z.ZodString;
118
+ snapshot_id: z.ZodString;
119
+ status: z.ZodEnum<{
120
+ candidate: "candidate";
121
+ deleting: "deleting";
122
+ }>;
123
+ created_at: z.ZodISODateTime;
124
+ }, z.core.$strict>;
125
+ export type TemplateUpgradeSnapshotDeletionCandidate = z.infer<typeof TemplateUpgradeSnapshotDeletionCandidateSchema>;
126
+ export declare const ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema: z.ZodObject<{
127
+ snapshots: z.ZodArray<z.ZodObject<{
128
+ site_id: z.ZodString;
129
+ snapshot_id: z.ZodString;
130
+ status: z.ZodEnum<{
131
+ candidate: "candidate";
132
+ deleting: "deleting";
133
+ }>;
134
+ created_at: z.ZodISODateTime;
135
+ }, z.core.$strict>>;
136
+ }, z.core.$strict>;
137
+ export type ListTemplateUpgradeSnapshotDeletionCandidatesResponse = z.infer<typeof ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema>;
@@ -0,0 +1,193 @@
1
+ import { z } from "zod";
2
+ export declare const TemplateUpgradeStatusSchema: z.ZodEnum<{
3
+ active: "active";
4
+ paused: "paused";
5
+ blocked: "blocked";
6
+ }>;
7
+ export type TemplateUpgradeStatus = z.infer<typeof TemplateUpgradeStatusSchema>;
8
+ export declare const TemplateUpgradeErrorCodeSchema: z.ZodEnum<{
9
+ typecheck_failed: "typecheck_failed";
10
+ health_failed: "health_failed";
11
+ validation_failed: "validation_failed";
12
+ }>;
13
+ export type TemplateUpgradeErrorCode = z.infer<typeof TemplateUpgradeErrorCodeSchema>;
14
+ export declare const TemplateUpgradeStateSchema: z.ZodObject<{
15
+ status: z.ZodEnum<{
16
+ active: "active";
17
+ paused: "paused";
18
+ blocked: "blocked";
19
+ }>;
20
+ attempts: z.ZodNumber;
21
+ attempted_template_version: z.ZodNullable<z.ZodString>;
22
+ last_error_code: z.ZodNullable<z.ZodEnum<{
23
+ typecheck_failed: "typecheck_failed";
24
+ health_failed: "health_failed";
25
+ validation_failed: "validation_failed";
26
+ }>>;
27
+ }, z.core.$strict>;
28
+ export type TemplateUpgradeState = z.infer<typeof TemplateUpgradeStateSchema>;
29
+ export declare const PrepareTemplateUpgradeStateRequestSchema: z.ZodObject<{
30
+ template_id: z.ZodString;
31
+ target_template_version: z.ZodString;
32
+ }, z.core.$strict>;
33
+ export type PrepareTemplateUpgradeStateRequest = z.infer<typeof PrepareTemplateUpgradeStateRequestSchema>;
34
+ export declare const PrepareTemplateUpgradeStateResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ action: z.ZodLiteral<"proceed">;
36
+ state: z.ZodObject<{
37
+ attempts: z.ZodNumber;
38
+ attempted_template_version: z.ZodNullable<z.ZodString>;
39
+ last_error_code: z.ZodNullable<z.ZodEnum<{
40
+ typecheck_failed: "typecheck_failed";
41
+ health_failed: "health_failed";
42
+ validation_failed: "validation_failed";
43
+ }>>;
44
+ status: z.ZodLiteral<"active">;
45
+ }, z.core.$strict>;
46
+ }, z.core.$strict>, z.ZodObject<{
47
+ action: z.ZodLiteral<"skip_not_newer">;
48
+ state: z.ZodObject<{
49
+ attempts: z.ZodNumber;
50
+ attempted_template_version: z.ZodNullable<z.ZodString>;
51
+ last_error_code: z.ZodNullable<z.ZodEnum<{
52
+ typecheck_failed: "typecheck_failed";
53
+ health_failed: "health_failed";
54
+ validation_failed: "validation_failed";
55
+ }>>;
56
+ status: z.ZodLiteral<"active">;
57
+ }, z.core.$strict>;
58
+ }, z.core.$strict>, z.ZodObject<{
59
+ action: z.ZodLiteral<"skip_paused">;
60
+ state: z.ZodObject<{
61
+ attempts: z.ZodNumber;
62
+ attempted_template_version: z.ZodNullable<z.ZodString>;
63
+ last_error_code: z.ZodNullable<z.ZodEnum<{
64
+ typecheck_failed: "typecheck_failed";
65
+ health_failed: "health_failed";
66
+ validation_failed: "validation_failed";
67
+ }>>;
68
+ status: z.ZodLiteral<"paused">;
69
+ }, z.core.$strict>;
70
+ }, z.core.$strict>, z.ZodObject<{
71
+ action: z.ZodLiteral<"skip_blocked">;
72
+ state: z.ZodObject<{
73
+ attempts: z.ZodNumber;
74
+ attempted_template_version: z.ZodNullable<z.ZodString>;
75
+ last_error_code: z.ZodNullable<z.ZodEnum<{
76
+ typecheck_failed: "typecheck_failed";
77
+ health_failed: "health_failed";
78
+ validation_failed: "validation_failed";
79
+ }>>;
80
+ status: z.ZodLiteral<"blocked">;
81
+ }, z.core.$strict>;
82
+ }, z.core.$strict>], "action">;
83
+ export type PrepareTemplateUpgradeStateResponse = z.infer<typeof PrepareTemplateUpgradeStateResponseSchema>;
84
+ /**
85
+ * Read-only projection of the persisted state for a target version. The query
86
+ * and response deliberately match prepare's bounded target/action contract;
87
+ * only the API method differs, so callers cannot supply tenant identity or raw
88
+ * validation data.
89
+ */
90
+ export declare const InspectTemplateUpgradeStateRequestSchema: z.ZodObject<{
91
+ template_id: z.ZodString;
92
+ target_template_version: z.ZodString;
93
+ }, z.core.$strict>;
94
+ export type InspectTemplateUpgradeStateRequest = z.infer<typeof InspectTemplateUpgradeStateRequestSchema>;
95
+ export declare const InspectTemplateUpgradeStateResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
96
+ action: z.ZodLiteral<"proceed">;
97
+ state: z.ZodObject<{
98
+ attempts: z.ZodNumber;
99
+ attempted_template_version: z.ZodNullable<z.ZodString>;
100
+ last_error_code: z.ZodNullable<z.ZodEnum<{
101
+ typecheck_failed: "typecheck_failed";
102
+ health_failed: "health_failed";
103
+ validation_failed: "validation_failed";
104
+ }>>;
105
+ status: z.ZodLiteral<"active">;
106
+ }, z.core.$strict>;
107
+ }, z.core.$strict>, z.ZodObject<{
108
+ action: z.ZodLiteral<"skip_not_newer">;
109
+ state: z.ZodObject<{
110
+ attempts: z.ZodNumber;
111
+ attempted_template_version: z.ZodNullable<z.ZodString>;
112
+ last_error_code: z.ZodNullable<z.ZodEnum<{
113
+ typecheck_failed: "typecheck_failed";
114
+ health_failed: "health_failed";
115
+ validation_failed: "validation_failed";
116
+ }>>;
117
+ status: z.ZodLiteral<"active">;
118
+ }, z.core.$strict>;
119
+ }, z.core.$strict>, z.ZodObject<{
120
+ action: z.ZodLiteral<"skip_paused">;
121
+ state: z.ZodObject<{
122
+ attempts: z.ZodNumber;
123
+ attempted_template_version: z.ZodNullable<z.ZodString>;
124
+ last_error_code: z.ZodNullable<z.ZodEnum<{
125
+ typecheck_failed: "typecheck_failed";
126
+ health_failed: "health_failed";
127
+ validation_failed: "validation_failed";
128
+ }>>;
129
+ status: z.ZodLiteral<"paused">;
130
+ }, z.core.$strict>;
131
+ }, z.core.$strict>, z.ZodObject<{
132
+ action: z.ZodLiteral<"skip_blocked">;
133
+ state: z.ZodObject<{
134
+ attempts: z.ZodNumber;
135
+ attempted_template_version: z.ZodNullable<z.ZodString>;
136
+ last_error_code: z.ZodNullable<z.ZodEnum<{
137
+ typecheck_failed: "typecheck_failed";
138
+ health_failed: "health_failed";
139
+ validation_failed: "validation_failed";
140
+ }>>;
141
+ status: z.ZodLiteral<"blocked">;
142
+ }, z.core.$strict>;
143
+ }, z.core.$strict>], "action">;
144
+ export type InspectTemplateUpgradeStateResponse = z.infer<typeof InspectTemplateUpgradeStateResponseSchema>;
145
+ export declare const RecordTemplateUpgradeFailureRequestSchema: z.ZodObject<{
146
+ template_id: z.ZodString;
147
+ target_template_version: z.ZodString;
148
+ error_code: z.ZodEnum<{
149
+ typecheck_failed: "typecheck_failed";
150
+ health_failed: "health_failed";
151
+ validation_failed: "validation_failed";
152
+ }>;
153
+ }, z.core.$strict>;
154
+ export type RecordTemplateUpgradeFailureRequest = z.infer<typeof RecordTemplateUpgradeFailureRequestSchema>;
155
+ export declare const RecordTemplateUpgradeFailureResponseSchema: z.ZodObject<{
156
+ state: z.ZodObject<{
157
+ status: z.ZodEnum<{
158
+ active: "active";
159
+ paused: "paused";
160
+ blocked: "blocked";
161
+ }>;
162
+ attempts: z.ZodNumber;
163
+ attempted_template_version: z.ZodNullable<z.ZodString>;
164
+ last_error_code: z.ZodNullable<z.ZodEnum<{
165
+ typecheck_failed: "typecheck_failed";
166
+ health_failed: "health_failed";
167
+ validation_failed: "validation_failed";
168
+ }>>;
169
+ }, z.core.$strict>;
170
+ }, z.core.$strict>;
171
+ export type RecordTemplateUpgradeFailureResponse = z.infer<typeof RecordTemplateUpgradeFailureResponseSchema>;
172
+ export declare const RecordTemplateUpgradeSuccessRequestSchema: z.ZodObject<{
173
+ template_id: z.ZodString;
174
+ target_template_version: z.ZodString;
175
+ }, z.core.$strict>;
176
+ export type RecordTemplateUpgradeSuccessRequest = z.infer<typeof RecordTemplateUpgradeSuccessRequestSchema>;
177
+ export declare const RecordTemplateUpgradeSuccessResponseSchema: z.ZodObject<{
178
+ state: z.ZodObject<{
179
+ status: z.ZodEnum<{
180
+ active: "active";
181
+ paused: "paused";
182
+ blocked: "blocked";
183
+ }>;
184
+ attempts: z.ZodNumber;
185
+ attempted_template_version: z.ZodNullable<z.ZodString>;
186
+ last_error_code: z.ZodNullable<z.ZodEnum<{
187
+ typecheck_failed: "typecheck_failed";
188
+ health_failed: "health_failed";
189
+ validation_failed: "validation_failed";
190
+ }>>;
191
+ }, z.core.$strict>;
192
+ }, z.core.$strict>;
193
+ export type RecordTemplateUpgradeSuccessResponse = z.infer<typeof RecordTemplateUpgradeSuccessResponseSchema>;
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ export declare const TemplateVersionSchema: z.ZodString;
3
+ export type TemplateVersion = z.infer<typeof TemplateVersionSchema>;
4
+ export type TemplateVersionComparison = -1 | 0 | 1;
5
+ export declare function compareTemplateVersions(left: unknown, right: unknown): TemplateVersionComparison | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcp-dev/contracts",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {