@geekmidas/constructs 1.1.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{HonoEndpointAdaptor-DuVb-H5h.d.mts → HonoEndpointAdaptor-C3AdQ0xS.d.mts} +3 -3
  3. package/dist/{HonoEndpointAdaptor-BuyXynoH.d.cts.map → HonoEndpointAdaptor-C3AdQ0xS.d.mts.map} +1 -1
  4. package/dist/{HonoEndpointAdaptor-BuyXynoH.d.cts → HonoEndpointAdaptor-vI3LPiyu.d.cts} +3 -3
  5. package/dist/{HonoEndpointAdaptor-DuVb-H5h.d.mts.map → HonoEndpointAdaptor-vI3LPiyu.d.cts.map} +1 -1
  6. package/dist/adaptors/aws.d.cts +1 -1
  7. package/dist/adaptors/hono.d.cts +2 -2
  8. package/dist/adaptors/hono.d.mts +1 -1
  9. package/dist/adaptors/testing.d.cts +1 -1
  10. package/dist/crons/Cron.d.cts +1 -1
  11. package/dist/crons/CronBuilder.d.cts +1 -1
  12. package/dist/crons/index.d.cts +5 -5
  13. package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +1 -1
  14. package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +1 -1
  15. package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +1 -1
  16. package/dist/endpoints/Endpoint.d.cts +1 -1
  17. package/dist/endpoints/EndpointBuilder.d.cts +1 -1
  18. package/dist/endpoints/EndpointFactory.d.cts +1 -1
  19. package/dist/endpoints/HonoEndpointAdaptor.d.cts +2 -2
  20. package/dist/endpoints/HonoEndpointAdaptor.d.mts +1 -1
  21. package/dist/endpoints/TestEndpointAdaptor.d.cts +1 -1
  22. package/dist/endpoints/audit.d.cts +1 -1
  23. package/dist/endpoints/helpers.d.cts +1 -1
  24. package/dist/endpoints/index.d.cts +3 -3
  25. package/dist/endpoints/index.d.mts +2 -2
  26. package/dist/endpoints/lazyAccessors.d.cts +1 -1
  27. package/dist/endpoints/processAudits.d.cts +1 -1
  28. package/dist/endpoints/rls.d.cts +1 -1
  29. package/dist/functions/index.d.cts +1 -1
  30. package/dist/index-BnoOaBQV.d.cts +12 -0
  31. package/dist/{index-0bHR_AbP.d.cts.map → index-BnoOaBQV.d.cts.map} +1 -1
  32. package/dist/subscribers/index.d.cts +2 -2
  33. package/dist/subscribers/index.d.cts.map +1 -1
  34. package/dist/subscribers/index.d.mts +2 -2
  35. package/dist/subscribers/index.d.mts.map +1 -1
  36. package/package.json +13 -13
  37. package/src/endpoints/__tests__/HonoEndpointAdaptor.pgboss-publisher.spec.ts +273 -0
  38. package/dist/index-0bHR_AbP.d.cts +0 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @geekmidas/constructs
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`be4f7a9`](https://github.com/geekmidas/toolbox/commit/be4f7a9bd5de7f08adbca582916d6902e0c24de2)]:
8
+ - @geekmidas/cache@1.1.0
9
+ - @geekmidas/audit@2.0.0
10
+ - @geekmidas/rate-limit@2.0.0
11
+
12
+ ## 2.0.0
13
+
14
+ ### Patch Changes
15
+
16
+ - ✨ [`83a24de`](https://github.com/geekmidas/toolbox/commit/83a24de902b3fadd98444cab552ecd84f32b6661) Thanks [@geekmidas](https://github.com/geekmidas)! - Add pg-boss event publisher/subscriber, CLI setup and upgrade commands, and secrets sync via AWS SSM
17
+ - ✨ **@geekmidas/events**: Add pg-boss backend for event publishing and subscribing with connection string support
18
+ - ✨ **@geekmidas/cli**: Add `gkm setup` command for dev environment initialization, `gkm upgrade` command with workspace detection, and secrets push/pull via AWS SSM Parameter Store
19
+ - 🐛 **@geekmidas/testkit**: Fix database creation race condition in PostgresMigrator
20
+ - ✨ **@geekmidas/constructs**: Add integration tests for pg-boss with HonoEndpoint
21
+
22
+ - Updated dependencies [[`83a24de`](https://github.com/geekmidas/toolbox/commit/83a24de902b3fadd98444cab552ecd84f32b6661)]:
23
+ - @geekmidas/events@1.1.0
24
+
3
25
  ## 1.1.1
4
26
 
5
27
  ### Patch Changes
@@ -7,7 +7,7 @@ import { EnvironmentParser } from "@geekmidas/envkit";
7
7
  import { EventPublisher } from "@geekmidas/events";
8
8
  import { Logger } from "@geekmidas/logger";
9
9
  import { StandardSchemaV1 } from "@standard-schema/spec";
10
- import * as hono_types9 from "hono/types";
10
+ import * as hono_types6 from "hono/types";
11
11
 
12
12
  //#region src/endpoints/HonoEndpointAdaptor.d.ts
13
13
  interface HonoEndpointOptions {
@@ -38,7 +38,7 @@ declare class HonoEndpoint<TRoute extends string, TMethod extends HttpMethod, TI
38
38
  * This method is kept for backward compatibility but does nothing.
39
39
  */
40
40
  static applyEventMiddleware(_app: Hono, _serviceDiscovery: ServiceDiscovery<any>): void;
41
- static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<hono_types9.BlankEnv, hono_types9.BlankSchema, "/"> | undefined, _logger: TLogger, cwd?: string, options?: HonoEndpointOptions): Promise<Hono>;
41
+ static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/"> | undefined, _logger: TLogger, cwd?: string, options?: HonoEndpointOptions): Promise<Hono>;
42
42
  static addRoutes<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>>, app: Hono, options?: HonoEndpointOptions): void;
43
43
  static addRoute<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>>, app: Hono): void;
44
44
  static addDocsRoute<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], app: Hono, docsPath: string, openApiOptions?: HonoEndpointOptions['openApiOptions']): void;
