@geekmidas/constructs 10.0.0-alpha.34 → 10.0.0-alpha.35

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.
Files changed (41) hide show
  1. package/dist/{Endpoint-BojvdQoh.d.mts → Endpoint-aG6oyuhR.d.mts} +2 -2
  2. package/dist/{Endpoint-BojvdQoh.d.mts.map → Endpoint-aG6oyuhR.d.mts.map} +1 -1
  3. package/dist/{Endpoint-xNGuv2Fq.d.cts → Endpoint-wV6FcBV0.d.cts} +2 -2
  4. package/dist/{Endpoint-xNGuv2Fq.d.cts.map → Endpoint-wV6FcBV0.d.cts.map} +1 -1
  5. package/dist/{EndpointFactory-DyT1yOJL.d.cts → EndpointFactory-CitKd3JQ.d.cts} +2 -2
  6. package/dist/{EndpointFactory-CaYTrUOO.d.mts.map → EndpointFactory-CitKd3JQ.d.cts.map} +1 -1
  7. package/dist/{EndpointFactory-CaYTrUOO.d.mts → EndpointFactory-DdMqIfSy.d.mts} +2 -2
  8. package/dist/{EndpointFactory-DyT1yOJL.d.cts.map → EndpointFactory-DdMqIfSy.d.mts.map} +1 -1
  9. package/dist/adaptors/aws.d.cts +1 -1
  10. package/dist/adaptors/aws.d.mts +1 -1
  11. package/dist/adaptors/hono.d.cts +1 -1
  12. package/dist/adaptors/hono.d.mts +1 -1
  13. package/dist/adaptors/testing.d.cts +1 -1
  14. package/dist/adaptors/testing.d.mts +1 -1
  15. package/dist/{auth-CJ5dp7T7.d.mts → auth-BVkkvI6F.d.mts} +10 -2
  16. package/dist/{auth-Bmo1wSQF.d.cts.map → auth-BVkkvI6F.d.mts.map} +1 -1
  17. package/dist/{auth-Bmo1wSQF.d.cts → auth-DYfF6Vfp.d.cts} +10 -2
  18. package/dist/{auth-CJ5dp7T7.d.mts.map → auth-DYfF6Vfp.d.cts.map} +1 -1
  19. package/dist/auth.cjs +66 -3
  20. package/dist/auth.cjs.map +1 -1
  21. package/dist/auth.d.cts +2 -2
  22. package/dist/auth.d.mts +2 -2
  23. package/dist/auth.mjs +66 -5
  24. package/dist/auth.mjs.map +1 -1
  25. package/dist/endpoints/index.d.cts +2 -2
  26. package/dist/endpoints/index.d.mts +2 -2
  27. package/dist/mobile-app.cjs +71 -0
  28. package/dist/mobile-app.cjs.map +1 -0
  29. package/dist/mobile-app.d.cts +61 -0
  30. package/dist/mobile-app.d.cts.map +1 -0
  31. package/dist/mobile-app.d.mts +61 -0
  32. package/dist/mobile-app.d.mts.map +1 -0
  33. package/dist/mobile-app.mjs +70 -0
  34. package/dist/mobile-app.mjs.map +1 -0
  35. package/dist/rest-api.d.cts +2 -2
  36. package/dist/rest-api.d.mts +2 -2
  37. package/dist/site.cjs +3 -3
  38. package/dist/site.cjs.map +1 -1
  39. package/dist/site.mjs +3 -3
  40. package/dist/site.mjs.map +1 -1
  41. package/package.json +46 -31
@@ -2,7 +2,7 @@ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
2
  import { a as FunctionHandler, r as Function } from "./index-yb3fXNyH.mjs";
3
3
  import { t as Authenticator } from "./construct-interface-D2gesxos.mjs";
4
4
  import { n as LowerHttpMethod, t as HttpMethod } from "./types-DMuSQeLL.mjs";
5
- import { n as AuthSession } from "./auth-CJ5dp7T7.mjs";
5
+ import { n as AuthSession } from "./auth-BVkkvI6F.mjs";
6
6
  import { ComponentCollector, OpenApiSchemaOptions } from "@geekmidas/schema/openapi";
7
7
  import { EnvironmentParser } from "@geekmidas/envkit";
8
8
  import { EventPublisher, ExtractPublisherMessage, MappedEvent } from "@geekmidas/events";
