@omg-dev/server 0.4.24
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.mjs +3278 -0
- package/dist/trigger-scan.mjs +95 -0
- package/package.json +40 -0
- package/src/auto-crud.ts +244 -0
- package/src/billing.ts +297 -0
- package/src/broker.ts +85 -0
- package/src/codec.ts +41 -0
- package/src/ctx.ts +33 -0
- package/src/db.ts +258 -0
- package/src/dispatcher.ts +257 -0
- package/src/http-error.ts +20 -0
- package/src/index.ts +702 -0
- package/src/migrator.ts +167 -0
- package/src/notifications.ts +628 -0
- package/src/predicate.ts +440 -0
- package/src/storage.ts +384 -0
- package/src/subscriptions.ts +654 -0
- package/src/test/auto-crud.test.ts +385 -0
- package/src/test/dispatcher.test.ts +271 -0
- package/src/test/migrator.test.ts +166 -0
- package/src/test/notifications.test.ts +96 -0
- package/src/test/predicate.test.ts +267 -0
- package/src/test/schema-swap.test.ts +252 -0
- package/src/test/security.test.ts +323 -0
- package/src/test/subscriptions.test.ts +878 -0
- package/src/test/trigger-scan.test.ts +78 -0
- package/src/trigger-scan.ts +173 -0
- package/src/triggers.ts +837 -0
- package/src/web-push.d.ts +18 -0
- package/src/workflows.test.ts +127 -0
- package/src/workflows.ts +438 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VibesHttpError — an expected, client-facing rejection with an explicit
|
|
3
|
+
* HTTP status. Handlers (and the infra-API proxy helpers in the
|
|
4
|
+
* control-plane) throw this instead of a bare Error when the failure is a
|
|
5
|
+
* known refusal — ownership checks, validation against an upstream API,
|
|
6
|
+
* upstream unavailability — rather than a bug.
|
|
7
|
+
*
|
|
8
|
+
* The dispatcher maps it to its status and, for 4xx, logs a one-liner
|
|
9
|
+
* instead of a stack-bearing "Handler error in <name>" crash entry. A bare
|
|
10
|
+
* Error keeps the existing 500-with-crash-log behavior.
|
|
11
|
+
*/
|
|
12
|
+
export class VibesHttpError extends Error {
|
|
13
|
+
readonly status: number
|
|
14
|
+
|
|
15
|
+
constructor(status: number, message: string) {
|
|
16
|
+
super(message)
|
|
17
|
+
this.name = "VibesHttpError"
|
|
18
|
+
this.status = status
|
|
19
|
+
}
|
|
20
|
+
}
|