@@ -47,4 +47,4 @@ declare class HonoEndpoint<TRoute extends string, TMethod extends HttpMethod, TI
47
47
 
48
48
  //#endregion
49
49
  export { HonoEndpoint, HonoEndpointOptions };
50
- //# sourceMappingURL=HonoEndpointAdaptor-DuVb-H5h.d.mts.map
50
+ //# sourceMappingURL=HonoEndpointAdaptor-C3AdQ0xS.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HonoEndpointAdaptor-BuyXynoH.d.cts","names":[],"sources":["../src/endpoints/HonoEndpointAdaptor.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;UAqCiB,mBAAA;;;AAAjB;AAqEA;;EAAyB,QAER,CAAA,EAAA,MAAA,GAAA,KAAA;EAAU;;;EAGD,cACT,CAAA,EAAA;IAAS,KAAA,CAAA,EAAA,MAAA;IAED,OAAA,CAAA,EAAA,MAAA;IAEF,WAAA,CAAA,EAAA,MAAA;EAAY,CAAA;;AAWhC,cArBU,YAqBV,CAAA,eAAA,MAAA,EAAA,gBAnBc,UAmBd,EAAA,eAlBa,eAkBb,GAAA,CAAA,CAAA,EAAA,mBAjBiB,gBAiBjB,GAAA,SAAA,GAAA,SAAA,EAAA,kBAhBgB,OAgBhB,EAAA,GAAA,EAAA,EAAA,gBAfc,MAed,GAfuB,MAevB,EAAA,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B,OA9J0B,EA+J1B,MA/J0B,EAgK1B,UAhK0B,EAiK1B,SAjK0B,EAkK1B,OAlK0B,EAmK1B,QAnK0B,EAoK1B,eApK0B,EAqK1B,0BArK0B,EAsK1B,aAtK0B,EAuK1B,wBAvK0B,EAwK1B,YAxK0B,EAyK1B,SAzK0B,EA0K1B,oBA1K0B,CAAA,EAAA,gBAAA,EA4KT,gBA5KS,CA4KQ,aA5KR,CA4KsB,SA5KtB,CAAA,CAAA,EAAA,GAAA,EA6KtB,IA7KsB,CAAA,EAAA,IAAA;EAAQ,OAoBJ,YAAA,CAAA,kBA0db,OA1da,EAAA,GAAA,EAAA,EAAA,gBA2df,MA3de,GA2dN,MA3dM,CAAA,CAAA,SAAA,EA6dpB,QA7doB,CAAA,MAAA,EA6dH,UA7dG,EAAA,GAAA,EAAA,GAAA,EA6dmB,SA7dnB,EA6d8B,OA7d9B,CAAA,EAAA,EAAA,GAAA,EA8d1B,IA9d0B,EAAA,QAAA,EAAA,MAAA,EAAA,cAAA,CAAA,EAged,mBAhec,CAAA,gBAAA,CAAA,CAAA,EAAA,IAAA"}
@@ -6,7 +6,7 @@ import { Logger } from "@geekmidas/logger";
6
6
  import { Service, ServiceDiscovery, ServiceRecord } from "@geekmidas/services";
7
7
  import { StandardSchemaV1 } from "@standard-schema/spec";
8
8
  import { EnvironmentParser } from "@geekmidas/envkit";
9
- import * as hono_types9 from "hono/types";
9
+ import * as hono_types3 from "hono/types";
10
10
  import { Context, Hono } from "hono";
11
11
 
12
12
  //#region src/endpoints/HonoEndpointAdaptor.d.ts
@@ -38,7 +38,7 @@ declare class HonoEndpoint<TRoute extends string, TMethod extends HttpMethod, TI
38
38
  * This method is kept for backward compatibility but does nothing.
39
39
  */
40
40
  static applyEventMiddleware(_app: Hono, _serviceDiscovery: ServiceDiscovery<any>): void;
41
- static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<hono_types9.BlankEnv, hono_types9.BlankSchema, "/"> | undefined, _logger: TLogger, cwd?: string, options?: HonoEndpointOptions): Promise<Hono>;
41
+ static fromRoutes<TLogger extends Logger, TServices extends Service[]>(routes: string[], envParser: EnvironmentParser<{}>, app: Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/"> | undefined, _logger: TLogger, cwd?: string, options?: HonoEndpointOptions): Promise<Hono>;
42
42
  static addRoutes<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>>, app: Hono, options?: HonoEndpointOptions): void;