@@ -872,4 +872,4 @@ declare enum SuccessStatus {
872
872
  type EndpointOutput<T> = T extends Endpoint<any, any, any, infer OutSchema, any, any, any, any> ? InferStandardSchema<OutSchema> : never;
873
873
  //#endregion
874
874
  export { getSecurityScheme as A, Authorizer as C, OAuthFlows as D, OAuthFlow as E, SecurityScheme as O, MappedAudit as S, BuiltInSecuritySchemeId as T, RlsBypass as _, EndpointContext as a, RlsContextExtractor as b, EndpointSchemas as c, ResponseBuilder as d, SessionFn as f, RLS_BYPASS as g, SessionAuth as h, Endpoint as i, isBuiltInSecurityScheme as j, createAuthorizer as k, EndpointSurface as l, NoAuthenticator as m, ConvertRouteParams as n, EndpointHandler as o, SuccessStatus as p, CookieFn as r, EndpointOutput as s, AuthorizeFn as t, HeaderFn as u, RlsConfig as v, BUILT_IN_SECURITY_SCHEMES as w, ActorExtractor as x, RlsContext as y };
875
- //# sourceMappingURL=Endpoint-BojvdQoh.d.mts.map
875
+ //# sourceMappingURL=Endpoint-aG6oyuhR.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Endpoint-BojvdQoh.d.mts","names":[],"sources":["../src/endpoints/Authorizer.ts","../src/endpoints/audit.ts","../src/endpoints/rls.ts","../src/endpoints/sessionAuth.ts","../src/endpoints/Endpoint.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAIiB;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,QAAQ;;EAER;;GAEC;;;;;UAMe;EAChB,WAAW;EACX,WAAW;EACX,oBAAoB;EACpB,oBAAoB;;UAGJ;EAChB;EACA;EACA;EACA,QAAQ;;;;;;cAOI;;aAEX;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;;;;KAKU,uCAAuC;;;;UAKlC;;;;EAIhB;;;;EAIA,iBAAiB;;;;;EAKjB;;;;;EAKA;;;;;EAKA,WAAW;;;;;iBAMI,iBACf,cACA,UAAU,KAAK,sBACb;;;;iBAUa,wBACf,eACE,QAAQ;;;;iBAOK,kBACf,cACA,gBAAgB,eAAe,kBAC7B;;;;;;;;;;UC3Hc,YAChB,qBAAqB,kCACrB,gBAAgB,8BAChB,cAAc,iBAAiB,gBAAgB,iBAAiB;;EAGhE,MAAM;;EAEN,UACC,UAAU,gBAAgB,mBACvB,oBAAoB,uBAEnB,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AAS,QACzB,oBACA,qBAAqB,mCAAmC,kCAIxD,uBACA,6BACG,oBAAoB,WAAW,SAAS,YAC3C,8BAA8B,SAC9B,eAAe,cAAc,iBAC7B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BL,gBACX,eAAe,yCACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,uBACA,2BACA,qBAAqB,mCAAmC,qCAKxD,KAAK,gBACJ,QACA,WACA,SACA,UACA,cACA,WACA,gBAED,UAAU,oBACN,kBAAkB,mBAMlB,yBAAyB,aACzB,qBAAqB,yBAAyB,cAC9C,QAAQ,yBAAyB,cACjC,QAAQ,qBAAqB,yBAAyB,yBAGtD,gCACA,mBACA,QAAQ;;;;aAKD;;EAEX;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;KAGW,eAAe,KAC1B,UAAU,8BAA8B,iCACrC,oBAAoB"}
1
+ {"version":3,"file":"Endpoint-aG6oyuhR.d.mts","names":[],"sources":["../src/endpoints/Authorizer.ts","../src/endpoints/audit.ts","../src/endpoints/rls.ts","../src/endpoints/sessionAuth.ts","../src/endpoints/Endpoint.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAIiB;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,QAAQ;;EAER;;GAEC;;;;;UAMe;EAChB,WAAW;EACX,WAAW;EACX,oBAAoB;EACpB,oBAAoB;;UAGJ;EAChB;EACA;EACA;EACA,QAAQ;;;;;;cAOI;;aAEX;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;;;;KAKU,uCAAuC;;;;UAKlC;;;;EAIhB;;;;EAIA,iBAAiB;;;;;EAKjB;;;;;EAKA;;;;;EAKA,WAAW;;;;;iBAMI,iBACf,cACA,UAAU,KAAK,sBACb;;;;iBAUa,wBACf,eACE,QA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AQ;;EAER,SAAS;;;;;KAML,eACJ,qBAAqB,mCAAmC,kCAIxD,6BACG;;;;;;;EASD,SAAS,QAAQ;;;;;KAMf,gBAAgB,yBAAyB;;;;;;;EAS3C,IAAI;;;;;;;;;;;;;;KAeK,gBACX,cAAc,yCACd,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,oBACA,qBAAqB,mCAAmC,kCAIxD,uBACA,6BACG,oBAAoB,WAAW,SAAS,YAC3C,8BAA8B,SAC9B,eAAe,cAAc,iBAC7B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BL,gBACX,eAAe,yCACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,uBACA,2BACA,qBAAqB,mCAAmC,qCAKxD,KAAK,gBACJ,QACA,WACA,SACA,UACA,cACA,WACA,gBAED,UAAU,oBACN,kBAAkB,mBAMlB,yBAAyB,aACzB,qBAAqB,yBAAyB,cAC9C,QAAQ,yBAAyB,cACjC,QAAQ,qBAAqB,yBAAyB,yBAGtD,gCACA,mBACA,QAAQ;;;;aAKD;;EAEX;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;KAGW,eAAe,KAC1B,UAAU,8BAA8B,iCACrC,oBAAoB"}
@@ -2,7 +2,7 @@ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
2
  import { a as FunctionHandler, r as Function } from "./index-BI23K3wy.cjs";
3
3
  import { t as Authenticator } from "./construct-interface-DPusCUSQ.cjs";
4
4
  import { n as LowerHttpMethod, t as HttpMethod } from "./types-DMuSQeLL.cjs";
5
- import { n as AuthSession } from "./auth-Bmo1wSQF.cjs";
5
+ import { n as AuthSession } from "./auth-DYfF6Vfp.cjs";
6
6
  import { EnvironmentParser } from "@geekmidas/envkit";
7
7
  import { EventPublisher, ExtractPublisherMessage, MappedEvent } from "@geekmidas/events";
8
8
  import { Logger } from "@geekmidas/logger";
@@ -872,4 +872,4 @@ declare enum SuccessStatus {
872
872
  type EndpointOutput<T> = T extends Endpoint<any, any, any, infer OutSchema, any, any, any, any> ? InferStandardSchema<OutSchema> : never;
873
873
  //#endregion
874
874
  export { getSecurityScheme as A, Authorizer as C, OAuthFlows as D, OAuthFlow as E, SecurityScheme as O, MappedAudit as S, BuiltInSecuritySchemeId as T, RlsBypass as _, EndpointContext as a, RlsContextExtractor as b, EndpointSchemas as c, ResponseBuilder as d, SessionFn as f, RLS_BYPASS as g, SessionAuth as h, Endpoint as i, isBuiltInSecurityScheme as j, createAuthorizer as k, EndpointSurface as l, NoAuthenticator as m, ConvertRouteParams as n, EndpointHandler as o, SuccessStatus as p, CookieFn as r, EndpointOutput as s, AuthorizeFn as t, HeaderFn as u, RlsConfig as v, BUILT_IN_SECURITY_SCHEMES as w, ActorExtractor as x, RlsContext as y };
875
- //# sourceMappingURL=Endpoint-xNGuv2Fq.d.cts.map
875
+ //# sourceMappingURL=Endpoint-wV6FcBV0.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Endpoint-xNGuv2Fq.d.cts","names":[],"sources":["../src/endpoints/Authorizer.ts","../src/endpoints/audit.ts","../src/endpoints/rls.ts","../src/endpoints/sessionAuth.ts","../src/endpoints/Endpoint.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAIiB;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,QAAQ;;EAER;;GAEC;;;;;UAMe;EAChB,WAAW;EACX,WAAW;EACX,oBAAoB;EACpB,oBAAoB;;UAGJ;EAChB;EACA;EACA;EACA,QAAQ;;;;;;cAOI;;aAEX;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;;;;KAKU,uCAAuC;;;;UAKlC;;;;EAIhB;;;;EAIA,iBAAiB;;;;;EAKjB;;;;;EAKA;;;;;EAKA,WAAW;;;;;iBAMI,iBACf,cACA,UAAU,KAAK,sBACb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Q;;EAER,QAAQ;;EAER,QAAQ;;EAER,SAAS;;;;;KAML,eACJ,qBAAqB,mCAAmC,kCAIxD,6BACG;;;;;;;EASD,SAAS,QAAQ;;;;;KAMf,gBAAgB,yBAAyB;;;;;;;EAS3C,IAAI;;;;;;;;;;;;;;KAeK,gBACX,cAAc,yCACd,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,oBACA,qBAAqB,mCAAmC,kCAIxD,uBACA,6BACG,oBAAoB,WAAW,SAAS,YAC3C,8BAA8B,SAC9B,eAAe,cAAc,iBAC7B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BL,gBACX,eAAe,yCACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,uBACA,2BACA,qBAAqB,mCAAmC,qCAKxD,KAAK,gBACJ,QACA,WACA,SACA,UACA,cACA,WACA,gBAED,UAAU,oBACN,kBAAkB,mBAMlB,yBAAyB,aACzB,qBAAqB,yBAAyB,cAC9C,QAAQ,yBAAyB,cACjC,QAAQ,qBAAqB,yBAAyB,yBAGtD,gCACA,mBACA,QAAQ;;;;aAKD;;EAEX;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;KAGW,eAAe,KAC1B,UAAU,8BAA8B,iCACrC,oBAAoB"}
1
+ {"version":3,"file":"Endpoint-wV6FcBV0.d.cts","names":[],"sources":["../src/endpoints/Authorizer.ts","../src/endpoints/audit.ts","../src/endpoints/rls.ts","../src/endpoints/sessionAuth.ts","../src/endpoints/Endpoint.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UAIiB;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,QAAQ;;EAER;;GAEC;;;;;UAMe;EAChB,WAAW;EACX,WAAW;EACX,oBAAoB;EACpB,oBAAoB;;UAGJ;EAChB;EACA;EACA;EACA,QAAQ;;;;;;cAOI;;aAEX;aACA;aACA;aACA;;;aAGA;aACA;aACA;;;aAGA;aACA;aACA;aACA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,cAAc,eAAe,UAAU;EAK9C,aACC,cACA,UAAU,KAAK;EAShB,OAAO,MAAM;EAKb,KAAK,GAAG,MAAM,IAAI,qBAAqB;EAIvC,eAAe;;;;;KAQX,oBACJ,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB;;EAGA,UAAU,cAAc;;EAExB,QAAQ;;EAER,QAAQ;;EAER,QAAQ;;EAER,SAAS;;;;;KAML,eACJ,qBAAqB,mCAAmC,kCAIxD,6BACG;;;;;;;EASD,SAAS,QAAQ;;;;;KAMf,gBAAgB,yBAAyB;;;;;;;EAS3C,IAAI;;;;;;;;;;;;;;KAeK,gBACX,cAAc,yCACd,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,oBACA,qBAAqB,mCAAmC,kCAIxD,uBACA,6BACG,oBAAoB,WAAW,SAAS,YAC3C,8BAA8B,SAC9B,eAAe,cAAc,iBAC7B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BL,gBACX,eAAe,yCACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,uBACA,2BACA,qBAAqB,mCAAmC,qCAKxD,KAAK,gBACJ,QACA,WACA,SACA,UACA,cACA,WACA,gBAED,UAAU,oBACN,kBAAkB,mBAMlB,yBAAyB,aACzB,qBAAqB,yBAAyB,cAC9C,QAAQ,yBAAyB,cACjC,QAAQ,qBAAqB,yBAAyB,yBAGtD,gCACA,mBACA,QAAQ;;;;aAKD;;EAEX;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;KAGW,eAAe,KAC1B,UAAU,8BAA8B,iCACrC,oBAAoB"}
@@ -2,7 +2,7 @@ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.cjs";
2
2
  import { n as BaseFunctionBuilder } from "./index-BI23K3wy.cjs";
3
3
  import { c as ServicesOf, r as Consumable } from "./construct-interface-DPusCUSQ.cjs";
4
4
  import { t as HttpMethod } from "./types-DMuSQeLL.cjs";
5
- import { C as Authorizer, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, c as EndpointSchemas, f as SessionFn, i as Endpoint, l as EndpointSurface, o as EndpointHandler, p as SuccessStatus, t as AuthorizeFn, v as RlsConfig, x as ActorExtractor } from "./Endpoint-xNGuv2Fq.cjs";
5
+ import { C as Authorizer, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, c as EndpointSchemas, f as SessionFn, i as Endpoint, l as EndpointSurface, o as EndpointHandler, p as SuccessStatus, t as AuthorizeFn, v as RlsConfig, x as ActorExtractor } from "./Endpoint-wV6FcBV0.cjs";
6
6
  import { EventPublisher, MappedEvent } from "@geekmidas/events";
7
7
  import { Logger } from "@geekmidas/logger";
8
8
  import { Service } from "@geekmidas/services";
@@ -336,4 +336,4 @@ interface EndpointFactoryOptions<TServices extends Service[] = [], TBasePath ext
336
336
  }
337
337
  //#endregion
338
338
  export { EndpointBuilder as n, EndpointFactory as t };
339
- //# sourceMappingURL=EndpointFactory-DyT1yOJL.d.cts.map
339
+ //# sourceMappingURL=EndpointFactory-CitKd3JQ.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EndpointFactory-CaYTrUOO.d.mts","names":[],"sources":["../src/endpoints/EndpointBuilder.ts","../src/endpoints/EndpointFactory.ts"],"mappings":";;;;;;;;;;;cAwCa,gBACZ,uBACA,gBAAgB,YAChB,eAAe,sBACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,qBAAqB,mCAAmC,kCAIxD,uBACA,sDACS,oBACT,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA;WA6BU,OAAO;WACP,QAAQ;YA5BR,SAAS;YACT;YACA,UAAU;YACV;YACA;YACA;EACV,aAAa,UAAU,WAAW,SAAS,UAAU;EAErD,YAAY,YAAY,WAAW,SAAS,UAAU,QAAQ;EAE9D,aAAa;E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WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;EAkCD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,SACA,YACI,cAAc,WAAW,KAC7B,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAoCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,SACA,YACI,cAAc,IAClB,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,GACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAuBD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,SACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;EA4BQ,QAAQ,UAAU,mBAAmB,sBAC7C,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA;;;;;EA8BD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;;;;;;;EAsBD,MAAM,QAAQ,YAAY,cAAc;;;;;;;;;;;;;;;;EAmB/B,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA;;;;;;;;;;;;;;;;;;;;EA+CD,IACC,QAAQ,UAAU,WAAW,UAAU,mBAAmB;;;;;;;;;;;;;;EAyB3D;EAKA,MAAM;EAMN,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,UACA,WACA,eACA,gBAEC,SACF,QACA,SACA,QACA,WACA,WACA,SACA,UACA,iBACA,4BACA,eACA,0BACA,cACA,WACA;;;;cC3uBW,gBACZ,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,2CACtB,kDACA,qBAAqB,mCAGjB,0BAA0B,YAAY,iBAC1C,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;UAG1B;;;;;;;;;;;UAWA;UACA;UACA;UAOA;UAGA;UAMA;;;;;;;;UAQA;UACA;UACA;UACA;UAGA;UAGA;UACA;UACA;EAER,cACC,UACA,oBACA,eACA,yBAEA,iBACA,mBACA,uBACA,sBACA,uBACA,uBACA,wBACA,uBACA,uBACA,kBACA,WACE,uBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,WACA,sBACA,kBACA;SAwBM,UAAU,0BAA0B,kBAC1C,MAAM,GACN,WAAU,YACR,UAAU,WAAW;EAmCxB,kBAAkB,6BACjB,aAAa,IACX,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,GACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;EAwDD,gBAAgB,UAAU,eAAe,iBACxC,SAAS,IACP,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,mBAAmB,GACnB;;;;;;;;;;;EAiDD,WACC,MACG,gCACM,mBACN,gCAED,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAqDD,MAAM,sBACL,MAAM,QACJ,gBACF,WACA,UAAU,WAAW,QACrB,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,UACC,IAAI,YAAY,WAAW,SAAS,qBAAqB,aACvD,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;EAgDD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,oBACE,WAAW,OAAO,YACtB,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,WAAW,OAAO,YAAY,UAAU;EA+BvD,SAAS,UAAU,WAClB,UAAU,IACR,oBACE,MAAM,YACV,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,MAAM,YAAY,UAAU;EA8C3C,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,WACA,WACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,UAAU;EAoDhC,UACC,UAAU,qBACV,sCAEA,WAAW,QAAQ,cAAc,KAC/B,gBACF,WACA,WACA,SACA,UACA,GACA,cACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,QAAQ,GACP,SAAS,UAAU,WAAW,SAAS,GAAG,aACxC,gBACF,WACA,WACA,SACA,GACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,GAAG;;;;;EAmDzB,SAAS,GAAG,sBACX,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA,OACA,kBACA;;;;;;EAsDD,QAAQ,UAAU,mBAAmB,sBACpC,SAAS,QAAQ,OAAO,KACtB,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA,sBACA,kBACA;;;;;EA6CD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;;;EAsDD,IAAI,gBAAgB,UAAU,WAAW,UAAU,UAClD,QAAQ,U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,QAAA,YAAA,QAAA,UAAA,wBAAA,cAAA,aAAA,cAAA,aAAA,uBAAA,WAAA,oBAAA,UAAA,iBAAA,4BAAA,cAAA,eAAA,0BAAA,cAAA,WAAA;EAxBlC,QAAQ,sBAAsB,MAAM,QAAK,gBAAA,oBAAA,uBAAA,QAAA,mBAAA,YAAA,wBAAA,6BAAA,YAAA,UAAA,2BAuBT,UAAI,wBACN,YAAI,QAAA,YAAA,QAAA,UAAA,wBAAA,cAAA,aAAA,cAAA,aAAA,yBAAA,WAAA,oBAAA,UAAA,iBAAA,4BAAA,cAAA,eAAA,0BAAA,cAAA,WAAA;;KAnBvB,oBAAoB,oBAAoB,mBAAmB,UACpE,kBACC,IACA,OACD;KAES,UACX,0BACA,wBACG,oBACH,uBACG,QACA,mBACC,YACA,wBACC,6BACC,YACI,UACL,2BAA2B,UAC1B,wBAAwB,YACpB,QAAQ,YACR,QAAQ,UACZ,wBAAwB,YACpB,aAAa,YACb,aAAa;UAGP,uBAChB,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;EAGlC,kBAAkB;;EAElB;EACA,WAAW;EACX,qBAAqB,YACpB,WACA,SACA,qBAEA;EAED,gBAAgB;EAChB,0BAA0B,UAAU,WAAW,SAAS,UAAU;EAClE,wBAAwB,QAAQ,4BAA4B;EAC5D,gBAAgB,YAAY;EAC5B,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB,QAAQ,0BAA0B;EAC1D,yBAAyB,QAAQ,sBAAsB;EACvD,wBAAwB,eAAe,WAAW,UAAU;EAC5D,wBAAwB;EACxB,mBAAmB;;;;;;;;;;;EAWnB,SAAS"}
1
+ {"version":3,"file":"EndpointFactory-CitKd3JQ.d.cts","names":[],"sources":["../src/endpoints/EndpointBuilder.ts","../src/endpoints/EndpointF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A,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,MAAM,UAAU,kBACf,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAKD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAsB,QAAQ;KACnC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,UACC,IAAI,YAAY,WAAW,SAAS,UAAU,QAAQ;EAKvD,UAAU,QAAQ;EAIlB,WACC,MAAM,gCACJ,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;EAkCD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,SACA,YACI,cAAc,WAAW,KAC7B,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAoCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,SACA,YACI,cAAc,IAClB,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,GACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAuBD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,SACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;EA4BQ,QAAQ,UAAU,mBAAmB,sBAC7C,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA;;;;;EA8BD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;;;;;;;EAsBD,MAAM,QAAQ,YAAY,cAAc;;;;;;;;;;;;;;;;EAmB/B,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA;;;;;;;;;;;;;;;;;;;;EA+CD,IACC,QAAQ,UAAU,WAAW,UAAU,mBAAmB;;;;;;;;;;;;;;EAyB3D;EAKA,MAAM;EAMN,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,UACA,WACA,eACA,gBAEC,SACF,QACA,SACA,QACA,WACA,WACA,SACA,UACA,iBACA,4BACA,eACA,0BACA,cACA,WACA;;;;cC3uBW,gBACZ,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,2CACtB,kDACA,qBAAqB,mCAGjB,0BAA0B,YAAY,iBAC1C,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;UAG1B;;;;;;;;;;;UAWA;UACA;UACA;UAOA;UAGA;UAMA;;;;;;;;UAQA;UACA;UACA;UACA;UAGA;UAGA;UACA;UACA;EAER,cACC,UACA,oBACA,eACA,yBAEA,iBACA,mBACA,uBACA,sBACA,uBACA,uBACA,wBACA,uBACA,uBACA,kBACA,WACE,uBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,WACA,sBACA,kBACA;SAwBM,UAAU,0BAA0B,kBAC1C,MAAM,GACN,WAAU,YACR,UAAU,WAAW;EAmCxB,kBAAkB,6BACjB,aAAa,IACX,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,GACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;EAwDD,gBAAgB,UAAU,eAAe,iBACxC,SAAS,IACP,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,mBAAmB,GACnB;;;;;;;;;;;EAiDD,WACC,MACG,gCACM,mBACN,gCAED,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAqDD,MAAM,sBACL,MAAM,QACJ,gBACF,WACA,UAAU,WAAW,QACrB,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,UACC,IAAI,YAAY,WAAW,SAAS,qBAAqB,aACvD,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;EAgDD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,oBACE,WAAW,OAAO,YACtB,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,WAAW,OAAO,YAAY,UAAU;EA+BvD,SAAS,UAAU,WAClB,UAAU,IACR,oBACE,MAAM,YACV,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,MAAM,YAAY,UAAU;EA8C3C,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,WACA,WACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,UAAU;EAoDhC,UACC,UAAU,qBACV,sCAEA,WAAW,QAAQ,cAAc,KAC/B,gBACF,WACA,WACA,SACA,UACA,GACA,cACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,QAAQ,GACP,SAAS,UAAU,WAAW,SAAS,GAAG,aACxC,gBACF,WACA,WACA,SACA,GACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,GAAG;;;;;EAmDzB,SAAS,GAAG,sBACX,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAA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;EAElB;EACA,WAAW;EACX,qBAAqB,YACpB,WACA,SACA,qBAEA;EAED,gBAAgB;EAChB,0BAA0B,UAAU,WAAW,SAAS,UAAU;EAClE,wBAAwB,QAAQ,4BAA4B;EAC5D,gBAAgB,YAAY;EAC5B,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB,QAAQ,0BAA0B;EAC1D,yBAAyB,QAAQ,sBAAsB;EACvD,wBAAwB,eAAe,WAAW,UAAU;EAC5D,wBAAwB;EACxB,mBAAmB;;;;;;;;;;;EAWnB,SAAS"}
@@ -2,7 +2,7 @@ import { t as StandardSchemaV1 } from "./index-CeEtxDmK.mjs";
2
2
  import { n as BaseFunctionBuilder } from "./index-yb3fXNyH.mjs";
3
3
  import { c as ServicesOf, r as Consumable } from "./construct-interface-D2gesxos.mjs";
4
4
  import { t as HttpMethod } from "./types-DMuSQeLL.mjs";
5
- import { C as Authorizer, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, c as EndpointSchemas, f as SessionFn, i as Endpoint, l as EndpointSurface, o as EndpointHandler, p as SuccessStatus, t as AuthorizeFn, v as RlsConfig, x as ActorExtractor } from "./Endpoint-BojvdQoh.mjs";
5
+ import { C as Authorizer, O as SecurityScheme, S as MappedAudit, T as BuiltInSecuritySchemeId, _ as RlsBypass, c as EndpointSchemas, f as SessionFn, i as Endpoint, l as EndpointSurface, o as EndpointHandler, p as SuccessStatus, t as AuthorizeFn, v as RlsConfig, x as ActorExtractor } from "./Endpoint-aG6oyuhR.mjs";
6
6
  import { EventPublisher, MappedEvent } from "@geekmidas/events";
7
7
  import { RateLimitConfig } from "@geekmidas/rate-limit";
8
8
  import { Service } from "@geekmidas/services";
@@ -336,4 +336,4 @@ interface EndpointFactoryOptions<TServices extends Service[] = [], TBasePath ext
336
336
  }
337
337
  //#endregion
338
338
  export { EndpointBuilder as n, EndpointFactory as t };
339
- //# sourceMappingURL=EndpointFactory-CaYTrUOO.d.mts.map
339
+ //# sourceMappingURL=EndpointFactory-DdMqIfSy.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EndpointFactory-DyT1yOJL.d.cts","names":[],"sources":["../src/endpoints/EndpointBuilder.ts","../src/endpoints/EndpointFactory.ts"],"mappings":";;;;;;;;;;;cAwCa,gBACZ,uBACA,gBAAgB,YAChB,eAAe,sBACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,qBAAqB,mCAAmC,kCAIxD,uBACA,sDACS,oBACT,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA;WA6BU,OAAO;WACP,QAAQ;YA5BR,SAAS;YACT;YACA,UAAU;YACV;YACA;YACA;EACV,aAAa,UAAU,WAAW,SAAS,UAAU;EAErD,YAAY,YAAY,WAAW,SAAS,UAAU,QAAQ;EAE9D,aAAa;EACb,uBAAuB;EACvB,kBAAkB;EAClB,kBAAkB,eAAe,WAAW,UAAU;EACtD,SAAS,YAAY,cAAc;;;;;;;EAOnC,UAAW;EACX,wBAAwB,eAAe;EACvC,aAAa,UAAU,WAAW,UAAU;EAC5C;EAEA,YACU,OAAO,QACP,QAAQ;EAMlB,cACC,WAAW,QAAQ,4BAA4B;EAMhD,mBACC,SAAS,QAAQ,0BAA0B;EAM5C,oBAAoB,SAAS,QAAQ,sBAAsB;EAI3D,YAAY;EAIZ,OAAO,QAAQ;EAIN,MAAM,eAAe,YAAY,iBAAiB,YAC1D,OAAO;EAOR,KAAK;EAIL,WAAW;;;;;;;;;;;;;;;;;;;EAsBX,aAAa;EAIJ,UAAU,UAAU,qBAAqB,sBACjD,WAAW,QAAQ,OAAO,KACxB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,GACA,OACA,cACA,eACA,0BACA,cACA,WACA;EA4BD,KAAK,UAAU,kBACd,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAoB,MAAM;KAC/B,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,MAAM,UAAU,kBACf,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAKD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAsB,QAAQ;KACnC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,UACC,IAAI,YAAY,WAAW,SAAS,UAAU,QAAQ;EAKvD,UAAU,QAAQ;EAIlB,WACC,MAAM,gCACJ,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;EAkCD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,SACA,YACI,cAAc,WAAW,KAC7B,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAoCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,SACA,YACI,cAAc,IAClB,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,GACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAuBD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,SACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;EA4BQ,QAAQ,UAAU,mBAAmB,sBAC7C,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA;;;;;EA8BD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;;;;;;;EAsBD,MAAM,QAAQ,YAAY,cAAc;;;;;;;;;;;;;;;;EAmB/B,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA;;;;;;;;;;;;;;;;;;;;EA+CD,IACC,QAAQ,UAAU,WAAW,UAAU,mBAAmB;;;;;;;;;;;;;;EAyB3D;EAKA,MAAM;EAMN,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,UACA,WACA,eACA,gBAEC,SACF,QACA,SACA,QACA,WACA,WACA,SACA,UACA,iBACA,4BACA,eACA,0BACA,cACA,WACA;;;;cC3uBW,gBACZ,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,2CACtB,kDACA,qBAAqB,mCAGjB,0BAA0B,YAAY,iBAC1C,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;UAG1B;;;;;;;;;;;UAWA;UACA;UACA;UAOA;UAGA;UAMA;;;;;;;;UAQA;UACA;UACA;UACA;UAGA;UAGA;UACA;UACA;EAER,cACC,UACA,oBACA,eACA,yBAEA,iBACA,mBACA,uBACA,sBACA,uBACA,uBACA,wBACA,uBACA,uBACA,kBACA,WACE,uBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,WACA,sBACA,kBACA;SAwBM,UAAU,0BAA0B,kBAC1C,MAAM,GACN,WAAU,YACR,UAAU,WAAW;EAmCxB,kBAAkB,6BACjB,aAAa,IACX,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,GACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;EAwDD,gBAAgB,UAAU,eAAe,iBACxC,SAAS,IACP,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,mBAAmB,GACnB;;;;;;;;;;;EAiDD,WACC,MACG,gCACM,mBACN,gCAED,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAqDD,MAAM,sBACL,MAAM,QACJ,gBACF,WACA,UAAU,WAAW,QACrB,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,UACC,IAAI,YAAY,WAAW,SAAS,qBAAqB,aACvD,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;EAgDD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,oBACE,WAAW,OAAO,YACtB,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,WAAW,OAAO,YAAY,UAAU;EA+BvD,SAAS,UAAU,WAClB,UAAU,IACR,oBACE,MAAM,YACV,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,MAAM,YAAY,UAAU;EA8C3C,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,WACA,WACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,UAAU;EAoDhC,UACC,UAAU,qBACV,sCAEA,WAAW,QAAQ,cAAc,KAC/B,gBACF,WACA,WACA,SACA,UACA,GACA,cACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,QAAQ,GACP,SAAS,UAAU,WAAW,SAAS,GAAG,aACxC,gBACF,WACA,WACA,SACA,G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,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;EAGlC,kBAAkB;;EAElB;EACA,WAAW;EACX,qBAAqB,YACpB,WACA,SACA,qBAEA;EAED,gBAAgB;EAChB,0BAA0B,UAAU,WAAW,SAAS,UAAU;EAClE,wBAAwB,QAAQ,4BAA4B;EAC5D,gBAAgB,YAAY;EAC5B,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB,QAAQ,0BAA0B;EAC1D,yBAAyB,QAAQ,sBAAsB;EACvD,wBAAwB,eAAe,WAAW,UAAU;EAC5D,wBAAwB;EACxB,mBAAmB;;;;;;;;;;;EAWnB,SAAS"}
1
+ {"version":3,"file":"EndpointFactory-DdMqIfSy.d.mts","names":[],"sources":["../src/endpoints/EndpointBuilder.ts","../src/endpoints/EndpointFactory.ts"],"mappings":";;;;;;;;;;;cAwCa,gBACZ,uBACA,gBAAgB,YAChB,eAAe,sBACf,kBAAkB,gBAClB,gBAAgB,SAAS,QACzB,kBAAkB,0CAClB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,qBAAqB,mCAAmC,kCAIxD,uBACA,sDACS,oBACT,QACA,WACA,WACA,SACA,iBACA,4BACA,eACA,0BACA,WACA;WA6BU,OAAO;WACP,QAAQ;YA5BR,SAAS;YACT;YACA,UAAU;YACV;YACA;YACA;EACV,aAAa,UAAU,WAAW,SAAS,UAAU;EAErD,YAAY,YAAY,WAAW,SAAS,UAAU,QAAQ;EAE9D,aAAa;EACb,uBAAuB;EACvB,kBAAkB;EAClB,kBAAkB,eAAe,WAAW,UAAU;EACtD,SAAS,YAAY,cAAc;;;;;;;EAOnC,UAAW;EACX,wBAAwB,eAAe;EACvC,aAAa,UAAU,WAAW,UAAU;EAC5C;EAEA,YACU,OAAO,QACP,QAAQ;EAMlB,cACC,WAAW,QAAQ,4BAA4B;EAMhD,mBACC,SAAS,QAAQ,0BAA0B;EAM5C,oBAAoB,SAAS,QAAQ,sBAAsB;EAI3D,YAAY;EAIZ,OAAO,QAAQ;EAIN,MAAM,eAAe,YAAY,iBAAiB,YAC1D,OAAO;EAOR,KAAK;EAIL,WAAW;;;;;;;;;;;;;;;;;;;EAsBX,aAAa;EAIJ,UAAU,UAAU,qBAAqB,sBACjD,WAAW,QAAQ,OAAO,KACxB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,GACA,OACA,cACA,eACA,0BACA,cACA,WACA;EA4BD,KAAK,UAAU,kBACd,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAoB,MAAM;KAC/B,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,MAAM,UAAU,kBACf,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAqB,OAAO;KACjC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAKD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,KAAK;IAAsB,QAAQ;KACnC,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAOD,UACC,IAAI,YAAY,WAAW,SAAS,UAAU,QAAQ;EAKvD,UAAU,QAAQ;EAIlB,WACC,MAAM,gCACJ,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;EAkCD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,gBACF,QACA,SACA,YACI,cAAc,WAAW,KAC7B,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAoCD,SAAS,UAAU,WAClB,UAAU,IACR,gBACF,QACA,SACA,YACI,cAAc,IAClB,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EA0BD,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,GACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;EAuBD,OAAO,UAAU,kBAChB,QAAQ,IACN,gBACF,QACA,SACA,QACA,WACA,SACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;EA4BQ,QAAQ,UAAU,mBAAmB,sBAC7C,SAAS,QAAQ,OAAO,KACtB,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA;;;;;EA8BD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA;;;;;;;;;;;;;;;;;;EAsBD,MAAM,QAAQ,YAAY,cAAc;;;;;;;;;;;;;;;;EAmB/B,SAAS,GAAG,sBACpB,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,QACA,SACA,QACA,WACA,SACA,WACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA;;;;;;;;;;;;;;;;;;;;EA+CD,IACC,QAAQ,UAAU,WAAW,UAAU,mBAAmB;;;;;;;;;;;;;;EAyB3D;EAKA,MAAM;EAMN,OACC,IAAI,gBACH,QACA,WACA,SACA,WACA,UACA,WACA,eACA,gBAEC,SACF,QACA,SACA,QACA,WACA,WACA,SACA,UACA,iBACA,4BACA,eACA,0BACA,cACA,WACA;;;;cC3uBW,gBACZ,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,2CACtB,kDACA,qBAAqB,mCAGjB,0BAA0B,YAAY,iBAC1C,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;UAG1B;;;;;;;;;;;UAWA;UACA;UACA;UAOA;UAGA;UAMA;;;;;;;;UAQA;UACA;UACA;UACA;UAGA;UAGA;UACA;UACA;EAER,cACC,UACA,oBACA,eACA,yBAEA,iBACA,mBACA,uBACA,sBACA,uBACA,uBACA,wBACA,uBACA,uBACA,kBACA,WACE,uBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,WACA,sBACA,kBACA;SAwBM,UAAU,0BAA0B,kBAC1C,MAAM,GACN,WAAU,YACR,UAAU,WAAW;EAmCxB,kBAAkB,6BACjB,aAAa,IACX,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,GACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;EAwDD,gBAAgB,UAAU,eAAe,iBACxC,SAAS,IACP,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,mBAAmB,GACnB;;;;;;;;;;;EAiDD,WACC,MACG,gCACM,mBACN,gCAED,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAqDD,MAAM,sBACL,MAAM,QACJ,gBACF,WACA,UAAU,WAAW,QACrB,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,UACC,IAAI,YAAY,WAAW,SAAS,qBAAqB,aACvD,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;EAgDD,gBAAgB,mBAAmB,cAClC,YAAY,IACV,oBACE,WAAW,OAAO,YACtB,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,WAAW,OAAO,YAAY,UAAU;EA+BvD,SAAS,UAAU,WAClB,UAAU,IACR,oBACE,MAAM,YACV,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,cAAc,MAAM,YAAY,UAAU;EA8C3C,OAAO,UAAU,QAChB,QAAQ,IACN,gBACF,WACA,WACA,GACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,UAAU;EAoDhC,UACC,UAAU,qBACV,sCAEA,WAAW,QAAQ,cAAc,KAC/B,gBACF,WACA,WACA,SACA,UACA,GACA,cACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;EAsCD,QAAQ,GACP,SAAS,UAAU,WAAW,SAAS,GAAG,aACxC,gBACF,WACA,WACA,SACA,GACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA,UAAU,WAAW,GAAG;;;;;EAmDzB,SAAS,GAAG,sBACX,QAAQ,WAAW,OAAO,KAAK,QAAQ,OAAO,KAC5C,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,GACA,OACA,kBACA;;;;;;EAsDD,QAAQ,UAAU,mBAAmB,sBACpC,SAAS,QAAQ,OAAO,KACtB,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,GACA,OACA,0BAA0B,IAC1B,WACA,sBACA,kBACA;;;;;EA6CD,MACC,WAAW,eAAe,WAAW,UAAU,WAC7C,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;;;;;;;;;;;;;;;;;;;EAsDD,IAAI,gBAAgB,UAAU,WAAW,UAAU,UAClD,QAAQ,UACN,gBACF,WACA,WACA,SACA,UACA,iBACA,4BACA,cACA,eACA,0BACA,cACA,WACA,sBACA,kBACA;UAoCO;EAsGR,KAAK,sBAAsB,MAAM,QAAK,gBAAA,oBAAA,uBAAA,QAAA,mBAAA,YAAA,wBAAA,6BAAA,YAAA,UAAA,2BA2CN,UAAI,wBACN,YAAI,QAAA,YAAA,QA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AAA,2BAuBT,UAAI,wBACN,YAAI,QAAA,YAAA,QAAA,UAAA,wBAAA,cAAA,aAAA,cAAA,aAAA,yBAAA,WAAA,oBAAA,UAAA,iBAAA,4BAAA,cAAA,eAAA,0BAAA,cAAA,WAAA;;KAnBvB,oBAAoB,oBAAoB,mBAAmB,UACpE,kBACC,IACA,OACD;KAES,UACX,0BACA,wBACG,oBACH,uBACG,QACA,mBACC,YACA,wBACC,6BACC,YACI,UACL,2BAA2B,UAC1B,wBAAwB,YACpB,QAAQ,YACR,QAAQ,UACZ,wBAAwB,YACpB,aAAa,YACb,aAAa;UAGP,uBAChB,kBAAkB,gBAClB,+BACA,gBAAgB,SAAS,QACzB,oBACA,wBAAwB,6CACxB,oDACA,4DACA,sBAAsB,sCACtB,kDACA,uBACA,8CACA,yBAAyB,eAAe,kBAAkB,eAEzD,iBAED,mBACG,UAAU,WAAW,UAAU;EAGlC,kBAAkB;;EAElB;EACA,WAAW;EACX,qBAAqB,YACpB,WACA,SACA,qBAEA;EAED,gBAAgB;EAChB,0BAA0B,UAAU,WAAW,SAAS,UAAU;EAClE,wBAAwB,QAAQ,4BAA4B;EAC5D,gBAAgB,YAAY;EAC5B,uBAAuB;EACvB,wBAAwB;EACxB,wBAAwB,QAAQ,0BAA0B;EAC1D,yBAAyB,QAAQ,sBAAsB;EACvD,wBAAwB,eAAe,WAAW,UAAU;EAC5D,wBAAwB;EACxB,mBAAmB;;;;;;;;;;;EAWnB,SAAS"}
@@ -3,7 +3,7 @@ import { a as FunctionHandler, r as Function$1 } from "../index-BI23K3wy.cjs";
3
3
  import { t as Cron } from "../Cron-CA2oa2nC.cjs";
4
4
  import { t as HttpMethod } from "../types-DMuSQeLL.cjs";
5
5
  import { t as Telemetry } from "../telemetry-DGcFlVpB.cjs";
6
- import { c as EndpointSchemas, i as Endpoint, r as CookieFn } from "../Endpoint-xNGuv2Fq.cjs";
6
+ import { c as EndpointSchemas, i as Endpoint, r as CookieFn } from "../Endpoint-wV6FcBV0.cjs";
7
7
  import { t as Queue } from "../Queue-Bhzi2WQC.cjs";
8
8
  import { t as Subscriber } from "../Subscriber-DQCaiOXF.cjs";
9
9
  import { EnvironmentParser } from "@geekmidas/envkit";
@@ -3,7 +3,7 @@ import { a as FunctionHandler, r as Function$1 } from "../index-yb3fXNyH.mjs";
3
3
  import { t as Cron } from "../Cron-B_iuyNxr.mjs";
4
4
  import { t as HttpMethod } from "../types-DMuSQeLL.mjs";
5
5
  import { t as Telemetry } from "../telemetry-DGcFlVpB.mjs";
6
- import { c as EndpointSchemas, i as Endpoint, r as CookieFn } from "../Endpoint-BojvdQoh.mjs";
6
+ import { c as EndpointSchemas, i as Endpoint, r as CookieFn } from "../Endpoint-aG6oyuhR.mjs";
7
7
  import { t as Queue } from "../Queue-BoUA-e83.mjs";
8
8
  import { t as Subscriber } from "../Subscriber-CIO3pwji.mjs";
9
9
  import { EnvironmentParser } from "@geekmidas/envkit";
@@ -1,6 +1,6 @@
1
1
  import { t as StandardSchemaV1 } from "../index-CeEtxDmK.cjs";
2
2
  import { t as HttpMethod } from "../types-DMuSQeLL.cjs";
3
- import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-xNGuv2Fq.cjs";
3
+ import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-wV6FcBV0.cjs";
4
4
  import { EnvironmentParser } from "@geekmidas/envkit";
5
5
  import { EventPublisher } from "@geekmidas/events";
6
6
  import { Logger } from "@geekmidas/logger";
@@ -1,6 +1,6 @@
1
1
  import { t as StandardSchemaV1 } from "../index-CeEtxDmK.mjs";
2
2
  import { t as HttpMethod } from "../types-DMuSQeLL.mjs";
3
- import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-BojvdQoh.mjs";
3
+ import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-aG6oyuhR.mjs";
4
4
  import { EnvironmentParser } from "@geekmidas/envkit";
5
5
  import { EventPublisher } from "@geekmidas/events";
6
6
  import { Service, ServiceDiscovery, ServiceRecord } from "@geekmidas/services";
@@ -1,7 +1,7 @@
1
1
  import { t as StandardSchemaV1 } from "../index-CeEtxDmK.cjs";
2
2
  import { r as Function } from "../index-BI23K3wy.cjs";
3
3
  import { t as HttpMethod } from "../types-DMuSQeLL.cjs";
4
- import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-xNGuv2Fq.cjs";
4
+ import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-wV6FcBV0.cjs";
5
5
  import { t as Queue } from "../Queue-Bhzi2WQC.cjs";
6
6
  import { t as Subscriber } from "../Subscriber-DQCaiOXF.cjs";
7
7
  import { t as KyselyDatabase } from "../kysely-CEVXacPN.cjs";
@@ -1,7 +1,7 @@
1
1
  import { t as StandardSchemaV1 } from "../index-CeEtxDmK.mjs";
2
2
  import { r as Function } from "../index-yb3fXNyH.mjs";
3
3
  import { t as HttpMethod } from "../types-DMuSQeLL.mjs";
4
- import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-BojvdQoh.mjs";
4
+ import { c as EndpointSchemas, i as Endpoint } from "../Endpoint-aG6oyuhR.mjs";
5
5
  import { t as Queue } from "../Queue-BoUA-e83.mjs";
6
6
  import { t as Subscriber } from "../Subscriber-CIO3pwji.mjs";
7
7
  import { t as KyselyDatabase } from "../kysely-mcTdPNhl.mjs";
@@ -156,6 +156,14 @@ declare class BetterAuth<TName extends string = string, TDatabase extends Consum
156
156
  */
157
157
  private optionsFor;
158
158
  }
159
+ /** A magic link moved to the device address when an app is its destination. */
160
+ declare function deviceLink(url: string, deviceUrl: string): string;
161
+ /** A mobile app depends on this auth server, and `@better-auth/expo` is absent. */
162
+ declare class ExpoPluginMissing extends Error {
163
+ readonly server: string;
164
+ readonly cause: unknown;
165
+ constructor(server: string, cause: unknown);
166
+ }
159
167
  /** The auth server answered a session check with something other than 200. */
160
168
  declare class SessionCheckFailed extends Error {
161
169
  readonly authenticator: string;
@@ -173,5 +181,5 @@ declare class SessionCheckFailed extends Error {
173
181
  */
174
182
  declare function idempotent(statements: string): string;
175
183
  //#endregion
176
- export { BetterAuthOptions as a, idempotent as c, BetterAuthConfig as i, AuthSession as n, BetterAuthOptionsContext as o, BetterAuth as r, SessionCheckFailed as s, AuthServer as t };
177
- //# sourceMappingURL=auth-CJ5dp7T7.d.mts.map
184
+ export { BetterAuthOptions as a, SessionCheckFailed as c, BetterAuthConfig as i, deviceLink as l, AuthSession as n, BetterAuthOptionsContext as o, BetterAuth as r, ExpoPluginMissing as s, AuthServer as t, idempotent as u };
185
+ //# sourceMappingURL=auth-BVkkvI6F.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-Bmo1wSQF.d.cts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;KAqDY,aAAa,kBAAkB;;KAG/B,cAAc;;KAGd,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBAoBtC;WAlBT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;;EA6CL,OACL,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;MAuBP;;;;;;;;;;;;;EAgBE,iBACL,SAAS,yBACP;;;;;;;;;;;;;;;;;;;;EAiDG,OAAO,SAAS,yBAAyB;IAAU,KAAK;;;;;;;EAoDxD,UAAU,SAAS,yBAAyB;;UAMpC;UAuBA;;;;;;;UAkBA;;;cAqFF,2BAA2B;WAE7B;WACA;EAFV,YACU,uBACA;;;;;;;;;;;iBAoBK,WAAW"}
1
+ {"version":3,"file":"auth-BVkkvI6F.d.mts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;KAsDY,aAAa,kBAAkB;;KAG/B,cAAc;;KAGd,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBAoBtC;WAlBT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;;EA6CL,OACL,SAAS,SACT,WAAW,wBACT,QAAQ;;;;;MAuBP;;;;;;;;;;;;;EAgBE,iBACL,SAAS,yBACP;;;;;;;;;;;;;;;;;;;;EAiDG,OAAO,SAAS,yBAAyB;IAAU,KAAK;;;;;;;EAoDxD,UAAU,SAAS,yBAAyB;;UAMpC;UAuBA;;;;;;;UAkBA;;;iBA2JC,WAAW,aAAa;;cAY3B,0BAA0B;WAE5B;WACS;EAFnB,YACU,gBACS;;;cAYP,2BAA2B;WAE7B;WACA;EAFV,YACU,uBACA;;;;;;;;;;;iBAoBK,WAAW"}
@@ -156,6 +156,14 @@ declare class BetterAuth<TName extends string = string, TDatabase extends Consum
156
156
  */
157
157
  private optionsFor;
158
158
  }
159
+ /** A magic link moved to the device address when an app is its destination. */
160
+ declare function deviceLink(url: string, deviceUrl: string): string;
161
+ /** A mobile app depends on this auth server, and `@better-auth/expo` is absent. */
162
+ declare class ExpoPluginMissing extends Error {
163
+ readonly server: string;
164
+ readonly cause: unknown;
165
+ constructor(server: string, cause: unknown);
166
+ }
159
167
  /** The auth server answered a session check with something other than 200. */
160
168
  declare class SessionCheckFailed extends Error {
161
169
  readonly authenticator: string;
@@ -173,5 +181,5 @@ declare class SessionCheckFailed extends Error {
173
181
  */
174
182
  declare function idempotent(statements: string): string;
175
183
  //#endregion
176
- export { BetterAuthOptions as a, idempotent as c, BetterAuthConfig as i, AuthSession as n, BetterAuthOptionsContext as o, BetterAuth as r, SessionCheckFailed as s, AuthServer as t };
177
- //# sourceMappingURL=auth-Bmo1wSQF.d.cts.map
184
+ export { BetterAuthOptions as a, SessionCheckFailed as c, BetterAuthConfig as i, deviceLink as l, AuthSession as n, BetterAuthOptionsContext as o, BetterAuth as r, ExpoPluginMissing as s, AuthServer as t, idempotent as u };
185
+ //# sourceMappingURL=auth-DYfF6Vfp.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-CJ5dp7T7.d.mts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;;KAqDY,aAAa,kBAAkB;;KAG/B,cAAc;;KAGd,oBAAoB,KAC/B,kBAAkB;;;;;;KASP,yBAAyB,uBAAuB,gBAC3D;EACC,UAAU,kBAAkB,WAAW;;UAGxB,iBAChB,kBAAkB,YAClB,uBAAuB;;;;;;;;EASvB,UAAU;;;;;;;;EAQV;;;;;;;EAOA;;;;;;;;;;;;EAYA,YAAY;;;;;;;;EAQZ,UACG,sBAEA,SAAS,yBAAyB,WAC7B,oBAAoB,QAAQ;;cAKxB,WACZ,+BACA,kBAAkB,aAAa,kBACzB,uBAAuB,uCACjB,UAAU,OAAO,aAAa,cAAc;mBAoBtC;WAlBT,IAAI;WACJ,SAAS,QAAQ,aAAa,QAAQ;WACtC;;;;;mBAMQ;EAQjB,YACC,IAAI,cAAc,QACD,QAAQ,iBAAiB,WAAW;;;;;;;;;;;;;;;EAuCtD,WAAW;;;;;;;;;EA6CL,OACL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B;WACA;EAFV,YACU,uBACA;;;;;;;;;;;iBAoBK,WAAW"}
package/dist/auth.cjs CHANGED
@@ -189,15 +189,20 @@ var BetterAuth = class {
189
189
  * built from the same options.
190
190
  */
191
191
  async optionsFor(options, as = {}) {
192
- const { secret, baseUrl, trustedOrigins, cookieDomain } = options.envParser.create((get) => ({
192
+ const { secret, baseUrl, trustedOrigins, cookieDomain, deviceUrl } = options.envParser.create((get) => ({
193
193
  secret: get(this.keys.secret).string(),
194
194
  baseUrl: get(this.keys.url).string(),
195
195
  trustedOrigins: get(this.keys.trustedOrigins).string().default("").transform((value) => value.split(",").map((origin) => origin.trim()).filter(Boolean)),
196
- cookieDomain: get(this.keys.cookieDomain).string().optional()
196
+ cookieDomain: get(this.keys.cookieDomain).string().optional(),
197
+ deviceUrl: get((0, _geekmidas_manifest.provideKey)(this.id, "deviceUrl")).string().optional()
197
198
  })).parse();
198
199
  const tenant = this.config.database;
199
200
  const db = await (as.owner && tenant.owner ? tenant.owner : tenant.service).register(options);
200
201
  const configured = await this.configured(options);
202
+ const origins = [...trustedOrigins, ...configured.trustedOrigins && Array.isArray(configured.trustedOrigins) ? configured.trustedOrigins : []];
203
+ const plugins = [...configured.plugins ?? []];
204
+ if (origins.some((origin) => !(0, _geekmidas_manifest.isWebOrigin)(origin)) && !plugins.some((plugin) => plugin.id === "expo")) plugins.push(await expoPlugin(this.id));
205
+ if (deviceUrl) for (const plugin of plugins) reachableFromDevice(plugin, deviceUrl);
201
206
  return {
202
207
  ...configured,
203
208
  secret,
@@ -207,7 +212,8 @@ var BetterAuth = class {
207
212
  db,
208
213
  type: "postgres"
209
214
  },
210
- trustedOrigins: [...trustedOrigins, ...configured.trustedOrigins && Array.isArray(configured.trustedOrigins) ? configured.trustedOrigins : []],
215
+ plugins,
216
+ trustedOrigins: origins,
211
217
  advanced: {
212
218
  ...configured.advanced,
213
219
  ...cookieDomain ? { crossSubDomainCookies: {
@@ -219,6 +225,61 @@ var BetterAuth = class {
219
225
  };
220
226
  }
221
227
  };
228
+ /** Better Auth's Expo plugin, which a mobile app's sign-in needs. */
229
+ async function expoPlugin(server) {
230
+ try {
231
+ const { expo } = await import("@better-auth/expo");
232
+ return expo();
233
+ } catch (error) {
234
+ throw new ExpoPluginMissing(server, error);
235
+ }
236
+ }
237
+ /** Links already rewritten — an `options` object is reused across builds. */
238
+ const rewritten = /* @__PURE__ */ new WeakSet();
239
+ /**
240
+ * Build the magic links an app asked for on the address a phone reaches.
241
+ *
242
+ * An app's link carries its scheme as the `callbackURL` (`shop-dev://…`)
243
+ * where a browser's carries a path or an `http(s)` URL — which is how the two
244
+ * are told apart. A browser's link is left alone: it is opened on this
245
+ * machine, where the server's own hostname resolves.
246
+ *
247
+ * Better Auth's magic-link plugin calls `sendMagicLink` through the options
248
+ * object it returns, so wrapping it there is wrapping the call.
249
+ */
250
+ function reachableFromDevice(plugin, deviceUrl) {
251
+ if (plugin.id !== "magic-link") return;
252
+ const options = plugin.options;
253
+ if (!options?.sendMagicLink || rewritten.has(options)) return;
254
+ rewritten.add(options);
255
+ const send = options.sendMagicLink;
256
+ options.sendMagicLink = (data, ...rest) => send({
257
+ ...data,
258
+ url: deviceLink(data.url, deviceUrl)
259
+ }, ...rest);
260
+ }
261
+ /** A magic link moved to the device address when an app is its destination. */
262
+ function deviceLink(url, deviceUrl) {
263
+ try {
264
+ const link = new URL(url);
265
+ const callback = link.searchParams.get("callbackURL") ?? "/";
266
+ if (callback.startsWith("/") || (0, _geekmidas_manifest.isWebOrigin)(callback)) return url;
267
+ return new URL(`${link.pathname}${link.search}`, deviceUrl).toString();
268
+ } catch {
269
+ return url;
270
+ }
271
+ }
272
+ /** A mobile app depends on this auth server, and `@better-auth/expo` is absent. */
273
+ var ExpoPluginMissing = class extends Error {
274
+ server;
275
+ cause;
276
+ constructor(server, cause) {
277
+ super(`'${server}' is called by a mobile app, and a mobile app signs in through Better Auth's Expo plugin — install it where the auth server runs: pnpm add @better-auth/expo`);
278
+ this.server = server;
279
+ this.cause = cause;
280
+ this.name = "ExpoPluginMissing";
281
+ }
282
+ };
222
283
  /** The auth server answered a session check with something other than 200. */
223
284
  var SessionCheckFailed = class extends Error {
224
285
  authenticator;
@@ -244,7 +305,9 @@ function idempotent(statements) {
244
305
  }
245
306
  //#endregion
246
307
  exports.BetterAuth = BetterAuth;
308
+ exports.ExpoPluginMissing = ExpoPluginMissing;
247
309
  exports.SessionCheckFailed = SessionCheckFailed;
310
+ exports.deviceLink = deviceLink;
248
311
  exports.idempotent = idempotent;
249
312
 
250
313
  //# sourceMappingURL=auth.cjs.map
package/dist/auth.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"auth.cjs","names":["canonicalId","environmentCase","provideKey","serviceKey","edgeTo","betterAuth"],"sources":["../src/auth.ts"],"sourcesContent":["/**\n * `BetterAuth` — a declared auth server.\n *\n * It is three things at once, which is what makes it the construct that\n * exercises most of the model: a consumer of a database, a producer of an\n * authorizer, and a set of endpoints. This lands the first two.\n *\n * Its tables live in a schema tenant it is *given* — `orders.schema('AuthDb')`\n * — rather than one it invents. The tenant declares the schema and the role;\n * this declares the one thing left, the signing secret, and reads back the keys\n * it needs.\n *\n * :::caution\n * The isolation that arrangement is *for* — the application's own role holding\n * no grant on these tables, so a compromised handler cannot read sessions — does\n * **not hold yet**. No target creates the per-schema role: both connect as the\n * database owner, so today the tenant is a `search_path`, which is a namespace\n * and not a privilege boundary. See \"Roles are declared and never created\" in\n * `docs/design/constructs-outstanding.md`.\n * :::\n *\n * It declares its own surface, so where it answers, who may call it, and the\n * domain its cookies are scoped to all arrive as environment resolved by the\n * target — none of them guessed from a port, and none of them listed by hand in\n * application config.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tenvironmentCase,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type {\n\tService,\n\tServiceRecord,\n\tServiceRegisterOptions,\n} from '@geekmidas/services';\nimport { betterAuth } from 'better-auth';\nimport type { Hono } from 'hono';\nimport type { Kysely } from 'kysely';\nimport {\n\ttype Authenticator,\n\ttype Construct,\n\ttype Consumable,\n\tedgeTo,\n\ttype ServicesOf,\n} from './construct-interface';\n\n/** The server better-auth hands back. */\nexport type AuthServer = ReturnType<typeof betterAuth>;\n\n/** A signed-in session as better-auth hands it back: `{ user, session }`. */\nexport type AuthSession = AuthServer['$Infer']['Session'];\n\n/** Everything better-auth takes, minus what the construct owns. */\nexport type BetterAuthOptions = Omit<\n\tParameters<typeof betterAuth>[0],\n\t'database' | 'secret' | 'basePath' | 'baseURL'\n>;\n\n/**\n * What an `options` callback is handed: the options this construct was\n * registered with, and a client for each construct its `dependsOn` names —\n * keyed by service name, exactly as an endpoint's handler receives them.\n */\nexport type BetterAuthOptionsContext<TUses extends readonly Consumable[]> =\n\tServiceRegisterOptions & {\n\t\tservices: ServiceRecord<[...ServicesOf<TUses>]>;\n\t};\n\nexport interface BetterAuthConfig<\n\tTDatabase extends Consumable,\n\tTUses extends readonly Consumable[] = readonly [],\n> {\n\t/**\n\t * The schema tenant its tables live in.\n\t *\n\t * A construct rather than a URL: the tenant already declares its schema and\n\t * its role, and taking the declaration is what puts the edge in the graph\n\t * instead of a connection string in two places.\n\t */\n\tdatabase: TDatabase;\n\t/**\n\t * The app that serves this auth server, relative to the workspace root —\n\t * `'apps/auth'`.\n\t *\n\t * Required, for the reason `RestApi.path` is. Not to be confused with\n\t * `basePath`, which is where its routes are mounted in a URL.\n\t */\n\tpath: string;\n\t/**\n\t * Where the auth routes are mounted, e.g. `/api/auth`.\n\t *\n\t * Structural — it is part of the URL every client calls, so it cannot differ\n\t * between stages the way the host can.\n\t */\n\tbasePath?: string;\n\t/**\n\t * The constructs `options` uses — the mailer a magic link goes through,\n\t * most often.\n\t *\n\t * One list, two jobs, the way an endpoint's `.dependsOn()` has: each is an\n\t * edge on the server's handler, so whatever is composed from the edges (a\n\t * container's environment, a deploy's grants) includes it; and each is\n\t * handed to `options` as a client in `services`, so there is no other way\n\t * for `options` to reach it — nothing to import and register by hand, and\n\t * so nothing that can be used without being declared.\n\t */\n\tdependsOn?: TUses;\n\t/**\n\t * The rest of better-auth's options: providers, plugins, email settings.\n\t *\n\t * A function when they need another construct — a magic-link plugin has to\n\t * *send* the link. It is handed the options this construct was registered\n\t * with, and `services`: a client for each construct in `dependsOn`.\n\t */\n\toptions?:\n\t\t| BetterAuthOptions\n\t\t| ((\n\t\t\t\tcontext: BetterAuthOptionsContext<TUses>,\n\t\t ) => BetterAuthOptions | Promise<BetterAuthOptions>);\n}\n\nconst DEFAULT_BASE_PATH = '/api/auth';\n\nexport class BetterAuth<\n\tTName extends string = string,\n\tTDatabase extends Consumable = Consumable,\n\tconst TUses extends readonly Consumable[] = readonly [],\n> implements Construct<TName, AuthServer>, Authenticator<AuthSession>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, AuthServer>;\n\treadonly basePath: string;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the keys the\n\t * target publishes and the keys the server reads cannot drift.\n\t */\n\tprivate readonly keys: {\n\t\tsecretId: string;\n\t\tsecret: string;\n\t\turl: string;\n\t\ttrustedOrigins: string;\n\t\tcookieDomain: string;\n\t};\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: BetterAuthConfig<TDatabase, TUses>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.basePath = config.basePath ?? DEFAULT_BASE_PATH;\n\n\t\t// A secret's name is its key: `Auth` signs with `AUTH_SECRET`, which is\n\t\t// also what better-auth's own tooling looks for.\n\t\tconst secretId = `${canonical}Secret`;\n\t\tthis.keys = {\n\t\t\tsecretId,\n\t\t\tsecret: environmentCase(secretId),\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\ttrustedOrigins: provideKey(canonical, 'trustedOrigins'),\n\t\t\tcookieDomain: provideKey(canonical, 'cookieDomain'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\t/**\n\t * A signing secret and a surface.\n\t *\n\t * The database is *not* declared here — the tenant that was passed in\n\t * declares it, and declaring it twice is the duplication the whole model\n\t * removes. What is declared is what this construct owns: the key it signs\n\t * with, and the routes it answers on.\n\t *\n\t * One endpoint, wildcarded. Better Auth routes internally and the set of\n\t * paths depends on which capabilities are enabled, so enumerating them here\n\t * would be a copy of its router that goes stale on its next release. The\n\t * surface's job is to send everything under `basePath` to one handler, which\n\t * is exactly what the declaration says.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'secret',\n\t\t\t\tid: this.keys.secretId,\n\t\t\t\tprovides: [this.keys.secret],\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: 'rest-api',\n\t\t\t\tid: this.id,\n\t\t\t\tpath: this.config.path,\n\t\t\t\tprovides: [\n\t\t\t\t\tthis.keys.url,\n\t\t\t\t\tthis.keys.trustedOrigins,\n\t\t\t\t\tthis.keys.cookieDomain,\n\t\t\t\t],\n\t\t\t\tendpoints: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: `${this.id}Handler`,\n\t\t\t\t\t\thandler: `${this.id}.handler`,\n\t\t\t\t\t\tmethod: 'ANY',\n\t\t\t\t\t\tpath: `${this.basePath}/*`,\n\t\t\t\t\t\t// Read off the tenant rather than written down: this\n\t\t\t\t\t\t// construct takes whatever database it is given, and a\n\t\t\t\t\t\t// hardcoded kind is a second statement of a fact the\n\t\t\t\t\t\t// tenant already makes.\n\t\t\t\t\t\tdependencies: [\n\t\t\t\t\t\t\tedgeTo(this.config.database),\n\t\t\t\t\t\t\t...(this.config.dependsOn ?? []).map(edgeTo),\n\t\t\t\t\t\t],\n\t\t\t\t\t\trequires: [this.keys.secret],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Whose request this is: the session for these headers, or `null`.\n\t *\n\t * Asked of the auth server over HTTP, at the URL the `.auth()` edge injects —\n\t * so it is the same call whether the server runs in this process, beside\n\t * it, or behind MSW in a test. Only the session headers are forwarded; the\n\t * surface decides which.\n\t */\n\tasync verify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<AuthSession | null> {\n\t\tconst { url } = envParser\n\t\t\t.create((get) => ({ url: get(this.keys.url).string() }))\n\t\t\t.parse();\n\n\t\tconst response = await fetch(`${url}${this.basePath}/get-session`, {\n\t\t\theaders,\n\t\t});\n\n\t\t// Better Auth answers `null` for a request with no session. Anything\n\t\t// other than a 200 is the server failing, which is not the same thing as\n\t\t// \"signed out\" and must not be read as it.\n\t\tif (!response.ok) {\n\t\t\tthrow new SessionCheckFailed(this.id, response.status);\n\t\t}\n\n\t\treturn (await response.json()) as AuthSession | null;\n\t}\n\n\t/**\n\t * The tenant this server keeps its tables in — whose migrations folder,\n\t * `db/<tenant>/`, Better Auth's schema is written into.\n\t */\n\tget databaseId(): string {\n\t\treturn this.config.database.id;\n\t}\n\n\t/**\n\t * The SQL that brings the tenant up to Better Auth's schema, or `undefined`\n\t * when it already matches.\n\t *\n\t * What `gkm migration` writes as the tenant's next migration, so Better\n\t * Auth's tables are committed, reviewed and applied like any other — rather\n\t * than diffed against the database at runtime, where a change nobody wrote\n\t * down happens on whichever machine migrates first.\n\t *\n\t * Compared as the owner, against the tenant `gkm migrate` has already brought\n\t * up to date: what comes back is only what the committed files are missing.\n\t */\n\tasync pendingMigration(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<string | undefined> {\n\t\t// The options, not a server built from them: better-auth checks its\n\t\t// schema when a server starts, and before the migration that creates the\n\t\t// tables it can only report them missing.\n\t\tconst resolved = await this.optionsFor(options, { owner: true });\n\t\tconst db = (resolved.database as { db: Kysely<Record<string, never>> }).db;\n\n\t\ttry {\n\t\t\t// better-auth 1.7 split the migration builder out of `better-auth/db`\n\t\t\t// into its own entry, so importing it no longer drags the whole db\n\t\t\t// layer in behind it.\n\t\t\tconst { getMigrations } = await import('better-auth/db/migration');\n\t\t\tconst { toBeCreated, toBeAdded, toBeAddedIndexes, compileMigrations } =\n\t\t\t\tawait getMigrations(resolved);\n\n\t\t\tif (\n\t\t\t\ttoBeCreated.length === 0 &&\n\t\t\t\ttoBeAdded.length === 0 &&\n\t\t\t\ttoBeAddedIndexes.length === 0\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn idempotent(await compileMigrations());\n\t\t} finally {\n\t\t\t// Its own pool: left open, it keeps the process that asked alive.\n\t\t\tawait db.destroy();\n\t\t}\n\t}\n\n\t/**\n\t * The server this surface runs as, built from its own declaration.\n\t *\n\t * A surface is a deploy unit, so something has to serve it, and the thing\n\t * that knows how is the construct — not a generator writing a mount into\n\t * somebody else's entry point. That is how the auth server came to be\n\t * mounted by a hook in the application it was supposed to be separate from,\n\t * and then to be served by nothing at all when the hook was deleted.\n\t *\n\t * The routes come from {@link declare}: one wildcard under `basePath`, read\n\t * off the same declaration the manifest carries, so the surface the graph\n\t * describes and the surface that answers requests cannot disagree.\n\t *\n\t * ```ts\n\t * // .gkm/server/app.ts — the whole generated entry\n\t * import { auth } from '@acme/constructs/auth.js';\n\t * export const { app } = await auth.server({ envParser });\n\t * ```\n\t */\n\tasync server(options: ServiceRegisterOptions): Promise<{ app: Hono }> {\n\t\tconst { Hono } = await import('hono');\n\t\tconst { cors } = await import('hono/cors');\n\t\tconst app = new Hono();\n\t\tconst server = await this.connect(options);\n\n\t\t// Who may call this surface, read off the graph. The same list Better\n\t\t// Auth checks for CSRF — it arrives as `<ID>_TRUSTED_ORIGINS`, composed\n\t\t// by the target from whatever declared an edge to this construct, so a\n\t\t// site that depends on the auth server is allowed to reach it and\n\t\t// nothing else is. Nobody writes an origin down.\n\t\tconst { origins } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\torigins: get(this.keys.trustedOrigins)\n\t\t\t\t\t.string()\n\t\t\t\t\t.default('')\n\t\t\t\t\t.transform((value: string) =>\n\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t\t.map((origin) => origin.trim())\n\t\t\t\t\t\t\t.filter(Boolean),\n\t\t\t\t\t),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\tapp.use('*', cors({ origin: origins, credentials: true, maxAge: 3600 }));\n\n\t\t// Read off the declaration rather than restated here. `ANY` is every\n\t\t// method Better Auth routes internally, which is the reason the\n\t\t// declaration wildcards rather than enumerating.\n\t\tconst [surface] = this.declare().filter(\n\t\t\t(d): d is Extract<Declaration, { kind: 'rest-api' }> =>\n\t\t\t\td.kind === 'rest-api',\n\t\t);\n\n\t\tfor (const endpoint of surface?.endpoints ?? []) {\n\t\t\tconst methods =\n\t\t\t\tendpoint.method === 'ANY'\n\t\t\t\t\t? (['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'] as const)\n\t\t\t\t\t: ([endpoint.method] as const);\n\n\t\t\tapp.on([...methods], endpoint.path, (c) => server.handler(c.req.raw));\n\t\t}\n\n\t\treturn { app };\n\t}\n\n\t/**\n\t * The ids of the better-auth plugins this server runs — what a client has\n\t * to pair its own plugins with (`magic-link` with `magicLinkClient`).\n\t * Resolved the way the server resolves them, options callback included.\n\t */\n\tasync pluginIds(options: ServiceRegisterOptions): Promise<string[]> {\n\t\tconst { plugins = [] } = await this.configured(options);\n\t\treturn plugins.map(({ id }) => id);\n\t}\n\n\t/** Better-auth's options as given — a value, or a callback of the environment. */\n\tprivate async configured(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<BetterAuthOptions> {\n\t\t// Hoisted: narrowing a property of `this` is not preserved across the\n\t\t// await, and the false branch is the plain-object form.\n\t\tconst configure = this.config.options;\n\t\tif (typeof configure !== 'function') return configure ?? {};\n\n\t\t// A client for each declared construct, from the options this call was\n\t\t// given — not the process-wide discovery, which keeps whichever env\n\t\t// parser reached it first.\n\t\tconst services: Record<string, unknown> = {};\n\t\tfor (const construct of this.config.dependsOn ?? []) {\n\t\t\tservices[construct.service.serviceName] =\n\t\t\t\tawait construct.service.register(options);\n\t\t}\n\n\t\treturn configure({\n\t\t\t...options,\n\t\t\tservices,\n\t\t} as BetterAuthOptionsContext<TUses>);\n\t}\n\n\tprivate async connect(\n\t\toptions: ServiceRegisterOptions,\n\t\tas: { owner?: boolean } = {},\n\t): Promise<AuthServer> {\n\t\t// `Auth<O>` is invariant in its options in better-auth 1.7, so the value\n\t\t// built from a concrete literal is not assignable to the `AuthServer`\n\t\t// alias, which names the constraint. The runtime object is the same one\n\t\t// either way; the assertion keeps the variance where it happens instead\n\t\t// of spreading a generic through the construct's public type.\n\t\treturn betterAuth(await this.optionsFor(options, as)) as AuthServer;\n\t}\n\n\t/**\n\t * Everything better-auth is given: the app's options, and what the construct\n\t * owns — its secret, its URL, its tenant's connection, the origins and cookie\n\t * domain its graph derives. One place, so the server and its migrations are\n\t * built from the same options.\n\t */\n\tprivate async optionsFor(\n\t\toptions: ServiceRegisterOptions,\n\t\tas: { owner?: boolean } = {},\n\t): Promise<Parameters<typeof betterAuth>[0]> {\n\t\tconst { secret, baseUrl, trustedOrigins, cookieDomain } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\tsecret: get(this.keys.secret).string(),\n\t\t\t\t// The surface's own URL, resolved by the target — not guessed from\n\t\t\t\t// a port, which was wrong the moment the server moved to 3001.\n\t\t\t\tbaseUrl: get(this.keys.url).string(),\n\t\t\t\t// Better Auth's CSRF check applies to every caller, not just\n\t\t\t\t// browsers, so an API calling the auth server is rejected unless\n\t\t\t\t// its origin is trusted. The list is derived from the graph and\n\t\t\t\t// arrives as one comma-separated value, for the same reason every\n\t\t\t\t// other derived value arrives as a string: it crosses a process\n\t\t\t\t// boundary as env.\n\t\t\t\ttrustedOrigins: get(this.keys.trustedOrigins)\n\t\t\t\t\t.string()\n\t\t\t\t\t.default('')\n\t\t\t\t\t.transform((value) =>\n\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t\t.map((origin) => origin.trim())\n\t\t\t\t\t\t\t.filter(Boolean),\n\t\t\t\t\t),\n\t\t\t\t// The domain a session cookie has to carry to be readable by a\n\t\t\t\t// frontend on a sibling host. Optional because there is often\n\t\t\t\t// nothing to widen to: locally everything shares `localhost`,\n\t\t\t\t// where cookies ignore the port and a `Domain` would only be a\n\t\t\t\t// value the browser refuses.\n\t\t\t\tcookieDomain: get(this.keys.cookieDomain).string().optional(),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\t// The tenant's own client: one construct, one connection, so what auth\n\t\t// writes and what the browser inspects cannot be two different databases.\n\t\t// A migration asks the tenant for its owner connection, which the tenant\n\t\t// exposes as a `Service` and not as anything `.dependsOn()` would take.\n\t\tconst tenant = this.config.database as Consumable & {\n\t\t\towner?: Service<string, unknown>;\n\t\t};\n\t\tconst source = as.owner && tenant.owner ? tenant.owner : tenant.service;\n\n\t\tconst db = (await source.register(options)) as Kysely<\n\t\t\tRecord<string, never>\n\t\t>;\n\n\t\tconst configured = await this.configured(options);\n\n\t\treturn {\n\t\t\t...configured,\n\t\t\tsecret,\n\t\t\tbaseURL: baseUrl,\n\t\t\tbasePath: this.basePath,\n\t\t\tdatabase: { db, type: 'postgres' },\n\t\t\t// Whatever the app added wins over the derived list rather than\n\t\t\t// replacing it: an origin nobody declared is still sometimes real.\n\t\t\ttrustedOrigins: [\n\t\t\t\t...trustedOrigins,\n\t\t\t\t...(configured.trustedOrigins &&\n\t\t\t\tArray.isArray(configured.trustedOrigins)\n\t\t\t\t\t? configured.trustedOrigins\n\t\t\t\t\t: []),\n\t\t\t],\n\t\t\tadvanced: {\n\t\t\t\t...configured.advanced,\n\t\t\t\t// Only when a domain was derived. Better Auth reads the presence\n\t\t\t\t// of this block as intent, so enabling it with no domain would\n\t\t\t\t// widen the cookie to whatever host happened to set it — and the\n\t\t\t\t// case with nothing to widen to is the common one, not an error.\n\t\t\t\t...(cookieDomain\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcrossSubDomainCookies: {\n\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\tdomain: cookieDomain,\n\t\t\t\t\t\t\t\t...configured.advanced?.crossSubDomainCookies,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t};\n\t}\n}\n\n/** The auth server answered a session check with something other than 200. */\nexport class SessionCheckFailed extends Error {\n\tconstructor(\n\t\treadonly authenticator: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`'${authenticator}' answered a session check with ${status}. ` +\n\t\t\t\t`A request with no session gets 200 and null; this is the server ` +\n\t\t\t\t`failing — check that it is running and reachable at its URL.`,\n\t\t);\n\t\tthis.name = 'SessionCheckFailed';\n\t}\n}\n\n/**\n * Better Auth's DDL, safe to run where its tables already exist.\n *\n * Its SQL is Kysely's, so its shape is known: `create table \"…\"`, `create index\n * \"…\"`, `alter table \"…\" add column \"…\"`. A database that has been running\n * already has those — Better Auth used to create them at runtime — and the\n * first committed migration would fail on them rather than recording that they\n * are there.\n */\nexport function idempotent(statements: string): string {\n\treturn statements\n\t\t.replace(/\\bcreate table \"/gi, 'create table if not exists \"')\n\t\t.replace(\n\t\t\t/\\bcreate (unique )?index \"/gi,\n\t\t\t(_, unique = '') => `create ${unique}index if not exists \"`,\n\t\t)\n\t\t.replace(/\\badd column \"/gi, 'add column if not exists \"');\n}\n"],"mappings":";;;;;AA+HA,MAAM,oBAAoB;AAE1B,IAAa,aAAb,MAKA;CAmBmB;CAlBlB;CACA;CACA;;;;;CAMA;CAQA,YACC,IACA,QACC;EADgB,KAAA,SAAA;EAEjB,MAAM,aAAA,GAAYA,oBAAAA,YAAAA,CAAY,EAAY;EAE1C,KAAK,KAAK;EACV,KAAK,WAAW,OAAO,YAAY;EAInC,MAAM,WAAW,G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C,CAAC,OAAO,CAAC,CAAC,SAAS;EAC7D,EAAE,CAAC,CACF,MAAM;EAMR,MAAM,SAAS,KAAK,OAAO;EAK3B,MAAM,KAAM,OAFG,GAAG,SAAS,OAAO,QAAQ,OAAO,QAAQ,OAAO,QAAA,CAEvC,SAAS,OAAO;EAIzC,MAAM,aAAa,MAAM,KAAK,WAAW,OAAO;EAEhD,OAAO;GACN,GAAG;GACH;GACA,SAAS;GACT,UAAU,KAAK;GACf,UAAU;IAAE;IAAI,MAAM;GAAW;GAGjC,gBAAgB,CACf,GAAG,gBACH,GAAI,WAAW,kBACf,MAAM,QAAQ,WAAW,cAAc,IACpC,WAAW,iBACX,CAAC,CACL;GACA,UAAU;IACT,GAAG,WAAW;IAKd,GAAI,eACD,EACA,uBAAuB;KACtB,SAAS;KACT,QAAQ;KACR,GAAG,WAAW,UAAU;IACzB,EACD,IACC,CAAC;GACL;EACD;CACD;AACD;;AAGA,IAAa,qBAAb,cAAwC,MAAM;CAEnC;CACA;CAFV,YACC,eACA,QACC;EACD,MACC,IAAI,cAAc,kCAAkC,OAAO,+HAG5D;EAPS,KAAA,gBAAA;EACA,KAAA,SAAA;EAOT,KAAK,OAAO;CACb;AACD;;;;;;;;;;AAWA,SAAgB,WAAW,YAA4B;CACtD,OAAO,WACL,QAAQ,sBAAsB,+BAA8B,CAAC,CAC7D,QACA,iCACC,GAAG,SAAS,OAAO,UAAU,OAAO,sBACtC,CAAC,CACA,QAAQ,oBAAoB,6BAA4B;AAC3D"}
1
+ {"version":3,"file":"auth.cjs","names":["canonicalId","environmentCase","provideKey","serviceKey","edgeTo","betterAuth","isWebOrigin"],"sources":["../src/auth.ts"],"sourcesContent":["/**\n * `BetterAuth` — a declared auth server.\n *\n * It is three things at once, which is what makes it the construct that\n * exercises most of the model: a consumer of a database, a producer of an\n * authorizer, and a set of endpoints. This lands the first two.\n *\n * Its tables live in a schema tenant it is *given* — `orders.schema('AuthDb')`\n * — rather than one it invents. The tenant declares the schema and the role;\n * this declares the one thing left, the signing secret, and reads back the keys\n * it needs.\n *\n * :::caution\n * The isolation that arrangement is *for* — the application's own role holding\n * no grant on these tables, so a compromised handler cannot read sessions — does\n * **not hold yet**. No target creates the per-schema role: both connect as the\n * database owner, so today the tenant is a `search_path`, which is a namespace\n * and not a privilege boundary. See \"Roles are declared and never created\" in\n * `docs/design/constructs-outstanding.md`.\n * :::\n *\n * It declares its own surface, so where it answers, who may call it, and the\n * domain its cookies are scoped to all arrive as environment resolved by the\n * target — none of them guessed from a port, and none of them listed by hand in\n * application config.\n */\n\nimport type { EnvironmentParser } from '@geekmidas/envkit';\nimport {\n\ttype ConstructName,\n\tcanonicalId,\n\ttype Declaration,\n\tenvironmentCase,\n\tisWebOrigin,\n\tprovideKey,\n\tserviceKey,\n} from '@geekmidas/manifest';\nimport type {\n\tService,\n\tServiceRecord,\n\tServiceRegisterOptions,\n} from '@geekmidas/services';\nimport { betterAuth } from 'better-auth';\nimport type { Hono } from 'hono';\nimport type { Kysely } from 'kysely';\nimport {\n\ttype Authenticator,\n\ttype Construct,\n\ttype Consumable,\n\tedgeTo,\n\ttype ServicesOf,\n} from './construct-interface';\n\n/** The server better-auth hands back. */\nexport type AuthServer = ReturnType<typeof betterAuth>;\n\n/** A signed-in session as better-auth hands it back: `{ user, session }`. */\nexport type AuthSession = AuthServer['$Infer']['Session'];\n\n/** Everything better-auth takes, minus what the construct owns. */\nexport type BetterAuthOptions = Omit<\n\tParameters<typeof betterAuth>[0],\n\t'database' | 'secret' | 'basePath' | 'baseURL'\n>;\n\n/**\n * What an `options` callback is handed: the options this construct was\n * registered with, and a client for each construct its `dependsOn` names —\n * keyed by service name, exactly as an endpoint's handler receives them.\n */\nexport type BetterAuthOptionsContext<TUses extends readonly Consumable[]> =\n\tServiceRegisterOptions & {\n\t\tservices: ServiceRecord<[...ServicesOf<TUses>]>;\n\t};\n\nexport interface BetterAuthConfig<\n\tTDatabase extends Consumable,\n\tTUses extends readonly Consumable[] = readonly [],\n> {\n\t/**\n\t * The schema tenant its tables live in.\n\t *\n\t * A construct rather than a URL: the tenant already declares its schema and\n\t * its role, and taking the declaration is what puts the edge in the graph\n\t * instead of a connection string in two places.\n\t */\n\tdatabase: TDatabase;\n\t/**\n\t * The app that serves this auth server, relative to the workspace root —\n\t * `'apps/auth'`.\n\t *\n\t * Required, for the reason `RestApi.path` is. Not to be confused with\n\t * `basePath`, which is where its routes are mounted in a URL.\n\t */\n\tpath: string;\n\t/**\n\t * Where the auth routes are mounted, e.g. `/api/auth`.\n\t *\n\t * Structural — it is part of the URL every client calls, so it cannot differ\n\t * between stages the way the host can.\n\t */\n\tbasePath?: string;\n\t/**\n\t * The constructs `options` uses — the mailer a magic link goes through,\n\t * most often.\n\t *\n\t * One list, two jobs, the way an endpoint's `.dependsOn()` has: each is an\n\t * edge on the server's handler, so whatever is composed from the edges (a\n\t * container's environment, a deploy's grants) includes it; and each is\n\t * handed to `options` as a client in `services`, so there is no other way\n\t * for `options` to reach it — nothing to import and register by hand, and\n\t * so nothing that can be used without being declared.\n\t */\n\tdependsOn?: TUses;\n\t/**\n\t * The rest of better-auth's options: providers, plugins, email settings.\n\t *\n\t * A function when they need another construct — a magic-link plugin has to\n\t * *send* the link. It is handed the options this construct was registered\n\t * with, and `services`: a client for each construct in `dependsOn`.\n\t */\n\toptions?:\n\t\t| BetterAuthOptions\n\t\t| ((\n\t\t\t\tcontext: BetterAuthOptionsContext<TUses>,\n\t\t ) => BetterAuthOptions | Promise<BetterAuthOptions>);\n}\n\nconst DEFAULT_BASE_PATH = '/api/auth';\n\nexport class BetterAuth<\n\tTName extends string = string,\n\tTDatabase extends Consumable = Consumable,\n\tconst TUses extends readonly Consumable[] = readonly [],\n> implements Construct<TName, AuthServer>, Authenticator<AuthSession>\n{\n\treadonly id: TName;\n\treadonly service: Service<Uncapitalize<TName>, AuthServer>;\n\treadonly basePath: string;\n\n\t/**\n\t * Declared once and read by both `declare()` and `connect()`, so the keys the\n\t * target publishes and the keys the server reads cannot drift.\n\t */\n\tprivate readonly keys: {\n\t\tsecretId: string;\n\t\tsecret: string;\n\t\turl: string;\n\t\ttrustedOrigins: string;\n\t\tcookieDomain: string;\n\t};\n\n\tconstructor(\n\t\tid: ConstructName<TName>,\n\t\tprivate readonly config: BetterAuthConfig<TDatabase, TUses>,\n\t) {\n\t\tconst canonical = canonicalId(id as string);\n\n\t\tthis.id = canonical as TName;\n\t\tthis.basePath = config.basePath ?? DEFAULT_BASE_PATH;\n\n\t\t// A secret's name is its key: `Auth` signs with `AUTH_SECRET`, which is\n\t\t// also what better-auth's own tooling looks for.\n\t\tconst secretId = `${canonical}Secret`;\n\t\tthis.keys = {\n\t\t\tsecretId,\n\t\t\tsecret: environmentCase(secretId),\n\t\t\turl: provideKey(canonical, 'url'),\n\t\t\ttrustedOrigins: provideKey(canonical, 'trustedOrigins'),\n\t\t\tcookieDomain: provideKey(canonical, 'cookieDomain'),\n\t\t};\n\n\t\t// A field, not a getter: consumers cache services by object identity.\n\t\tthis.service = {\n\t\t\tserviceName: serviceKey(canonical) as Uncapitalize<TName>,\n\t\t\tregister: (options) => this.connect(options),\n\t\t};\n\t}\n\n\t/**\n\t * A signing secret and a surface.\n\t *\n\t * The database is *not* declared here — the tenant that was passed in\n\t * declares it, and declaring it twice is the duplication the whole model\n\t * removes. What is declared is what this construct owns: the key it signs\n\t * with, and the routes it answers on.\n\t *\n\t * One endpoint, wildcarded. Better Auth routes internally and the set of\n\t * paths depends on which capabilities are enabled, so enumerating them here\n\t * would be a copy of its router that goes stale on its next release. The\n\t * surface's job is to send everything under `basePath` to one handler, which\n\t * is exactly what the declaration says.\n\t */\n\tdeclare(): Declaration[] {\n\t\treturn [\n\t\t\t{\n\t\t\t\tkind: 'secret',\n\t\t\t\tid: this.keys.secretId,\n\t\t\t\tprovides: [this.keys.secret],\n\t\t\t},\n\t\t\t{\n\t\t\t\tkind: 'rest-api',\n\t\t\t\tid: this.id,\n\t\t\t\tpath: this.config.path,\n\t\t\t\tprovides: [\n\t\t\t\t\tthis.keys.url,\n\t\t\t\t\tthis.keys.trustedOrigins,\n\t\t\t\t\tthis.keys.cookieDomain,\n\t\t\t\t],\n\t\t\t\tendpoints: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: `${this.id}Handler`,\n\t\t\t\t\t\thandler: `${this.id}.handler`,\n\t\t\t\t\t\tmethod: 'ANY',\n\t\t\t\t\t\tpath: `${this.basePath}/*`,\n\t\t\t\t\t\t// Read off the tenant rather than written down: this\n\t\t\t\t\t\t// construct takes whatever database it is given, and a\n\t\t\t\t\t\t// hardcoded kind is a second statement of a fact the\n\t\t\t\t\t\t// tenant already makes.\n\t\t\t\t\t\tdependencies: [\n\t\t\t\t\t\t\tedgeTo(this.config.database),\n\t\t\t\t\t\t\t...(this.config.dependsOn ?? []).map(edgeTo),\n\t\t\t\t\t\t],\n\t\t\t\t\t\trequires: [this.keys.secret],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t];\n\t}\n\n\t/**\n\t * Whose request this is: the session for these headers, or `null`.\n\t *\n\t * Asked of the auth server over HTTP, at the URL the `.auth()` edge injects —\n\t * so it is the same call whether the server runs in this process, beside\n\t * it, or behind MSW in a test. Only the session headers are forwarded; the\n\t * surface decides which.\n\t */\n\tasync verify(\n\t\theaders: Headers,\n\t\tenvParser: EnvironmentParser<{}>,\n\t): Promise<AuthSession | null> {\n\t\tconst { url } = envParser\n\t\t\t.create((get) => ({ url: get(this.keys.url).string() }))\n\t\t\t.parse();\n\n\t\tconst response = await fetch(`${url}${this.basePath}/get-session`, {\n\t\t\theaders,\n\t\t});\n\n\t\t// Better Auth answers `null` for a request with no session. Anything\n\t\t// other than a 200 is the server failing, which is not the same thing as\n\t\t// \"signed out\" and must not be read as it.\n\t\tif (!response.ok) {\n\t\t\tthrow new SessionCheckFailed(this.id, response.status);\n\t\t}\n\n\t\treturn (await response.json()) as AuthSession | null;\n\t}\n\n\t/**\n\t * The tenant this server keeps its tables in — whose migrations folder,\n\t * `db/<tenant>/`, Better Auth's schema is written into.\n\t */\n\tget databaseId(): string {\n\t\treturn this.config.database.id;\n\t}\n\n\t/**\n\t * The SQL that brings the tenant up to Better Auth's schema, or `undefined`\n\t * when it already matches.\n\t *\n\t * What `gkm migration` writes as the tenant's next migration, so Better\n\t * Auth's tables are committed, reviewed and applied like any other — rather\n\t * than diffed against the database at runtime, where a change nobody wrote\n\t * down happens on whichever machine migrates first.\n\t *\n\t * Compared as the owner, against the tenant `gkm migrate` has already brought\n\t * up to date: what comes back is only what the committed files are missing.\n\t */\n\tasync pendingMigration(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<string | undefined> {\n\t\t// The options, not a server built from them: better-auth checks its\n\t\t// schema when a server starts, and before the migration that creates the\n\t\t// tables it can only report them missing.\n\t\tconst resolved = await this.optionsFor(options, { owner: true });\n\t\tconst db = (resolved.database as { db: Kysely<Record<string, never>> }).db;\n\n\t\ttry {\n\t\t\t// better-auth 1.7 split the migration builder out of `better-auth/db`\n\t\t\t// into its own entry, so importing it no longer drags the whole db\n\t\t\t// layer in behind it.\n\t\t\tconst { getMigrations } = await import('better-auth/db/migration');\n\t\t\tconst { toBeCreated, toBeAdded, toBeAddedIndexes, compileMigrations } =\n\t\t\t\tawait getMigrations(resolved);\n\n\t\t\tif (\n\t\t\t\ttoBeCreated.length === 0 &&\n\t\t\t\ttoBeAdded.length === 0 &&\n\t\t\t\ttoBeAddedIndexes.length === 0\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn idempotent(await compileMigrations());\n\t\t} finally {\n\t\t\t// Its own pool: left open, it keeps the process that asked alive.\n\t\t\tawait db.destroy();\n\t\t}\n\t}\n\n\t/**\n\t * The server this surface runs as, built from its own declaration.\n\t *\n\t * A surface is a deploy unit, so something has to serve it, and the thing\n\t * that knows how is the construct — not a generator writing a mount into\n\t * somebody else's entry point. That is how the auth server came to be\n\t * mounted by a hook in the application it was supposed to be separate from,\n\t * and then to be served by nothing at all when the hook was deleted.\n\t *\n\t * The routes come from {@link declare}: one wildcard under `basePath`, read\n\t * off the same declaration the manifest carries, so the surface the graph\n\t * describes and the surface that answers requests cannot disagree.\n\t *\n\t * ```ts\n\t * // .gkm/server/app.ts — the whole generated entry\n\t * import { auth } from '@acme/constructs/auth.js';\n\t * export const { app } = await auth.server({ envParser });\n\t * ```\n\t */\n\tasync server(options: ServiceRegisterOptions): Promise<{ app: Hono }> {\n\t\tconst { Hono } = await import('hono');\n\t\tconst { cors } = await import('hono/cors');\n\t\tconst app = new Hono();\n\t\tconst server = await this.connect(options);\n\n\t\t// Who may call this surface, read off the graph. The same list Better\n\t\t// Auth checks for CSRF — it arrives as `<ID>_TRUSTED_ORIGINS`, composed\n\t\t// by the target from whatever declared an edge to this construct, so a\n\t\t// site that depends on the auth server is allowed to reach it and\n\t\t// nothing else is. Nobody writes an origin down.\n\t\tconst { origins } = options.envParser\n\t\t\t.create((get) => ({\n\t\t\t\torigins: get(this.keys.trustedOrigins)\n\t\t\t\t\t.string()\n\t\t\t\t\t.default('')\n\t\t\t\t\t.transform((value: string) =>\n\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t\t.map((origin) => origin.trim())\n\t\t\t\t\t\t\t.filter(Boolean),\n\t\t\t\t\t),\n\t\t\t}))\n\t\t\t.parse();\n\n\t\tapp.use('*', cors({ origin: origins, credentials: true, maxAge: 3600 }));\n\n\t\t// Read off the declaration rather than restated here. `ANY` is every\n\t\t// method Better Auth routes internally, which is the reason the\n\t\t// declaration wildcards rather than enumerating.\n\t\tconst [surface] = this.declare().filter(\n\t\t\t(d): d is Extract<Declaration, { kind: 'rest-api' }> =>\n\t\t\t\td.kind === 'rest-api',\n\t\t);\n\n\t\tfor (const endpoint of surface?.endpoints ?? []) {\n\t\t\tconst methods =\n\t\t\t\tendpoint.method === 'ANY'\n\t\t\t\t\t? (['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'] as const)\n\t\t\t\t\t: ([endpoint.method] as const);\n\n\t\t\tapp.on([...methods], endpoint.path, (c) => server.handler(c.req.raw));\n\t\t}\n\n\t\treturn { app };\n\t}\n\n\t/**\n\t * The ids of the better-auth plugins this server runs — what a client has\n\t * to pair its own plugins with (`magic-link` with `magicLinkClient`).\n\t * Resolved the way the server resolves them, options callback included.\n\t */\n\tasync pluginIds(options: ServiceRegisterOptions): Promise<string[]> {\n\t\tconst { plugins = [] } = await this.configured(options);\n\t\treturn plugins.map(({ id }) => id);\n\t}\n\n\t/** Better-auth's options as given — a value, or a callback of the environment. */\n\tprivate async configured(\n\t\toptions: ServiceRegisterOptions,\n\t): Promise<BetterAuthOptions> {\n\t\t// Hoisted: narrowing a property of `this` is not preserved across the\n\t\t// await, and the false branch is the plain-object form.\n\t\tconst configure = this.config.options;\n\t\tif (typeof configure !== 'function') return configure ?? {};\n\n\t\t// A client for each declared construct, from the options this call was\n\t\t// given — not the process-wide discovery, which keeps whichever env\n\t\t// parser reached it first.\n\t\tconst services: Record<string, unknown> = {};\n\t\tfor (const construct of this.config.dependsOn ?? []) {\n\t\t\tservices[construct.service.serviceName] =\n\t\t\t\tawait construct.service.register(options);\n\t\t}\n\n\t\treturn configure({\n\t\t\t...options,\n\t\t\tservices,\n\t\t} as BetterAuthOptionsContext<TUses>);\n\t}\n\n\tprivate async connect(\n\t\toptions: ServiceRegisterOptions,\n\t\tas: { owner?: boolean } = {},\n\t): Promise<AuthServer> {\n\t\t// `Auth<O>` is invariant in its options in better-auth 1.7, so the value\n\t\t// built from a concrete literal is not assignable to the `AuthServer`\n\t\t// alias, which names the constraint. The runtime object is the same one\n\t\t// either way; the assertion keeps the variance where it happens instead\n\t\t// of spreading a generic through the construct's public type.\n\t\treturn betterAuth(await this.optionsFor(options, as)) as AuthServer;\n\t}\n\n\t/**\n\t * Everything better-auth is given: the app's options, and what the construct\n\t * owns — its secret, its URL, its tenant's connection, the origins and cookie\n\t * domain its graph derives. One place, so the server and its migrations are\n\t * built from the same options.\n\t */\n\tprivate async optionsFor(\n\t\toptions: ServiceRegisterOptions,\n\t\tas: { owner?: boolean } = {},\n\t): Promise<Parameters<typeof betterAuth>[0]> {\n\t\tconst { secret, baseUrl, trustedOrigins, cookieDomain, deviceUrl } =\n\t\t\toptions.envParser\n\t\t\t\t.create((get) => ({\n\t\t\t\t\tsecret: get(this.keys.secret).string(),\n\t\t\t\t\t// The surface's own URL, resolved by the target — not guessed from\n\t\t\t\t\t// a port, which was wrong the moment the server moved to 3001.\n\t\t\t\t\tbaseUrl: get(this.keys.url).string(),\n\t\t\t\t\t// Better Auth's CSRF check applies to every caller, not just\n\t\t\t\t\t// browsers, so an API calling the auth server is rejected unless\n\t\t\t\t\t// its origin is trusted. The list is derived from the graph and\n\t\t\t\t\t// arrives as one comma-separated value, for the same reason every\n\t\t\t\t\t// other derived value arrives as a string: it crosses a process\n\t\t\t\t\t// boundary as env.\n\t\t\t\t\ttrustedOrigins: get(this.keys.trustedOrigins)\n\t\t\t\t\t\t.string()\n\t\t\t\t\t\t.default('')\n\t\t\t\t\t\t.transform((value) =>\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t.split(',')\n\t\t\t\t\t\t\t\t.map((origin) => origin.trim())\n\t\t\t\t\t\t\t\t.filter(Boolean),\n\t\t\t\t\t\t),\n\t\t\t\t\t// The domain a session cookie has to carry to be readable by a\n\t\t\t\t\t// frontend on a sibling host. Optional because there is often\n\t\t\t\t\t// nothing to widen to: locally everything shares `localhost`,\n\t\t\t\t\t// where cookies ignore the port and a `Domain` would only be a\n\t\t\t\t\t// value the browser refuses.\n\t\t\t\t\tcookieDomain: get(this.keys.cookieDomain).string().optional(),\n\t\t\t\t\t// Where a phone reaches this server, on a local stage with a mobile\n\t\t\t\t\t// app: its own port on the LAN address. Never deployed.\n\t\t\t\t\tdeviceUrl: get(provideKey(this.id, 'deviceUrl')).string().optional(),\n\t\t\t\t}))\n\t\t\t\t.parse();\n\n\t\t// The tenant's own client: one construct, one connection, so what auth\n\t\t// writes and what the browser inspects cannot be two different databases.\n\t\t// A migration asks the tenant for its owner connection, which the tenant\n\t\t// exposes as a `Service` and not as anything `.dependsOn()` would take.\n\t\tconst tenant = this.config.database as Consumable & {\n\t\t\towner?: Service<string, unknown>;\n\t\t};\n\t\tconst source = as.owner && tenant.owner ? tenant.owner : tenant.service;\n\n\t\tconst db = (await source.register(options)) as Kysely<\n\t\t\tRecord<string, never>\n\t\t>;\n\n\t\tconst configured = await this.configured(options);\n\n\t\t// Whatever the app added wins over the derived list rather than\n\t\t// replacing it: an origin nobody declared is still sometimes real.\n\t\tconst origins = [\n\t\t\t...trustedOrigins,\n\t\t\t...(configured.trustedOrigins && Array.isArray(configured.trustedOrigins)\n\t\t\t\t? configured.trustedOrigins\n\t\t\t\t: []),\n\t\t];\n\n\t\tconst plugins = [...(configured.plugins ?? [])];\n\t\t// A mobile app depends on this server: its scheme is among the origins.\n\t\t// Better Auth's Expo plugin is what lets it sign in — the app sends its\n\t\t// scheme as the origin, and the plugin is what reads it — so it is added\n\t\t// here rather than written into every app that has one.\n\t\tif (\n\t\t\torigins.some((origin) => !isWebOrigin(origin)) &&\n\t\t\t!plugins.some((plugin) => plugin.id === 'expo')\n\t\t) {\n\t\t\tplugins.push(await expoPlugin(this.id));\n\t\t}\n\t\t// A sign-in link the app asked for is opened on the phone, which cannot\n\t\t// resolve this server's local hostname; on a local stage it is built on\n\t\t// the address the phone reaches it on instead.\n\t\tif (deviceUrl) {\n\t\t\tfor (const plugin of plugins) reachableFromDevice(plugin, deviceUrl);\n\t\t}\n\n\t\treturn {\n\t\t\t...configured,\n\t\t\tsecret,\n\t\t\tbaseURL: baseUrl,\n\t\t\tbasePath: this.basePath,\n\t\t\tdatabase: { db, type: 'postgres' },\n\t\t\tplugins,\n\t\t\ttrustedOrigins: origins,\n\t\t\tadvanced: {\n\t\t\t\t...configured.advanced,\n\t\t\t\t// Only when a domain was derived. Better Auth reads the presence\n\t\t\t\t// of this block as intent, so enabling it with no domain would\n\t\t\t\t// widen the cookie to whatever host happened to set it — and the\n\t\t\t\t// case with nothing to widen to is the common one, not an error.\n\t\t\t\t...(cookieDomain\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcrossSubDomainCookies: {\n\t\t\t\t\t\t\t\tenabled: true,\n\t\t\t\t\t\t\t\tdomain: cookieDomain,\n\t\t\t\t\t\t\t\t...configured.advanced?.crossSubDomainCookies,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t},\n\t\t};\n\t}\n}\n\n/** Better Auth's Expo plugin, which a mobile app's sign-in needs. */\nasync function expoPlugin(\n\tserver: string,\n): Promise<NonNullable<BetterAuthOptions['plugins']>[number]> {\n\ttry {\n\t\tconst { expo } = (await import('@better-auth/expo')) as {\n\t\t\texpo: () => NonNullable<BetterAuthOptions['plugins']>[number];\n\t\t};\n\t\treturn expo();\n\t} catch (error) {\n\t\tthrow new ExpoPluginMissing(server, error);\n\t}\n}\n\n/** Links already rewritten — an `options` object is reused across builds. */\nconst rewritten = new WeakSet<object>();\n\n/**\n * Build the magic links an app asked for on the address a phone reaches.\n *\n * An app's link carries its scheme as the `callbackURL` (`shop-dev://…`)\n * where a browser's carries a path or an `http(s)` URL — which is how the two\n * are told apart. A browser's link is left alone: it is opened on this\n * machine, where the server's own hostname resolves.\n *\n * Better Auth's magic-link plugin calls `sendMagicLink` through the options\n * object it returns, so wrapping it there is wrapping the call.\n */\nfunction reachableFromDevice(plugin: { id: string }, deviceUrl: string): void {\n\tif (plugin.id !== 'magic-link') return;\n\tconst options = (plugin as { options?: MagicLinkOptions }).options;\n\tif (!options?.sendMagicLink || rewritten.has(options)) return;\n\trewritten.add(options);\n\n\tconst send = options.sendMagicLink;\n\toptions.sendMagicLink = (data, ...rest) =>\n\t\tsend({ ...data, url: deviceLink(data.url, deviceUrl) }, ...rest);\n}\n\ninterface MagicLinkOptions {\n\tsendMagicLink?: (\n\t\tdata: { email: string; url: string; token: string },\n\t\t...rest: unknown[]\n\t) => unknown;\n}\n\n/** A magic link moved to the device address when an app is its destination. */\nexport function deviceLink(url: string, deviceUrl: string): string {\n\ttry {\n\t\tconst link = new URL(url);\n\t\tconst callback = link.searchParams.get('callbackURL') ?? '/';\n\t\tif (callback.startsWith('/') || isWebOrigin(callback)) return url;\n\t\treturn new URL(`${link.pathname}${link.search}`, deviceUrl).toString();\n\t} catch {\n\t\treturn url;\n\t}\n}\n\n/** A mobile app depends on this auth server, and `@better-auth/expo` is absent. */\nexport class ExpoPluginMissing extends Error {\n\tconstructor(\n\t\treadonly server: string,\n\t\toverride readonly cause: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`'${server}' is called by a mobile app, and a mobile app signs in through ` +\n\t\t\t\t`Better Auth's Expo plugin — install it where the auth server runs: ` +\n\t\t\t\t`pnpm add @better-auth/expo`,\n\t\t);\n\t\tthis.name = 'ExpoPluginMissing';\n\t}\n}\n\n/** The auth server answered a session check with something other than 200. */\nexport class SessionCheckFailed extends Error {\n\tconstructor(\n\t\treadonly authenticator: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`'${authenticator}' answered a session check with ${status}. ` +\n\t\t\t\t`A request with no session gets 200 and null; this is the server ` +\n\t\t\t\t`failing — check that it is running and reachable at its URL.`,\n\t\t);\n\t\tthis.name = 'SessionCheckFailed';\n\t}\n}\n\n/**\n * Better Auth's DDL, safe to run where its tables already exist.\n *\n * Its SQL is Kysely's, so its shape is known: `create table \"…\"`, `create index\n * \"…\"`, `alter table \"…\" add column \"…\"`. A database that has been running\n * already has those — Better Auth used to create them at runtime — and the\n * first committed migration would fail on them rather than recording that they\n * are there.\n */\nexport function idempotent(statements: string): string {\n\treturn statements\n\t\t.replace(/\\bcreate table \"/gi, 'create table if not exists \"')\n\t\t.replace(\n\t\t\t/\\bcreate (unique )?index \"/gi,\n\t\t\t(_, unique = '') => `create ${unique}index if not exists \"`,\n\t\t)\n\t\t.replace(/\\badd column \"/gi, 'add column if not exists \"');\n}\n"],"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A,SAAgB,WAAW,YAA4B;CACtD,OAAO,WACL,QAAQ,sBAAsB,+BAA8B,CAAC,CAC7D,QACA,iCACC,GAAG,SAAS,OAAO,UAAU,OAAO,sBACtC,CAAC,CACA,QAAQ,oBAAoB,6BAA4B;AAC3D"}
package/dist/auth.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as BetterAuthOptions, c as idempotent, i as BetterAuthConfig, n as AuthSession, o as BetterAuthOptionsContext, r as BetterAuth, s as SessionCheckFailed, t as AuthServer } from "./auth-Bmo1wSQF.cjs";
2
- export { AuthServer, AuthSession, BetterAuth, BetterAuthConfig, BetterAuthOptions, BetterAuthOptionsContext, SessionCheckFailed, idempotent };
1
+ import { a as BetterAuthOptions, c as SessionCheckFailed, i as BetterAuthConfig, l as deviceLink, n as AuthSession, o as BetterAuthOptionsContext, r as BetterAuth, s as ExpoPluginMissing, t as AuthServer, u as idempotent } from "./auth-DYfF6Vfp.cjs";
2
+ export { AuthServer, AuthSession, BetterAuth, BetterAuthConfig, BetterAuthOptions, BetterAuthOptionsContext, ExpoPluginMissing, SessionCheckFailed, deviceLink, idempotent };
package/dist/auth.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as BetterAuthOptions, c as idempotent, i as BetterAuthConfig, n as AuthSession, o as BetterAuthOptionsContext, r as BetterAuth, s as SessionCheckFailed, t as AuthServer } from "./auth-CJ5dp7T7.mjs";
2
- export { AuthServer, AuthSession, BetterAuth, BetterAuthConfig, BetterAuthOptions, BetterAuthOptionsContext, SessionCheckFailed, idempotent };
1
+ import { a as BetterAuthOptions, c as SessionCheckFailed, i as BetterAuthConfig, l as deviceLink, n as AuthSession, o as BetterAuthOptionsContext, r as BetterAuth, s as ExpoPluginMissing, t as AuthServer, u as idempotent } from "./auth-BVkkvI6F.mjs";
2
+ export { AuthServer, AuthSession, BetterAuth, BetterAuthConfig, BetterAuthOptions, BetterAuthOptionsContext, ExpoPluginMissing, SessionCheckFailed, deviceLink, idempotent };