equipped 5.3.0-alpha.0 → 5.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/CHANGELOG.md +14 -0
- package/dist/cjs/server/adapters/express/index.cjs +312 -4
- package/dist/cjs/server/adapters/express/index.cjs.map +1 -1
- package/dist/cjs/server/adapters/express/index.min.cjs +7 -7
- package/dist/cjs/server/adapters/express/index.min.cjs.map +1 -1
- package/dist/cjs/server/adapters/fastify/index.cjs +315 -4
- package/dist/cjs/server/adapters/fastify/index.cjs.map +1 -1
- package/dist/cjs/server/adapters/fastify/index.min.cjs +7 -7
- package/dist/cjs/server/adapters/fastify/index.min.cjs.map +1 -1
- package/dist/cjs/server/index.cjs +261 -4
- package/dist/cjs/server/index.cjs.map +1 -1
- package/dist/cjs/server/index.min.cjs +7 -7
- package/dist/cjs/server/index.min.cjs.map +1 -1
- package/dist/esm/cache/adapters/in-memory/index.min.mjs +1 -1
- package/dist/esm/cache/adapters/in-memory/index.mjs +2 -2
- package/dist/esm/cache/adapters/redis/index.min.mjs +1 -1
- package/dist/esm/cache/adapters/redis/index.mjs +3 -3
- package/dist/esm/cache/index.min.mjs +1 -1
- package/dist/esm/cache/index.mjs +2 -2
- package/dist/esm/{chunk-AUKXL4EA.min.mjs → chunk-2GGMLKRP.min.mjs} +2 -2
- package/dist/esm/{chunk-TWKHVLLT.mjs → chunk-3TP7NINX.mjs} +2 -2
- package/dist/esm/{chunk-RIRBNBTC.mjs → chunk-5PZACGPI.mjs} +3 -3
- package/dist/esm/{chunk-OXI6IKAM.min.mjs → chunk-676VIABN.min.mjs} +2 -2
- package/dist/esm/{chunk-I4BB436E.mjs → chunk-7CP7ZE2O.mjs} +2 -2
- package/dist/esm/{chunk-YTM6ZURZ.min.mjs → chunk-7NF7PV6S.min.mjs} +2 -2
- package/dist/esm/{chunk-WHIWTP2Z.min.mjs → chunk-7SQ5JQYR.min.mjs} +2 -2
- package/dist/esm/{chunk-2TCFNKRZ.mjs → chunk-A4P7P6BU.mjs} +262 -5
- package/dist/esm/chunk-A4P7P6BU.mjs.map +1 -0
- package/dist/esm/{chunk-KW3PBDFD.mjs → chunk-BWUFPMVG.mjs} +2 -2
- package/dist/esm/{chunk-YTHRK2PO.mjs → chunk-HXFNN6RI.mjs} +3 -3
- package/dist/esm/chunk-IN5YKIJ7.min.mjs +32 -0
- package/dist/esm/chunk-IN5YKIJ7.min.mjs.map +1 -0
- package/dist/esm/{chunk-ECBJ3NT3.min.mjs → chunk-IRYCN6PI.min.mjs} +2 -2
- package/dist/esm/{chunk-IEBC3OWN.mjs → chunk-LKS5ZE45.mjs} +2 -2
- package/dist/esm/{chunk-6DW4GW3R.min.mjs → chunk-MQXTTWPS.min.mjs} +2 -2
- package/dist/esm/{chunk-MYGAF2AC.min.mjs → chunk-P4PRHHIY.min.mjs} +2 -2
- package/dist/esm/{chunk-6SB5M4XH.mjs → chunk-TSVHZZE4.mjs} +3 -3
- package/dist/esm/dbs/adapters/mongodb/index.min.mjs +1 -1
- package/dist/esm/dbs/adapters/mongodb/index.mjs +3 -3
- package/dist/esm/dbs/index.min.mjs +1 -1
- package/dist/esm/dbs/index.mjs +3 -3
- package/dist/esm/errors/index.min.mjs +1 -1
- package/dist/esm/errors/index.mjs +1 -1
- package/dist/esm/events/adapters/kafka/index.min.mjs +1 -1
- package/dist/esm/events/adapters/kafka/index.mjs +2 -2
- package/dist/esm/events/adapters/rabbitmq/index.min.mjs +1 -1
- package/dist/esm/events/adapters/rabbitmq/index.mjs +1 -1
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/instance/index.min.mjs +1 -1
- package/dist/esm/instance/index.mjs +1 -1
- package/dist/esm/introspection-THKMXV5V.min.mjs +2 -0
- package/dist/esm/{introspection-Y7EXSYPD.mjs → introspection-YJF3QAUK.mjs} +3 -3
- package/dist/esm/jobs/adapters/redis/index.min.mjs +1 -1
- package/dist/esm/jobs/adapters/redis/index.mjs +3 -3
- package/dist/esm/orm/adapters/in-memory/index.min.mjs +1 -1
- package/dist/esm/orm/adapters/in-memory/index.mjs +3 -3
- package/dist/esm/orm/adapters/json/index.min.mjs +1 -1
- package/dist/esm/orm/adapters/json/index.mjs +3 -3
- package/dist/esm/orm/adapters/mongodb/index.min.mjs +1 -1
- package/dist/esm/orm/adapters/mongodb/index.mjs +2 -2
- package/dist/esm/orm/adapters/postgresql/index.min.mjs +2 -2
- package/dist/esm/orm/adapters/postgresql/index.mjs +3 -3
- package/dist/esm/orm/index.min.mjs +1 -1
- package/dist/esm/orm/index.mjs +3 -3
- package/dist/esm/server/adapters/express/index.min.mjs +1 -1
- package/dist/esm/server/adapters/express/index.min.mjs.map +1 -1
- package/dist/esm/server/adapters/express/index.mjs +52 -1
- package/dist/esm/server/adapters/express/index.mjs.map +1 -1
- package/dist/esm/server/adapters/fastify/index.min.mjs +1 -1
- package/dist/esm/server/adapters/fastify/index.min.mjs.map +1 -1
- package/dist/esm/server/adapters/fastify/index.mjs +55 -1
- package/dist/esm/server/adapters/fastify/index.mjs.map +1 -1
- package/dist/esm/server/index.min.mjs +1 -1
- package/dist/esm/server/index.mjs +1 -1
- package/dist/esm/utilities/index.min.mjs +1 -1
- package/dist/esm/utilities/index.mjs +1 -1
- package/dist/esm/validations/index.min.mjs +1 -1
- package/dist/esm/validations/index.mjs +1 -1
- package/dist/types/{base-3PpBAx1K.d.ts → base-BDTBLZ9a.d.ts} +26 -2
- package/dist/types/cache/adapters/in-memory/index.js +2 -2
- package/dist/types/cache/adapters/redis/index.js +3 -3
- package/dist/types/cache/index.js +2 -2
- package/dist/types/{chunk-H6JBLKX5.js → chunk-4DH3POYM.js} +2 -2
- package/dist/types/{chunk-XOU2A2Y6.js → chunk-55CTVK7R.js} +1 -1
- package/dist/types/{chunk-A2MRYMCA.js → chunk-5Z26ZURE.js} +1 -1
- package/dist/types/{chunk-JZ2JTENY.js → chunk-IZDJDGOV.js} +2 -2
- package/dist/types/{chunk-IAHTILKJ.js → chunk-J3TGB5YQ.js} +1 -1
- package/dist/types/{chunk-LWUMIHL4.js → chunk-LPB5LS7A.js} +1 -1
- package/dist/types/{chunk-32DMHN3G.js → chunk-TT5EORDK.js} +261 -4
- package/dist/types/{chunk-4LRJJSGG.js → chunk-YLJNBL6J.js} +2 -2
- package/dist/types/dbs/adapters/mongodb/index.js +3 -3
- package/dist/types/dbs/index.js +3 -3
- package/dist/types/errors/index.js +1 -1
- package/dist/types/events/adapters/kafka/index.js +2 -2
- package/dist/types/events/adapters/rabbitmq/index.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/instance/index.js +1 -1
- package/dist/types/{introspection-ZQCAW254.js → introspection-EHGM4RMO.js} +2 -2
- package/dist/types/jobs/adapters/redis/index.js +3 -3
- package/dist/types/orm/adapters/in-memory/index.js +3 -3
- package/dist/types/orm/adapters/json/index.js +3 -3
- package/dist/types/orm/adapters/mongodb/index.js +2 -2
- package/dist/types/orm/adapters/postgresql/index.js +3 -3
- package/dist/types/orm/index.js +3 -3
- package/dist/types/server/adapters/express/index.d.ts +3 -1
- package/dist/types/server/adapters/express/index.js +52 -1
- package/dist/types/server/adapters/fastify/index.d.ts +3 -1
- package/dist/types/server/adapters/fastify/index.js +55 -1
- package/dist/types/server/index.d.ts +2 -2
- package/dist/types/server/index.js +1 -1
- package/dist/types/utilities/index.js +1 -1
- package/dist/types/validations/index.js +1 -1
- package/package.json +2 -4
- package/dist/esm/chunk-2TCFNKRZ.mjs.map +0 -1
- package/dist/esm/chunk-LTDVZJYJ.min.mjs +0 -32
- package/dist/esm/chunk-LTDVZJYJ.min.mjs.map +0 -1
- package/dist/esm/introspection-GP3G26B6.min.mjs +0 -2
- /package/dist/esm/{chunk-AUKXL4EA.min.mjs.map → chunk-2GGMLKRP.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-TWKHVLLT.mjs.map → chunk-3TP7NINX.mjs.map} +0 -0
- /package/dist/esm/{chunk-RIRBNBTC.mjs.map → chunk-5PZACGPI.mjs.map} +0 -0
- /package/dist/esm/{chunk-OXI6IKAM.min.mjs.map → chunk-676VIABN.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-I4BB436E.mjs.map → chunk-7CP7ZE2O.mjs.map} +0 -0
- /package/dist/esm/{chunk-YTM6ZURZ.min.mjs.map → chunk-7NF7PV6S.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-WHIWTP2Z.min.mjs.map → chunk-7SQ5JQYR.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-KW3PBDFD.mjs.map → chunk-BWUFPMVG.mjs.map} +0 -0
- /package/dist/esm/{chunk-YTHRK2PO.mjs.map → chunk-HXFNN6RI.mjs.map} +0 -0
- /package/dist/esm/{chunk-ECBJ3NT3.min.mjs.map → chunk-IRYCN6PI.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-IEBC3OWN.mjs.map → chunk-LKS5ZE45.mjs.map} +0 -0
- /package/dist/esm/{chunk-6DW4GW3R.min.mjs.map → chunk-MQXTTWPS.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-MYGAF2AC.min.mjs.map → chunk-P4PRHHIY.min.mjs.map} +0 -0
- /package/dist/esm/{chunk-6SB5M4XH.mjs.map → chunk-TSVHZZE4.mjs.map} +0 -0
- /package/dist/esm/{introspection-GP3G26B6.min.mjs.map → introspection-THKMXV5V.min.mjs.map} +0 -0
- /package/dist/esm/{introspection-Y7EXSYPD.mjs.map → introspection-YJF3QAUK.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from "../../../chunk-
|
|
1
|
+
import{a as r}from "../../../chunk-IRYCN6PI.min.mjs";import{K as n,m as s}from "../../../chunk-IN5YKIJ7.min.mjs";import"../../../chunk-DSUJ5FUL.min.mjs";import"../../../chunk-AQY7QVYI.min.mjs";import{v as p}from"valleyed";var l=()=>p.object({}),i=class a extends s(l,r){#e=new Map;#t;constructor(t){super(t),n.on("start",async()=>{this.#t=setInterval(()=>{let e=Date.now();for(let[o,c]of this.#e.entries())c.expiredAt&&c.expiredAt<=e&&this.#e.delete(o)},5e3)},{class:a}),n.on("close",async()=>clearInterval(this.#t),{class:a})}async delete(t){this.#e.delete(this.getScopedKey(t))}async get(t){let e=this.#e.get(this.getScopedKey(t));return e&&(e.expiredAt===void 0||e.expiredAt>Date.now())?e.data:null}async set(t,e,o){this.#e.set(this.getScopedKey(t),{data:e,expiredAt:o?Date.now()+o*1e3:void 0})}};export{i as InMemoryCache,l as inMemoryCacheConfigPipe};
|
|
2
2
|
//# sourceMappingURL=index.min.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Cache
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-LKS5ZE45.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Instance,
|
|
6
6
|
configurable
|
|
7
|
-
} from "../../../chunk-
|
|
7
|
+
} from "../../../chunk-A4P7P6BU.mjs";
|
|
8
8
|
import "../../../chunk-VCCS7CAI.mjs";
|
|
9
9
|
import "../../../chunk-J5LGTIGS.mjs";
|
|
10
10
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b}from "../../../chunk-
|
|
1
|
+
import{a,b}from "../../../chunk-7NF7PV6S.min.mjs";import"../../../chunk-IRYCN6PI.min.mjs";import"../../../chunk-IN5YKIJ7.min.mjs";import"../../../chunk-DSUJ5FUL.min.mjs";import"../../../chunk-AQY7QVYI.min.mjs";export{b as RedisCache,a as redisConfigPipe};
|
|
2
2
|
//# sourceMappingURL=index.min.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RedisCache,
|
|
3
3
|
redisConfigPipe
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
4
|
+
} from "../../../chunk-5PZACGPI.mjs";
|
|
5
|
+
import "../../../chunk-LKS5ZE45.mjs";
|
|
6
|
+
import "../../../chunk-A4P7P6BU.mjs";
|
|
7
7
|
import "../../../chunk-VCCS7CAI.mjs";
|
|
8
8
|
import "../../../chunk-J5LGTIGS.mjs";
|
|
9
9
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from "../chunk-
|
|
1
|
+
import{a as o}from "../chunk-IRYCN6PI.min.mjs";import"../chunk-IN5YKIJ7.min.mjs";import"../chunk-DSUJ5FUL.min.mjs";import"../chunk-AQY7QVYI.min.mjs";export{o as Cache};
|
|
2
2
|
//# sourceMappingURL=index.min.mjs.map
|
package/dist/esm/cache/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as s}from "./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as s}from "./chunk-MQXTTWPS.min.mjs";import{K as a}from "./chunk-IN5YKIJ7.min.mjs";var o=class{constructor(n){this.config=n}getScopedDb(n){return a.get().getScopedName(n).replaceAll(".","-")}};import{v as u}from"valleyed";var x=()=>u.object({debeziumUrl:u.string(),eventBus:u.instanceOf(s)});import{v as e}from"valleyed";var i=(p=>(p.and="and",p.or="or",p))(i||{}),y=(r=>(r.lt="lt",r.lte="lte",r.gt="gt",r.gte="gte",r.eq="eq",r.ne="ne",r.in="in",r.nin="nin",r))(y||{}),l=e.catch(e.defaults(e.in(["and","or"]),"and"),"and"),f=e.object({field:e.string(),value:e.any(),condition:e.catch(e.defaults(e.in(Object.values(y)),"eq"),"eq")}),c=e.recursive(()=>e.discriminate(t=>Object.values(i).includes(t.condition)?"block":"regular",{block:e.object({condition:l,value:e.array(c)}),regular:f}),"QueryWhereBlock"),d=e.defaults(e.array(c),[]);function m(){return e.meta(e.object({all:e.defaults(e.boolean(),!1),limit:e.lazy(()=>{let t=a.get().settings.utils.paginationDefaultLimit;return e.catch(e.defaults(e.number().pipe(e.lte(t)),t),t)}),page:e.catch(e.defaults(e.number().pipe(e.gte(1)),1),1),search:e.defaults(e.nullish(e.object({value:e.string(),fields:e.array(e.string())})),null),sort:e.defaults(e.array(e.object({field:e.string(),desc:e.defaults(e.boolean(),!1)})),[]),whereType:l,where:d,select:e.optional(e.array(e.string()))}).pipe(t=>({...t,auth:[],authType:"and"})),{title:"Query Params",$refId:"QueryParams"})}function O(t){return e.object({pages:e.object({current:e.number(),start:e.number(),last:e.number(),previous:e.nullable(e.number()),next:e.nullable(e.number())}),docs:e.object({limit:e.number(),total:e.number(),count:e.number()}),results:e.array(t)})}function v(t){return e.assert(m(),t)}export{o as a,x as b,i as c,y as d,m as e,O as f,v as g};
|
|
2
|
+
//# sourceMappingURL=chunk-2GGMLKRP.min.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EquippedError,
|
|
3
3
|
Instance
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A4P7P6BU.mjs";
|
|
5
5
|
|
|
6
6
|
// src/orm/errors/validation.ts
|
|
7
7
|
var OrmValidationError = class extends EquippedError {
|
|
@@ -1277,4 +1277,4 @@ export {
|
|
|
1277
1277
|
opTouchedFields,
|
|
1278
1278
|
flattenOps
|
|
1279
1279
|
};
|
|
1280
|
-
//# sourceMappingURL=chunk-
|
|
1280
|
+
//# sourceMappingURL=chunk-3TP7NINX.mjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Cache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LKS5ZE45.mjs";
|
|
4
4
|
import {
|
|
5
5
|
EquippedError,
|
|
6
6
|
Instance,
|
|
7
7
|
configurable
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-A4P7P6BU.mjs";
|
|
9
9
|
|
|
10
10
|
// src/cache/adapters/redis/index.ts
|
|
11
11
|
import { Cluster, Redis } from "ioredis";
|
|
@@ -110,4 +110,4 @@ export {
|
|
|
110
110
|
redisConfigPipe,
|
|
111
111
|
RedisCache
|
|
112
112
|
};
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
113
|
+
//# sourceMappingURL=chunk-5PZACGPI.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from "./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from "./chunk-IN5YKIJ7.min.mjs";var t=class extends r{adapter;table;constructor(e){super(`Introspection failed for table '${e.table}' on adapter '${e.adapter}'`,{adapter:e.adapter,table:e.table},e.cause),this.adapter=e.adapter,this.table=e.table}};export{t as a};
|
|
2
|
+
//# sourceMappingURL=chunk-676VIABN.min.mjs.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
configurable,
|
|
5
5
|
parseJSONValue,
|
|
6
6
|
random_exports
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-A4P7P6BU.mjs";
|
|
8
8
|
import {
|
|
9
9
|
EventBus
|
|
10
10
|
} from "./chunk-VCCS7CAI.mjs";
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
kafkaConfigPipe,
|
|
100
100
|
KafkaEventBus
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-7CP7ZE2O.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from "./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p}from "./chunk-IRYCN6PI.min.mjs";import{K as n,a as c,m as r}from "./chunk-IN5YKIJ7.min.mjs";import{Cluster as d,Redis as u}from"ioredis";import{v as t}from"valleyed";var m=()=>t.meta(t.object({host:t.string(),port:t.optional(t.number()),password:t.optional(t.string()),username:t.optional(t.string()),tls:t.optional(t.boolean()),cluster:t.optional(t.boolean())}),{title:"Redis Config",$refId:"RedisConfig"}),l=class a extends r(m,p){#e;constructor(e,s){super(e);let o={...e.host?{host:e.host}:{},...e.port?{port:e.port}:{}},i={...s,...e.password?{password:e.password}:{},...e.username?{username:e.username}:{},...e.tls?{tls:{}}:{},lazyConnect:!0};this.#e=e.cluster?new d([o],{...s,redisOptions:i,lazyConnect:!0}):new u({...i,...o}),this.#e.on("error",async h=>{n.crash(new c("Redis failed with error",{},h))}),s||n.on("start",async()=>this.#e.connect(),{class:a}),n.on("close",async()=>this.#e.quit(),{class:a})}get connectionOptions(){return this.#e.options}async delete(e){await this.#e.del(this.getScopedKey(e))}async get(e){return await this.#e.get(this.getScopedKey(e))}async set(e,s,o){o?await this.#e.setex(this.getScopedKey(e),o,s):this.#e.set(this.getScopedKey(e),s)}};export{m as a,l as b};
|
|
2
|
+
//# sourceMappingURL=chunk-7NF7PV6S.min.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{K as x,a as m}from "./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{K as x,a as m}from "./chunk-IN5YKIJ7.min.mjs";var f=class extends m{constructor(t,r,c,l){super(`ORM validation error (${t}) on ${r}.${c}`,{kind:t,schema:r,operation:c,failures:l});this.kind=t;this.schema=r;this.operation=c;this.failures=l}};import"valleyed";var O=class{name;path;constructor(e,t){this.name=e,this.path=t??[e]}};function p(a){return a instanceof O?a.path.join("."):a}var T=class extends O{pipe;onCreate;onUpdate;constructor(e,t,r){super(e),this.pipe=t,this.onCreate=r?.onCreate,this.onUpdate=r?.onUpdate}},P=class{constructor(e,t,r,c){this.name=e;this.pipe=t;this.deps=r;this.compute=c}};var i=class{constructor(e,t,r){this.op=t;this.value=r;this.field=p(e)}field},g=class a{constructor(e="and",t){this.op=e;this.children=t??[]}children;#e(e){return new a(this.op,[...this.children,e])}eq(e,t){return this.#e(new i(e,"eq",t))}ne(e,t){return this.#e(new i(e,"ne",t))}gt(e,t){return this.#e(new i(e,"gt",t))}gte(e,t){return this.#e(new i(e,"gte",t))}lt(e,t){return this.#e(new i(e,"lt",t))}lte(e,t){return this.#e(new i(e,"lte",t))}in(e,t){return this.#e(new i(e,"in",t))}notIn(e,t){return this.#e(new i(e,"notIn",t))}like(e,t){return this.#e(new i(e,"like",t))}exists(e){return this.#e(new i(e,"exists",!0))}notExists(e){return this.#e(new i(e,"notExists",!0))}contains(e,t){return this.#e(new i(e,"contains",t))}notContains(e,t){return this.#e(new i(e,"notContains",t))}and(e){if(e.length===0)throw new m("and() requires at least one filter factory",{op:"and"});let t=new a("and",e.map(r=>r(a.create())));return this.#e(t)}or(e){if(e.length===0)throw new m("or() requires at least one filter factory",{op:"or"});let t=new a("or",e.map(r=>r(a.create())));return this.#e(t)}clone(){return new a(this.op,this.children.map(e=>e instanceof i?new i(e.field,e.op,structuredClone(e.value)):e.clone()))}static create(){return new a}};function V(a,e,t){let r=[];t.aggregates.length===0&&r.push({cause:"At least one aggregator step is required"});let c=new Set;for(let s of t.aggregates)c.has(s.alias)&&r.push({alias:s.alias,cause:`Duplicate alias "${s.alias}"`}),c.add(s.alias),e.aggregateOps.includes(s.fn)||r.push({alias:s.alias,cause:`Undeclared aggregate op "${s.fn}"`});let l=a.fields,n=new Set(Object.keys(l));for(let s of t.groupBy)n.has(s)||r.push({field:s,cause:`Unknown groupBy field "${s}" on schema "${a.name}"`}),c.has(s)&&r.push({alias:s,cause:`Alias "${s}" collides with groupBy field name`});if(r.length>0)throw new f("aggregate",a.name,"aggregate",r);if(t.where&&E(a,t.where),t.having){let h=function(d){if(d instanceof i)s.has(d.field)||u.push({field:d.field,cause:`Unknown having field "${d.field}" \u2014 must be an aggregator alias or groupBy field`});else if(d instanceof g)for(let U of d.children)h(U)};var o=h;let s=new Set([...c,...t.groupBy]),u=[];for(let d of t.having.children)h(d);if(u.length>0)throw new f("aggregate",a.name,"aggregate",u)}}function E(a,e){let t=a.fields,r=new Set(Object.keys(t)),c=[];function l(n){if(n instanceof i)r.has(n.field)||c.push({field:n.field,cause:`Unknown field "${n.field}" on schema "${a.name}"`});else if(n instanceof g)for(let o of n.children)l(o)}for(let n of e.children)l(n);if(c.length>0)throw new f("validation",a.name,"filter",c.map(n=>({field:n.field,cause:n.cause})))}var q=class{queryableOps=[];updateOps=[];aggregateOps=[];supportedFieldTypes=[];onFatalError(e){let t=e instanceof m?e:new m("OrmAdapter fatal error",{},e);x.crash(t)}constructor(){let e=this;typeof e.connect=="function"&&x.on("start",()=>e.connect(),{class:this.constructor}),typeof e.disconnect=="function"&&x.on("close",()=>e.disconnect(),{class:this.constructor})}use(e,t){let r=this,c=async function*(){},l={findMany:(n,o)=>r.findMany?.(e,t,n,o)??Promise.resolve([]),iterateMany:(n,o)=>r.iterateMany?.(e,t,n,o)??c(),findOne:async n=>(await l.findMany(n,{limit:1}))[0]??null,count:n=>r.count?.(e,t,n)??Promise.reject(new Error("count not implemented")),createOne:async n=>(await l.createMany([n]))[0],createMany:n=>r.createMany?.(e,t,n)??Promise.resolve([]),updateMany:(n,o)=>r.updateMany?.(e,t,n,o)??Promise.resolve([]),updateOne:async(n,o)=>{let s=await l.findOne(n);if(!s)return null;let u=e.pkField.name,h=g.create().eq(u,s[u]);return(await l.updateMany(h,o))[0]??null},upsertOne:(n,o,s)=>r.upsertOne?.(e,t,n,o,s)??Promise.reject(new Error("upsertOne not implemented")),deleteOne:async n=>{let o=await l.findOne(n);if(!o)return null;let s=e.pkField.name;if(r.deleteByPk)await r.deleteByPk(e,t,o[s]);else if(r.deleteMany){let u=g.create().eq(s,o[s]);await r.deleteMany(e,t,u)}return o},deleteMany:n=>r.deleteMany?.(e,t,n)??Promise.resolve([]),raw:(...n)=>r.raw?.(e,t,...n)??Promise.reject(new Error("raw not implemented")),aggregate:n=>r.aggregate?.(e,t,n)??Promise.reject(new Error("aggregate not implemented")),aggregateOps:r.aggregateOps??[]};return l}};var y=class{constructor(e){this.values=e}kind="set"},w=class{constructor(e,t){this.field=e;this.value=t}kind="inc"},F=class{constructor(e,t){this.field=e;this.value=t}kind="mul"},S=class{constructor(e,t){this.field=e;this.value=t}kind="min"},v=class{constructor(e,t){this.field=e;this.value=t}kind="max"},k=class{constructor(e){this.field=e}kind="unset"},A=class{constructor(e,t){this.field=e;this.value=t}kind="push"},b=class{constructor(e,t){this.field=e;this.value=t}kind="pull"},B=class{constructor(e,t){this.field=e;this.value=t}kind="patch"};function Q(a){return a instanceof y||a instanceof w||a instanceof F||a instanceof S||a instanceof v||a instanceof k||a instanceof A||a instanceof b||a instanceof B}function z(a){return new y(a)}function J(a,e){return new w(p(a),e)}function X(a,e){return new F(p(a),e)}function Y(a,e){return new S(p(a),e)}function Z(a,e){return new v(p(a),e)}function ee(a){return new k(p(a))}function te(a,e){return new A(p(a),e)}function ae(a,e){return new b(p(a),e)}function ne(a,e){return new B(p(a),e)}function re(a){return a instanceof y?Object.keys(a.values):[a.field]}function se(a){let e={};for(let t of a)t instanceof y?Object.assign(e,t.values):e[t.field]=t;return e}export{f as a,O as b,p as c,T as d,P as e,i as f,g,V as h,E as i,q as j,y as k,w as l,F as m,S as n,v as o,k as p,A as q,b as r,B as s,Q as t,z as u,J as v,X as w,Y as x,Z as y,ee as z,te as A,ae as B,ne as C,re as D,se as E};
|
|
2
|
+
//# sourceMappingURL=chunk-7SQ5JQYR.min.mjs.map
|
|
@@ -46,6 +46,7 @@ var RequestError = class extends EquippedError {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
// src/server/adapters/base.ts
|
|
49
|
+
import "http";
|
|
49
50
|
import "@fastify/cors";
|
|
50
51
|
import "cors";
|
|
51
52
|
import { Server as SocketServer } from "socket.io";
|
|
@@ -935,6 +936,22 @@ var serverConfigPipe = () => v3.object({
|
|
|
935
936
|
),
|
|
936
937
|
socketsAuthMethods: v3.defaults(v3.array(v3.instanceOf(BaseRequestAuthMethod)), [])
|
|
937
938
|
});
|
|
939
|
+
var rawResponseHandledSymbol = /* @__PURE__ */ Symbol("rawResponseHandled");
|
|
940
|
+
var rawResponseHandled = Object.freeze({ [rawResponseHandledSymbol]: true });
|
|
941
|
+
var rawResponseNotStartedMessage = "Raw not-found handler did not start or complete a response";
|
|
942
|
+
function isRawResponseHandled(input) {
|
|
943
|
+
return Boolean(input && typeof input === "object" && rawResponseHandledSymbol in input);
|
|
944
|
+
}
|
|
945
|
+
function hasRawResponseStarted(response) {
|
|
946
|
+
return response.headersSent || response.writableEnded;
|
|
947
|
+
}
|
|
948
|
+
function writeRawHandlerError(response, error) {
|
|
949
|
+
if (hasRawResponseStarted(response)) return;
|
|
950
|
+
response.statusCode = StatusCodes.BadRequest;
|
|
951
|
+
response.setHeader("Content-Type", "application/json");
|
|
952
|
+
const message = error instanceof Error ? error.message : `${error}`;
|
|
953
|
+
response.end(JSON.stringify([{ message }]));
|
|
954
|
+
}
|
|
938
955
|
var errorsSchemas = Object.entries(StatusCodes).filter(([, value]) => value > 399).map(([key, value]) => ({
|
|
939
956
|
status: value,
|
|
940
957
|
contentType: "application/json",
|
|
@@ -951,6 +968,9 @@ var Server = class {
|
|
|
951
968
|
#serverConfig;
|
|
952
969
|
#queue = [];
|
|
953
970
|
#routesByKey = /* @__PURE__ */ new Set();
|
|
971
|
+
#started = false;
|
|
972
|
+
#beforeListenHandlers = [];
|
|
973
|
+
#notFoundHandler = null;
|
|
954
974
|
setup(httpServer, config) {
|
|
955
975
|
this.#httpServer = httpServer;
|
|
956
976
|
this.#serverConfig = config;
|
|
@@ -1000,10 +1020,21 @@ var Server = class {
|
|
|
1000
1020
|
});
|
|
1001
1021
|
});
|
|
1002
1022
|
}
|
|
1023
|
+
setNotFoundHandler(handler) {
|
|
1024
|
+
if (this.#started) throw new EquippedError("Cannot set not-found handler after server has started", {});
|
|
1025
|
+
this.#notFoundHandler = handler;
|
|
1026
|
+
return this;
|
|
1027
|
+
}
|
|
1028
|
+
onBeforeListen(handler) {
|
|
1029
|
+
if (this.#started) throw new EquippedError("Cannot add before-listen handler after server has started", {});
|
|
1030
|
+
this.#beforeListenHandlers.push(handler);
|
|
1031
|
+
return this;
|
|
1032
|
+
}
|
|
1003
1033
|
test() {
|
|
1004
1034
|
return supertest(this.#httpServer);
|
|
1005
1035
|
}
|
|
1006
1036
|
async start() {
|
|
1037
|
+
this.#started = true;
|
|
1007
1038
|
const config = this.#serverConfig;
|
|
1008
1039
|
const instance = Instance.get();
|
|
1009
1040
|
const { app } = instance.settings;
|
|
@@ -1017,10 +1048,7 @@ var Server = class {
|
|
|
1017
1048
|
})
|
|
1018
1049
|
});
|
|
1019
1050
|
await Promise.all(this.#queue.map((cb) => cb()));
|
|
1020
|
-
this.registerNotFoundHandler(async (req) =>
|
|
1021
|
-
const request = await this.parseRequest(req);
|
|
1022
|
-
throw new NotFoundError(`Route ${request.path} not found`);
|
|
1023
|
-
});
|
|
1051
|
+
this.registerNotFoundHandler(async (req, res) => await this.#handleNotFound(req, res));
|
|
1024
1052
|
this.registerErrorHandler(async (error, _, res) => {
|
|
1025
1053
|
if (!(error instanceof EquippedError)) Instance.get().log.error({ error }, "Uncaught error in route handler");
|
|
1026
1054
|
const response = error instanceof RequestError ? new Response({
|
|
@@ -1035,10 +1063,36 @@ var Server = class {
|
|
|
1035
1063
|
});
|
|
1036
1064
|
return await this.handleResponse(res, response);
|
|
1037
1065
|
});
|
|
1066
|
+
for (const handler of this.#beforeListenHandlers) await handler({ httpServer: this.#httpServer, port: config.port });
|
|
1038
1067
|
const started = await this.startServer(config.port);
|
|
1039
1068
|
if (started) Instance.get().log.info(`${instance.id}(${app.name}) service listening on port ${config.port}`);
|
|
1040
1069
|
return started;
|
|
1041
1070
|
}
|
|
1071
|
+
createNodeRawResponder(input) {
|
|
1072
|
+
return async (handler) => {
|
|
1073
|
+
input.beforeHandle?.();
|
|
1074
|
+
try {
|
|
1075
|
+
await handler(input.request, input.response);
|
|
1076
|
+
} catch (error) {
|
|
1077
|
+
if (!hasRawResponseStarted(input.response)) {
|
|
1078
|
+
writeRawHandlerError(input.response, error);
|
|
1079
|
+
return rawResponseHandled;
|
|
1080
|
+
}
|
|
1081
|
+
throw error;
|
|
1082
|
+
}
|
|
1083
|
+
if (!hasRawResponseStarted(input.response))
|
|
1084
|
+
writeRawHandlerError(input.response, new EquippedError(rawResponseNotStartedMessage, {}));
|
|
1085
|
+
return rawResponseHandled;
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
async #handleNotFound(req, res) {
|
|
1089
|
+
const request = await this.parseRequest(req);
|
|
1090
|
+
if (!this.#notFoundHandler) throw new NotFoundError(`Route ${request.path} not found`);
|
|
1091
|
+
const result = await this.#notFoundHandler({ request, respondWithRaw: this.createRawResponder(req, res) });
|
|
1092
|
+
if (isRawResponseHandled(result)) return;
|
|
1093
|
+
if (result instanceof Response) return await this.handleResponse(res, result);
|
|
1094
|
+
throw new EquippedError("Not-found handler must return a Response or respondWithRaw(...)", {});
|
|
1095
|
+
}
|
|
1042
1096
|
#resolveSchema(method, schema) {
|
|
1043
1097
|
const defaultStatusCode = schema?.defaultStatusCode ?? StatusCodes.Ok;
|
|
1044
1098
|
const defaultContentType = schema?.defaultContentType ?? "application/json";
|
|
@@ -1129,6 +1183,209 @@ var Server = class {
|
|
|
1129
1183
|
};
|
|
1130
1184
|
}
|
|
1131
1185
|
};
|
|
1186
|
+
if (void 0) {
|
|
1187
|
+
let ensureTestInstance = function() {
|
|
1188
|
+
const instance = Instance.maybeGet() ?? Instance.create({ app: { name: "equipped-test" }, log: { level: "silent" } });
|
|
1189
|
+
if (!testInstanceState.__equippedTestInstanceAliased) {
|
|
1190
|
+
instance.alias("equipped-test");
|
|
1191
|
+
testInstanceState.__equippedTestInstanceAliased = true;
|
|
1192
|
+
}
|
|
1193
|
+
}, createRawResponse = function() {
|
|
1194
|
+
const chunks = [];
|
|
1195
|
+
return {
|
|
1196
|
+
statusCode: 200,
|
|
1197
|
+
headersSent: false,
|
|
1198
|
+
writableEnded: false,
|
|
1199
|
+
headers: {},
|
|
1200
|
+
setHeader(key, value) {
|
|
1201
|
+
this.headers[key] = value;
|
|
1202
|
+
},
|
|
1203
|
+
end(chunk) {
|
|
1204
|
+
if (chunk !== void 0) chunks.push(Buffer.isBuffer(chunk) ? chunk.toString("utf8") : String(chunk));
|
|
1205
|
+
this.headersSent = true;
|
|
1206
|
+
this.writableEnded = true;
|
|
1207
|
+
},
|
|
1208
|
+
body() {
|
|
1209
|
+
return chunks.join("");
|
|
1210
|
+
}
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
ensureTestInstance2 = ensureTestInstance, createRawResponse2 = createRawResponse;
|
|
1214
|
+
const { describe, expect, test } = void 0;
|
|
1215
|
+
const testInstanceState = globalThis;
|
|
1216
|
+
class TestServer extends Server {
|
|
1217
|
+
handledResponse = null;
|
|
1218
|
+
startedPorts = [];
|
|
1219
|
+
notFoundHandler = null;
|
|
1220
|
+
constructor() {
|
|
1221
|
+
super();
|
|
1222
|
+
this.setup(http.createServer(), {
|
|
1223
|
+
port: 0,
|
|
1224
|
+
cors: void 0,
|
|
1225
|
+
eventBus: void 0,
|
|
1226
|
+
publicPath: void 0,
|
|
1227
|
+
healthPath: void 0,
|
|
1228
|
+
openapi: { docsVersion: "1.0.0", docsBaseUrl: ["/"], docsPath: "/__docs" },
|
|
1229
|
+
requests: {
|
|
1230
|
+
log: false,
|
|
1231
|
+
rateLimit: { enabled: false, periodInMs: 1, limit: 1 },
|
|
1232
|
+
slowdown: { enabled: false, periodInMs: 1, delayAfter: 1, delayInMs: 1 }
|
|
1233
|
+
},
|
|
1234
|
+
socketsAuthMethods: []
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
async parseRequest(req) {
|
|
1238
|
+
return new Request2({
|
|
1239
|
+
ip: "127.0.0.1",
|
|
1240
|
+
body: {},
|
|
1241
|
+
cookies: {},
|
|
1242
|
+
params: {},
|
|
1243
|
+
query: {},
|
|
1244
|
+
method: Methods.get,
|
|
1245
|
+
path: req.path,
|
|
1246
|
+
headers: {},
|
|
1247
|
+
files: {}
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
async handleResponse(_, response) {
|
|
1251
|
+
this.handledResponse = response;
|
|
1252
|
+
}
|
|
1253
|
+
createRawResponder(req, res) {
|
|
1254
|
+
return this.createNodeRawResponder({ request: req.rawRequest, response: res.rawResponse });
|
|
1255
|
+
}
|
|
1256
|
+
registerRoute() {
|
|
1257
|
+
}
|
|
1258
|
+
registerErrorHandler() {
|
|
1259
|
+
}
|
|
1260
|
+
registerNotFoundHandler(cb) {
|
|
1261
|
+
this.notFoundHandler = cb;
|
|
1262
|
+
}
|
|
1263
|
+
async startServer(port) {
|
|
1264
|
+
this.startedPorts.push(port);
|
|
1265
|
+
return true;
|
|
1266
|
+
}
|
|
1267
|
+
async dispatchNotFound(path) {
|
|
1268
|
+
if (!this.notFoundHandler) throw new Error("not-found handler was not registered");
|
|
1269
|
+
this.handledResponse = null;
|
|
1270
|
+
const rawResponse = createRawResponse();
|
|
1271
|
+
await this.notFoundHandler({ path, rawRequest: {} }, { rawResponse });
|
|
1272
|
+
return { handledResponse: this.handledResponse, rawResponse };
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
describe("Server before-listen handlers", () => {
|
|
1276
|
+
test("runs before-listen handlers before adapter listen in registration order", async () => {
|
|
1277
|
+
ensureTestInstance();
|
|
1278
|
+
const server = new TestServer();
|
|
1279
|
+
const calls = [];
|
|
1280
|
+
let receivedServer = null;
|
|
1281
|
+
server.onBeforeListen(({ httpServer, port }) => {
|
|
1282
|
+
calls.push(`first:${port}`);
|
|
1283
|
+
receivedServer = httpServer;
|
|
1284
|
+
expect(server.startedPorts).toEqual([]);
|
|
1285
|
+
}).onBeforeListen(({ httpServer, port }) => {
|
|
1286
|
+
calls.push(`second:${port}`);
|
|
1287
|
+
expect(httpServer).toBe(receivedServer);
|
|
1288
|
+
expect(server.startedPorts).toEqual([]);
|
|
1289
|
+
});
|
|
1290
|
+
await server.start();
|
|
1291
|
+
expect(calls).toEqual(["first:0", "second:0"]);
|
|
1292
|
+
expect(receivedServer).toBeInstanceOf(http.Server);
|
|
1293
|
+
expect(server.startedPorts).toEqual([0]);
|
|
1294
|
+
});
|
|
1295
|
+
test("rejects startup when a before-listen handler fails before adapter listen", async () => {
|
|
1296
|
+
ensureTestInstance();
|
|
1297
|
+
const server = new TestServer();
|
|
1298
|
+
server.onBeforeListen(async () => {
|
|
1299
|
+
throw new Error("before-listen failed");
|
|
1300
|
+
});
|
|
1301
|
+
await expect(server.start()).rejects.toThrow("before-listen failed");
|
|
1302
|
+
expect(server.startedPorts).toEqual([]);
|
|
1303
|
+
});
|
|
1304
|
+
test("rejects adding before-listen handlers after server startup", async () => {
|
|
1305
|
+
ensureTestInstance();
|
|
1306
|
+
const server = new TestServer();
|
|
1307
|
+
await server.start();
|
|
1308
|
+
expect(() => server.onBeforeListen(() => {
|
|
1309
|
+
})).toThrow("Cannot add before-listen handler after server has started");
|
|
1310
|
+
});
|
|
1311
|
+
});
|
|
1312
|
+
describe("Server not-found handler", () => {
|
|
1313
|
+
test("throws the default Equipped not-found error when no custom handler is set", async () => {
|
|
1314
|
+
ensureTestInstance();
|
|
1315
|
+
const server = new TestServer();
|
|
1316
|
+
await server.start();
|
|
1317
|
+
await expect(server.dispatchNotFound("/missing")).rejects.toBeInstanceOf(NotFoundError);
|
|
1318
|
+
});
|
|
1319
|
+
test("allows a custom not-found handler to return an Equipped response", async () => {
|
|
1320
|
+
ensureTestInstance();
|
|
1321
|
+
const server = new TestServer();
|
|
1322
|
+
server.setNotFoundHandler(
|
|
1323
|
+
({ request }) => new Response({
|
|
1324
|
+
body: [{ message: `No route for ${request.path}` }],
|
|
1325
|
+
status: StatusCodes.NotFound,
|
|
1326
|
+
headers: {},
|
|
1327
|
+
cookies: {},
|
|
1328
|
+
contentType: "application/json"
|
|
1329
|
+
})
|
|
1330
|
+
);
|
|
1331
|
+
await server.start();
|
|
1332
|
+
const result = await server.dispatchNotFound("/custom");
|
|
1333
|
+
expect(result.handledResponse?.status).toBe(StatusCodes.NotFound);
|
|
1334
|
+
expect(result.handledResponse?.body).toEqual([{ message: "No route for /custom" }]);
|
|
1335
|
+
});
|
|
1336
|
+
test("allows a custom not-found handler to complete the response through a raw Node listener", async () => {
|
|
1337
|
+
ensureTestInstance();
|
|
1338
|
+
const server = new TestServer();
|
|
1339
|
+
server.setNotFoundHandler(
|
|
1340
|
+
({ respondWithRaw }) => respondWithRaw((_, response) => {
|
|
1341
|
+
response.statusCode = 203;
|
|
1342
|
+
response.end("raw fallback");
|
|
1343
|
+
})
|
|
1344
|
+
);
|
|
1345
|
+
await server.start();
|
|
1346
|
+
const result = await server.dispatchNotFound("/page");
|
|
1347
|
+
expect(result.handledResponse).toBeNull();
|
|
1348
|
+
expect(result.rawResponse.statusCode).toBe(203);
|
|
1349
|
+
expect(result.rawResponse.body()).toBe("raw fallback");
|
|
1350
|
+
});
|
|
1351
|
+
test("writes a clear raw error when a raw not-found handler does not start a response", async () => {
|
|
1352
|
+
ensureTestInstance();
|
|
1353
|
+
const server = new TestServer();
|
|
1354
|
+
server.setNotFoundHandler(({ respondWithRaw }) => respondWithRaw(() => {
|
|
1355
|
+
}));
|
|
1356
|
+
await server.start();
|
|
1357
|
+
const result = await server.dispatchNotFound("/page");
|
|
1358
|
+
expect(result.handledResponse).toBeNull();
|
|
1359
|
+
expect(result.rawResponse.statusCode).toBe(StatusCodes.BadRequest);
|
|
1360
|
+
expect(result.rawResponse.body()).toContain(rawResponseNotStartedMessage);
|
|
1361
|
+
});
|
|
1362
|
+
test("rejects a custom not-found handler result that is neither an Equipped response nor raw completion", async () => {
|
|
1363
|
+
ensureTestInstance();
|
|
1364
|
+
const server = new TestServer();
|
|
1365
|
+
server.setNotFoundHandler((() => void 0));
|
|
1366
|
+
await server.start();
|
|
1367
|
+
await expect(server.dispatchNotFound("/bad")).rejects.toThrow("Not-found handler must return a Response or respondWithRaw(...)");
|
|
1368
|
+
});
|
|
1369
|
+
test("rejects setting the custom not-found handler after server startup", async () => {
|
|
1370
|
+
ensureTestInstance();
|
|
1371
|
+
const server = new TestServer();
|
|
1372
|
+
await server.start();
|
|
1373
|
+
expect(
|
|
1374
|
+
() => server.setNotFoundHandler(
|
|
1375
|
+
() => new Response({
|
|
1376
|
+
body: null,
|
|
1377
|
+
status: StatusCodes.NotFound,
|
|
1378
|
+
headers: {},
|
|
1379
|
+
cookies: {},
|
|
1380
|
+
contentType: "application/json"
|
|
1381
|
+
})
|
|
1382
|
+
)
|
|
1383
|
+
).toThrow("Cannot set not-found handler after server has started");
|
|
1384
|
+
});
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
var ensureTestInstance2;
|
|
1388
|
+
var createRawResponse2;
|
|
1132
1389
|
|
|
1133
1390
|
// src/server/middlewares/requireAuthUser.ts
|
|
1134
1391
|
var requireAuthUser = (methods) => makeMiddleware(
|
|
@@ -1821,4 +2078,4 @@ export {
|
|
|
1821
2078
|
ValidationError,
|
|
1822
2079
|
Instance
|
|
1823
2080
|
};
|
|
1824
|
-
//# sourceMappingURL=chunk-
|
|
2081
|
+
//# sourceMappingURL=chunk-A4P7P6BU.mjs.map
|