43
43
  static addRoute<TRoute extends string, TMethod extends HttpMethod, TInput extends EndpointSchemas = {}, TOutSchema extends StandardSchemaV1 | undefined = undefined, TServices extends Service[] = [], TLogger extends Logger = Logger, TSession = unknown, TEventPublisher extends EventPublisher<any> | undefined = undefined, TEventPublisherServiceName extends string = string, TAuditStorage extends AuditStorage | undefined = undefined, TAuditStorageServiceName extends string = string, TAuditAction extends AuditableAction<string, unknown> = AuditableAction<string, unknown>, TDatabase = undefined, TDatabaseServiceName extends string = string>(endpoint: Endpoint<TRoute, TMethod, TInput, TOutSchema, TServices, TLogger, TSession, TEventPublisher, TEventPublisherServiceName, TAuditStorage, TAuditStorageServiceName, TAuditAction, TDatabase, TDatabaseServiceName>, serviceDiscovery: ServiceDiscovery<ServiceRecord<TServices>>, app: Hono): void;
44
44
  static addDocsRoute<TServices extends Service[] = [], TLogger extends Logger = Logger>(endpoints: Endpoint<string, HttpMethod, any, any, TServices, TLogger>[], app: Hono, docsPath: string, openApiOptions?: HonoEndpointOptions['openApiOptions']): void;
@@ -47,4 +47,4 @@ declare class HonoEndpoint<TRoute extends string, TMethod extends HttpMethod, TI
47
47
 
48
48
  //#endregion
49
49
  export { HonoEndpoint, HonoEndpointOptions };
50
- //# sourceMappingURL=HonoEndpointAdaptor-BuyXynoH.d.cts.map
50
+ //# sourceMappingURL=HonoEndpointAdaptor-vI3LPiyu.d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BAAA,CAAA,CAAA,EAAA,IAAA"}
@@ -4,7 +4,7 @@ import "../telemetry-BTaiRqPo.cjs";
4
4
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
5
5
  import "../Function-CwlB89lS.cjs";
6
6
  import "../FunctionBuilder-D_7f5MfS.cjs";
7
- import "../index-0bHR_AbP.cjs";
7
+ import "../index-BnoOaBQV.cjs";
8
8
  import "../Authorizer-DWtwC8we.cjs";
9
9
  import "../Endpoint-C9N6CmvB.cjs";
10
10
  import "../AmazonApiGatewayEndpointAdaptor-Bxvs-F0F.cjs";
@@ -3,8 +3,8 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
- import { HonoEndpoint } from "../HonoEndpointAdaptor-BuyXynoH.cjs";
9
+ import { HonoEndpoint } from "../HonoEndpointAdaptor-vI3LPiyu.cjs";
10
10
  export { HonoEndpoint };
@@ -6,5 +6,5 @@ import "../FunctionBuilder-m5BNA2Ap.mjs";
6
6
  import "../index-DQo_Csy7.mjs";
7
7
  import "../Authorizer-DBsrDTuf.mjs";
8
8
  import "../Endpoint-BiPM0glm.mjs";
9
- import { HonoEndpoint } from "../HonoEndpointAdaptor-DuVb-H5h.mjs";
9
+ import { HonoEndpoint } from "../HonoEndpointAdaptor-C3AdQ0xS.mjs";
10
10
  export { HonoEndpoint };
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import "../Subscriber-1rDE7HuM.cjs";
@@ -2,6 +2,6 @@ import "../Construct-CX7HyFfT.cjs";
2
2
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
3
3
  import "../Function-CwlB89lS.cjs";
4
4
  import "../FunctionBuilder-D_7f5MfS.cjs";
5
- import "../index-0bHR_AbP.cjs";
5
+ import "../index-BnoOaBQV.cjs";
6
6
  import { Cron, CronExpression, RateExpression, ScheduleExpression } from "../Cron-BDxW6fYg.cjs";
7
7
  export { Cron, CronExpression, RateExpression, ScheduleExpression };
@@ -2,7 +2,7 @@ import "../Construct-CX7HyFfT.cjs";
2
2
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
3
3
  import "../Function-CwlB89lS.cjs";
4
4
  import "../FunctionBuilder-D_7f5MfS.cjs";
5
- import "../index-0bHR_AbP.cjs";
5
+ import "../index-BnoOaBQV.cjs";
6
6
  import "../Cron-BDxW6fYg.cjs";
7
7
  import { CronBuilder } from "../CronBuilder-CginrW3H.cjs";
8
8
  export { CronBuilder };
@@ -2,15 +2,15 @@ import "../Construct-CX7HyFfT.cjs";
2
2
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
3
3
  import "../Function-CwlB89lS.cjs";
4
4
  import "../FunctionBuilder-D_7f5MfS.cjs";
5
- import "../index-0bHR_AbP.cjs";
5
+ import "../index-BnoOaBQV.cjs";
6
6
  import { Cron, CronExpression, RateExpression, ScheduleExpression } from "../Cron-BDxW6fYg.cjs";
7
7
  import { CronBuilder } from "../CronBuilder-CginrW3H.cjs";
8
- import * as _geekmidas_logger5 from "@geekmidas/logger";
9
- import * as _geekmidas_services4 from "@geekmidas/services";
10
- import * as _geekmidas_schema3 from "@geekmidas/schema";
8
+ import * as _geekmidas_logger2 from "@geekmidas/logger";
9
+ import * as _geekmidas_services1 from "@geekmidas/services";
10
+ import * as _geekmidas_schema0 from "@geekmidas/schema";
11
11
 
