@greatwait/contracts 0.2.3 → 0.3.0
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 +98 -0
- 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 +71 -0
- package/dist/configuration.js +204 -0
- package/dist/data-export.d.ts +3 -3
- package/dist/effective-limits.d.ts +4 -4
- 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/identifiers.d.ts +2 -0
- package/dist/identifiers.js +2 -0
- 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/operations.d.ts +573 -89
- package/dist/operations.js +67 -0
- package/dist/protocol.d.ts +19 -5
- package/dist/protocol.js +14 -7
- 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 +64 -63
- package/dist/scheduling.js +10 -37
- package/dist/test-sink.d.ts +6 -6
- 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,71 @@
|
|
|
1
|
+
export declare const CONFIGURATION_DEFAULTS: Readonly<{
|
|
2
|
+
bulkMaxTargets: 100000;
|
|
3
|
+
bulkExecutionLifetimeSeconds: 604800;
|
|
4
|
+
bulkPreviewLifetimeSeconds: 300;
|
|
5
|
+
bulkResultRetentionSeconds: 1209600;
|
|
6
|
+
bulkBatchSize: 25;
|
|
7
|
+
bulkWorkerConcurrency: 1;
|
|
8
|
+
bulkActiveJobLimit: 1;
|
|
9
|
+
bulkWorkBudgetSeconds: 3;
|
|
10
|
+
bulkCarrierBatchSize: 100;
|
|
11
|
+
attemptDetailRetentionSeconds: 604800;
|
|
12
|
+
forecastHorizonSeconds: number;
|
|
13
|
+
historyRetentionSeconds: 1209600;
|
|
14
|
+
inlinePayloadBytes: 65536;
|
|
15
|
+
payloadRetentionSeconds: 259200;
|
|
16
|
+
usageWindowDays: 366;
|
|
17
|
+
}>;
|
|
18
|
+
export type DeploymentContext = "local" | "staging" | "production";
|
|
19
|
+
export type ConfigurationScope = "global" | "organization";
|
|
20
|
+
export type ConfigurationLayer = "default" | "global" | "deployment" | "organization";
|
|
21
|
+
export interface ConfigurationValues {
|
|
22
|
+
readonly bulkMaxTargets?: number;
|
|
23
|
+
readonly bulkExecutionLifetimeSeconds?: number;
|
|
24
|
+
readonly bulkPreviewLifetimeSeconds?: number;
|
|
25
|
+
readonly bulkResultRetentionSeconds?: number;
|
|
26
|
+
readonly bulkBatchSize?: number;
|
|
27
|
+
readonly bulkWorkerConcurrency?: number;
|
|
28
|
+
readonly bulkActiveJobLimit?: number;
|
|
29
|
+
readonly bulkWorkBudgetSeconds?: number;
|
|
30
|
+
readonly bulkCarrierBatchSize?: number;
|
|
31
|
+
readonly inlinePayloadBytes?: number;
|
|
32
|
+
readonly partitionKeyCeiling?: number;
|
|
33
|
+
readonly forecastHorizonSeconds?: number;
|
|
34
|
+
readonly usageWindowDays?: number;
|
|
35
|
+
readonly attemptDetailRetentionSeconds?: number;
|
|
36
|
+
readonly historyRetentionSeconds?: number;
|
|
37
|
+
readonly payloadRetentionSeconds?: number;
|
|
38
|
+
readonly pageLimit?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ConfigurationSetting {
|
|
41
|
+
readonly key: keyof ConfigurationValues;
|
|
42
|
+
readonly type: "integer";
|
|
43
|
+
readonly unit: "bytes" | "count" | "seconds" | "days";
|
|
44
|
+
readonly default?: number;
|
|
45
|
+
readonly minimum: number;
|
|
46
|
+
readonly maximum: number;
|
|
47
|
+
readonly layers: readonly ConfigurationLayer[];
|
|
48
|
+
readonly change: "live" | "deployment";
|
|
49
|
+
readonly rationale: string;
|
|
50
|
+
readonly enforcement: readonly string[];
|
|
51
|
+
readonly exhaustion: string;
|
|
52
|
+
readonly visibility: "customer";
|
|
53
|
+
}
|
|
54
|
+
export declare const CONFIGURATION_CATALOG: readonly ConfigurationSetting[];
|
|
55
|
+
export declare function validateConfigurationValues(value: unknown, scope: ConfigurationScope): ConfigurationValues;
|
|
56
|
+
export interface EffectiveConfiguration {
|
|
57
|
+
readonly values: ConfigurationValues;
|
|
58
|
+
readonly revision: {
|
|
59
|
+
readonly global: number;
|
|
60
|
+
readonly organization: number;
|
|
61
|
+
};
|
|
62
|
+
readonly provenance: Readonly<Record<string, ConfigurationLayer>>;
|
|
63
|
+
}
|
|
64
|
+
export declare function resolveEffectiveConfiguration(input: {
|
|
65
|
+
readonly deployment: DeploymentContext;
|
|
66
|
+
readonly baseline?: ConfigurationValues;
|
|
67
|
+
readonly global?: ConfigurationValues;
|
|
68
|
+
readonly organization?: ConfigurationValues;
|
|
69
|
+
readonly globalRevision?: number;
|
|
70
|
+
readonly organizationRevision?: number;
|
|
71
|
+
}): EffectiveConfiguration;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product-owned adaptation of Flow XO Agents FXO-2600 catalog metadata,
|
|
3
|
+
* precedence, immutable resolution and value provenance (82bcc247).
|
|
4
|
+
* Operator updates are strict; historical values are never silently clamped.
|
|
5
|
+
* This leaf imports no application, database or Worker implementation.
|
|
6
|
+
*/
|
|
7
|
+
import { BULK_CONFIGURATION_MAXIMA, MAX_INLINE_PAYLOAD_BYTES, MAX_FORECAST_HORIZON_SECONDS, MAX_USAGE_WINDOW_DAYS, MAX_PARTITION_KEY_CEILING, PUBLIC_PAGE_SIZE, } from "./configuration-bounds.js";
|
|
8
|
+
export const CONFIGURATION_DEFAULTS = Object.freeze({
|
|
9
|
+
bulkMaxTargets: 100_000,
|
|
10
|
+
bulkExecutionLifetimeSeconds: 604_800,
|
|
11
|
+
bulkPreviewLifetimeSeconds: 300,
|
|
12
|
+
bulkResultRetentionSeconds: 1_209_600,
|
|
13
|
+
bulkBatchSize: 25,
|
|
14
|
+
bulkWorkerConcurrency: 1,
|
|
15
|
+
bulkActiveJobLimit: 1,
|
|
16
|
+
bulkWorkBudgetSeconds: 3,
|
|
17
|
+
bulkCarrierBatchSize: 100,
|
|
18
|
+
attemptDetailRetentionSeconds: 604_800,
|
|
19
|
+
forecastHorizonSeconds: MAX_FORECAST_HORIZON_SECONDS,
|
|
20
|
+
historyRetentionSeconds: 1_209_600,
|
|
21
|
+
inlinePayloadBytes: MAX_INLINE_PAYLOAD_BYTES,
|
|
22
|
+
payloadRetentionSeconds: 259_200,
|
|
23
|
+
usageWindowDays: MAX_USAGE_WINDOW_DAYS,
|
|
24
|
+
});
|
|
25
|
+
const allowanceLayers = ["default", "global", "organization"];
|
|
26
|
+
const deploymentLayers = ["default", "deployment"];
|
|
27
|
+
export const CONFIGURATION_CATALOG = Object.freeze([
|
|
28
|
+
...[
|
|
29
|
+
"bulkMaxTargets",
|
|
30
|
+
"bulkExecutionLifetimeSeconds",
|
|
31
|
+
"bulkPreviewLifetimeSeconds",
|
|
32
|
+
"bulkResultRetentionSeconds",
|
|
33
|
+
"bulkBatchSize",
|
|
34
|
+
"bulkWorkerConcurrency",
|
|
35
|
+
"bulkActiveJobLimit",
|
|
36
|
+
"bulkWorkBudgetSeconds",
|
|
37
|
+
"bulkCarrierBatchSize",
|
|
38
|
+
].map((key) => ({
|
|
39
|
+
key,
|
|
40
|
+
type: "integer",
|
|
41
|
+
unit: key.endsWith("Seconds") ? "seconds" : "count",
|
|
42
|
+
default: CONFIGURATION_DEFAULTS[key],
|
|
43
|
+
minimum: 1,
|
|
44
|
+
maximum: BULK_CONFIGURATION_MAXIMA[key],
|
|
45
|
+
layers: allowanceLayers,
|
|
46
|
+
change: "live",
|
|
47
|
+
visibility: "customer",
|
|
48
|
+
rationale: "Owner-approved bounded bulk preparation and execution. Backlog limits do not increase in-flight work or ordinary delivery quotas; result retention is additionally capped by effective history retention.",
|
|
49
|
+
enforcement: ["bulk-operations"],
|
|
50
|
+
exhaustion: "Oversized selections refuse; deadlines expire remaining work; durable checkpoints preserve completed effects.",
|
|
51
|
+
})),
|
|
52
|
+
{
|
|
53
|
+
key: "inlinePayloadBytes",
|
|
54
|
+
type: "integer",
|
|
55
|
+
unit: "bytes",
|
|
56
|
+
default: CONFIGURATION_DEFAULTS.inlinePayloadBytes,
|
|
57
|
+
minimum: 0,
|
|
58
|
+
maximum: MAX_INLINE_PAYLOAD_BYTES,
|
|
59
|
+
layers: allowanceLayers,
|
|
60
|
+
change: "live",
|
|
61
|
+
rationale: "The operator removed the lower storage allowance. Default is the existing public payload envelope; a deliberate override may narrow it. Unbounded bodies would exceed the existing SQL and receiver representations.",
|
|
62
|
+
enforcement: ["authority-service", "schedule-draft"],
|
|
63
|
+
exhaustion: "Local validation and authoritative plan-limit-reached",
|
|
64
|
+
visibility: "customer",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "partitionKeyCeiling",
|
|
68
|
+
type: "integer",
|
|
69
|
+
unit: "count",
|
|
70
|
+
minimum: 1,
|
|
71
|
+
maximum: MAX_PARTITION_KEY_CEILING,
|
|
72
|
+
layers: allowanceLayers,
|
|
73
|
+
change: "live",
|
|
74
|
+
rationale: "No inherited count cap. A deliberate override uses indexed successor seeks bounded to ceiling plus one; its supported bound preserves the existing transaction work envelope.",
|
|
75
|
+
enforcement: ["authority-service", "postgres-repository"],
|
|
76
|
+
exhaustion: "New keys refused; existing keys and committed schedules preserved",
|
|
77
|
+
visibility: "customer",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "forecastHorizonSeconds",
|
|
81
|
+
type: "integer",
|
|
82
|
+
unit: "seconds",
|
|
83
|
+
default: CONFIGURATION_DEFAULTS.forecastHorizonSeconds,
|
|
84
|
+
minimum: 60,
|
|
85
|
+
maximum: MAX_FORECAST_HORIZON_SECONDS,
|
|
86
|
+
layers: allowanceLayers,
|
|
87
|
+
change: "live",
|
|
88
|
+
rationale: "The operator removed the six-hour allowance. Default is the existing public forecast horizon; explicit work exhaustion cannot masquerade as complete coverage.",
|
|
89
|
+
enforcement: ["authority-reads"],
|
|
90
|
+
exhaustion: "Window clipped; exhausted work returns explicit incomplete refusal",
|
|
91
|
+
visibility: "customer",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "usageWindowDays",
|
|
95
|
+
type: "integer",
|
|
96
|
+
unit: "days",
|
|
97
|
+
default: CONFIGURATION_DEFAULTS.usageWindowDays,
|
|
98
|
+
minimum: 1,
|
|
99
|
+
maximum: MAX_USAGE_WINDOW_DAYS,
|
|
100
|
+
layers: allowanceLayers,
|
|
101
|
+
change: "live",
|
|
102
|
+
rationale: "The operator removed the 31-day allowance. Default is the existing public usage envelope; it does not extend retention or restore purged data.",
|
|
103
|
+
enforcement: ["authority-reads"],
|
|
104
|
+
exhaustion: "Read window constrained to effective policy",
|
|
105
|
+
visibility: "customer",
|
|
106
|
+
},
|
|
107
|
+
...[
|
|
108
|
+
"attemptDetailRetentionSeconds",
|
|
109
|
+
"historyRetentionSeconds",
|
|
110
|
+
"payloadRetentionSeconds",
|
|
111
|
+
].map((key) => ({
|
|
112
|
+
key,
|
|
113
|
+
type: "integer",
|
|
114
|
+
unit: "seconds",
|
|
115
|
+
default: CONFIGURATION_DEFAULTS[key],
|
|
116
|
+
minimum: 0,
|
|
117
|
+
maximum: 9_007_199_254_740,
|
|
118
|
+
layers: deploymentLayers,
|
|
119
|
+
change: "deployment",
|
|
120
|
+
rationale: "Accepted retention policy, separately governed. Stored schedule durations preserve committed policy; increases cannot restore purged data.",
|
|
121
|
+
enforcement: ["authority-service", "authority-reads", "retention"],
|
|
122
|
+
exhaustion: "Read cutoff and bounded purge; no organization override",
|
|
123
|
+
visibility: "customer",
|
|
124
|
+
})),
|
|
125
|
+
{
|
|
126
|
+
key: "pageLimit",
|
|
127
|
+
type: "integer",
|
|
128
|
+
unit: "count",
|
|
129
|
+
minimum: PUBLIC_PAGE_SIZE.min,
|
|
130
|
+
maximum: PUBLIC_PAGE_SIZE.max,
|
|
131
|
+
layers: deploymentLayers,
|
|
132
|
+
change: "deployment",
|
|
133
|
+
rationale: "Public page protocol maximum; continuation preserves completeness.",
|
|
134
|
+
enforcement: ["authority-reads"],
|
|
135
|
+
exhaustion: "Bounded page with continuation",
|
|
136
|
+
visibility: "customer",
|
|
137
|
+
},
|
|
138
|
+
]);
|
|
139
|
+
export function validateConfigurationValues(value, scope) {
|
|
140
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
141
|
+
throw new TypeError("configuration values must be an object");
|
|
142
|
+
if (scope !== "global" && scope !== "organization")
|
|
143
|
+
throw new TypeError("unsupported configuration scope");
|
|
144
|
+
const parsed = {};
|
|
145
|
+
for (const [key, candidate] of Object.entries(value)) {
|
|
146
|
+
const definition = CONFIGURATION_CATALOG.find((entry) => entry.key === key);
|
|
147
|
+
if (definition === undefined || !definition.layers.includes(scope))
|
|
148
|
+
throw new TypeError(`configuration setting ${key} does not support ${scope} edits`);
|
|
149
|
+
if (typeof candidate !== "number" ||
|
|
150
|
+
!Number.isSafeInteger(candidate) ||
|
|
151
|
+
candidate < definition.minimum ||
|
|
152
|
+
candidate > definition.maximum)
|
|
153
|
+
throw new RangeError(`configuration setting ${key} must be an integer from ${String(definition.minimum)} to ${String(definition.maximum)} ${definition.unit}`);
|
|
154
|
+
parsed[key] = candidate;
|
|
155
|
+
}
|
|
156
|
+
return Object.freeze(parsed);
|
|
157
|
+
}
|
|
158
|
+
export function resolveEffectiveConfiguration(input) {
|
|
159
|
+
if (!["local", "staging", "production"].includes(input.deployment))
|
|
160
|
+
throw new TypeError("unsupported deployment context");
|
|
161
|
+
const global = validateConfigurationValues(input.global ?? {}, "global");
|
|
162
|
+
const organization = validateConfigurationValues(input.organization ?? {}, "organization");
|
|
163
|
+
const values = { ...CONFIGURATION_DEFAULTS };
|
|
164
|
+
const provenance = Object.fromEntries(Object.keys(values).map((key) => [key, "default"]));
|
|
165
|
+
const apply = (layer, changes) => {
|
|
166
|
+
for (const [key, value] of Object.entries(changes)) {
|
|
167
|
+
values[key] = value;
|
|
168
|
+
provenance[key] = layer;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
if (input.baseline !== undefined) {
|
|
172
|
+
for (const [key, candidate] of Object.entries(input.baseline)) {
|
|
173
|
+
const setting = CONFIGURATION_CATALOG.find((entry) => entry.key === key);
|
|
174
|
+
if (setting === undefined ||
|
|
175
|
+
typeof candidate !== "number" ||
|
|
176
|
+
!Number.isSafeInteger(candidate) ||
|
|
177
|
+
candidate < setting.minimum ||
|
|
178
|
+
candidate > setting.maximum)
|
|
179
|
+
throw new RangeError("invalid deployment baseline");
|
|
180
|
+
}
|
|
181
|
+
for (const key of Object.keys(values))
|
|
182
|
+
delete values[key];
|
|
183
|
+
for (const key of Object.keys(provenance))
|
|
184
|
+
delete provenance[key];
|
|
185
|
+
apply("deployment", input.baseline);
|
|
186
|
+
}
|
|
187
|
+
apply("global", global);
|
|
188
|
+
apply("organization", organization);
|
|
189
|
+
for (const revision of [
|
|
190
|
+
input.globalRevision ?? 0,
|
|
191
|
+
input.organizationRevision ?? 0,
|
|
192
|
+
]) {
|
|
193
|
+
if (!Number.isSafeInteger(revision) || revision < 0)
|
|
194
|
+
throw new RangeError("configuration revision must be a nonnegative integer");
|
|
195
|
+
}
|
|
196
|
+
return Object.freeze({
|
|
197
|
+
values: Object.freeze(values),
|
|
198
|
+
revision: Object.freeze({
|
|
199
|
+
global: input.globalRevision ?? 0,
|
|
200
|
+
organization: input.organizationRevision ?? 0,
|
|
201
|
+
}),
|
|
202
|
+
provenance: Object.freeze(provenance),
|
|
203
|
+
});
|
|
204
|
+
}
|
package/dist/data-export.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare const dataExportIdSchema: import("zod").ZodString;
|
|
|
6
6
|
export declare function newDataExportId(randomBytes?: RandomBytes): string;
|
|
7
7
|
export declare const DATA_EXPORT_STATES: readonly ["active", "complete", "cancelled"];
|
|
8
8
|
export declare const dataExportStateSchema: import("zod").ZodEnum<{
|
|
9
|
-
active: "active";
|
|
10
9
|
cancelled: "cancelled";
|
|
10
|
+
active: "active";
|
|
11
11
|
complete: "complete";
|
|
12
12
|
}>;
|
|
13
13
|
/** Creating an export takes no authority from the body. */
|
|
@@ -18,8 +18,8 @@ export declare const dataExportSchema: import("zod").ZodObject<{
|
|
|
18
18
|
cutoffAt: import("zod").ZodString;
|
|
19
19
|
id: import("zod").ZodString;
|
|
20
20
|
state: import("zod").ZodEnum<{
|
|
21
|
-
active: "active";
|
|
22
21
|
cancelled: "cancelled";
|
|
22
|
+
active: "active";
|
|
23
23
|
complete: "complete";
|
|
24
24
|
}>;
|
|
25
25
|
updatedAt: import("zod").ZodString;
|
|
@@ -46,8 +46,8 @@ export declare const dataExportCancelledSchema: import("zod").ZodObject<{
|
|
|
46
46
|
cutoffAt: import("zod").ZodString;
|
|
47
47
|
id: import("zod").ZodString;
|
|
48
48
|
state: import("zod").ZodEnum<{
|
|
49
|
-
active: "active";
|
|
50
49
|
cancelled: "cancelled";
|
|
50
|
+
active: "active";
|
|
51
51
|
complete: "complete";
|
|
52
52
|
}>;
|
|
53
53
|
updatedAt: import("zod").ZodString;
|
|
@@ -8,26 +8,26 @@ export declare const effectiveCustomerLimitsSchema: import("zod").ZodObject<{
|
|
|
8
8
|
}, import("zod/v4/core").$strict>;
|
|
9
9
|
provenance: import("zod").ZodObject<{
|
|
10
10
|
inlinePayloadBytes: import("zod").ZodEnum<{
|
|
11
|
-
default: "default";
|
|
12
11
|
organization: "organization";
|
|
12
|
+
default: "default";
|
|
13
13
|
global: "global";
|
|
14
14
|
deployment: "deployment";
|
|
15
15
|
}>;
|
|
16
16
|
partitionKeyCeiling: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
17
|
-
default: "default";
|
|
18
17
|
organization: "organization";
|
|
18
|
+
default: "default";
|
|
19
19
|
global: "global";
|
|
20
20
|
deployment: "deployment";
|
|
21
21
|
}>>;
|
|
22
22
|
forecastHorizonSeconds: import("zod").ZodEnum<{
|
|
23
|
-
default: "default";
|
|
24
23
|
organization: "organization";
|
|
24
|
+
default: "default";
|
|
25
25
|
global: "global";
|
|
26
26
|
deployment: "deployment";
|
|
27
27
|
}>;
|
|
28
28
|
usageWindowDays: import("zod").ZodEnum<{
|
|
29
|
-
default: "default";
|
|
30
29
|
organization: "organization";
|
|
30
|
+
default: "default";
|
|
31
31
|
global: "global";
|
|
32
32
|
deployment: "deployment";
|
|
33
33
|
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
/** Retained execution search extends the same current-parent predicates. */
|
|
3
|
+
export declare const executionSelectionSchema: import("zod").ZodObject<{
|
|
4
|
+
endpoint: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodLiteral<"none">]>>;
|
|
5
|
+
schedule: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
external_identifier: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
tag: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
status: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
9
|
+
cancelled: "cancelled";
|
|
10
|
+
active: "active";
|
|
11
|
+
paused: "paused";
|
|
12
|
+
completed: "completed";
|
|
13
|
+
}>>;
|
|
14
|
+
recurrence: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
15
|
+
at: "at";
|
|
16
|
+
every: "every";
|
|
17
|
+
cron: "cron";
|
|
18
|
+
}>>;
|
|
19
|
+
text: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
from: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
to: import("zod").ZodOptional<import("zod").ZodString>;
|
|
22
|
+
outcome: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
23
|
+
planned: "planned";
|
|
24
|
+
due: "due";
|
|
25
|
+
dispatching: "dispatching";
|
|
26
|
+
retry_wait: "retry_wait";
|
|
27
|
+
ambiguous: "ambiguous";
|
|
28
|
+
succeeded: "succeeded";
|
|
29
|
+
terminal_failed: "terminal_failed";
|
|
30
|
+
cancelled: "cancelled";
|
|
31
|
+
skipped_stale: "skipped_stale";
|
|
32
|
+
}>>;
|
|
33
|
+
}, import("zod/v4/core").$strip>;
|
|
34
|
+
export type ExecutionSelection = z.infer<typeof executionSelectionSchema>;
|
|
35
|
+
export declare function normalizeExecutionSelection(selection: ExecutionSelection): {
|
|
36
|
+
outcome?: "planned" | "due" | "dispatching" | "retry_wait" | "ambiguous" | "succeeded" | "terminal_failed" | "cancelled" | "skipped_stale";
|
|
37
|
+
to?: string;
|
|
38
|
+
from?: string;
|
|
39
|
+
external_identifier?: string;
|
|
40
|
+
tag?: string;
|
|
41
|
+
status?: "cancelled" | "active" | "paused" | "completed";
|
|
42
|
+
recurrence?: "at" | "every" | "cron";
|
|
43
|
+
endpoint?: string;
|
|
44
|
+
text?: string;
|
|
45
|
+
schedule?: string;
|
|
46
|
+
dueAfter?: string;
|
|
47
|
+
dueBefore?: string;
|
|
48
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
import { occurrenceStateSchema } from "./occurrence-states.js";
|
|
3
|
+
import { scheduleSelectionSchema, normalizeScheduleSelection, } from "./schedule-selection.js";
|
|
4
|
+
import { timestampSchema } from "./time.js";
|
|
5
|
+
/** Retained execution search extends the same current-parent predicates. */
|
|
6
|
+
export const executionSelectionSchema = scheduleSelectionSchema
|
|
7
|
+
.omit({ dueBefore: true, dueAfter: true })
|
|
8
|
+
.extend({
|
|
9
|
+
from: timestampSchema.optional(),
|
|
10
|
+
to: timestampSchema.optional(),
|
|
11
|
+
outcome: occurrenceStateSchema.optional(),
|
|
12
|
+
});
|
|
13
|
+
export function normalizeExecutionSelection(selection) {
|
|
14
|
+
const parent = normalizeScheduleSelection(selection);
|
|
15
|
+
return {
|
|
16
|
+
...parent,
|
|
17
|
+
...(selection.from === undefined ? {} : { from: selection.from }),
|
|
18
|
+
...(selection.to === undefined ? {} : { to: selection.to }),
|
|
19
|
+
...(selection.outcome === undefined ? {} : { outcome: selection.outcome }),
|
|
20
|
+
};
|
|
21
|
+
}
|
package/dist/http-request.d.ts
CHANGED
|
@@ -158,9 +158,9 @@ export declare const storedHttpRequestSchema: import("zod").ZodObject<{
|
|
|
158
158
|
GET: "GET";
|
|
159
159
|
}>;
|
|
160
160
|
bodyMode: import("zod").ZodEnum<{
|
|
161
|
+
none: "none";
|
|
161
162
|
envelope: "envelope";
|
|
162
163
|
json: "json";
|
|
163
|
-
none: "none";
|
|
164
164
|
}>;
|
|
165
165
|
headers: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
166
166
|
name: import("zod").ZodString;
|
package/dist/identifiers.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const ID_PREFIXES: {
|
|
|
17
17
|
readonly apiCredential: "ak";
|
|
18
18
|
readonly apiCredentialEvent: "ake";
|
|
19
19
|
readonly attempt: "att";
|
|
20
|
+
readonly bulkJob: "bjo";
|
|
20
21
|
readonly authorizationRequest: "oar";
|
|
21
22
|
readonly callbackSigningKey: "csk";
|
|
22
23
|
readonly delivery: "dlv";
|
|
@@ -49,6 +50,7 @@ export declare const oauthGrantIdSchema: import("zod").ZodString;
|
|
|
49
50
|
export declare const oauthGrantEventIdSchema: import("zod").ZodString;
|
|
50
51
|
export declare const scheduleIdSchema: import("zod").ZodString;
|
|
51
52
|
export declare const occurrenceIdSchema: import("zod").ZodString;
|
|
53
|
+
export declare const bulkJobIdSchema: import("zod").ZodString;
|
|
52
54
|
export declare const attemptIdSchema: import("zod").ZodString;
|
|
53
55
|
export declare const deliveryIdSchema: import("zod").ZodString;
|
|
54
56
|
export declare const endpointIdSchema: import("zod").ZodString;
|
package/dist/identifiers.js
CHANGED
|
@@ -21,6 +21,7 @@ export const ID_PREFIXES = {
|
|
|
21
21
|
// would make an identifier ambiguous about which stream it belongs to.
|
|
22
22
|
apiCredentialEvent: "ake",
|
|
23
23
|
attempt: "att",
|
|
24
|
+
bulkJob: "bjo",
|
|
24
25
|
// A pending OAuth authorization, alive only between the client's redirect and
|
|
25
26
|
// the member's answer. It is an identifier rather than an opaque blob because
|
|
26
27
|
// the consent screen has to fetch it by name, and a blob in a URL is a blob
|
|
@@ -79,6 +80,7 @@ export const oauthGrantIdSchema = idSchema("oauthGrant");
|
|
|
79
80
|
export const oauthGrantEventIdSchema = idSchema("oauthGrantEvent");
|
|
80
81
|
export const scheduleIdSchema = idSchema("schedule");
|
|
81
82
|
export const occurrenceIdSchema = idSchema("occurrence");
|
|
83
|
+
export const bulkJobIdSchema = idSchema("bulkJob");
|
|
82
84
|
export const attemptIdSchema = idSchema("attempt");
|
|
83
85
|
export const deliveryIdSchema = idSchema("delivery");
|
|
84
86
|
export const endpointIdSchema = idSchema("endpoint");
|
package/dist/identity.d.ts
CHANGED
|
@@ -71,8 +71,8 @@ export type MembershipRole = z.infer<typeof membershipRoleSchema>;
|
|
|
71
71
|
*/
|
|
72
72
|
export declare const MEMBERSHIP_STATUSES: readonly ["active", "suspended", "removed"];
|
|
73
73
|
export declare const membershipStatusSchema: import("zod").ZodEnum<{
|
|
74
|
-
removed: "removed";
|
|
75
74
|
active: "active";
|
|
75
|
+
removed: "removed";
|
|
76
76
|
suspended: "suspended";
|
|
77
77
|
}>;
|
|
78
78
|
export type MembershipStatus = z.infer<typeof membershipStatusSchema>;
|
|
@@ -105,8 +105,8 @@ export declare const membershipSchema: import("zod").ZodObject<{
|
|
|
105
105
|
billing: "billing";
|
|
106
106
|
}>;
|
|
107
107
|
status: import("zod").ZodEnum<{
|
|
108
|
-
removed: "removed";
|
|
109
108
|
active: "active";
|
|
109
|
+
removed: "removed";
|
|
110
110
|
suspended: "suspended";
|
|
111
111
|
}>;
|
|
112
112
|
user: import("zod").ZodString;
|
|
@@ -147,8 +147,8 @@ export declare const membershipChangeSchema: import("zod").ZodObject<{
|
|
|
147
147
|
billing: "billing";
|
|
148
148
|
}>;
|
|
149
149
|
status: import("zod").ZodEnum<{
|
|
150
|
-
removed: "removed";
|
|
151
150
|
active: "active";
|
|
151
|
+
removed: "removed";
|
|
152
152
|
suspended: "suspended";
|
|
153
153
|
}>;
|
|
154
154
|
user: import("zod").ZodString;
|
package/dist/index.d.ts
CHANGED
|
@@ -35,3 +35,8 @@ export * from "./http-request.js";
|
|
|
35
35
|
export { sanitizedDiagnosticText, diagnosticBodyText, responseBodySentence, requestCaptureSentence, attemptStatusGuidance, } from "./attempt-diagnostics.js";
|
|
36
36
|
export { PROJECT_NOTIFICATION_OPERATIONS, notificationEmailRecipientsSchema, notificationEmailSettingsSchema, statusWebhookEventSchema, statusWebhookConfigurationSchema, projectNotificationSettingsSchema, projectNotificationSettingsUpdateRequestSchema, statusSigningKeyRequestSchema, statusSigningKeyCreatedSchema, statusWebhookPayloadSchema, statusWebhookDeliverySchema, statusWebhookDeliveryPageSchema, type ProjectNotificationSettings, type ProjectNotificationSettingsUpdateRequest, type StatusSigningKeyCreated, type StatusWebhookEvent, type StatusWebhookPayload, type StatusWebhookDelivery, type StatusWebhookDeliveryPage, } from "./project-notifications.js";
|
|
37
37
|
export { externalIdentifierSchema, scheduleTagSchema, scheduleTagsSchema, } from "./host-correlation.js";
|
|
38
|
+
export { scheduleSelectionSchema, normalizeScheduleSelection, type ScheduleSelection, } from "./schedule-selection.js";
|
|
39
|
+
export * from "./bulk-operations.js";
|
|
40
|
+
export { executionSelectionSchema, normalizeExecutionSelection, type ExecutionSelection, } from "./execution-selection.js";
|
|
41
|
+
export { bulkJobIdSchema } from "./identifiers.js";
|
|
42
|
+
export * from "./attempt-search.js";
|
package/dist/index.js
CHANGED
|
@@ -35,3 +35,8 @@ export * from "./http-request.js";
|
|
|
35
35
|
export { sanitizedDiagnosticText, diagnosticBodyText, responseBodySentence, requestCaptureSentence, attemptStatusGuidance, } from "./attempt-diagnostics.js";
|
|
36
36
|
export { PROJECT_NOTIFICATION_OPERATIONS, notificationEmailRecipientsSchema, notificationEmailSettingsSchema, statusWebhookEventSchema, statusWebhookConfigurationSchema, projectNotificationSettingsSchema, projectNotificationSettingsUpdateRequestSchema, statusSigningKeyRequestSchema, statusSigningKeyCreatedSchema, statusWebhookPayloadSchema, statusWebhookDeliverySchema, statusWebhookDeliveryPageSchema, } from "./project-notifications.js";
|
|
37
37
|
export { externalIdentifierSchema, scheduleTagSchema, scheduleTagsSchema, } from "./host-correlation.js";
|
|
38
|
+
export { scheduleSelectionSchema, normalizeScheduleSelection, } from "./schedule-selection.js";
|
|
39
|
+
export * from "./bulk-operations.js";
|
|
40
|
+
export { executionSelectionSchema, normalizeExecutionSelection, } from "./execution-selection.js";
|
|
41
|
+
export { bulkJobIdSchema } from "./identifiers.js";
|
|
42
|
+
export * from "./attempt-search.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
export declare const OCCURRENCE_STATES: readonly ["planned", "due", "dispatching", "retry_wait", "ambiguous", "succeeded", "terminal_failed", "cancelled", "skipped_stale"];
|
|
3
|
+
export declare const occurrenceStateSchema: import("zod").ZodEnum<{
|
|
4
|
+
planned: "planned";
|
|
5
|
+
due: "due";
|
|
6
|
+
dispatching: "dispatching";
|
|
7
|
+
retry_wait: "retry_wait";
|
|
8
|
+
ambiguous: "ambiguous";
|
|
9
|
+
succeeded: "succeeded";
|
|
10
|
+
terminal_failed: "terminal_failed";
|
|
11
|
+
cancelled: "cancelled";
|
|
12
|
+
skipped_stale: "skipped_stale";
|
|
13
|
+
}>;
|
|
14
|
+
export type OccurrenceState = z.infer<typeof occurrenceStateSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "./zod.js";
|
|
2
|
+
export const OCCURRENCE_STATES = [
|
|
3
|
+
"planned",
|
|
4
|
+
"due",
|
|
5
|
+
"dispatching",
|
|
6
|
+
"retry_wait",
|
|
7
|
+
"ambiguous",
|
|
8
|
+
"succeeded",
|
|
9
|
+
"terminal_failed",
|
|
10
|
+
"cancelled",
|
|
11
|
+
"skipped_stale",
|
|
12
|
+
];
|
|
13
|
+
export const occurrenceStateSchema = z.enum(OCCURRENCE_STATES);
|