@pristine-ts/common 0.0.175 → 0.0.179

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 (36) hide show
  1. package/dist/lib/cjs/common.module.js +1 -0
  2. package/dist/lib/cjs/common.module.js.map +1 -1
  3. package/dist/lib/cjs/enums/service-definition-tag.enum.js +14 -17
  4. package/dist/lib/cjs/enums/service-definition-tag.enum.js.map +1 -1
  5. package/dist/lib/cjs/interfaces/interfaces.js +0 -1
  6. package/dist/lib/cjs/interfaces/interfaces.js.map +1 -1
  7. package/dist/lib/cjs/models/models.js +15 -0
  8. package/dist/lib/cjs/models/models.js.map +1 -0
  9. package/dist/lib/cjs/models/request.js +44 -0
  10. package/dist/lib/cjs/models/request.js.map +1 -0
  11. package/dist/lib/cjs/models/response.js +13 -0
  12. package/dist/lib/cjs/models/response.js.map +1 -0
  13. package/dist/lib/esm/common.module.js +1 -0
  14. package/dist/lib/esm/common.module.js.map +1 -1
  15. package/dist/lib/esm/enums/service-definition-tag.enum.js +14 -17
  16. package/dist/lib/esm/enums/service-definition-tag.enum.js.map +1 -1
  17. package/dist/lib/esm/interfaces/interfaces.js +0 -1
  18. package/dist/lib/esm/interfaces/interfaces.js.map +1 -1
  19. package/dist/lib/esm/models/models.js +3 -0
  20. package/dist/lib/esm/models/models.js.map +1 -0
  21. package/dist/lib/esm/models/request.js +40 -0
  22. package/dist/lib/esm/models/request.js.map +1 -0
  23. package/dist/lib/esm/models/response.js +9 -0
  24. package/dist/lib/esm/models/response.js.map +1 -0
  25. package/dist/types/common.module.d.ts +1 -0
  26. package/dist/types/enums/service-definition-tag.enum.d.ts +14 -17
  27. package/dist/types/interfaces/interfaces.d.ts +0 -1
  28. package/dist/types/models/models.d.ts +2 -0
  29. package/dist/types/models/request.d.ts +48 -0
  30. package/dist/types/models/response.d.ts +24 -0
  31. package/package.json +2 -2
  32. package/dist/lib/cjs/interfaces/request.interface.js +0 -3
  33. package/dist/lib/cjs/interfaces/request.interface.js.map +0 -1
  34. package/dist/lib/esm/interfaces/request.interface.js +0 -2
  35. package/dist/lib/esm/interfaces/request.interface.js.map +0 -1
  36. package/dist/types/interfaces/request.interface.d.ts +0 -30
@@ -16,6 +16,7 @@ __exportStar(require("./contexts/contexts"), exports);
16
16
  __exportStar(require("./decorators/decorators"), exports);
17
17
  __exportStar(require("./enums/enums"), exports);
18
18
  __exportStar(require("./errors/errors"), exports);
19
+ __exportStar(require("./models/models"), exports);
19
20
  __exportStar(require("./interfaces/interfaces"), exports);
20
21
  __exportStar(require("./types/types"), exports);