12
12
  //#region src/crons/index.d.ts
13
- declare const c: CronBuilder<_geekmidas_schema3.ComposableStandardSchema, _geekmidas_services4.Service<string, unknown>[], _geekmidas_logger5.Logger, undefined, undefined, string, undefined, string>;
13
+ declare const c: CronBuilder<_geekmidas_schema0.ComposableStandardSchema, _geekmidas_services1.Service<string, unknown>[], _geekmidas_logger2.Logger, undefined, undefined, string, undefined, string>;
14
14
  //# sourceMappingURL=index.d.ts.map
15
15
 
16
16
  //#endregion
@@ -4,7 +4,7 @@ import "../telemetry-BTaiRqPo.cjs";
4
4
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
5
5
  import "../Function-CwlB89lS.cjs";
6
6
  import "../FunctionBuilder-D_7f5MfS.cjs";
7
- import "../index-0bHR_AbP.cjs";
7
+ import "../index-BnoOaBQV.cjs";
8
8
  import "../Authorizer-DWtwC8we.cjs";
9
9
  import "../Endpoint-C9N6CmvB.cjs";
10
10
  import { AmazonApiGatewayEndpoint, AmazonApiGatewayEndpointHandlerResponse, AmazonApiGatewayEndpointOptions, AmazonApiGatewayV1EndpointHandler, AmazonApiGatewayV2EndpointHandler, Event, GetInputResponse, HandlerEvent, LoggerContext, TelescopeIntegration } from "../AmazonApiGatewayEndpointAdaptor-Bxvs-F0F.cjs";
@@ -4,7 +4,7 @@ import "../telemetry-BTaiRqPo.cjs";
4
4
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
5
5
  import "../Function-CwlB89lS.cjs";
6
6
  import "../FunctionBuilder-D_7f5MfS.cjs";
7
- import "../index-0bHR_AbP.cjs";
7
+ import "../index-BnoOaBQV.cjs";
8
8
  import "../Authorizer-DWtwC8we.cjs";
9
9
  import "../Endpoint-C9N6CmvB.cjs";
10
10
  import "../AmazonApiGatewayEndpointAdaptor-Bxvs-F0F.cjs";
@@ -4,7 +4,7 @@ import "../telemetry-BTaiRqPo.cjs";
4
4
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
5
5
  import "../Function-CwlB89lS.cjs";
6
6
  import "../FunctionBuilder-D_7f5MfS.cjs";
7
- import "../index-0bHR_AbP.cjs";
7
+ import "../index-BnoOaBQV.cjs";
8
8
  import "../Authorizer-DWtwC8we.cjs";
9
9
  import "../Endpoint-C9N6CmvB.cjs";
10
10
  import { AmazonApiGatewayEndpointOptions } from "../AmazonApiGatewayEndpointAdaptor-Bxvs-F0F.cjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { AuthorizeContext, AuthorizeFn, ConvertRouteParams, CookieFn, CookieOptions, Endpoint, EndpointContext, EndpointEvent, EndpointHandler, EndpointHeaders, EndpointInput, EndpointOpenApiSchema, EndpointOptions, EndpointOutput, EndpointSchemas, HeaderFn, MultiHeaderFn, ResponseBuilder, ResponseMetadata, ResponseWithMetadata, SessionContext, SessionFn, SingleHeaderFn, SuccessStatus } from "../Endpoint-C9N6CmvB.cjs";
9
9
  export { AuthorizeContext, AuthorizeFn, ConvertRouteParams, CookieFn, CookieOptions, Endpoint, EndpointContext, EndpointEvent, EndpointHandler, EndpointHeaders, EndpointInput, EndpointOpenApiSchema, EndpointOptions, EndpointOutput, EndpointSchemas, HeaderFn, MultiHeaderFn, ResponseBuilder, ResponseMetadata, ResponseWithMetadata, SessionContext, SessionFn, SingleHeaderFn, SuccessStatus };
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import { EndpointBuilder } from "../EndpointBuilder-Bel6RS7W.cjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import { SecurityScheme } from "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import "../EndpointBuilder-Bel6RS7W.cjs";
@@ -3,8 +3,8 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
- import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-BuyXynoH.cjs";
9
+ import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-vI3LPiyu.cjs";
10
10
  export { HonoEndpoint, HonoEndpointOptions };
@@ -6,5 +6,5 @@ import "../FunctionBuilder-m5BNA2Ap.mjs";
6
6
  import "../index-DQo_Csy7.mjs";
7
7
  import "../Authorizer-DBsrDTuf.mjs";
8
8
  import "../Endpoint-BiPM0glm.mjs";
9
- import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-DuVb-H5h.mjs";
9
+ import { HonoEndpoint, HonoEndpointOptions } from "../HonoEndpointAdaptor-C3AdQ0xS.mjs";
10
10
  export { HonoEndpoint, HonoEndpointOptions };
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import { TestEndpointAdaptor, TestHttpResponse, TestRequestAdaptor } from "../TestEndpointAdaptor-CCf3Dg0u.cjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { ActorExtractor, EndpointAuditorConfig, MappedAudit } from "../Endpoint-C9N6CmvB.cjs";
9
9
  export { ActorExtractor, EndpointAuditorConfig, MappedAudit };
