@sealant/api-contracts-next 0.40.0-next.812 → 0.40.0-next.814
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/core-api/budgets.d.ts +16 -5
- package/dist/core-api/budgets.js +9 -7
- package/dist/core-api/control-plane.d.ts +1074 -1067
- package/dist/core-api/inference.d.ts +90 -6
- package/dist/core-api/inference.js +51 -9
- package/dist/core-api/system.d.ts +12 -0
- package/dist/core-api/system.js +6 -0
- package/package.json +2 -2
|
@@ -7,12 +7,23 @@ export declare const requestBudgetRefusalSchema: Schema.Struct<{
|
|
|
7
7
|
}>;
|
|
8
8
|
/** Admission metadata absent from older servers and non-admission budget errors. */
|
|
9
9
|
export type RequestBudgetRefusal = typeof requestBudgetRefusalSchema.Type;
|
|
10
|
+
/** What every budget refusal says: which limit, and when there is room again. */
|
|
11
|
+
export declare const budgetExceededFields: {
|
|
12
|
+
message: Schema.String;
|
|
13
|
+
budget: Schema.String;
|
|
14
|
+
limit: Schema.Number;
|
|
15
|
+
retryAfterSeconds: Schema.Number;
|
|
16
|
+
refusal: Schema.optional<Schema.Struct<{
|
|
17
|
+
readonly phase: Schema.Literal<"before-work">;
|
|
18
|
+
readonly bucket: Schema.Literals<readonly ["owner", "unowned", "key", "principal"]>;
|
|
19
|
+
}>>;
|
|
20
|
+
};
|
|
10
21
|
declare const BudgetExceededError_base: Schema.Class<BudgetExceededError, Schema.TaggedStruct<"BudgetExceededError", {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
message: Schema.String;
|
|
23
|
+
budget: Schema.String;
|
|
24
|
+
limit: Schema.Number;
|
|
25
|
+
retryAfterSeconds: Schema.Number;
|
|
26
|
+
refusal: Schema.optional<Schema.Struct<{
|
|
16
27
|
readonly phase: Schema.Literal<"before-work">;
|
|
17
28
|
readonly bucket: Schema.Literals<readonly ["owner", "unowned", "key", "principal"]>;
|
|
18
29
|
}>>;
|
package/dist/core-api/budgets.js
CHANGED
|
@@ -5,18 +5,20 @@ export const requestBudgetRefusalSchema = Schema.Struct({
|
|
|
5
5
|
phase: Schema.Literal("before-work"),
|
|
6
6
|
bucket: Schema.Literals(["owner", "unowned", "key", "principal"]),
|
|
7
7
|
});
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
* limit, `retryAfterSeconds` when there is room again: the rest of a rate window, or an estimate
|
|
11
|
-
* for a concurrency ceiling that only frees when the owner's own work settles.
|
|
12
|
-
*/
|
|
13
|
-
export class BudgetExceededError extends Schema.TaggedError()("BudgetExceededError", {
|
|
8
|
+
/** What every budget refusal says: which limit, and when there is room again. */
|
|
9
|
+
export const budgetExceededFields = {
|
|
14
10
|
message: Schema.String,
|
|
15
11
|
budget: Schema.String,
|
|
16
12
|
limit: Schema.Number,
|
|
17
13
|
retryAfterSeconds: Schema.Number,
|
|
18
14
|
refusal: Schema.optional(requestBudgetRefusalSchema),
|
|
19
|
-
}
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A budget refused new work (429). Nothing already running was stopped. `budget` names which
|
|
18
|
+
* limit, `retryAfterSeconds` when there is room again: the rest of a rate window, or an estimate
|
|
19
|
+
* for a concurrency ceiling that only frees when the owner's own work settles.
|
|
20
|
+
*/
|
|
21
|
+
export class BudgetExceededError extends Schema.TaggedError()("BudgetExceededError", budgetExceededFields, { httpApiStatus: 429 }) {
|
|
20
22
|
}
|
|
21
23
|
/** Declares request admission failures on every control-plane endpoint. */
|
|
22
24
|
export class RequestBudget extends HttpApiMiddleware.Service()("@sealant/api-contracts/RequestBudget", { error: BudgetExceededError }) {
|