inviton-backduck 1.0.0 → 1.0.2

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 (42) hide show
  1. package/README.md +1 -5
  2. package/dist/exceptions/badRequestException.d.ts +9 -0
  3. package/dist/exceptions/badRequestException.d.ts.map +1 -0
  4. package/dist/exceptions/badRequestException.js +9 -0
  5. package/dist/exceptions/badRequestException.js.map +1 -0
  6. package/dist/exceptions/exceptionWithHttpCode.d.ts +7 -0
  7. package/dist/exceptions/exceptionWithHttpCode.d.ts.map +1 -0
  8. package/dist/exceptions/exceptionWithHttpCode.js +2 -0
  9. package/dist/exceptions/exceptionWithHttpCode.js.map +1 -0
  10. package/dist/exceptions/index.d.ts +7 -0
  11. package/dist/exceptions/index.d.ts.map +1 -0
  12. package/dist/exceptions/index.js +6 -0
  13. package/dist/exceptions/index.js.map +1 -0
  14. package/dist/exceptions/notFoundException.d.ts +9 -0
  15. package/dist/exceptions/notFoundException.d.ts.map +1 -0
  16. package/dist/exceptions/notFoundException.js +9 -0
  17. package/dist/exceptions/notFoundException.js.map +1 -0
  18. package/dist/exceptions/notImplementedException.d.ts +4 -0
  19. package/dist/exceptions/notImplementedException.d.ts.map +1 -0
  20. package/dist/exceptions/notImplementedException.js +8 -0
  21. package/dist/exceptions/notImplementedException.js.map +1 -0
  22. package/dist/exceptions/unauthorizedException.d.ts +9 -0
  23. package/dist/exceptions/unauthorizedException.d.ts.map +1 -0
  24. package/dist/exceptions/unauthorizedException.js +9 -0
  25. package/dist/exceptions/unauthorizedException.js.map +1 -0
  26. package/dist/exceptions/workflowInterceptionException.d.ts +19 -0
  27. package/dist/exceptions/workflowInterceptionException.d.ts.map +1 -0
  28. package/dist/exceptions/workflowInterceptionException.js +11 -0
  29. package/dist/exceptions/workflowInterceptionException.js.map +1 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +2 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/interception/index.d.ts +3 -0
  35. package/dist/interception/index.d.ts.map +1 -0
  36. package/dist/interception/index.js +2 -0
  37. package/dist/interception/index.js.map +1 -0
  38. package/dist/interception/workflowInteceptionHandler.interface.d.ts +43 -0
  39. package/dist/interception/workflowInteceptionHandler.interface.d.ts.map +1 -0
  40. package/dist/interception/workflowInteceptionHandler.interface.js +2 -0
  41. package/dist/interception/workflowInteceptionHandler.interface.js.map +1 -0
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @inviton/backduck
1
+ # inviton-backduck
2
2
 
3
3
  Runtime-agnostic utilities for building web servers with Express and Bun support.
4
4
 
@@ -296,7 +296,3 @@ MIT
296
296
  ## Author
297
297
 
298
298
  Inviton