@@ -3,7 +3,7 @@ import { HttpMethod } from "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { Endpoint } from "../Endpoint-C9N6CmvB.cjs";
9
9
  import { Service } from "@geekmidas/services";
@@ -3,17 +3,17 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import { Authorizer, BUILT_IN_SECURITY_SCHEMES, BuiltInSecuritySchemeId, OAuthFlow, OAuthFlows, SecurityScheme, createAuthorizer, getSecurityScheme, isBuiltInSecurityScheme } from "../Authorizer-DWtwC8we.cjs";
8
8
  import { ActorExtractor, Endpoint, EndpointContext, EndpointHandler, EndpointOutput, EndpointSchemas, MappedAudit, RLS_BYPASS, ResponseBuilder, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor } from "../Endpoint-C9N6CmvB.cjs";
9
9
  import { EndpointBuilder } from "../EndpointBuilder-Bel6RS7W.cjs";
10
10
  import { EndpointFactory } from "../EndpointFactory-CXvakOkn.cjs";
11
11
  import { publishConstructEvents } from "../publisher-BrzPGnm4.cjs";
12
12
  import { createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders } from "../lazyAccessors-DdZaA716.cjs";
13
- import * as _geekmidas_logger6 from "@geekmidas/logger";
13
+ import * as _geekmidas_logger8 from "@geekmidas/logger";
14
14
 
15
15
  //#region src/endpoints/index.d.ts
16
- declare const e: EndpointFactory<[], "", _geekmidas_logger6.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
16
+ declare const e: EndpointFactory<[], "", _geekmidas_logger8.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
17
17
  //# sourceMappingURL=index.d.ts.map
18
18
 
19
19
  //#endregion
@@ -10,10 +10,10 @@ import { EndpointBuilder } from "../EndpointBuilder-B0Aj5jbB.mjs";
10
10
  import { EndpointFactory } from "../EndpointFactory-CWIeWCRG.mjs";
11
11
  import { publishConstructEvents } from "../publisher-CP4gpv-4.mjs";
12
12
  import { createApiGatewayCookies, createApiGatewayHeaders, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders } from "../lazyAccessors-DXkJpnyX.mjs";
13
- import * as _geekmidas_logger6 from "@geekmidas/logger";
13
+ import * as _geekmidas_logger8 from "@geekmidas/logger";
14
14
 
15
15
  //#region src/endpoints/index.d.ts
16
- declare const e: EndpointFactory<[], "", _geekmidas_logger6.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
16
+ declare const e: EndpointFactory<[], "", _geekmidas_logger8.Logger, unknown, undefined, string, readonly string[], undefined, string, never, undefined, string, Record<string, SecurityScheme>, undefined>;
17
17
  //# sourceMappingURL=index.d.ts.map
18
18
 
19
19
  //#endregion
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import "../Endpoint-C9N6CmvB.cjs";
9
9
  import { createApiGatewayCookies, createApiGatewayHeaders, createCookieHeaderAccessor, createHonoCookies, createHonoHeaders, createNoopCookies, createNoopHeaders, createObjectHeaders } from "../lazyAccessors-DdZaA716.cjs";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { CookieFn, Endpoint, HeaderFn } from "../Endpoint-C9N6CmvB.cjs";
9
9
  import { AuditStorage, AuditableAction, Auditor } from "@geekmidas/audit";
@@ -3,7 +3,7 @@ import "../types-B5H3piDg.cjs";
3
3
  import "../BaseFunctionBuilder-C-4hYTfj.cjs";
4
4
  import "../Function-CwlB89lS.cjs";
5
5
  import "../FunctionBuilder-D_7f5MfS.cjs";
6
- import "../index-0bHR_AbP.cjs";
6
+ import "../index-BnoOaBQV.cjs";
7
7
  import "../Authorizer-DWtwC8we.cjs";
8
8
  import { RLS_BYPASS, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor } from "../Endpoint-C9N6CmvB.cjs";
9
9
  export { RLS_BYPASS, RlsBypass, RlsConfig, RlsContext, RlsContextExtractor };
@@ -2,5 +2,5 @@ import "../Construct-CX7HyFfT.cjs";
2
2
  import { BaseFunctionBuilder } from "../BaseFunctionBuilder-C-4hYTfj.cjs";
3
3
  import { Function, FunctionContext, FunctionHandler } from "../Function-CwlB89lS.cjs";
4
4
  import { FunctionBuilder } from "../FunctionBuilder-D_7f5MfS.cjs";
5
- import { f } from "../index-0bHR_AbP.cjs";
5
+ import { f } from "../index-BnoOaBQV.cjs";
6
6
  export { BaseFunctionBuilder, Function, FunctionBuilder, FunctionContext, FunctionHandler, f };
