@vxil/config 0.3.1 → 0.4.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/index.d.ts +33 -2
- package/package.json +2 -2
- package/src/index.ts +35 -1
package/dist/index.d.ts
CHANGED
|
@@ -118,7 +118,14 @@ export type FunctionTrigger = {
|
|
|
118
118
|
} | {
|
|
119
119
|
kind: 'queue';
|
|
120
120
|
source: string;
|
|
121
|
-
}
|
|
121
|
+
}
|
|
122
|
+
/** `webhook`: the function is woken by a webhook_subscription fan-out whose
|
|
123
|
+
* target_url is `<edge>/v1/internal/fn/trigger/<name>?tenant=<id>`. `source` is
|
|
124
|
+
* an event-name PREFIX filter (e.g. 'payments.'), enforced at delivery — a
|
|
125
|
+
* non-matching event is ACK-200 skipped. Declaring the binding is what opts the
|
|
126
|
+
* function into event delivery; a receiver that declares only `cron` keeps the
|
|
127
|
+
* older cron+{} wake. */
|
|
128
|
+
| {
|
|
122
129
|
kind: 'webhook';
|
|
123
130
|
source: string;
|
|
124
131
|
} | {
|
|
@@ -142,10 +149,34 @@ export interface FunctionDef {
|
|
|
142
149
|
secrets?: string[];
|
|
143
150
|
/** Outbound host allowlist (deny-by-default egress guard). */
|
|
144
151
|
egressAllow?: string[];
|
|
152
|
+
/** Per-function resource declarations. Both optional; both clamped server-side.
|
|
153
|
+
* `memoryMb` was REMOVED (2026-09-18): memory is fixed by the managed runtime
|
|
154
|
+
* and is not per-dispatch selectable. A config that still declares it pushes
|
|
155
|
+
* fine — the key is stripped, and `vxil plan --explain` marks it DROPPED. */
|
|
145
156
|
limits?: {
|
|
157
|
+
/** per-dispatch isolate CPU ceiling, ms (5..300000). Only ever TIGHTENS the
|
|
158
|
+
* platform cap.
|
|
159
|
+
*
|
|
160
|
+
* IT ALSO RAISES YOUR BILL on a metered tenant, and that is worth reading
|
|
161
|
+
* twice: it raises (never lowers) the per-invoke credit reserve, whose floor
|
|
162
|
+
* is the manifest default — and the reserve is the CEILING the pro-rated
|
|
163
|
+
* settle clamps into, because the settle can never commit more than the hold
|
|
164
|
+
* it releases from. So an invoke whose wall time exceeds `defaultLimits.cpuMs`
|
|
165
|
+
* (50) settles at its MEASURED wall-ms instead of being capped at 50:
|
|
166
|
+
* declaring `cpuMs: 1000` makes an 800 ms invoke cost 800 instead of 50.
|
|
167
|
+
* Declaring only `timeoutMs` leaves metering byte-identical.
|
|
168
|
+
*
|
|
169
|
+
* It does NOT affect anyone else's availability: the account-wide daily
|
|
170
|
+
* capacity budget counts the platform's own per-invoke estimate, never this
|
|
171
|
+
* value (workers/functions-v1/src/capacity.ts `capacityReserveCpuMs`). */
|
|
146
172
|
cpuMs?: number;
|
|
173
|
+
/** wall budget for ONE outbound fetch this function makes, ms (1000..120000,
|
|
174
|
+
* default 30000). Not a whole-invocation budget: three 25 s fetches still
|
|
175
|
+
* take 75 s. The invocation is bounded separately by the platform's own
|
|
176
|
+
* deadline (`FN_MAX_INVOKE_MS`, default ≥ 5 minutes), which raising this
|
|
177
|
+
* value widens with you. The vxil API callback leg keeps the platform's
|
|
178
|
+
* own 30 s bound. */
|
|
147
179
|
timeoutMs?: number;
|
|
148
|
-
memoryMb?: number;
|
|
149
180
|
};
|
|
150
181
|
enabled?: boolean;
|
|
151
182
|
/** optional typed contract surfaced by `vxil gen` (Level 1, §4.5). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxil/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Typed vxil.config.ts authoring for the vxil backend platform — defineConfig, feature and cms field definitions (published for @vxil/cli).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://vxil.com",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@vxil/feature-configs": "0.
|
|
25
|
+
"@vxil/feature-configs": "0.4.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
package/src/index.ts
CHANGED
|
@@ -137,6 +137,12 @@ export type FunctionTrigger =
|
|
|
137
137
|
| { kind: 'http'; path?: string }
|
|
138
138
|
| { kind: 'cron'; schedule: string }
|
|
139
139
|
| { kind: 'queue'; source: string }
|
|
140
|
+
/** `webhook`: the function is woken by a webhook_subscription fan-out whose
|
|
141
|
+
* target_url is `<edge>/v1/internal/fn/trigger/<name>?tenant=<id>`. `source` is
|
|
142
|
+
* an event-name PREFIX filter (e.g. 'payments.'), enforced at delivery — a
|
|
143
|
+
* non-matching event is ACK-200 skipped. Declaring the binding is what opts the
|
|
144
|
+
* function into event delivery; a receiver that declares only `cron` keeps the
|
|
145
|
+
* older cron+{} wake. */
|
|
140
146
|
| { kind: 'webhook'; source: string }
|
|
141
147
|
| { kind: 'cmsHook'; collection: string; event: 'beforeCreate' | 'beforeUpdate' | 'beforeWrite' }
|
|
142
148
|
| { kind: 'authHook'; event?: AuthHookEvent };
|
|
@@ -154,7 +160,35 @@ export interface FunctionDef {
|
|
|
154
160
|
secrets?: string[];
|
|
155
161
|
/** Outbound host allowlist (deny-by-default egress guard). */
|
|
156
162
|
egressAllow?: string[];
|
|
157
|
-
|
|
163
|
+
/** Per-function resource declarations. Both optional; both clamped server-side.
|
|
164
|
+
* `memoryMb` was REMOVED (2026-09-18): memory is fixed by the managed runtime
|
|
165
|
+
* and is not per-dispatch selectable. A config that still declares it pushes
|
|
166
|
+
* fine — the key is stripped, and `vxil plan --explain` marks it DROPPED. */
|
|
167
|
+
limits?: {
|
|
168
|
+
/** per-dispatch isolate CPU ceiling, ms (5..300000). Only ever TIGHTENS the
|
|
169
|
+
* platform cap.
|
|
170
|
+
*
|
|
171
|
+
* IT ALSO RAISES YOUR BILL on a metered tenant, and that is worth reading
|
|
172
|
+
* twice: it raises (never lowers) the per-invoke credit reserve, whose floor
|
|
173
|
+
* is the manifest default — and the reserve is the CEILING the pro-rated
|
|
174
|
+
* settle clamps into, because the settle can never commit more than the hold
|
|
175
|
+
* it releases from. So an invoke whose wall time exceeds `defaultLimits.cpuMs`
|
|
176
|
+
* (50) settles at its MEASURED wall-ms instead of being capped at 50:
|
|
177
|
+
* declaring `cpuMs: 1000` makes an 800 ms invoke cost 800 instead of 50.
|
|
178
|
+
* Declaring only `timeoutMs` leaves metering byte-identical.
|
|
179
|
+
*
|
|
180
|
+
* It does NOT affect anyone else's availability: the account-wide daily
|
|
181
|
+
* capacity budget counts the platform's own per-invoke estimate, never this
|
|
182
|
+
* value (workers/functions-v1/src/capacity.ts `capacityReserveCpuMs`). */
|
|
183
|
+
cpuMs?: number;
|
|
184
|
+
/** wall budget for ONE outbound fetch this function makes, ms (1000..120000,
|
|
185
|
+
* default 30000). Not a whole-invocation budget: three 25 s fetches still
|
|
186
|
+
* take 75 s. The invocation is bounded separately by the platform's own
|
|
187
|
+
* deadline (`FN_MAX_INVOKE_MS`, default ≥ 5 minutes), which raising this
|
|
188
|
+
* value widens with you. The vxil API callback leg keeps the platform's
|
|
189
|
+
* own 30 s bound. */
|
|
190
|
+
timeoutMs?: number;
|
|
191
|
+
};
|
|
158
192
|
enabled?: boolean;
|
|
159
193
|
/** optional typed contract surfaced by `vxil gen` (Level 1, §4.5). */
|
|
160
194
|
signature?: { input?: unknown; output?: unknown };
|