@greatwait/contracts 0.2.3 → 0.3.1
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.
- package/dist/attempt-search.d.ts +235 -0
- package/dist/attempt-search.js +101 -0
- package/dist/authority.js +9 -9
- package/dist/billing.d.ts +4 -4
- package/dist/bulk-operations.d.ts +1832 -0
- package/dist/bulk-operations.js +610 -0
- package/dist/configuration-bounds.d.ts +12 -0
- package/dist/configuration-bounds.js +12 -0
- package/dist/configuration.d.ts +75 -0
- package/dist/configuration.js +242 -0
- package/dist/data-export.d.ts +3 -3
- package/dist/delivery.d.ts +1 -0
- package/dist/delivery.js +1 -0
- package/dist/effective-limits.d.ts +4 -4
- package/dist/endpoints.js +25 -25
- package/dist/execution-selection.d.ts +48 -0
- package/dist/execution-selection.js +21 -0
- package/dist/http-request.d.ts +1 -1
- package/dist/http-request.js +25 -23
- package/dist/identifiers.d.ts +2 -0
- package/dist/identifiers.js +21 -19
- package/dist/identity.d.ts +3 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/occurrence-states.d.ts +14 -0
- package/dist/occurrence-states.js +13 -0
- package/dist/operational-config.js +7 -6
- package/dist/operations.d.ts +573 -89
- package/dist/operations.js +67 -0
- package/dist/protocol.d.ts +19 -5
- package/dist/protocol.js +47 -40
- package/dist/schedule-selection.d.ts +28 -0
- package/dist/schedule-selection.js +48 -0
- package/dist/scheduling-records.d.ts +20 -20
- package/dist/scheduling.d.ts +109 -63
- package/dist/scheduling.js +101 -117
- package/dist/signatures.d.ts +6 -6
- package/dist/signatures.js +24 -24
- package/dist/stored-http.d.ts +18 -0
- package/dist/stored-http.js +106 -0
- package/dist/test-sink.d.ts +6 -6
- package/dist/time.js +7 -7
- package/dist/usage.d.ts +3 -3
- package/generated/v1/examples/attempts.search.response.json +42 -0
- package/generated/v1/examples/bulk.cancel.request.json +3 -0
- package/generated/v1/examples/bulk.cancel.response.json +59 -0
- package/generated/v1/examples/bulk.confirm.request.json +5 -0
- package/generated/v1/examples/bulk.confirm.response.json +59 -0
- package/generated/v1/examples/bulk.items.response.json +3 -0
- package/generated/v1/examples/bulk.list.response.json +63 -0
- package/generated/v1/examples/bulk.pause.request.json +3 -0
- package/generated/v1/examples/bulk.pause.response.json +59 -0
- package/generated/v1/examples/bulk.preview.request.json +12 -0
- package/generated/v1/examples/bulk.preview.response.json +59 -0
- package/generated/v1/examples/bulk.read.response.json +59 -0
- package/generated/v1/examples/bulk.resume.request.json +3 -0
- package/generated/v1/examples/bulk.resume.response.json +59 -0
- package/generated/v1/manifest.json +243 -1
- package/generated/v1/openapi.json +21569 -2418
- package/generated/v1/policy-matrix.json +63 -0
- package/generated/v1/schemas/attempts.search.query.json +96 -0
- package/generated/v1/schemas/attempts.search.response.json +271 -0
- package/generated/v1/schemas/bulk.cancel.request.json +13 -0
- package/generated/v1/schemas/bulk.cancel.response.json +1717 -0
- package/generated/v1/schemas/bulk.confirm.request-headers.json +13 -0
- package/generated/v1/schemas/bulk.confirm.request.json +19 -0
- package/generated/v1/schemas/bulk.confirm.response.json +1717 -0
- package/generated/v1/schemas/bulk.items.query.json +29 -0
- package/generated/v1/schemas/bulk.items.response.json +194 -0
- package/generated/v1/schemas/bulk.list.query.json +32 -0
- package/generated/v1/schemas/bulk.list.response.json +1789 -0
- package/generated/v1/schemas/bulk.pause.request.json +13 -0
- package/generated/v1/schemas/bulk.pause.response.json +1717 -0
- package/generated/v1/schemas/bulk.preview.request.json +1218 -0
- package/generated/v1/schemas/bulk.preview.response.json +1717 -0
- package/generated/v1/schemas/bulk.read.response.json +1717 -0
- package/generated/v1/schemas/bulk.resume.request.json +13 -0
- package/generated/v1/schemas/bulk.resume.response.json +1717 -0
- package/generated/v1/schemas/executions.list.query.json +33 -12
- package/generated/v1/schemas/schedules.list.query.json +32 -3
- package/generated/v1/snippets/attempts.search.json +6 -0
- package/generated/v1/snippets/bulk.cancel.json +6 -0
- package/generated/v1/snippets/bulk.confirm.json +6 -0
- package/generated/v1/snippets/bulk.items.json +6 -0
- package/generated/v1/snippets/bulk.list.json +6 -0
- package/generated/v1/snippets/bulk.pause.json +6 -0
- package/generated/v1/snippets/bulk.preview.json +6 -0
- package/generated/v1/snippets/bulk.read.json +6 -0
- package/generated/v1/snippets/bulk.resume.json +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
import { type CursorBinding } from "./protocol.js";
|
|
3
|
+
import type { FieldError } from "./problems.js";
|
|
4
|
+
/** Actual attempt start, never occurrence planned time. Boundaries are [start, end). */
|
|
5
|
+
export declare const projectAttemptSearchRequestSchema: import("zod").ZodObject<{
|
|
6
|
+
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
limit: import("zod").ZodDefault<import("zod").ZodNumber>;
|
|
8
|
+
startedFrom: import("zod").ZodString;
|
|
9
|
+
startedBefore: import("zod").ZodString;
|
|
10
|
+
responseStatus: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
11
|
+
statusClass: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
12
|
+
"1xx": "1xx";
|
|
13
|
+
"2xx": "2xx";
|
|
14
|
+
"3xx": "3xx";
|
|
15
|
+
"4xx": "4xx";
|
|
16
|
+
"5xx": "5xx";
|
|
17
|
+
}>>;
|
|
18
|
+
outcome: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
19
|
+
ambiguous: "ambiguous";
|
|
20
|
+
succeeded: "succeeded";
|
|
21
|
+
retryable_failure: "retryable_failure";
|
|
22
|
+
terminal_failure: "terminal_failure";
|
|
23
|
+
}>, import("zod").ZodLiteral<"in_flight">]>>;
|
|
24
|
+
diagnostic: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
25
|
+
rate_limited: "rate_limited";
|
|
26
|
+
completion_timed_out: "completion_timed_out";
|
|
27
|
+
delivered: "delivered";
|
|
28
|
+
duplicate_inflight: "duplicate_inflight";
|
|
29
|
+
endpoint_unavailable: "endpoint_unavailable";
|
|
30
|
+
endpoint_unsafe: "endpoint_unsafe";
|
|
31
|
+
http_refused: "http_refused";
|
|
32
|
+
http_retryable: "http_retryable";
|
|
33
|
+
http_terminal: "http_terminal";
|
|
34
|
+
identity_conflict: "identity_conflict";
|
|
35
|
+
network_ambiguous: "network_ambiguous";
|
|
36
|
+
payload_unavailable: "payload_unavailable";
|
|
37
|
+
}>>;
|
|
38
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<"none">]>>;
|
|
39
|
+
schedule: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
41
|
+
tag: import("zod").ZodOptional<import("zod").ZodString>;
|
|
42
|
+
}, import("zod/v4/core").$strip>;
|
|
43
|
+
export type ProjectAttemptSearchRequest = z.infer<typeof projectAttemptSearchRequestSchema>;
|
|
44
|
+
export type NormalizedAttemptSelection = {
|
|
45
|
+
readonly startedFrom: string;
|
|
46
|
+
readonly startedBefore: string;
|
|
47
|
+
} & {
|
|
48
|
+
readonly [Key in Exclude<keyof ProjectAttemptSearchRequest, "cursor" | "limit" | "startedFrom" | "startedBefore">]?: Exclude<ProjectAttemptSearchRequest[Key], undefined>;
|
|
49
|
+
};
|
|
50
|
+
export declare function normalizeAttemptSelection(request: ProjectAttemptSearchRequest): NormalizedAttemptSelection;
|
|
51
|
+
export declare function projectAttemptCursorBinding(request: ProjectAttemptSearchRequest): CursorBinding;
|
|
52
|
+
export declare function parseProjectAttemptSearchRequest(query: URLSearchParams): {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
readonly page: ProjectAttemptSearchRequest;
|
|
55
|
+
} | {
|
|
56
|
+
readonly ok: false;
|
|
57
|
+
readonly errors: readonly FieldError[];
|
|
58
|
+
};
|
|
59
|
+
/** Safe search summary: content and secret-bearing HTTP evidence is detail-only. */
|
|
60
|
+
export declare const projectAttemptSearchResultSchema: import("zod").ZodObject<{
|
|
61
|
+
attempt: import("zod").ZodObject<{
|
|
62
|
+
id: import("zod").ZodString;
|
|
63
|
+
attemptNumber: import("zod").ZodNumber;
|
|
64
|
+
occurrence: import("zod").ZodString;
|
|
65
|
+
startedAt: import("zod").ZodString;
|
|
66
|
+
state: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
67
|
+
ambiguous: "ambiguous";
|
|
68
|
+
succeeded: "succeeded";
|
|
69
|
+
retryable_failure: "retryable_failure";
|
|
70
|
+
terminal_failure: "terminal_failure";
|
|
71
|
+
}>>;
|
|
72
|
+
classifiedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
+
durationMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
74
|
+
responseStatus: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
75
|
+
diagnostic: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
76
|
+
rate_limited: "rate_limited";
|
|
77
|
+
completion_timed_out: "completion_timed_out";
|
|
78
|
+
delivered: "delivered";
|
|
79
|
+
duplicate_inflight: "duplicate_inflight";
|
|
80
|
+
endpoint_unavailable: "endpoint_unavailable";
|
|
81
|
+
endpoint_unsafe: "endpoint_unsafe";
|
|
82
|
+
http_refused: "http_refused";
|
|
83
|
+
http_retryable: "http_retryable";
|
|
84
|
+
http_terminal: "http_terminal";
|
|
85
|
+
identity_conflict: "identity_conflict";
|
|
86
|
+
network_ambiguous: "network_ambiguous";
|
|
87
|
+
payload_unavailable: "payload_unavailable";
|
|
88
|
+
}>>;
|
|
89
|
+
remediation: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
90
|
+
none: "none";
|
|
91
|
+
review_retry_policy: "review_retry_policy";
|
|
92
|
+
inspect_receiver: "inspect_receiver";
|
|
93
|
+
review_endpoint: "review_endpoint";
|
|
94
|
+
replace_payload: "replace_payload";
|
|
95
|
+
contact_support: "contact_support";
|
|
96
|
+
review_before_redelivery: "review_before_redelivery";
|
|
97
|
+
}>>;
|
|
98
|
+
trigger: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
99
|
+
kind: import("zod").ZodLiteral<"automatic">;
|
|
100
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
101
|
+
kind: import("zod").ZodLiteral<"redelivery">;
|
|
102
|
+
sourceAttemptId: import("zod").ZodString;
|
|
103
|
+
}, import("zod/v4/core").$strip>], "kind">;
|
|
104
|
+
}, import("zod/v4/core").$strip>;
|
|
105
|
+
occurrence: import("zod").ZodObject<{
|
|
106
|
+
generation: import("zod").ZodNumber;
|
|
107
|
+
id: import("zod").ZodString;
|
|
108
|
+
plannedFor: import("zod").ZodString;
|
|
109
|
+
schedule: import("zod").ZodString;
|
|
110
|
+
sequence: import("zod").ZodNumber;
|
|
111
|
+
settledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
112
|
+
state: import("zod").ZodEnum<{
|
|
113
|
+
planned: "planned";
|
|
114
|
+
due: "due";
|
|
115
|
+
dispatching: "dispatching";
|
|
116
|
+
retry_wait: "retry_wait";
|
|
117
|
+
ambiguous: "ambiguous";
|
|
118
|
+
succeeded: "succeeded";
|
|
119
|
+
terminal_failed: "terminal_failed";
|
|
120
|
+
cancelled: "cancelled";
|
|
121
|
+
skipped_stale: "skipped_stale";
|
|
122
|
+
}>;
|
|
123
|
+
firstAttemptLatenessMs: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
124
|
+
firstAttemptStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
125
|
+
timingEligibility: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
126
|
+
customer_blocked: "customer_blocked";
|
|
127
|
+
eligible: "eligible";
|
|
128
|
+
platform_blocked: "platform_blocked";
|
|
129
|
+
}>>;
|
|
130
|
+
timingEligibilityReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
131
|
+
timingPolicyVersion: import("zod").ZodOptional<import("zod").ZodString>;
|
|
132
|
+
attemptCount: import("zod").ZodNumber;
|
|
133
|
+
}, import("zod/v4/core").$strip>;
|
|
134
|
+
schedule: import("zod").ZodObject<{
|
|
135
|
+
id: import("zod").ZodString;
|
|
136
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
137
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodString>;
|
|
138
|
+
external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
139
|
+
tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
140
|
+
}, import("zod/v4/core").$strip>;
|
|
141
|
+
}, import("zod/v4/core").$strip>;
|
|
142
|
+
export type ProjectAttemptSearchResult = z.infer<typeof projectAttemptSearchResultSchema>;
|
|
143
|
+
export declare const projectAttemptPageSchema: import("zod").ZodObject<{
|
|
144
|
+
data: import("zod").ZodArray<import("zod").ZodObject<{
|
|
145
|
+
attempt: import("zod").ZodObject<{
|
|
146
|
+
id: import("zod").ZodString;
|
|
147
|
+
attemptNumber: import("zod").ZodNumber;
|
|
148
|
+
occurrence: import("zod").ZodString;
|
|
149
|
+
startedAt: import("zod").ZodString;
|
|
150
|
+
state: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
151
|
+
ambiguous: "ambiguous";
|
|
152
|
+
succeeded: "succeeded";
|
|
153
|
+
retryable_failure: "retryable_failure";
|
|
154
|
+
terminal_failure: "terminal_failure";
|
|
155
|
+
}>>;
|
|
156
|
+
classifiedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
157
|
+
durationMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
158
|
+
responseStatus: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
159
|
+
diagnostic: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
160
|
+
rate_limited: "rate_limited";
|
|
161
|
+
completion_timed_out: "completion_timed_out";
|
|
162
|
+
delivered: "delivered";
|
|
163
|
+
duplicate_inflight: "duplicate_inflight";
|
|
164
|
+
endpoint_unavailable: "endpoint_unavailable";
|
|
165
|
+
endpoint_unsafe: "endpoint_unsafe";
|
|
166
|
+
http_refused: "http_refused";
|
|
167
|
+
http_retryable: "http_retryable";
|
|
168
|
+
http_terminal: "http_terminal";
|
|
169
|
+
identity_conflict: "identity_conflict";
|
|
170
|
+
network_ambiguous: "network_ambiguous";
|
|
171
|
+
payload_unavailable: "payload_unavailable";
|
|
172
|
+
}>>;
|
|
173
|
+
remediation: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
174
|
+
none: "none";
|
|
175
|
+
review_retry_policy: "review_retry_policy";
|
|
176
|
+
inspect_receiver: "inspect_receiver";
|
|
177
|
+
review_endpoint: "review_endpoint";
|
|
178
|
+
replace_payload: "replace_payload";
|
|
179
|
+
contact_support: "contact_support";
|
|
180
|
+
review_before_redelivery: "review_before_redelivery";
|
|
181
|
+
}>>;
|
|
182
|
+
trigger: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
183
|
+
kind: import("zod").ZodLiteral<"automatic">;
|
|
184
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
185
|
+
kind: import("zod").ZodLiteral<"redelivery">;
|
|
186
|
+
sourceAttemptId: import("zod").ZodString;
|
|
187
|
+
}, import("zod/v4/core").$strip>], "kind">;
|
|
188
|
+
}, import("zod/v4/core").$strip>;
|
|
189
|
+
occurrence: import("zod").ZodObject<{
|
|
190
|
+
generation: import("zod").ZodNumber;
|
|
191
|
+
id: import("zod").ZodString;
|
|
192
|
+
plannedFor: import("zod").ZodString;
|
|
193
|
+
schedule: import("zod").ZodString;
|
|
194
|
+
sequence: import("zod").ZodNumber;
|
|
195
|
+
settledAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
196
|
+
state: import("zod").ZodEnum<{
|
|
197
|
+
planned: "planned";
|
|
198
|
+
due: "due";
|
|
199
|
+
dispatching: "dispatching";
|
|
200
|
+
retry_wait: "retry_wait";
|
|
201
|
+
ambiguous: "ambiguous";
|
|
202
|
+
succeeded: "succeeded";
|
|
203
|
+
terminal_failed: "terminal_failed";
|
|
204
|
+
cancelled: "cancelled";
|
|
205
|
+
skipped_stale: "skipped_stale";
|
|
206
|
+
}>;
|
|
207
|
+
firstAttemptLatenessMs: import("zod").ZodOptional<import("zod").ZodInt>;
|
|
208
|
+
firstAttemptStartedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
209
|
+
timingEligibility: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
210
|
+
customer_blocked: "customer_blocked";
|
|
211
|
+
eligible: "eligible";
|
|
212
|
+
platform_blocked: "platform_blocked";
|
|
213
|
+
}>>;
|
|
214
|
+
timingEligibilityReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
215
|
+
timingPolicyVersion: import("zod").ZodOptional<import("zod").ZodString>;
|
|
216
|
+
attemptCount: import("zod").ZodNumber;
|
|
217
|
+
}, import("zod/v4/core").$strip>;
|
|
218
|
+
schedule: import("zod").ZodObject<{
|
|
219
|
+
id: import("zod").ZodString;
|
|
220
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
221
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodString>;
|
|
222
|
+
external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
223
|
+
tags: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
224
|
+
}, import("zod/v4/core").$strip>;
|
|
225
|
+
}, import("zod/v4/core").$strip>>;
|
|
226
|
+
nextCursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
227
|
+
freshness: import("zod").ZodObject<{
|
|
228
|
+
kind: import("zod").ZodLiteral<"authoritative">;
|
|
229
|
+
}, import("zod/v4/core").$strip>;
|
|
230
|
+
retention: import("zod").ZodObject<{
|
|
231
|
+
from: import("zod").ZodString;
|
|
232
|
+
detailsFrom: import("zod").ZodString;
|
|
233
|
+
}, import("zod/v4/core").$strip>;
|
|
234
|
+
}, import("zod/v4/core").$strip>;
|
|
235
|
+
export type ProjectAttemptPage = z.infer<typeof projectAttemptPageSchema>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
import { pageRequestSchema, pageSchema } from "./protocol.js";
|
|
3
|
+
import { endpointIdSchema, scheduleIdSchema } from "./identifiers.js";
|
|
4
|
+
import { externalIdentifierSchema, scheduleTagSchema, scheduleTagsSchema, } from "./host-correlation.js";
|
|
5
|
+
import { timestampSchema } from "./time.js";
|
|
6
|
+
import { attemptSearchSummaryShape, attemptStateSchema, attemptDiagnosticSchema, occurrenceSchema, scheduleNameSchema, } from "./scheduling.js";
|
|
7
|
+
/** Actual attempt start, never occurrence planned time. Boundaries are [start, end). */
|
|
8
|
+
export const projectAttemptSearchRequestSchema = /* @__PURE__ */ (() => pageRequestSchema
|
|
9
|
+
.extend({
|
|
10
|
+
startedFrom: timestampSchema,
|
|
11
|
+
startedBefore: timestampSchema,
|
|
12
|
+
responseStatus: z.number().int().min(100).max(599).optional(),
|
|
13
|
+
statusClass: z.enum(["1xx", "2xx", "3xx", "4xx", "5xx"]).optional(),
|
|
14
|
+
outcome: z.union([attemptStateSchema, z.literal("in_flight")]).optional(),
|
|
15
|
+
diagnostic: attemptDiagnosticSchema.optional(),
|
|
16
|
+
endpoint: z.union([endpointIdSchema, z.literal("none")]).optional(),
|
|
17
|
+
schedule: scheduleIdSchema.optional(),
|
|
18
|
+
external_identifier: externalIdentifierSchema.optional(),
|
|
19
|
+
tag: scheduleTagSchema.optional(),
|
|
20
|
+
})
|
|
21
|
+
.refine((value) => Date.parse(value.startedFrom) < Date.parse(value.startedBefore), {
|
|
22
|
+
message: "must be later than startedFrom",
|
|
23
|
+
path: ["startedBefore"],
|
|
24
|
+
}))();
|
|
25
|
+
export function normalizeAttemptSelection(request) {
|
|
26
|
+
return Object.fromEntries(Object.entries(request).filter(([key, value]) => key !== "cursor" && key !== "limit" && value !== undefined));
|
|
27
|
+
}
|
|
28
|
+
export function projectAttemptCursorBinding(request) {
|
|
29
|
+
return {
|
|
30
|
+
operation: "attempts.search",
|
|
31
|
+
parameters: Object.fromEntries(Object.entries(normalizeAttemptSelection(request)).map(([key, value]) => [
|
|
32
|
+
key,
|
|
33
|
+
String(value),
|
|
34
|
+
])),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function parseProjectAttemptSearchRequest(query) {
|
|
38
|
+
const raw = {};
|
|
39
|
+
const errors = [];
|
|
40
|
+
for (const field of Object.keys(projectAttemptSearchRequestSchema.shape)) {
|
|
41
|
+
const values = query.getAll(field);
|
|
42
|
+
if (values.length > 1) {
|
|
43
|
+
errors.push({
|
|
44
|
+
pointer: `/${field}`,
|
|
45
|
+
reason: "must be given at most once",
|
|
46
|
+
});
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const value = values[0];
|
|
50
|
+
if (value !== undefined)
|
|
51
|
+
raw[field] =
|
|
52
|
+
(field === "limit" || field === "responseStatus") &&
|
|
53
|
+
/^-?\d+$/u.test(value)
|
|
54
|
+
? Number(value)
|
|
55
|
+
: value;
|
|
56
|
+
}
|
|
57
|
+
if (errors.length)
|
|
58
|
+
return { ok: false, errors };
|
|
59
|
+
const parsed = projectAttemptSearchRequestSchema.safeParse(raw);
|
|
60
|
+
return parsed.success
|
|
61
|
+
? { ok: true, page: parsed.data }
|
|
62
|
+
: {
|
|
63
|
+
ok: false,
|
|
64
|
+
errors: parsed.error.issues.map((issue) => ({
|
|
65
|
+
pointer: `/${issue.path.join("/")}`,
|
|
66
|
+
reason: issue.message,
|
|
67
|
+
})),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Safe search summary: content and secret-bearing HTTP evidence is detail-only. */
|
|
71
|
+
export const projectAttemptSearchResultSchema = /* @__PURE__ */ (() => z.object({
|
|
72
|
+
attempt: z.object({
|
|
73
|
+
id: attemptSearchSummaryShape.id,
|
|
74
|
+
attemptNumber: attemptSearchSummaryShape.attemptNumber,
|
|
75
|
+
occurrence: attemptSearchSummaryShape.occurrence,
|
|
76
|
+
startedAt: attemptSearchSummaryShape.startedAt,
|
|
77
|
+
state: attemptSearchSummaryShape.state,
|
|
78
|
+
classifiedAt: attemptSearchSummaryShape.classifiedAt,
|
|
79
|
+
durationMs: attemptSearchSummaryShape.durationMs,
|
|
80
|
+
responseStatus: attemptSearchSummaryShape.responseStatus,
|
|
81
|
+
diagnostic: attemptSearchSummaryShape.diagnostic,
|
|
82
|
+
remediation: attemptSearchSummaryShape.remediation,
|
|
83
|
+
trigger: attemptSearchSummaryShape.trigger,
|
|
84
|
+
}),
|
|
85
|
+
occurrence: occurrenceSchema,
|
|
86
|
+
schedule: z.object({
|
|
87
|
+
id: scheduleIdSchema,
|
|
88
|
+
name: scheduleNameSchema.optional(),
|
|
89
|
+
endpoint: endpointIdSchema.optional(),
|
|
90
|
+
external_identifier: externalIdentifierSchema.optional(),
|
|
91
|
+
tags: scheduleTagsSchema.optional(),
|
|
92
|
+
}),
|
|
93
|
+
}))();
|
|
94
|
+
export const projectAttemptPageSchema = /* @__PURE__ */ (() => pageSchema(projectAttemptSearchResultSchema).extend({
|
|
95
|
+
freshness: z.object({ kind: z.literal("authoritative") }),
|
|
96
|
+
/** Normal plan horizons; older live/retained records may still be returned. */
|
|
97
|
+
retention: z.object({
|
|
98
|
+
from: timestampSchema,
|
|
99
|
+
detailsFrom: timestampSchema,
|
|
100
|
+
}),
|
|
101
|
+
}))();
|
package/dist/authority.js
CHANGED
|
@@ -26,13 +26,13 @@ import { environmentIdSchema, organizationIdSchema, projectIdSchema, } from "./i
|
|
|
26
26
|
* third if one is ever added.
|
|
27
27
|
*/
|
|
28
28
|
export const ENVIRONMENT_KINDS_IN_ORDER = ["test", "live"];
|
|
29
|
-
export const environmentKindSchema = z.enum(ENVIRONMENT_KINDS_IN_ORDER);
|
|
30
|
-
export const authoritySchema = z.object({
|
|
29
|
+
export const environmentKindSchema = /* @__PURE__ */ (() => z.enum(ENVIRONMENT_KINDS_IN_ORDER))();
|
|
30
|
+
export const authoritySchema = /* @__PURE__ */ (() => z.object({
|
|
31
31
|
environment: environmentIdSchema,
|
|
32
32
|
environmentKind: environmentKindSchema,
|
|
33
33
|
organization: organizationIdSchema,
|
|
34
34
|
project: projectIdSchema,
|
|
35
|
-
});
|
|
35
|
+
}))();
|
|
36
36
|
/**
|
|
37
37
|
* The initial scope vocabulary. Scopes are `resource:action`, lower case, and
|
|
38
38
|
* additive — a new scope is a compatible change, removing or narrowing one is
|
|
@@ -126,7 +126,7 @@ export const SCOPES = [
|
|
|
126
126
|
*/
|
|
127
127
|
"usage:read",
|
|
128
128
|
];
|
|
129
|
-
export const scopeSchema = z.enum(SCOPES);
|
|
129
|
+
export const scopeSchema = /* @__PURE__ */ (() => z.enum(SCOPES))();
|
|
130
130
|
/** Read scopes implied by the matching write scope. */
|
|
131
131
|
const IMPLIED_BY_WRITE = {
|
|
132
132
|
"credentials:write": "credentials:read",
|
|
@@ -170,13 +170,13 @@ export function effectiveScopes(granted) {
|
|
|
170
170
|
* gives for one that does not exist.
|
|
171
171
|
*/
|
|
172
172
|
export const PRINCIPAL_KINDS = ["api-credential", "oauth", "session"];
|
|
173
|
-
export const principalKindSchema = z.enum(PRINCIPAL_KINDS);
|
|
174
|
-
export const principalSchema = z.object({
|
|
173
|
+
export const principalKindSchema = /* @__PURE__ */ (() => z.enum(PRINCIPAL_KINDS))();
|
|
174
|
+
export const principalSchema = /* @__PURE__ */ (() => z.object({
|
|
175
175
|
authority: authoritySchema,
|
|
176
176
|
scopes: z.array(scopeSchema).min(1),
|
|
177
177
|
/** How the principal was established, for audit and refusal messages. */
|
|
178
178
|
via: principalKindSchema,
|
|
179
|
-
});
|
|
179
|
+
}))();
|
|
180
180
|
/**
|
|
181
181
|
* Whether a principal may act on an already-resolved resource.
|
|
182
182
|
*
|
|
@@ -298,10 +298,10 @@ export const SESSION_AUTHORITY_HEADERS = {
|
|
|
298
298
|
* know whether a scope is implied can apply the same published expansion the
|
|
299
299
|
* service does.
|
|
300
300
|
*/
|
|
301
|
-
export const credentialContextSchema = z.object({
|
|
301
|
+
export const credentialContextSchema = /* @__PURE__ */ (() => z.object({
|
|
302
302
|
environmentKind: environmentKindSchema,
|
|
303
303
|
/** How this credential authenticated. Never `session`: see the operation. */
|
|
304
304
|
principal: z.enum(["api-credential", "oauth"]),
|
|
305
305
|
project: projectIdSchema,
|
|
306
306
|
scopes: z.array(scopeSchema).min(1),
|
|
307
|
-
});
|
|
307
|
+
}))();
|
package/dist/billing.d.ts
CHANGED
|
@@ -1406,8 +1406,8 @@ export declare const promotionGrantViewSchema: import("zod").ZodObject<{
|
|
|
1406
1406
|
durationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1407
1407
|
}, import("zod/v4/core").$strip>], "kind">;
|
|
1408
1408
|
state: import("zod").ZodEnum<{
|
|
1409
|
-
expired: "expired";
|
|
1410
1409
|
active: "active";
|
|
1410
|
+
expired: "expired";
|
|
1411
1411
|
revoked: "revoked";
|
|
1412
1412
|
}>;
|
|
1413
1413
|
startsAt: import("zod").ZodString;
|
|
@@ -1450,8 +1450,8 @@ export declare const billingPromotionsSchema: import("zod").ZodObject<{
|
|
|
1450
1450
|
durationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1451
1451
|
}, import("zod/v4/core").$strip>], "kind">;
|
|
1452
1452
|
state: import("zod").ZodEnum<{
|
|
1453
|
-
expired: "expired";
|
|
1454
1453
|
active: "active";
|
|
1454
|
+
expired: "expired";
|
|
1455
1455
|
revoked: "revoked";
|
|
1456
1456
|
}>;
|
|
1457
1457
|
startsAt: import("zod").ZodString;
|
|
@@ -1505,8 +1505,8 @@ export declare const billingRedeemResponseSchema: import("zod").ZodObject<{
|
|
|
1505
1505
|
durationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1506
1506
|
}, import("zod/v4/core").$strip>], "kind">;
|
|
1507
1507
|
state: import("zod").ZodEnum<{
|
|
1508
|
-
expired: "expired";
|
|
1509
1508
|
active: "active";
|
|
1509
|
+
expired: "expired";
|
|
1510
1510
|
revoked: "revoked";
|
|
1511
1511
|
}>;
|
|
1512
1512
|
startsAt: import("zod").ZodString;
|
|
@@ -1548,8 +1548,8 @@ export declare const billingRedeemResponseSchema: import("zod").ZodObject<{
|
|
|
1548
1548
|
durationInMonths: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1549
1549
|
}, import("zod/v4/core").$strip>], "kind">;
|
|
1550
1550
|
state: import("zod").ZodEnum<{
|
|
1551
|
-
expired: "expired";
|
|
1552
1551
|
active: "active";
|
|
1552
|
+
expired: "expired";
|
|
1553
1553
|
revoked: "revoked";
|
|
1554
1554
|
}>;
|
|
1555
1555
|
startsAt: import("zod").ZodString;
|