@@ -0,0 +1,12 @@
1
+ import { FunctionBuilder } from "./FunctionBuilder-D_7f5MfS.cjs";
2
+ import * as _geekmidas_audit7 from "@geekmidas/audit";
3
+ import * as _geekmidas_logger6 from "@geekmidas/logger";
4
+ import * as _geekmidas_schema5 from "@geekmidas/schema";
5
+
6
+ //#region src/functions/index.d.ts
7
+ declare const f: FunctionBuilder<_geekmidas_schema5.ComposableStandardSchema, undefined, [], _geekmidas_logger6.Logger, undefined, string, undefined, string, undefined, string, _geekmidas_audit7.AuditableAction<string, unknown>>;
8
+ //# sourceMappingURL=index.d.ts.map
9
+
10
+ //#endregion
11
+ export { f };
12
+ //# sourceMappingURL=index-BnoOaBQV.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-0bHR_AbP.d.cts","names":[],"sources":["../src/functions/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAWa,GAAC,gBAAwB,kBAAA,CAAxB,wBAAA,iBAAA,kBAAA,CAAA,MAAA,2DAAA,iBAAA,CAAA"}
1
+ {"version":3,"file":"index-BnoOaBQV.d.cts","names":[],"sources":["../src/functions/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAWa,GAAC,gBAAwB,kBAAA,CAAxB,wBAAA,iBAAA,kBAAA,CAAA,MAAA,2DAAA,iBAAA,CAAA"}
@@ -1,10 +1,10 @@
1
1
  import "../Construct-CX7HyFfT.cjs";
2
2
  import { Subscriber } from "../Subscriber-1rDE7HuM.cjs";
3
3
  import { SubscriberBuilder } from "../SubscriberBuilder-B9uva8fZ.cjs";
4
- import * as _geekmidas_logger8 from "@geekmidas/logger";
4
+ import * as _geekmidas_logger10 from "@geekmidas/logger";
5
5
 
6
6
  //#region src/subscribers/index.d.ts
7
- declare const s: SubscriberBuilder<[], _geekmidas_logger8.Logger, undefined, undefined, string, []>;
7
+ declare const s: SubscriberBuilder<[], _geekmidas_logger10.Logger, undefined, undefined, string, []>;
8
8
  //# sourceMappingURL=index.d.ts.map
9
9
 
10
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,kBAAA,CAA1B,MAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,mBAAA,CAA1B,MAAA"}
@@ -1,10 +1,10 @@
1
1
  import "../Construct-C2SyofdS.mjs";
2
2
  import { Subscriber } from "../Subscriber-BgB3RRxb.mjs";
3
3
  import { SubscriberBuilder } from "../SubscriberBuilder-DaQkh2Nt.mjs";
4
- import * as _geekmidas_logger8 from "@geekmidas/logger";
4
+ import * as _geekmidas_logger10 from "@geekmidas/logger";
5
5
 
6
6
  //#region src/subscribers/index.d.ts
7
- declare const s: SubscriberBuilder<[], _geekmidas_logger8.Logger, undefined, undefined, string, []>;
7
+ declare const s: SubscriberBuilder<[], _geekmidas_logger10.Logger, undefined, undefined, string, []>;
8
8
  //# sourceMappingURL=index.d.ts.map
9
9
 
10
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,kBAAA,CAA1B,MAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,mBAAA,CAA1B,MAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/constructs",
3
- "version": "1.1.1",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -78,32 +78,32 @@
78
78
  "kysely": "~0.28.8",
79
79
  "pg": "~8.16.3",
80
80
  "zod": "~4.1.13",
81
- "@geekmidas/cache": "^1.0.0",
82
- "@geekmidas/audit": "^1.0.0",
81
+ "@geekmidas/audit": "^2.0.0",
82
+ "@geekmidas/cache": "^1.1.0",
83
83
  "@geekmidas/db": "^1.0.0",
84
84
  "@geekmidas/envkit": "^1.0.3",
85
85
  "@geekmidas/errors": "^1.0.0",
86
- "@geekmidas/events": "^1.0.0",
87
- "@geekmidas/rate-limit": "^1.0.0",
86
+ "@geekmidas/events": "^1.1.0",
88
87
  "@geekmidas/logger": "^1.0.0",
88
+ "@geekmidas/rate-limit": "^2.0.0",
89
+ "@geekmidas/schema": "^1.0.0",
89
90
  "@geekmidas/services": "^1.0.1",
90
- "@geekmidas/testkit": "^1.0.1",
91
- "@geekmidas/schema": "^1.0.0"
91
+ "@geekmidas/testkit": "^1.0.2"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "@middy/core": ">=6.3.1",
95
95
  "@types/aws-lambda": ">=8.10.92",
96
96
  "hono": ">=4.8.2",
97
- "@geekmidas/cache": "^1.0.0",
98
- "@geekmidas/audit": "^1.0.0",
97
+ "@geekmidas/audit": "^2.0.0",
98
+ "@geekmidas/cache": "^1.1.0",
99
99
  "@geekmidas/db": "^1.0.0",
100
100
  "@geekmidas/envkit": "^1.0.3",
101
- "@geekmidas/rate-limit": "^1.0.0",
102
101
  "@geekmidas/errors": "^1.0.0",
103
- "@geekmidas/events": "^1.0.0",
102
+ "@geekmidas/events": "^1.1.0",
103
+ "@geekmidas/logger": "^1.0.0",
104
+ "@geekmidas/rate-limit": "^2.0.0",
104
105
  "@geekmidas/schema": "^1.0.0",
105
- "@geekmidas/services": "^1.0.1",
106
- "@geekmidas/logger": "^1.0.0"
106
+ "@geekmidas/services": "^1.0.1"
107
107
  },