299
-
300
- ## Repository
301
-
302
- https://github.com/inviton/backduck
@@ -0,0 +1,9 @@
1
+ import { IExceptionWithHttpCode } from "./exceptionWithHttpCode";
2
+ interface IBadRequestException extends IExceptionWithHttpCode {
3
+ name: string;
4
+ }
5
+ export default class BadRequestException extends Error implements IBadRequestException {
6
+ constructor(messageLocalized?: string);
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=badRequestException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badRequestException.d.ts","sourceRoot":"","sources":["../../src/exceptions/badRequestException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,UAAU,oBAAqB,SAAQ,sBAAsB;IAC5D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,KAAM,YAAW,oBAAoB;gBACzE,gBAAgB,CAAC,EAAE,MAAM;CAMrC"}
@@ -0,0 +1,9 @@
1
+ export default class BadRequestException extends Error {
2
+ constructor(messageLocalized) {
3
+ super(messageLocalized || 'Bad request');
4
+ this.name = 'BadRequestException'; // Important for identifying error type
5
+ this.httpCode = 400;
6
+ Object.setPrototypeOf(this, new.target.prototype); // Fix prototype chain
7
+ }
8
+ }
9
+ //# sourceMappingURL=badRequestException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badRequestException.js","sourceRoot":"","sources":["../../src/exceptions/badRequestException.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,KAAK;IACrD,YAAY,gBAAyB;QACpC,KAAK,CAAC,gBAAgB,IAAI,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC,CAAC,uCAAuC;QACzE,IAA6B,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,sBAAsB;IAC1E,CAAC;CACD"}
@@ -0,0 +1,7 @@
1
+ export interface IExceptionWithHttpCode {
2
+ /**
3
+ * HTTP status code associated with the exception.
4
+ */
5
+ httpCode?: number;
6
+ }
7
+ //# sourceMappingURL=exceptionWithHttpCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptionWithHttpCode.d.ts","sourceRoot":"","sources":["../../src/exceptions/exceptionWithHttpCode.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=exceptionWithHttpCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptionWithHttpCode.js","sourceRoot":"","sources":["../../src/exceptions/exceptionWithHttpCode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export { default as BadRequestException } from './badRequestException';
2
+ export type { IExceptionWithHttpCode } from './exceptionWithHttpCode';
3
+ export { default as NotFoundException } from './notFoundException';
4
+ export { default as NotImplementedException } from './notImplementedException';
5
+ export { default as UnauthorizedException } from './unauthorizedException';
6
+ export { default as WorkflowInterceptionException } from './workflowInterceptionException';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { default as BadRequestException } from './badRequestException';
2
+ export { default as NotFoundException } from './notFoundException';
3
+ export { default as NotImplementedException } from './notImplementedException';
4
+ export { default as UnauthorizedException } from './unauthorizedException';
5
+ export { default as WorkflowInterceptionException } from './workflowInterceptionException';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { IExceptionWithHttpCode } from "./exceptionWithHttpCode";
2
+ interface INotFoundException extends IExceptionWithHttpCode {
3
+ name: string;
4
+ }
5
+ export default class NotFoundException extends Error implements INotFoundException {
6
+ constructor(messageLocalized?: string);
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=notFoundException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notFoundException.d.ts","sourceRoot":"","sources":["../../src/exceptions/notFoundException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,UAAU,kBAAmB,SAAQ,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,KAAM,YAAW,kBAAkB;gBACrE,gBAAgB,CAAC,EAAE,MAAM;CAMrC"}
@@ -0,0 +1,9 @@
1
+ export default class NotFoundException extends Error {
2
+ constructor(messageLocalized) {
3
+ super(messageLocalized || 'Not found');
4
+ this.name = 'NotFoundException';
5
+ this.httpCode = 404;
6
+ Object.setPrototypeOf(this, new.target.prototype); // Fix prototype chain
7
+ }
8
+ }
9
+ //# sourceMappingURL=notFoundException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notFoundException.js","sourceRoot":"","sources":["../../src/exceptions/notFoundException.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,KAAK;IACnD,YAAY,gBAAyB;QACpC,KAAK,CAAC,gBAAgB,IAAI,WAAW,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAC/B,IAA2B,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC5C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,sBAAsB;IAC1E,CAAC;CACD"}
@@ -0,0 +1,4 @@
1
+ export default class NotImplementedException extends Error {
2
+ constructor(message?: string);
3
+ }
4
+ //# sourceMappingURL=notImplementedException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notImplementedException.d.ts","sourceRoot":"","sources":["../../src/exceptions/notImplementedException.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK;gBAC7C,OAAO,CAAC,EAAE,MAAM;CAK5B"}
@@ -0,0 +1,8 @@
1
+ export default class NotImplementedException extends Error {
2
+ constructor(message) {
3
+ super(message || 'Not implemented');
4
+ this.name = 'NotImplementedException'; // Important for identifying error type
5
+ Object.setPrototypeOf(this, new.target.prototype); // Fix prototype chain
6
+ }
7
+ }
8
+ //# sourceMappingURL=notImplementedException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notImplementedException.js","sourceRoot":"","sources":["../../src/exceptions/notImplementedException.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK;IACzD,YAAY,OAAgB;QAC3B,KAAK,CAAC,OAAO,IAAI,iBAAiB,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC,CAAC,uCAAuC;QAC9E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,sBAAsB;IAC1E,CAAC;CACD"}
@@ -0,0 +1,9 @@
1
+ import { IExceptionWithHttpCode } from "./exceptionWithHttpCode";
2
+ interface IUnauthorizedException extends IExceptionWithHttpCode {
3
+ name: string;
4
+ }
5
+ export default class UnauthorizedException extends Error implements IUnauthorizedException {
6
+ constructor(messageLocalized?: string);
7
+ }
8
+ export {};
9
+ //# sourceMappingURL=unauthorizedException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unauthorizedException.d.ts","sourceRoot":"","sources":["../../src/exceptions/unauthorizedException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,UAAU,sBAAuB,SAAQ,sBAAsB;IAC9D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,KAAM,YAAW,sBAAsB;gBAC7E,gBAAgB,CAAC,EAAE,MAAM;CAMrC"}
@@ -0,0 +1,9 @@
1
+ export default class UnauthorizedException extends Error {
2
+ constructor(messageLocalized) {
3
+ super(messageLocalized || 'Unauthorized');
4
+ this.name = 'UnauthorizedException'; // Important for identifying error type
5
+ this.httpCode = 401;
6
+ Object.setPrototypeOf(this, new.target.prototype); // Fix prototype chain
7
+ }
8
+ }
9
+ //# sourceMappingURL=unauthorizedException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unauthorizedException.js","sourceRoot":"","sources":["../../src/exceptions/unauthorizedException.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,KAAK;IACvD,YAAY,gBAAyB;QACpC,KAAK,CAAC,gBAAgB,IAAI,cAAc,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC,CAAC,uCAAuC;QAC3E,IAA+B,CAAC,QAAQ,GAAG,GAAG,CAAC;QAChD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,sBAAsB;IAC1E,CAAC;CACD"}
@@ -0,0 +1,19 @@
1
+ import { WorkflowInterception } from "../interception/workflowInteceptionHandler.interface";
2
+ import { IExceptionWithHttpCode } from "./exceptionWithHttpCode";
3
+ interface IWorkflowInterceptionException extends IExceptionWithHttpCode {
4
+ /**
5
+ * Name of the exception for identification.
6
+ */
7
+ name: string;
8
+ /**
9
+ * Interception information.
10
+ */
11
+ interception: WorkflowInterception<any, any>;
12
+ }
13
+ export default class WorkflowInterceptionException extends Error implements IWorkflowInterceptionException {
14
+ readonly httpCode: number;
15
+ readonly interception: WorkflowInterception<any, any>;
16
+ constructor(interception: WorkflowInterception<any, any>);
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=workflowInterceptionException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowInterceptionException.d.ts","sourceRoot":"","sources":["../../src/exceptions/workflowInterceptionException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,UAAU,8BAA+B,SAAQ,sBAAsB;IACtE;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAC7C;AAED,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,KAAM,YAAW,8BAA8B;IACzG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAO;IAChC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBAE1C,YAAY,EAAE,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC;CAMxD"}
@@ -0,0 +1,11 @@
1
+ export default class WorkflowInterceptionException extends Error {
2
+ httpCode = 400;
3
+ interception;
4
+ constructor(interception) {
5
+ super(interception.message || 'Workflow interception');
6
+ this.name = 'WorkflowInterceptionException'; // Important for identifying error type
7
+ this.interception = interception;
8
+ Object.setPrototypeOf(this, new.target.prototype); // Fix prototype chain
9
+ }
10
+ }
11
+ //# sourceMappingURL=workflowInterceptionException.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowInterceptionException.js","sourceRoot":"","sources":["../../src/exceptions/workflowInterceptionException.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,KAAK;IACtD,QAAQ,GAAW,GAAG,CAAC;IACvB,YAAY,CAAiC;IAEtD,YAAY,YAA4C;QACvD,KAAK,CAAC,YAAY,CAAC,OAAO,IAAI,uBAAuB,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC,CAAC,uCAAuC;QACpF,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,sBAAsB;IAC1E,CAAC;CACD"}
package/dist/index.d.ts CHANGED
@@ -43,5 +43,7 @@ export { ControllerGetMiddlewares, Middleware as MiddlewareDecorator, ParseReque
43
43
  export { ControllerBase, createRouter, type HttpMethod, type IController, WebRouter as UniversalRouter, WebRouter, } from './router';
44
44
  export { IS_BUN, RUNTIME } from './runtime-detect';
45
45
  export { type BuildableRouter, createServer, type ServerInstance, type StaticFileConfig, UniversalServer, type UniversalServerOptions, } from './server';
46
+ export { BadRequestException, type IExceptionWithHttpCode, NotFoundException, NotImplementedException, UnauthorizedException, WorkflowInterceptionException, } from './exceptions';
47
+ export { type WorkflowInterception, type WorkflowInterceptionResponse, WorkflowInterceptionResult, } from './interception';
46
48
  export { RuntimeUtils } from './utils';
47
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,cAAc,UAAU,CAAC;AAGzB,YAAY,EACX,aAAa,EACb,oBAAoB,IAAI,UAAU,EAClC,YAAY,EACZ,UAAU,IAAI,gBAAgB,EAC9B,UAAU,EACV,WAAW,GACX,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACN,wBAAwB,EACxB,UAAU,IAAI,mBAAmB,EACjC,gBAAgB,EAChB,WAAW,EACX,KAAK,GACL,MAAM,cAAc,CAAC;AAGtB,OAAO,EACN,cAAc,EACd,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,SAAS,IAAI,eAAe,EAC5B,SAAS,GACT,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EACN,KAAK,eAAe,EACpB,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,sBAAsB,GAC3B,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,cAAc,UAAU,CAAC;AAGzB,YAAY,EACX,aAAa,EACb,oBAAoB,IAAI,UAAU,EAClC,YAAY,EACZ,UAAU,IAAI,gBAAgB,EAC9B,UAAU,EACV,WAAW,GACX,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACN,wBAAwB,EACxB,UAAU,IAAI,mBAAmB,EACjC,gBAAgB,EAChB,WAAW,EACX,KAAK,GACL,MAAM,cAAc,CAAC;AAGtB,OAAO,EACN,cAAc,EACd,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,SAAS,IAAI,eAAe,EAC5B,SAAS,GACT,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EACN,KAAK,eAAe,EACpB,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,sBAAsB,GAC3B,MAAM,UAAU,CAAC;AAGlB,OAAO,EACN,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,GAC7B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,0BAA0B,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -47,6 +47,8 @@ export { ControllerBase, createRouter, WebRouter as UniversalRouter, WebRouter,
47
47
  export { IS_BUN, RUNTIME } from './runtime-detect';
48
48
  // Server - Server creation and configuration
49
49
  export { createServer, UniversalServer, } from './server';
50
+ // Exceptions - Common HTTP and workflow exceptions
51
+ export { BadRequestException, NotFoundException, NotImplementedException, UnauthorizedException, WorkflowInterceptionException, } from './exceptions';
50
52
  // Utils - Request parsing and helper utilities
51
53
  export { RuntimeUtils } from './utils';
52
54
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,0FAA0F;AAC1F,cAAc,UAAU,CAAC;AAYzB,kDAAkD;AAClD,OAAO,EACN,wBAAwB,EACxB,UAAU,IAAI,mBAAmB,EACjC,gBAAgB,EAChB,WAAW,EACX,KAAK,GACL,MAAM,cAAc,CAAC;AAEtB,wDAAwD;AACxD,OAAO,EACN,cAAc,EACd,YAAY,EAGZ,SAAS,IAAI,eAAe,EAC5B,SAAS,GACT,MAAM,UAAU,CAAC;AAElB,yDAAyD;AACzD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,6CAA6C;AAC7C,OAAO,EAEN,YAAY,EAGZ,eAAe,GAEf,MAAM,UAAU,CAAC;AAElB,+CAA+C;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,0FAA0F;AAC1F,cAAc,UAAU,CAAC;AAYzB,kDAAkD;AAClD,OAAO,EACN,wBAAwB,EACxB,UAAU,IAAI,mBAAmB,EACjC,gBAAgB,EAChB,WAAW,EACX,KAAK,GACL,MAAM,cAAc,CAAC;AAEtB,wDAAwD;AACxD,OAAO,EACN,cAAc,EACd,YAAY,EAGZ,SAAS,IAAI,eAAe,EAC5B,SAAS,GACT,MAAM,UAAU,CAAC;AAElB,yDAAyD;AACzD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,6CAA6C;AAC7C,OAAO,EAEN,YAAY,EAGZ,eAAe,GAEf,MAAM,UAAU,CAAC;AAElB,mDAAmD;AACnD,OAAO,EACN,mBAAmB,EAEnB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,GAC7B,MAAM,cAAc,CAAC;AAStB,+CAA+C;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type { WorkflowInterception, WorkflowInterceptionResponse, } from './workflowInteceptionHandler.interface';
2
+ export { WorkflowInterceptionResult } from './workflowInteceptionHandler.interface';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interception/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,oBAAoB,EACpB,4BAA4B,GAC5B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interception/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Response object returned by interceptor methods to indicate the outcome
3
+ * and provide optional interception details.
4
+ *
5
+ * @template TInterception - Type of the custom data attached to the interception
6
+ */
7
+ export interface WorkflowInterceptionResponse<TInterception, TInterceptionType> {
8
+ /** Indicates whether to continue processing, intercept, or handle error */
9
+ result: WorkflowInterceptionResult;
10
+ /** Optional error information when result is ERROR */
11
+ error?: any;
12
+ /** Optional interception details when result is INTERCEPTED */
13
+ interception?: WorkflowInterception<TInterception, TInterceptionType>;
14
+ }
15
+ /**
16
+ * Enumeration defining the possible outcomes of an interceptor method call.
17
+ * Used by the orchestrator to determine whether to continue or stop processing.
18
+ */
19
+ export declare const enum WorkflowInterceptionResult {
20
+ /** Continue processing normally - no interception occurred */
21
+ OK = 0,
22
+ /** Stop processing - workflow has been intercepted */
23
+ INTERCEPTED = 1,
24
+ /** Soft interception - processing may continue with caution */
25
+ WEAK_INTERCEPTED = 2,
26
+ /** Error occurred during interception - TODO: determine if this is needed */
27
+ ERROR = 3
28
+ }
29
+ /**
30
+ * Contains detailed information about an interception when processing is stopped.
31
+ * Provides context about why the interception occurred and any relevant data.
32
+ *
33
+ * @template TInterceptionData - Type of the custom data specific to this interception
34
+ */
35
+ export interface WorkflowInterception<TInterceptionData, TInterceptionType> {
36
+ /** Human-readable message explaining why the interception occurred */
37
+ message: string;
38
+ /** Type/category of the interception for classification purposes */
39
+ type: TInterceptionType;
40
+ /** Custom data relevant to this specific interception */
41
+ data: TInterceptionData;
42
+ }
43
+ //# sourceMappingURL=workflowInteceptionHandler.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowInteceptionHandler.interface.d.ts","sourceRoot":"","sources":["../../src/interception/workflowInteceptionHandler.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B,CAAC,aAAa,EAAE,iBAAiB;IAC7E,2EAA2E;IAC3E,MAAM,EAAE,0BAA0B,CAAC;IAEnC,sDAAsD;IACtD,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ,+DAA+D;IAC/D,YAAY,CAAC,EAAE,oBAAoB,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;CACtE;AAED;;;GAGG;AACH,0BAAkB,0BAA0B;IAC3C,8DAA8D;IAC9D,EAAE,IAAI;IAEN,sDAAsD;IACtD,WAAW,IAAI;IAEf,+DAA+D;IAC/D,gBAAgB,IAAI;IAEpB,6EAA6E;IAC7E,KAAK,IAAI;CACT;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB,CAAC,iBAAiB,EAAE,iBAAiB;IACzE,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAEhB,oEAAoE;IACpE,IAAI,EAAE,iBAAiB,CAAC;IAExB,yDAAyD;IACzD,IAAI,EAAE,iBAAiB,CAAC;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workflowInteceptionHandler.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowInteceptionHandler.interface.js","sourceRoot":"","sources":["../../src/interception/workflowInteceptionHandler.interface.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inviton-backduck",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Runtime-agnostic utilities for building web servers with Express and Bun support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",