@skillstew/common 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export * from "./types/UserRoles";
2
- export * from "./constants/HttpStatus";
3
1
  export * from "./events/AppEvent";
4
2
  export * from "./events/schemas/userEventsSchema";
5
3
  export * from "./events/CreateEvent";
package/build/index.js CHANGED
@@ -14,10 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- // Types
18
- __exportStar(require("./types/UserRoles"), exports);
19
- // Constants
20
- __exportStar(require("./constants/HttpStatus"), exports);
21
17
  // Events
22
18
  __exportStar(require("./events/AppEvent"), exports);
23
19
  __exportStar(require("./events/schemas/userEventsSchema"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillstew/common",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -1,9 +1,3 @@
1
- // Types
2
- export * from "./types/UserRoles";
3
-
4
- // Constants
5
- export * from "./constants/HttpStatus";
6
-
7
1
  // Events
8
2
  export * from "./events/AppEvent";
9
3
  export * from "./events/schemas/userEventsSchema";
@@ -1,27 +0,0 @@
1
- export declare enum HttpStatus {
2
- OK = 200,
3
- CREATED = 201,
4
- ACCEPTED = 202,
5
- NO_CONTENT = 204,
6
- MOVED_PERMANENTLY = 301,
7
- FOUND = 302,
8
- NOT_MODIFIED = 304,
9
- BAD_REQUEST = 400,
10
- UNAUTHORIZED = 401,
11
- PAYMENT_REQUIRED = 402,
12
- FORBIDDEN = 403,
13
- NOT_FOUND = 404,
14
- METHOD_NOT_ALLOWED = 405,
15
- NOT_ACCEPTABLE = 406,
16
- REQUEST_TIMEOUT = 408,
17
- CONFLICT = 409,
18
- GONE = 410,
19
- PAYLOAD_TOO_LARGE = 413,
20
- UNSUPPORTED_MEDIA_TYPE = 415,
21
- TOO_MANY_REQUESTS = 429,
22
- INTERNAL_SERVER_ERROR = 500,
23
- NOT_IMPLEMENTED = 501,
24
- BAD_GATEWAY = 502,
25
- SERVICE_UNAVAILABLE = 503,
26
- GATEWAY_TIMEOUT = 504
27
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpStatus = void 0;
4
- var HttpStatus;
5
- (function (HttpStatus) {
6
- // 2xx Success
7
- HttpStatus[HttpStatus["OK"] = 200] = "OK";
8
- HttpStatus[HttpStatus["CREATED"] = 201] = "CREATED";
9
- HttpStatus[HttpStatus["ACCEPTED"] = 202] = "ACCEPTED";
10
- HttpStatus[HttpStatus["NO_CONTENT"] = 204] = "NO_CONTENT";
11
- // 3xx Redirection
12
- HttpStatus[HttpStatus["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
13
- HttpStatus[HttpStatus["FOUND"] = 302] = "FOUND";
14
- HttpStatus[HttpStatus["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
15
- // 4xx Client Errors
16
- HttpStatus[HttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
17
- HttpStatus[HttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
18
- HttpStatus[HttpStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
19
- HttpStatus[HttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
20
- HttpStatus[HttpStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
21
- HttpStatus[HttpStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
22
- HttpStatus[HttpStatus["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
23
- HttpStatus[HttpStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
24
- HttpStatus[HttpStatus["CONFLICT"] = 409] = "CONFLICT";
25
- HttpStatus[HttpStatus["GONE"] = 410] = "GONE";
26
- HttpStatus[HttpStatus["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
27
- HttpStatus[HttpStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
28
- HttpStatus[HttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
29
- // 5xx Server Errors
30
- HttpStatus[HttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
31
- HttpStatus[HttpStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
32
- HttpStatus[HttpStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
33
- HttpStatus[HttpStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
34
- HttpStatus[HttpStatus["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
35
- })(HttpStatus || (exports.HttpStatus = HttpStatus = {}));
@@ -1,2 +0,0 @@
1
- export declare const USER_ROLES: readonly ["USER", "EXPERT", "ADMIN"];
2
- export type UserRoles = (typeof USER_ROLES)[number];
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USER_ROLES = void 0;
4
- exports.USER_ROLES = ["USER", "EXPERT", "ADMIN"];
@@ -1,34 +0,0 @@
1
- export enum HttpStatus {
2
- // 2xx Success
3
- OK = 200,
4
- CREATED = 201,
5
- ACCEPTED = 202,
6
- NO_CONTENT = 204,
7
-
8
- // 3xx Redirection
9
- MOVED_PERMANENTLY = 301,
10
- FOUND = 302,
11
- NOT_MODIFIED = 304,
12
-
13
- // 4xx Client Errors
14
- BAD_REQUEST = 400,
15
- UNAUTHORIZED = 401,
16
- PAYMENT_REQUIRED = 402,
17
- FORBIDDEN = 403,
18
- NOT_FOUND = 404,
19
- METHOD_NOT_ALLOWED = 405,
20
- NOT_ACCEPTABLE = 406,
21
- REQUEST_TIMEOUT = 408,
22
- CONFLICT = 409,
23
- GONE = 410,
24
- PAYLOAD_TOO_LARGE = 413,
25
- UNSUPPORTED_MEDIA_TYPE = 415,
26
- TOO_MANY_REQUESTS = 429,
27
-
28
- // 5xx Server Errors
29
- INTERNAL_SERVER_ERROR = 500,
30
- NOT_IMPLEMENTED = 501,
31
- BAD_GATEWAY = 502,
32
- SERVICE_UNAVAILABLE = 503,
33
- GATEWAY_TIMEOUT = 504,
34
- }
@@ -1,2 +0,0 @@
1
- export const USER_ROLES = ["USER", "EXPERT", "ADMIN"] as const;
2
- export type UserRoles = (typeof USER_ROLES)[number];
@@ -1,16 +0,0 @@
1
- import { RequestUser } from "../../3-presentation/types/RequestType";
2
- import { UserRoles } from "../../0-domain/entities/UserRoles";
3
-
4
- export interface RequestUser {
5
- id: string | number;
6
- email: string;
7
- role: UserRoles;
8
- }
9
-
10
- declare global {
11
- namespace Express {
12
- interface Request {
13
- user: RequestUser;
14
- }
15
- }
16
- }