108
108
  "peerDependenciesMeta": {
109
109
  "@geekmidas/audit": {
@@ -0,0 +1,273 @@
1
+ import { EnvironmentParser } from '@geekmidas/envkit';
2
+ import type { EventPublisher, PublishableMessage } from '@geekmidas/events';
3
+ import {
4
+ PgBossConnection,
5
+ PgBossPublisher,
6
+ PgBossSubscriber,
7
+ } from '@geekmidas/events/pgboss';
8
+ import type { Service } from '@geekmidas/services';
9
+ import { ServiceDiscovery } from '@geekmidas/services';
10
+ import { Hono } from 'hono';
11
+ import { afterAll, beforeAll, describe, expect, it } from 'vitest';
12
+ import { z } from 'zod';
13
+ import { e } from '../EndpointFactory';
14
+ import { HonoEndpoint } from '../HonoEndpointAdaptor';
15
+
16
+ type OrderEvent =
17
+ | PublishableMessage<'order.created', { orderId: string; total: number }>
18
+ | PublishableMessage<'notification.sent', { orderId: string; type: string }>;
19
+
20
+ const POSTGRES_URL = 'postgres://geekmidas:geekmidas@localhost:5432/geekmidas';
21
+
22
+ const uniqueQueue = () =>
23
+ `test-${Date.now()}-${Math.random().toString(36).substring(7)}`;
24
+
25
+ describe('HonoEndpoint with PgBoss Publisher', () => {
26
+ let connection: PgBossConnection;
27
+ let envParser: EnvironmentParser<{}>;
28
+
29
+ beforeAll(async () => {
30
+ connection = new PgBossConnection({
31
+ connectionString: POSTGRES_URL,
32
+ schema: 'pgboss_hono_publisher_test',
33
+ });
34
+ await connection.connect();
35
+ envParser = new EnvironmentParser({});
36
+ });
37
+
38
+ afterAll(async () => {
39
+ await connection.close();
40
+ });
41
+
42
+ it('should publish events to pg-boss after successful endpoint execution', async () => {
43
+ const eventType = uniqueQueue();
44
+ const received: any[] = [];
45
+
46
+ const publisher = new PgBossPublisher<OrderEvent>(connection);
47
+
48
+ const PgBossPublisherService: Service<
49
+ 'eventPublisher',
50
+ EventPublisher<OrderEvent>
51
+ > = {
52
+ serviceName: 'eventPublisher' as const,
53
+ register: () => publisher,
54
+ };
55
+
56
+ const outputSchema = z.object({
57
+ orderId: z.string(),
58
+ total: z.number(),
59
+ });
60
+
61
+ const endpoint = e
62
+ .publisher(PgBossPublisherService)
63
+ .post('/orders')
64
+ .output(outputSchema)
65
+ .event({
66
+ type: eventType as any,
67
+ payload: (response) => ({
68
+ orderId: response.orderId,
69
+ total: response.total,
70
+ }),
71
+ })
72
+ .handle(async () => ({
73
+ orderId: 'order-42',
74
+ total: 99.99,
75
+ }));
76
+
77
+ const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
78
+ const app = new Hono();
79
+ HonoEndpoint.applyEventMiddleware(app, serviceDiscovery);
80
+
81
+ const adaptor = new HonoEndpoint(endpoint);
82
+ adaptor.addRoute(serviceDiscovery, app);
83
+
84
+ // Subscribe to events via pg-boss before making the request
85
+ const subscriber = new PgBossSubscriber<OrderEvent>(connection, {
86
+ pollingIntervalSeconds: 1,
87
+ });
88
+ await subscriber.subscribe([eventType as any], async (event) => {
89
+ received.push(event);
90
+ });
91
+
92
+ // Fire the endpoint
93
+ const response = await app.request('/orders', {
94
+ method: 'POST',
95
+ body: JSON.stringify({}),
96
+ headers: { 'Content-Type': 'application/json' },
97
+ });
98
+
99
+ expect(response.status).toBe(200);
100
+ expect(await response.json()).toEqual({
101
+ orderId: 'order-42',
102
+ total: 99.99,
103
+ });
104
+
105
+ // Wait for pg-boss to poll and deliver the event
106
+ await new Promise((resolve) => setTimeout(resolve, 3000));
107
+
108
+ expect(received.length).toBe(1);
109
+ expect(received[0]).toEqual({
110
+ type: eventType,
111
+ payload: { orderId: 'order-42', total: 99.99 },
112
+ });
113
+ });
114
+
115
+ it('should publish multiple events and respect when conditions', async () => {
116
+ const createdType = uniqueQueue();
117
+ const notificationType = uniqueQueue();
118
+ const received: any[] = [];
119
+
120
+ const publisher = new PgBossPublisher<OrderEvent>(connection);
121
+
122
+ const PgBossPublisherService: Service<
123
+ 'eventPublisher',
124
+ EventPublisher<OrderEvent>
125
+ > = {
126
+ serviceName: 'eventPublisher' as const,
127
+ register: () => publisher,
128
+ };
129
+
130
+ const outputSchema = z.object({
131
+ orderId: z.string(),
132
+ total: z.number(),
133
+ isHighValue: z.boolean(),
134
+ });
135
+
136
+ const endpoint = e
137
+ .publisher(PgBossPublisherService)
138
+ .post('/orders')
139
+ .output(outputSchema)
140
+ .event({
141
+ type: createdType as any,
142
+ payload: (response) => ({
143
+ orderId: response.orderId,
144
+ total: response.total,
145
+ }),
146
+ })
147
+ .event({
148
+ type: notificationType as any,
149
+ payload: (response) => ({
150
+ orderId: response.orderId,
151
+ type: 'high-value-alert',
152
+ }),
153
+ when: (response) => response.isHighValue === true,
154
+ })
155
+ .handle(async () => ({
156
+ orderId: 'order-99',
157
+ total: 5000,
158
+ isHighValue: true,
159
+ }));
160
+
161
+ const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
162
+ const app = new Hono();
163
+ HonoEndpoint.applyEventMiddleware(app, serviceDiscovery);
164
+
165
+ const adaptor = new HonoEndpoint(endpoint);
166
+ adaptor.addRoute(serviceDiscovery, app);
167
+
168
+ // Subscribe to both event types
169
+ const subscriber = new PgBossSubscriber<OrderEvent>(connection, {
170
+ pollingIntervalSeconds: 1,
171
+ });
172
+ await subscriber.subscribe(
173
+ [createdType as any, notificationType as any],
174
+ async (event) => {
175
+ received.push(event);
176
+ },
177
+ );
178
+
179
+ // Fire the endpoint
180
+ const response = await app.request('/orders', {
181
+ method: 'POST',
182
+ body: JSON.stringify({}),
183
+ headers: { 'Content-Type': 'application/json' },
184
+ });
185
+
186
+ expect(response.status).toBe(200);
187
+
188
+ // Wait for pg-boss to poll and deliver events
189
+ await new Promise((resolve) => setTimeout(resolve, 3000));
190
+
191
+ expect(received.length).toBe(2);
192
+ expect(received).toEqual(
193
+ expect.arrayContaining([
194
+ {
195
+ type: createdType,
196
+ payload: { orderId: 'order-99', total: 5000 },
197
+ },
198
+ {
199
+ type: notificationType,
200
+ payload: { orderId: 'order-99', type: 'high-value-alert' },
201
+ },
202
+ ]),
203
+ );
204
+ });
205
+
206
+ it('should not publish events when when condition is false', async () => {
207
+ const eventType = uniqueQueue();
208
+ const received: any[] = [];
209
+
210
+ const publisher = new PgBossPublisher<OrderEvent>(connection);
211
+
212
+ const PgBossPublisherService: Service<
213
+ 'eventPublisher',
214
+ EventPublisher<OrderEvent>
215
+ > = {
216
+ serviceName: 'eventPublisher' as const,
217
+ register: () => publisher,
218
+ };
219
+
220
+ const outputSchema = z.object({
221
+ orderId: z.string(),
222
+ total: z.number(),
223
+ isHighValue: z.boolean(),
224
+ });
225
+
226
+ const endpoint = e
227
+ .publisher(PgBossPublisherService)
228
+ .post('/orders')
229
+ .output(outputSchema)
230
+ .event({
231
+ type: eventType as any,
232
+ payload: (response) => ({
233
+ orderId: response.orderId,
234
+ type: 'high-value-alert',
235
+ }),
236
+ when: (response) => response.isHighValue === true,
237
+ })
238
+ .handle(async () => ({
239
+ orderId: 'order-small',
240
+ total: 5,
241
+ isHighValue: false,
242
+ }));
243
+
244
+ const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
245
+ const app = new Hono();
246
+ HonoEndpoint.applyEventMiddleware(app, serviceDiscovery);
247
+
248
+ const adaptor = new HonoEndpoint(endpoint);
249
+ adaptor.addRoute(serviceDiscovery, app);
250
+
251
+ // Subscribe
252
+ const subscriber = new PgBossSubscriber<OrderEvent>(connection, {
253
+ pollingIntervalSeconds: 1,
254
+ });
255
+ await subscriber.subscribe([eventType as any], async (event) => {
256
+ received.push(event);
257
+ });
258
+
259
+ // Fire the endpoint
260
+ const response = await app.request('/orders', {
261
+ method: 'POST',
262
+ body: JSON.stringify({}),
263
+ headers: { 'Content-Type': 'application/json' },
264
+ });
265
+
266
+ expect(response.status).toBe(200);
267
+
268
+ // Wait to confirm no events arrive
269
+ await new Promise((resolve) => setTimeout(resolve, 3000));
270
+
271
+ expect(received.length).toBe(0);
272
+ });
273
+ });
@@ -1,12 +0,0 @@
1
- import { FunctionBuilder } from "./FunctionBuilder-D_7f5MfS.cjs";
2
- import * as _geekmidas_audit2 from "@geekmidas/audit";
3
- import * as _geekmidas_logger1 from "@geekmidas/logger";
4
- import * as _geekmidas_schema0 from "@geekmidas/schema";
5
-
6
- //#region src/functions/index.d.ts
7
- declare const f: FunctionBuilder<_geekmidas_schema0.ComposableStandardSchema, undefined, [], _geekmidas_logger1.Logger, undefined, string, undefined, string, undefined, string, _geekmidas_audit2.AuditableAction<string, unknown>>;
8
- //# sourceMappingURL=index.d.ts.map
9
-
10
- //#endregion
11
- export { f };
12
- //# sourceMappingURL=index-0bHR_AbP.d.cts.map