21
22
  __exportStar(require("./common.module.keyname"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"common.module.js","sourceRoot":"","sources":["../../../src/common.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mEAA4D;AAE5D,sDAAoC;AACpC,0DAAwC;AACxC,gDAA8B;AAC9B,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,0DAAwC;AAE3B,QAAA,YAAY,GAAqB;IAC1C,OAAO,EAAE,2CAAmB;IAC5B,aAAa,EAAE,EAEd;IACD,qBAAqB,EAAE,EAAE;CAC5B,CAAA"}
1
+ {"version":3,"file":"common.module.js","sourceRoot":"","sources":["../../../src/common.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mEAA4D;AAE5D,sDAAoC;AACpC,0DAAwC;AACxC,gDAA8B;AAC9B,kDAAgC;AAChC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,0DAAwC;AAE3B,QAAA,YAAY,GAAqB;IAC1C,OAAO,EAAE,2CAAmB;IAC5B,aAAa,EAAE,EAEd;IACD,qBAAqB,EAAE,EAAE;CAC5B,CAAA"}
@@ -9,23 +9,20 @@ exports.ServiceDefinitionTagEnum = void 0;
9
9
  */
10
10
  var ServiceDefinitionTagEnum;
11
11
  (function (ServiceDefinitionTagEnum) {
12
+ ServiceDefinitionTagEnum["CurrentChildContainer"] = "CURRENT_CHILD_CONTAINER";
13
+ ServiceDefinitionTagEnum["EventHandler"] = "EventHandlerInterface";
14
+ ServiceDefinitionTagEnum["EventInterceptor"] = "EventInterceptorInterface";
15
+ ServiceDefinitionTagEnum["EventListener"] = "EventListenerInterface";
16
+ ServiceDefinitionTagEnum["EventMapper"] = "EventMapperInterface";
17
+ ServiceDefinitionTagEnum["HttpRequestInterceptor"] = "HttpRequestInterceptorInterface";
18
+ ServiceDefinitionTagEnum["HttpResponseInterceptor"] = "HttpResponseInterceptorInterface";
19
+ ServiceDefinitionTagEnum["HttpErrorResponseInterceptor"] = "HttpErrorResponseInterceptorInterface";
20
+ ServiceDefinitionTagEnum["IdentityProvider"] = "IdentityProviderInterface";
21
+ ServiceDefinitionTagEnum["Logger"] = "LoggerInterface";
12
22
  ServiceDefinitionTagEnum["MethodParameterDecoratorResolver"] = "METHOD_PARAMETER_DECORATOR_RESOLVER";
13
- ServiceDefinitionTagEnum["RequestInterceptor"] = "REQUEST_INTERCEPTOR";
14
- ServiceDefinitionTagEnum["ResponseInterceptor"] = "RESPONSE_INTERCEPTOR";
15
- ServiceDefinitionTagEnum["ErrorResponseInterceptor"] = "ERROR_RESPONSE_INTERCEPTOR";
16
- ServiceDefinitionTagEnum["EventInterceptor"] = "EVENT_INTERCEPTOR";
17
- ServiceDefinitionTagEnum["RouterRequestEnricher"] = "ROUTER_REQUEST_ENRICHER";
18
- ServiceDefinitionTagEnum["RouterResponseEnricher"] = "ROUTER_RESPONSE_ENRICHER";
19
- ServiceDefinitionTagEnum["EventListener"] = "EVENT_LISTENER";
20
- ServiceDefinitionTagEnum["EventParser"] = "EVENT_PARSER";
21
- ServiceDefinitionTagEnum["EventSubscriber"] = "EVENT_SUBSCRIBER";
22
- ServiceDefinitionTagEnum["Voter"] = "VOTER";
23
- ServiceDefinitionTagEnum["Logger"] = "LOGGER";
24
- ServiceDefinitionTagEnum["Tracer"] = "TRACER";
25
- ServiceDefinitionTagEnum["HttpRequestInterceptor"] = "HTTP_REQUEST_INTERCEPTOR";
26
- ServiceDefinitionTagEnum["HttpResponseInterceptor"] = "HTTP_RESPONSE_INTERCEPTOR";
27
- ServiceDefinitionTagEnum["HttpErrorResponseInterceptor"] = "HTTP_ERROR_RESPONSE_INTERCEPTOR";
28
- ServiceDefinitionTagEnum["IdentityProvider"] = "IDENTITY_PROVIDER";
29
- ServiceDefinitionTagEnum["ScheduledTask"] = "SCHEDULED_TASK";
23
+ ServiceDefinitionTagEnum["RequestInterceptor"] = "RequestInterceptorInterface";
24
+ ServiceDefinitionTagEnum["ScheduledTask"] = "ScheduledTaskInterface";
25
+ ServiceDefinitionTagEnum["Tracer"] = "TracerInterface";
26
+ ServiceDefinitionTagEnum["Voter"] = "VoterInterface";
30
27
  })(ServiceDefinitionTagEnum = exports.ServiceDefinitionTagEnum || (exports.ServiceDefinitionTagEnum = {}));
31
28
  //# sourceMappingURL=service-definition-tag.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-definition-tag.enum.js","sourceRoot":"","sources":["../../../../src/enums/service-definition-tag.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,wBAmBX;AAnBD,WAAY,wBAAwB;IAChC,oGAAwE,CAAA;IACxE,sEAA0C,CAAA;IAC1C,wEAA4C,CAAA;IAC5C,mFAAuD,CAAA;IACvD,kEAAsC,CAAA;IACtC,6EAAiD,CAAA;IACjD,+EAAmD,CAAA;IACnD,4DAAgC,CAAA;IAChC,wDAA4B,CAAA;IAC5B,gEAAoC,CAAA;IACpC,2CAAe,CAAA;IACf,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,+EAAmD,CAAA;IACnD,iFAAqD,CAAA;IACrD,4FAAgE,CAAA;IAChE,kEAAsC,CAAA;IACtC,4DAAgC,CAAA;AACpC,CAAC,EAnBW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAmBnC"}
1
+ {"version":3,"file":"service-definition-tag.enum.js","sourceRoot":"","sources":["../../../../src/enums/service-definition-tag.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,wBAgBX;AAhBD,WAAY,wBAAwB;IAChC,6EAAiD,CAAA;IACjD,kEAAsC,CAAA;IACtC,0EAA8C,CAAA;IAC9C,oEAAwC,CAAA;IACxC,gEAAoC,CAAA;IACpC,sFAA0D,CAAA;IAC1D,wFAA4D,CAAA;IAC5D,kGAAsE,CAAA;IACtE,0EAA8C,CAAA;IAC9C,sDAA0B,CAAA;IAC1B,oGAAwE,CAAA;IACxE,8EAAkD,CAAA;IAClD,oEAAwC,CAAA;IACxC,sDAA0B,CAAA;IAC1B,oDAAwB,CAAA;AAC5B,CAAC,EAhBW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAgBnC"}
@@ -17,7 +17,6 @@ __exportStar(require("./factory-provider-registration.interface"), exports);
17
17
  __exportStar(require("./identity.interface"), exports);
18
18
  __exportStar(require("./module.interface"), exports);
19
19
  __exportStar(require("./module-scoped-registration.interface"), exports);
20
- __exportStar(require("./request.interface"), exports);
21
20
  __exportStar(require("./resolver.interface"), exports);
22
21
  __exportStar(require("./tagged-registration.interface"), exports);
23
22
  __exportStar(require("./token-provider-registration.interface"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAuC;AACvC,4DAA0C;AAC1C,6EAA2D;AAC3D,4EAA0D;AAC1D,uDAAqC;AACrC,qDAAmC;AACnC,yEAAuD;AACvD,sDAAoC;AACpC,uDAAqC;AACrC,kEAAgD;AAChD,0EAAwD;AACxD,0EAAwD"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAuC;AACvC,4DAA0C;AAC1C,6EAA2D;AAC3D,4EAA0D;AAC1D,uDAAqC;AACrC,qDAAmC;AACnC,yEAAuD;AACvD,uDAAqC;AACrC,kEAAgD;AAChD,0EAAwD;AACxD,0EAAwD"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./request"), exports);
14
+ __exportStar(require("./response"), exports);
15
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/models/models.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0B;AAC1B,6CAA2B"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Request = void 0;
4
+ class Request {
5
+ constructor(httpMethod, url) {
6
+ /**
7
+ * The headers of the request.
8
+ */
9
+ this.headers = {};
10
+ /**
11
+ * The body of the request.
12
+ */
13
+ this.body = {};
14
+ this.httpMethod = httpMethod;
15
+ this.url = url;
16
+ }
17
+ /**
18
+ * This method sets a header parameter in the Request.
19
+ *
20
+ * @param name The name of the header.
21
+ * @param value The value of the header.
22
+ */
23
+ setHeader(name, value) {
24
+ this.headers[name] = value;
25
+ }
26
+ /**
27
+ * This method returns whether or not the header exists in the Request.
28
+ *
29
+ * @param name The name of the header.
30
+ */
31
+ hasHeader(name) {
32
+ return this.headers.hasOwnProperty(name);
33
+ }
34
+ /**
35
+ * This method returns the header corresponding to the name or undefined if it doesn't exist.
36
+ *
37
+ * @param name The name of the header.
38
+ */
39
+ getHeader(name) {
40
+ return this.headers[name];
41
+ }
42
+ }
43
+ exports.Request = Request;
44
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/models/request.ts"],"names":[],"mappings":";;;AAKA,MAAa,OAAO;IA0BhB,YAAY,UAA+B,EAAE,GAAW;QAfxD;;WAEG;QACH,YAAO,GAA8B,EAAE,CAAC;QAExC;;WAEG;QACH,SAAI,GAAQ,EAAE,CAAC;QAQX,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,IAAY,EAAE,KAAa;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACJ;AA1DD,0BA0DC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Response = void 0;
4
+ class Response {
5
+ constructor() {
6
+ /**
7
+ * The status code of the response. By default we return a 200.
8
+ */
9
+ this.status = 200;
10
+ }
11
+ }
12
+ exports.Response = Response;
13
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/models/response.ts"],"names":[],"mappings":";;;AAKA,MAAa,QAAQ;IAArB;QACI;;WAEG;QACH,WAAM,GAAW,GAAG,CAAC;IAgBzB,CAAC;CAAA;AApBD,4BAoBC"}
@@ -3,6 +3,7 @@ export * from "./contexts/contexts";
3
3
  export * from "./decorators/decorators";
4
4
  export * from "./enums/enums";
5
5
  export * from "./errors/errors";
6
+ export * from "./models/models";
6
7
  export * from "./interfaces/interfaces";
7
8
  export * from "./types/types";
8
9
  export * from "./common.module.keyname";
@@ -1 +1 @@
1
- {"version":3,"file":"common.module.js","sourceRoot":"","sources":["../../../src/common.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAE5D,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AAExC,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC1C,OAAO,EAAE,mBAAmB;IAC5B,aAAa,EAAE,EAEd;IACD,qBAAqB,EAAE,EAAE;CAC5B,CAAA"}
1
+ {"version":3,"file":"common.module.js","sourceRoot":"","sources":["../../../src/common.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;AAE5D,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AAExC,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC1C,OAAO,EAAE,mBAAmB;IAC5B,aAAa,EAAE,EAEd;IACD,qBAAqB,EAAE,EAAE;CAC5B,CAAA"}
@@ -6,23 +6,20 @@
6
6
  */
7
7
  export var ServiceDefinitionTagEnum;
8
8
  (function (ServiceDefinitionTagEnum) {
9
+ ServiceDefinitionTagEnum["CurrentChildContainer"] = "CURRENT_CHILD_CONTAINER";
10
+ ServiceDefinitionTagEnum["EventHandler"] = "EventHandlerInterface";
11
+ ServiceDefinitionTagEnum["EventInterceptor"] = "EventInterceptorInterface";
12
+ ServiceDefinitionTagEnum["EventListener"] = "EventListenerInterface";
13
+ ServiceDefinitionTagEnum["EventMapper"] = "EventMapperInterface";
14
+ ServiceDefinitionTagEnum["HttpRequestInterceptor"] = "HttpRequestInterceptorInterface";
15
+ ServiceDefinitionTagEnum["HttpResponseInterceptor"] = "HttpResponseInterceptorInterface";
16
+ ServiceDefinitionTagEnum["HttpErrorResponseInterceptor"] = "HttpErrorResponseInterceptorInterface";
17
+ ServiceDefinitionTagEnum["IdentityProvider"] = "IdentityProviderInterface";
18
+ ServiceDefinitionTagEnum["Logger"] = "LoggerInterface";
9
19
  ServiceDefinitionTagEnum["MethodParameterDecoratorResolver"] = "METHOD_PARAMETER_DECORATOR_RESOLVER";
10
- ServiceDefinitionTagEnum["RequestInterceptor"] = "REQUEST_INTERCEPTOR";
11
- ServiceDefinitionTagEnum["ResponseInterceptor"] = "RESPONSE_INTERCEPTOR";
12
- ServiceDefinitionTagEnum["ErrorResponseInterceptor"] = "ERROR_RESPONSE_INTERCEPTOR";
13
- ServiceDefinitionTagEnum["EventInterceptor"] = "EVENT_INTERCEPTOR";
14
- ServiceDefinitionTagEnum["RouterRequestEnricher"] = "ROUTER_REQUEST_ENRICHER";
15
- ServiceDefinitionTagEnum["RouterResponseEnricher"] = "ROUTER_RESPONSE_ENRICHER";
16
- ServiceDefinitionTagEnum["EventListener"] = "EVENT_LISTENER";
17
- ServiceDefinitionTagEnum["EventParser"] = "EVENT_PARSER";
18
- ServiceDefinitionTagEnum["EventSubscriber"] = "EVENT_SUBSCRIBER";
19
- ServiceDefinitionTagEnum["Voter"] = "VOTER";
20
- ServiceDefinitionTagEnum["Logger"] = "LOGGER";
21
- ServiceDefinitionTagEnum["Tracer"] = "TRACER";
22
- ServiceDefinitionTagEnum["HttpRequestInterceptor"] = "HTTP_REQUEST_INTERCEPTOR";
23
- ServiceDefinitionTagEnum["HttpResponseInterceptor"] = "HTTP_RESPONSE_INTERCEPTOR";
24
- ServiceDefinitionTagEnum["HttpErrorResponseInterceptor"] = "HTTP_ERROR_RESPONSE_INTERCEPTOR";
25
- ServiceDefinitionTagEnum["IdentityProvider"] = "IDENTITY_PROVIDER";
26
- ServiceDefinitionTagEnum["ScheduledTask"] = "SCHEDULED_TASK";
20
+ ServiceDefinitionTagEnum["RequestInterceptor"] = "RequestInterceptorInterface";
21
+ ServiceDefinitionTagEnum["ScheduledTask"] = "ScheduledTaskInterface";
22
+ ServiceDefinitionTagEnum["Tracer"] = "TracerInterface";
23
+ ServiceDefinitionTagEnum["Voter"] = "VoterInterface";
27
24
  })(ServiceDefinitionTagEnum || (ServiceDefinitionTagEnum = {}));
28
25
  //# sourceMappingURL=service-definition-tag.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-definition-tag.enum.js","sourceRoot":"","sources":["../../../../src/enums/service-definition-tag.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,wBAmBX;AAnBD,WAAY,wBAAwB;IAChC,oGAAwE,CAAA;IACxE,sEAA0C,CAAA;IAC1C,wEAA4C,CAAA;IAC5C,mFAAuD,CAAA;IACvD,kEAAsC,CAAA;IACtC,6EAAiD,CAAA;IACjD,+EAAmD,CAAA;IACnD,4DAAgC,CAAA;IAChC,wDAA4B,CAAA;IAC5B,gEAAoC,CAAA;IACpC,2CAAe,CAAA;IACf,6CAAiB,CAAA;IACjB,6CAAiB,CAAA;IACjB,+EAAmD,CAAA;IACnD,iFAAqD,CAAA;IACrD,4FAAgE,CAAA;IAChE,kEAAsC,CAAA;IACtC,4DAAgC,CAAA;AACpC,CAAC,EAnBW,wBAAwB,KAAxB,wBAAwB,QAmBnC"}
1
+ {"version":3,"file":"service-definition-tag.enum.js","sourceRoot":"","sources":["../../../../src/enums/service-definition-tag.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,wBAgBX;AAhBD,WAAY,wBAAwB;IAChC,6EAAiD,CAAA;IACjD,kEAAsC,CAAA;IACtC,0EAA8C,CAAA;IAC9C,oEAAwC,CAAA;IACxC,gEAAoC,CAAA;IACpC,sFAA0D,CAAA;IAC1D,wFAA4D,CAAA;IAC5D,kGAAsE,CAAA;IACtE,0EAA8C,CAAA;IAC9C,sDAA0B,CAAA;IAC1B,oGAAwE,CAAA;IACxE,8EAAkD,CAAA;IAClD,oEAAwC,CAAA;IACxC,sDAA0B,CAAA;IAC1B,oDAAwB,CAAA;AAC5B,CAAC,EAhBW,wBAAwB,KAAxB,wBAAwB,QAgBnC"}
@@ -5,7 +5,6 @@ export * from "./factory-provider-registration.interface";
5
5
  export * from "./identity.interface";
6
6
  export * from "./module.interface";
7
7
  export * from "./module-scoped-registration.interface";
8
- export * from "./request.interface";
9
8
  export * from "./resolver.interface";
10
9
  export * from "./tagged-registration.interface";
11
10
  export * from "./token-provider-registration.interface";
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wCAAwC,CAAC;AACvD,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./request";
2
+ export * from "./response";
3
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/models/models.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,40 @@
1
+ export class Request {
2
+ constructor(httpMethod, url) {
3
+ /**
4
+ * The headers of the request.
5
+ */
6
+ this.headers = {};
7
+ /**
8
+ * The body of the request.
9
+ */
10
+ this.body = {};
11
+ this.httpMethod = httpMethod;
12
+ this.url = url;
13
+ }
14
+ /**
15
+ * This method sets a header parameter in the Request.
16
+ *
17
+ * @param name The name of the header.
18
+ * @param value The value of the header.
19
+ */
20
+ setHeader(name, value) {
21
+ this.headers[name] = value;
22
+ }
23
+ /**
24
+ * This method returns whether or not the header exists in the Request.
25
+ *
26
+ * @param name The name of the header.
27
+ */
28
+ hasHeader(name) {
29
+ return this.headers.hasOwnProperty(name);
30
+ }
31
+ /**
32
+ * This method returns the header corresponding to the name or undefined if it doesn't exist.
33
+ *
34
+ * @param name The name of the header.
35
+ */
36
+ getHeader(name) {
37
+ return this.headers[name];
38
+ }
39
+ }
40
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/models/request.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,OAAO;IA0BhB,YAAY,UAA+B,EAAE,GAAW;QAfxD;;WAEG;QACH,YAAO,GAA8B,EAAE,CAAC;QAExC;;WAEG;QACH,SAAI,GAAQ,EAAE,CAAC;QAQX,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,IAAY,EAAE,KAAa;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ export class Response {
2
+ constructor() {
3
+ /**
4
+ * The status code of the response. By default we return a 200.
5
+ */
6
+ this.status = 200;
7
+ }
8
+ }
9
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/models/response.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,QAAQ;IAArB;QACI;;WAEG;QACH,WAAM,GAAW,GAAG,CAAC;IAgBzB,CAAC;CAAA"}
@@ -3,6 +3,7 @@ export * from "./contexts/contexts";
3
3
  export * from "./decorators/decorators";
4
4
  export * from "./enums/enums";
5
5
  export * from "./errors/errors";
6
+ export * from "./models/models";
6
7
  export * from "./interfaces/interfaces";
7
8
  export * from "./types/types";
8
9
  export * from "./common.module.keyname";
@@ -5,22 +5,19 @@
5
5
  * resolve all the voters by requesting the VOTER token and asking the container for a resolveAll.
6
6
  */
7
7
  export declare enum ServiceDefinitionTagEnum {
8
+ CurrentChildContainer = "CURRENT_CHILD_CONTAINER",
9
+ EventHandler = "EventHandlerInterface",
10
+ EventInterceptor = "EventInterceptorInterface",
11
+ EventListener = "EventListenerInterface",
12
+ EventMapper = "EventMapperInterface",
13
+ HttpRequestInterceptor = "HttpRequestInterceptorInterface",
14
+ HttpResponseInterceptor = "HttpResponseInterceptorInterface",
15
+ HttpErrorResponseInterceptor = "HttpErrorResponseInterceptorInterface",
16
+ IdentityProvider = "IdentityProviderInterface",
17
+ Logger = "LoggerInterface",
8
18
  MethodParameterDecoratorResolver = "METHOD_PARAMETER_DECORATOR_RESOLVER",
9
- RequestInterceptor = "REQUEST_INTERCEPTOR",
10
- ResponseInterceptor = "RESPONSE_INTERCEPTOR",
11
- ErrorResponseInterceptor = "ERROR_RESPONSE_INTERCEPTOR",
12
- EventInterceptor = "EVENT_INTERCEPTOR",
13
- RouterRequestEnricher = "ROUTER_REQUEST_ENRICHER",
14
- RouterResponseEnricher = "ROUTER_RESPONSE_ENRICHER",
15
- EventListener = "EVENT_LISTENER",
16
- EventParser = "EVENT_PARSER",
17
- EventSubscriber = "EVENT_SUBSCRIBER",
18
- Voter = "VOTER",
19
- Logger = "LOGGER",
20
- Tracer = "TRACER",
21
- HttpRequestInterceptor = "HTTP_REQUEST_INTERCEPTOR",
22
- HttpResponseInterceptor = "HTTP_RESPONSE_INTERCEPTOR",
23
- HttpErrorResponseInterceptor = "HTTP_ERROR_RESPONSE_INTERCEPTOR",
24
- IdentityProvider = "IDENTITY_PROVIDER",
25
- ScheduledTask = "SCHEDULED_TASK"
19
+ RequestInterceptor = "RequestInterceptorInterface",
20
+ ScheduledTask = "ScheduledTaskInterface",
21
+ Tracer = "TracerInterface",
22
+ Voter = "VoterInterface"
26
23
  }
@@ -5,7 +5,6 @@ export * from "./factory-provider-registration.interface";
5
5
  export * from "./identity.interface";
6
6
  export * from "./module.interface";
7
7
  export * from "./module-scoped-registration.interface";
8
- export * from "./request.interface";
9
8
  export * from "./resolver.interface";
10
9
  export * from "./tagged-registration.interface";
11
10
  export * from "./token-provider-registration.interface";
@@ -0,0 +1,2 @@
1
+ export * from "./request";
2
+ export * from "./response";
@@ -0,0 +1,48 @@
1
+ /**
2
+ * This Request object represents the class used internally that represents a Request.
3
+ */
4
+ import { HttpMethod } from "../enums/http-method.enum";
5
+ export declare class Request {
6
+ /**
7
+ * The http method of the request.
8
+ */
9
+ httpMethod: HttpMethod | string;
10
+ /**
11
+ * The url of the request.
12
+ */
13
+ url: string;
14
+ /**
15
+ * The headers of the request.
16
+ */
17
+ headers: {
18
+ [key: string]: string;
19
+ };
20
+ /**
21
+ * The body of the request.
22
+ */
23
+ body: any;
24
+ /**
25
+ * The raw body of the request.
26
+ */
27
+ rawBody?: any;
28
+ constructor(httpMethod: HttpMethod | string, url: string);
29
+ /**
30
+ * This method sets a header parameter in the Request.
31
+ *
32
+ * @param name The name of the header.
33
+ * @param value The value of the header.
34
+ */
35
+ setHeader(name: string, value: string): void;
36
+ /**
37
+ * This method returns whether or not the header exists in the Request.
38
+ *
39
+ * @param name The name of the header.
40
+ */
41
+ hasHeader(name: string): boolean;
42
+ /**
43
+ * This method returns the header corresponding to the name or undefined if it doesn't exist.
44
+ *
45
+ * @param name The name of the header.
46
+ */
47
+ getHeader(name: string): string | undefined;
48
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This Response object represents the class used internally that represents a Response.
3
+ */
4
+ import { Request } from "./request";
5
+ export declare class Response {
6
+ /**
7
+ * The status code of the response. By default we return a 200.
8
+ */
9
+ status: number;
10
+ /**
11
+ * The headers of the response.
12
+ */
13
+ headers?: {
14
+ [key: string]: string;
15
+ };
16
+ /**
17
+ * The body of the response.
18
+ */
19
+ body?: any;
20
+ /**
21
+ * The request that triggered this response.
22
+ */
23
+ request?: Request;
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristine-ts/common",
3
- "version": "0.0.175",
3
+ "version": "0.0.179",
4
4
  "description": "",
5
5
  "module": "dist/lib/esm/common.module.js",
6
6
  "main": "dist/lib/cjs/common.module.js",
@@ -56,5 +56,5 @@
56
56
  "src/*.{js,ts}"
57
57
  ]
58
58
  },
59
- "gitHead": "30a123361180b337de390a5a53cd2013c2db8e7e"
59
+ "gitHead": "2af3d4b4ecfb0af32b5b3020c78ad5f8d1f64ca6"
60
60
  }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=request.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/request.interface.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=request.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/request.interface.ts"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- import { HttpMethod } from "../enums/http-method.enum";
2
- /**
3
- * This interface defines the fields that must be present in a Request. This interface is used to communicate
4
- * externally with this module. When dealing with requests internally, we transform this request interface into
5
- * the Request object since it contains methods that make working with the Request more easily.
6
- */
7
- export interface RequestInterface {
8
- /**
9
- * The http method used in the request.
10
- */
11
- httpMethod: string | HttpMethod;
12
- /**
13
- * The url of the request.
14
- */
15
- url: string;
16
- /**
17
- * The headers of the request.
18
- */
19
- headers?: {
20
- [key: string]: string;
21
- };
22
- /**
23
- * The parsed body of the request.
24
- */
25
- body?: any;
26
- /**
27
- * The raw body of the request.
28
- */
29
- rawBody?: any;
30
- }