@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,75 @@
|
|
|
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
|
+
/** Bounds and edit authority shared by validation and the descriptive catalog. */
|
|
55
|
+
export type ConfigurationRule = Pick<ConfigurationSetting, "key" | "unit" | "minimum" | "maximum" | "layers">;
|
|
56
|
+
export declare const CONFIGURATION_RULES: readonly ConfigurationRule[];
|
|
57
|
+
/** Descriptive metadata is only initialized by catalog consumers. */
|
|
58
|
+
export declare const CONFIGURATION_CATALOG: readonly ConfigurationSetting[];
|
|
59
|
+
export declare function validateConfigurationValues(value: unknown, scope: ConfigurationScope): ConfigurationValues;
|
|
60
|
+
export interface EffectiveConfiguration {
|
|
61
|
+
readonly values: ConfigurationValues;
|
|
62
|
+
readonly revision: {
|
|
63
|
+
readonly global: number;
|
|
64
|
+
readonly organization: number;
|
|
65
|
+
};
|
|
66
|
+
readonly provenance: Readonly<Record<string, ConfigurationLayer>>;
|
|
67
|
+
}
|
|
68
|
+
export declare function resolveEffectiveConfiguration(input: {
|
|
69
|
+
readonly deployment: DeploymentContext;
|
|
70
|
+
readonly baseline?: ConfigurationValues;
|
|
71
|
+
readonly global?: ConfigurationValues;
|
|
72
|
+
readonly organization?: ConfigurationValues;
|
|
73
|
+
readonly globalRevision?: number;
|
|
74
|
+
readonly organizationRevision?: number;
|
|
75
|
+
}): EffectiveConfiguration;
|
|
@@ -0,0 +1,242 @@
|
|
|
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_RULES = 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
|
+
unit: key.endsWith("Seconds") ? "seconds" : "count",
|
|
41
|
+
minimum: 1,
|
|
42
|
+
maximum: BULK_CONFIGURATION_MAXIMA[key],
|
|
43
|
+
layers: allowanceLayers,
|
|
44
|
+
})),
|
|
45
|
+
{
|
|
46
|
+
key: "inlinePayloadBytes",
|
|
47
|
+
unit: "bytes",
|
|
48
|
+
minimum: 0,
|
|
49
|
+
maximum: MAX_INLINE_PAYLOAD_BYTES,
|
|
50
|
+
layers: allowanceLayers,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "partitionKeyCeiling",
|
|
54
|
+
unit: "count",
|
|
55
|
+
minimum: 1,
|
|
56
|
+
maximum: MAX_PARTITION_KEY_CEILING,
|
|
57
|
+
layers: allowanceLayers,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: "forecastHorizonSeconds",
|
|
61
|
+
unit: "seconds",
|
|
62
|
+
minimum: 60,
|
|
63
|
+
maximum: MAX_FORECAST_HORIZON_SECONDS,
|
|
64
|
+
layers: allowanceLayers,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: "usageWindowDays",
|
|
68
|
+
unit: "days",
|
|
69
|
+
minimum: 1,
|
|
70
|
+
maximum: MAX_USAGE_WINDOW_DAYS,
|
|
71
|
+
layers: allowanceLayers,
|
|
72
|
+
},
|
|
73
|
+
...[
|
|
74
|
+
"attemptDetailRetentionSeconds",
|
|
75
|
+
"historyRetentionSeconds",
|
|
76
|
+
"payloadRetentionSeconds",
|
|
77
|
+
].map((key) => ({
|
|
78
|
+
key,
|
|
79
|
+
unit: "seconds",
|
|
80
|
+
minimum: 0,
|
|
81
|
+
maximum: 9_007_199_254_740,
|
|
82
|
+
layers: deploymentLayers,
|
|
83
|
+
})),
|
|
84
|
+
{
|
|
85
|
+
key: "pageLimit",
|
|
86
|
+
unit: "count",
|
|
87
|
+
minimum: PUBLIC_PAGE_SIZE.min,
|
|
88
|
+
maximum: PUBLIC_PAGE_SIZE.max,
|
|
89
|
+
layers: deploymentLayers,
|
|
90
|
+
},
|
|
91
|
+
]);
|
|
92
|
+
/** Descriptive metadata is only initialized by catalog consumers. */
|
|
93
|
+
export const CONFIGURATION_CATALOG =
|
|
94
|
+
/* @__PURE__ */ (() => {
|
|
95
|
+
const metadata = [
|
|
96
|
+
...[
|
|
97
|
+
"bulkMaxTargets",
|
|
98
|
+
"bulkExecutionLifetimeSeconds",
|
|
99
|
+
"bulkPreviewLifetimeSeconds",
|
|
100
|
+
"bulkResultRetentionSeconds",
|
|
101
|
+
"bulkBatchSize",
|
|
102
|
+
"bulkWorkerConcurrency",
|
|
103
|
+
"bulkActiveJobLimit",
|
|
104
|
+
"bulkWorkBudgetSeconds",
|
|
105
|
+
"bulkCarrierBatchSize",
|
|
106
|
+
].map((key) => ({
|
|
107
|
+
key,
|
|
108
|
+
change: "live",
|
|
109
|
+
visibility: "customer",
|
|
110
|
+
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.",
|
|
111
|
+
enforcement: ["bulk-operations"],
|
|
112
|
+
exhaustion: "Oversized selections refuse; deadlines expire remaining work; durable checkpoints preserve completed effects.",
|
|
113
|
+
})),
|
|
114
|
+
{
|
|
115
|
+
key: "inlinePayloadBytes",
|
|
116
|
+
change: "live",
|
|
117
|
+
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.",
|
|
118
|
+
enforcement: ["authority-service", "schedule-draft"],
|
|
119
|
+
exhaustion: "Local validation and authoritative plan-limit-reached",
|
|
120
|
+
visibility: "customer",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: "partitionKeyCeiling",
|
|
124
|
+
change: "live",
|
|
125
|
+
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.",
|
|
126
|
+
enforcement: ["authority-service", "postgres-repository"],
|
|
127
|
+
exhaustion: "New keys refused; existing keys and committed schedules preserved",
|
|
128
|
+
visibility: "customer",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
key: "forecastHorizonSeconds",
|
|
132
|
+
change: "live",
|
|
133
|
+
rationale: "The operator removed the six-hour allowance. Default is the existing public forecast horizon; explicit work exhaustion cannot masquerade as complete coverage.",
|
|
134
|
+
enforcement: ["authority-reads"],
|
|
135
|
+
exhaustion: "Window clipped; exhausted work returns explicit incomplete refusal",
|
|
136
|
+
visibility: "customer",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
key: "usageWindowDays",
|
|
140
|
+
change: "live",
|
|
141
|
+
rationale: "The operator removed the 31-day allowance. Default is the existing public usage envelope; it does not extend retention or restore purged data.",
|
|
142
|
+
enforcement: ["authority-reads"],
|
|
143
|
+
exhaustion: "Read window constrained to effective policy",
|
|
144
|
+
visibility: "customer",
|
|
145
|
+
},
|
|
146
|
+
...[
|
|
147
|
+
"attemptDetailRetentionSeconds",
|
|
148
|
+
"historyRetentionSeconds",
|
|
149
|
+
"payloadRetentionSeconds",
|
|
150
|
+
].map((key) => ({
|
|
151
|
+
key,
|
|
152
|
+
change: "deployment",
|
|
153
|
+
rationale: "Accepted retention policy, separately governed. Stored schedule durations preserve committed policy; increases cannot restore purged data.",
|
|
154
|
+
enforcement: ["authority-service", "authority-reads", "retention"],
|
|
155
|
+
exhaustion: "Read cutoff and bounded purge; no organization override",
|
|
156
|
+
visibility: "customer",
|
|
157
|
+
})),
|
|
158
|
+
{
|
|
159
|
+
key: "pageLimit",
|
|
160
|
+
change: "deployment",
|
|
161
|
+
rationale: "Public page protocol maximum; continuation preserves completeness.",
|
|
162
|
+
enforcement: ["authority-reads"],
|
|
163
|
+
exhaustion: "Bounded page with continuation",
|
|
164
|
+
visibility: "customer",
|
|
165
|
+
},
|
|
166
|
+
];
|
|
167
|
+
const defaults = CONFIGURATION_DEFAULTS;
|
|
168
|
+
return Object.freeze(metadata.map((entry) => ({
|
|
169
|
+
...CONFIGURATION_RULES.find((rule) => rule.key === entry.key),
|
|
170
|
+
type: "integer",
|
|
171
|
+
...(defaults[entry.key] === undefined
|
|
172
|
+
? {}
|
|
173
|
+
: { default: defaults[entry.key] }),
|
|
174
|
+
...entry,
|
|
175
|
+
})));
|
|
176
|
+
})();
|
|
177
|
+
export function validateConfigurationValues(value, scope) {
|
|
178
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
179
|
+
throw new TypeError("configuration values must be an object");
|
|
180
|
+
if (scope !== "global" && scope !== "organization")
|
|
181
|
+
throw new TypeError("unsupported configuration scope");
|
|
182
|
+
const parsed = {};
|
|
183
|
+
for (const [key, candidate] of Object.entries(value)) {
|
|
184
|
+
const definition = CONFIGURATION_RULES.find((entry) => entry.key === key);
|
|
185
|
+
if (definition === undefined || !definition.layers.includes(scope))
|
|
186
|
+
throw new TypeError(`configuration setting ${key} does not support ${scope} edits`);
|
|
187
|
+
if (typeof candidate !== "number" ||
|
|
188
|
+
!Number.isSafeInteger(candidate) ||
|
|
189
|
+
candidate < definition.minimum ||
|
|
190
|
+
candidate > definition.maximum)
|
|
191
|
+
throw new RangeError(`configuration setting ${key} must be an integer from ${String(definition.minimum)} to ${String(definition.maximum)} ${definition.unit}`);
|
|
192
|
+
parsed[key] = candidate;
|
|
193
|
+
}
|
|
194
|
+
return Object.freeze(parsed);
|
|
195
|
+
}
|
|
196
|
+
export function resolveEffectiveConfiguration(input) {
|
|
197
|
+
if (!["local", "staging", "production"].includes(input.deployment))
|
|
198
|
+
throw new TypeError("unsupported deployment context");
|
|
199
|
+
const global = validateConfigurationValues(input.global ?? {}, "global");
|
|
200
|
+
const organization = validateConfigurationValues(input.organization ?? {}, "organization");
|
|
201
|
+
const values = { ...CONFIGURATION_DEFAULTS };
|
|
202
|
+
const provenance = Object.fromEntries(Object.keys(values).map((key) => [key, "default"]));
|
|
203
|
+
const apply = (layer, changes) => {
|
|
204
|
+
for (const [key, value] of Object.entries(changes)) {
|
|
205
|
+
values[key] = value;
|
|
206
|
+
provenance[key] = layer;
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
if (input.baseline !== undefined) {
|
|
210
|
+
for (const [key, candidate] of Object.entries(input.baseline)) {
|
|
211
|
+
const setting = CONFIGURATION_RULES.find((entry) => entry.key === key);
|
|
212
|
+
if (setting === undefined ||
|
|
213
|
+
typeof candidate !== "number" ||
|
|
214
|
+
!Number.isSafeInteger(candidate) ||
|
|
215
|
+
candidate < setting.minimum ||
|
|
216
|
+
candidate > setting.maximum)
|
|
217
|
+
throw new RangeError("invalid deployment baseline");
|
|
218
|
+
}
|
|
219
|
+
for (const key of Object.keys(values))
|
|
220
|
+
delete values[key];
|
|
221
|
+
for (const key of Object.keys(provenance))
|
|
222
|
+
delete provenance[key];
|
|
223
|
+
apply("deployment", input.baseline);
|
|
224
|
+
}
|
|
225
|
+
apply("global", global);
|
|
226
|
+
apply("organization", organization);
|
|
227
|
+
for (const revision of [
|
|
228
|
+
input.globalRevision ?? 0,
|
|
229
|
+
input.organizationRevision ?? 0,
|
|
230
|
+
]) {
|
|
231
|
+
if (!Number.isSafeInteger(revision) || revision < 0)
|
|
232
|
+
throw new RangeError("configuration revision must be a nonnegative integer");
|
|
233
|
+
}
|
|
234
|
+
return Object.freeze({
|
|
235
|
+
values: Object.freeze(values),
|
|
236
|
+
revision: Object.freeze({
|
|
237
|
+
global: input.globalRevision ?? 0,
|
|
238
|
+
organization: input.organizationRevision ?? 0,
|
|
239
|
+
}),
|
|
240
|
+
provenance: Object.freeze(provenance),
|
|
241
|
+
});
|
|
242
|
+
}
|
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;
|
package/dist/delivery.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export interface StoredHttpRequest {
|
|
|
45
45
|
readonly encryptedTemplate?: EncryptedSchedulePayload;
|
|
46
46
|
}
|
|
47
47
|
export declare const HTTP_HEADER_AAD_VERSION: "greatwait.http-header.v1";
|
|
48
|
+
export { mergeStoredHttpHeaders, validScheduleHttp, validStoredHttpHeaders, } from "./stored-http.js";
|
|
48
49
|
export declare const HTTP_TEMPLATE_AAD_VERSION: "greatwait.http-template.v1";
|
|
49
50
|
/**
|
|
50
51
|
* One immutable delivery attempt, minted by the Scheduler Partition from its
|
package/dist/delivery.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export const SCHEDULE_PAYLOAD_AAD_VERSION = "greatwait.schedule-payload.v1";
|
|
10
10
|
export const HTTP_HEADER_AAD_VERSION = "greatwait.http-header.v1";
|
|
11
|
+
export { mergeStoredHttpHeaders, validScheduleHttp, validStoredHttpHeaders, } from "./stored-http.js";
|
|
11
12
|
export const HTTP_TEMPLATE_AAD_VERSION = "greatwait.http-template.v1";
|
|
12
13
|
/**
|
|
13
14
|
* What a receiver says about work it acknowledged and then finished.
|
|
@@ -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
|
}>;
|
package/dist/endpoints.js
CHANGED
|
@@ -20,7 +20,7 @@ import { timestampSchema } from "./time.js";
|
|
|
20
20
|
* nothing to prove.
|
|
21
21
|
*/
|
|
22
22
|
export const CALLBACK_ENDPOINT_STATUSES = ["active", "disabled"];
|
|
23
|
-
export const callbackEndpointStatusSchema = z.enum(CALLBACK_ENDPOINT_STATUSES);
|
|
23
|
+
export const callbackEndpointStatusSchema = /* @__PURE__ */ (() => z.enum(CALLBACK_ENDPOINT_STATUSES))();
|
|
24
24
|
/**
|
|
25
25
|
* Why an address could not be resolved or reached: the classification the
|
|
26
26
|
* DNS inspection at create and update, and the delivery egress, share. It
|
|
@@ -37,7 +37,7 @@ export const CALLBACK_EGRESS_FAILURES = [
|
|
|
37
37
|
"timed_out",
|
|
38
38
|
"unexpected_status",
|
|
39
39
|
];
|
|
40
|
-
export const callbackEgressFailureSchema = z.enum(CALLBACK_EGRESS_FAILURES);
|
|
40
|
+
export const callbackEgressFailureSchema = /* @__PURE__ */ (() => z.enum(CALLBACK_EGRESS_FAILURES))();
|
|
41
41
|
/**
|
|
42
42
|
* @deprecated The former retained endpoint count ceiling. W0-15 removes count
|
|
43
43
|
* enforcement after the operator's decision; DNS/mutation admission and paged
|
|
@@ -56,7 +56,7 @@ export const CALLBACK_ADMISSION_RATE_LIMITS = {
|
|
|
56
56
|
};
|
|
57
57
|
/** Longest period during which a receiver may accept current and next keys. */
|
|
58
58
|
export const CALLBACK_SIGNING_KEY_ROTATION_OVERLAP_SECONDS = 86_400;
|
|
59
|
-
export const callbackSigningKeysSchema = z.object({
|
|
59
|
+
export const callbackSigningKeysSchema = /* @__PURE__ */ (() => z.object({
|
|
60
60
|
current: callbackSigningKeyIdSchema,
|
|
61
61
|
next: z
|
|
62
62
|
.object({
|
|
@@ -66,7 +66,7 @@ export const callbackSigningKeysSchema = z.object({
|
|
|
66
66
|
overlapEndsAt: timestampSchema,
|
|
67
67
|
})
|
|
68
68
|
.optional(),
|
|
69
|
-
});
|
|
69
|
+
}))();
|
|
70
70
|
/**
|
|
71
71
|
* An endpoint's name: unique within its project and environment, compared
|
|
72
72
|
* exactly (W4-14, FXO-2255).
|
|
@@ -80,16 +80,16 @@ export const callbackSigningKeysSchema = z.object({
|
|
|
80
80
|
* "Prod receiver" and "prod receiver" are both allowed. Deliberately unlike a
|
|
81
81
|
* project's name, which ignores case and spacing.
|
|
82
82
|
*/
|
|
83
|
-
export const callbackEndpointNameSchema = z
|
|
83
|
+
export const callbackEndpointNameSchema = /* @__PURE__ */ (() => z
|
|
84
84
|
.string()
|
|
85
85
|
.trim()
|
|
86
86
|
.min(1, "must not be blank")
|
|
87
|
-
.max(2_048, "must be at most 2048 characters");
|
|
87
|
+
.max(2_048, "must be at most 2048 characters"))();
|
|
88
88
|
/**
|
|
89
89
|
* A metadata-only endpoint shape. The sealed signing secret has no public
|
|
90
90
|
* field, so list/get/update/disable/enable cannot accidentally recover it.
|
|
91
91
|
*/
|
|
92
|
-
export const callbackEndpointSchema = z.object({
|
|
92
|
+
export const callbackEndpointSchema = /* @__PURE__ */ (() => z.object({
|
|
93
93
|
headers: z.array(publicHttpHeaderSchema).optional(),
|
|
94
94
|
createdAt: timestampSchema,
|
|
95
95
|
disabledAt: timestampSchema.optional(),
|
|
@@ -107,33 +107,33 @@ export const callbackEndpointSchema = z.object({
|
|
|
107
107
|
updatedAt: timestampSchema,
|
|
108
108
|
url: z.string().url(),
|
|
109
109
|
version: z.number().int().positive(),
|
|
110
|
-
});
|
|
111
|
-
export const callbackEndpointPageSchema = pageSchema(callbackEndpointSchema);
|
|
110
|
+
}))();
|
|
111
|
+
export const callbackEndpointPageSchema = /* @__PURE__ */ (() => pageSchema(callbackEndpointSchema))();
|
|
112
112
|
/** The one response that carries the per-endpoint secret. */
|
|
113
|
-
export const callbackEndpointCreatedSchema = callbackEndpointSchema.extend({
|
|
113
|
+
export const callbackEndpointCreatedSchema = /* @__PURE__ */ (() => callbackEndpointSchema.extend({
|
|
114
114
|
keyId: callbackSigningKeyIdSchema,
|
|
115
115
|
secret: z.string().min(1),
|
|
116
116
|
shownOnce: z.literal(true),
|
|
117
|
-
});
|
|
118
|
-
export const callbackSigningKeyRotationRequestSchema = z.object({
|
|
117
|
+
}))();
|
|
118
|
+
export const callbackSigningKeyRotationRequestSchema = /* @__PURE__ */ (() => z.object({
|
|
119
119
|
overlapSeconds: z
|
|
120
120
|
.number()
|
|
121
121
|
.int()
|
|
122
122
|
.min(0)
|
|
123
123
|
.max(CALLBACK_SIGNING_KEY_ROTATION_OVERLAP_SECONDS, "must not exceed the maximum endpoint-key overlap")
|
|
124
124
|
.optional(),
|
|
125
|
-
});
|
|
126
|
-
export const callbackEndpointRotatedSchema = z.object({
|
|
125
|
+
}))();
|
|
126
|
+
export const callbackEndpointRotatedSchema = /* @__PURE__ */ (() => z.object({
|
|
127
127
|
endpoint: callbackEndpointSchema,
|
|
128
128
|
keyId: callbackSigningKeyIdSchema,
|
|
129
129
|
secret: z.string().min(1),
|
|
130
130
|
shownOnce: z.literal(true),
|
|
131
|
-
});
|
|
131
|
+
}))();
|
|
132
132
|
/** One signing key and the secret behind it, as a signed-in person may see it. */
|
|
133
|
-
export const callbackEndpointSigningSecretSchema = z.object({
|
|
133
|
+
export const callbackEndpointSigningSecretSchema = /* @__PURE__ */ (() => z.object({
|
|
134
134
|
keyId: callbackSigningKeyIdSchema,
|
|
135
135
|
secret: z.string().min(1),
|
|
136
|
-
});
|
|
136
|
+
}))();
|
|
137
137
|
/**
|
|
138
138
|
* What `endpoints.revealSigningSecret` answers (FXO-2244).
|
|
139
139
|
*
|
|
@@ -142,14 +142,14 @@ export const callbackEndpointSigningSecretSchema = z.object({
|
|
|
142
142
|
* rotation both keys are here, with the instant the overlap ends, because a
|
|
143
143
|
* receiver being moved to the new key needs both until then.
|
|
144
144
|
*/
|
|
145
|
-
export const callbackEndpointSigningSecretsSchema = z.object({
|
|
145
|
+
export const callbackEndpointSigningSecretsSchema = /* @__PURE__ */ (() => z.object({
|
|
146
146
|
current: callbackEndpointSigningSecretSchema,
|
|
147
147
|
/** The endpoint these belong to, so an answer names what it is about. */
|
|
148
148
|
id: endpointIdSchema,
|
|
149
149
|
next: callbackEndpointSigningSecretSchema
|
|
150
150
|
.extend({ overlapEndsAt: timestampSchema })
|
|
151
151
|
.optional(),
|
|
152
|
-
});
|
|
152
|
+
}))();
|
|
153
153
|
/**
|
|
154
154
|
* Where an endpoint's signing secret is, for a result that does not carry it
|
|
155
155
|
* (W9-44, FXO-2907).
|
|
@@ -166,7 +166,7 @@ export const callbackEndpointSigningSecretsSchema = z.object({
|
|
|
166
166
|
* reader deciding whether it holds a secret should be told so, not left to
|
|
167
167
|
* infer it from what is missing.
|
|
168
168
|
*/
|
|
169
|
-
export const signingSecretNoticeSchema = z.object({
|
|
169
|
+
export const signingSecretNoticeSchema = /* @__PURE__ */ (() => z.object({
|
|
170
170
|
/** One sentence an agent can relay to the person it is working for. */
|
|
171
171
|
guidance: z.string().min(1),
|
|
172
172
|
/** Never `true`: these results do not carry the secret. */
|
|
@@ -176,7 +176,7 @@ export const signingSecretNoticeSchema = z.object({
|
|
|
176
176
|
* reveals the secret. Absent only where this deployment has no dashboard.
|
|
177
177
|
*/
|
|
178
178
|
revealUrl: z.string().url().optional(),
|
|
179
|
-
});
|
|
179
|
+
}))();
|
|
180
180
|
/**
|
|
181
181
|
* The dashboard path of one endpoint's page, beneath the project and
|
|
182
182
|
* environment it belongs to. The dashboard's router serves it; a test there
|
|
@@ -208,11 +208,11 @@ export function signingSecretNotice(target, dashboardOrigin) {
|
|
|
208
208
|
* Metadata only, like every endpoint read. There is no `secret` field to fill
|
|
209
209
|
* by mistake; the shape is what keeps it out of an agent's history.
|
|
210
210
|
*/
|
|
211
|
-
export const callbackEndpointEnsuredSchema = callbackEndpointSchema.extend({
|
|
211
|
+
export const callbackEndpointEnsuredSchema = /* @__PURE__ */ (() => callbackEndpointSchema.extend({
|
|
212
212
|
/** Whether this call created the endpoint, or found one already there. */
|
|
213
213
|
created: z.boolean(),
|
|
214
214
|
signingSecret: signingSecretNoticeSchema,
|
|
215
|
-
});
|
|
215
|
+
}))();
|
|
216
216
|
/**
|
|
217
217
|
* A callback destination as a caller types it: HTTPS on port 443, no
|
|
218
218
|
* credentials or fragment, a public name or address. The DNS half of the
|
|
@@ -233,7 +233,7 @@ export function callbackUrlSchema() {
|
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
export const callbackEndpointRequestSchema = z.object({
|
|
236
|
+
export const callbackEndpointRequestSchema = /* @__PURE__ */ (() => z.object({
|
|
237
237
|
headers: endpointHeaderChangesSchema.optional(),
|
|
238
238
|
/**
|
|
239
239
|
* A name for people (W4-14, FXO-2255). Omitted on a create, the endpoint
|
|
@@ -243,4 +243,4 @@ export const callbackEndpointRequestSchema = z.object({
|
|
|
243
243
|
*/
|
|
244
244
|
name: callbackEndpointNameSchema.optional(),
|
|
245
245
|
url: callbackUrlSchema(),
|
|
246
|
-
});
|
|
246
|
+
}))();
|
|
@@ -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;
|