@articketing2021/common 1.0.9 → 1.0.11

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.
@@ -0,0 +1,2 @@
1
+ export * from "./ticket-created-listener";
2
+ export * from "./ticket-updated-listener";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ticket-created-listener"), exports);
18
+ __exportStar(require("./ticket-updated-listener"), exports);
@@ -0,0 +1,4 @@
1
+ export * from "./base-listener";
2
+ export * from "./base-publisher";
3
+ export * from "./Tickets";
4
+ export * from "./orders";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./base-listener"), exports);
18
+ __exportStar(require("./base-publisher"), exports);
19
+ __exportStar(require("./Tickets"), exports);
20
+ __exportStar(require("./orders"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./order-cancelled-event";
2
+ export * from "./order-created-event";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./order-cancelled-event"), exports);
18
+ __exportStar(require("./order-created-event"), exports);
@@ -0,0 +1,10 @@
1
+ import { Subjects } from "../../types";
2
+ export interface OrderCancelledEvent {
3
+ subject: Subjects.OrderCancelled;
4
+ data: {
5
+ id: string;
6
+ ticket: {
7
+ id: string;
8
+ };
9
+ };
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { OrderStatus, Subjects } from "../../types";
2
+ export interface OrderCreatedEvent {
3
+ subject: Subjects.OrderCreated;
4
+ data: {
5
+ id: string;
6
+ status: OrderStatus;
7
+ userId: string;
8
+ expiresAt: string;
9
+ ticket: {
10
+ id: string;
11
+ price: number;
12
+ };
13
+ };
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/build/index.d.ts CHANGED
@@ -9,10 +9,8 @@ export * from "./middleware/current-user";
9
9
  export * from "./middleware/error-handler";
10
10
  export * from "./middleware/require-auth";
11
11
  export * from "./middleware/validate-request";
12
- export * from "./events/base-listener";
13
- export * from "./events/base-publisher";
12
+ export * from "./events";
14
13
  export * from "./events/Tickets/ticket-created-listener";
15
14
  export * from "./events/Tickets/ticket-updated-listener";
16
15
  export * from "./types/index";
17
- export * from "./types/events";
18
16
  export * from "./types/events/tickets";
package/build/index.js CHANGED
@@ -28,13 +28,11 @@ __exportStar(require("./middleware/error-handler"), exports);
28
28
  __exportStar(require("./middleware/require-auth"), exports);
29
29
  __exportStar(require("./middleware/validate-request"), exports);
30
30
  //Events
31
- __exportStar(require("./events/base-listener"), exports);
32
- __exportStar(require("./events/base-publisher"), exports);
31
+ __exportStar(require("./events"), exports);
33
32
  //Events-tickets
34
33
  __exportStar(require("./events/Tickets/ticket-created-listener"), exports);
35
34
  __exportStar(require("./events/Tickets/ticket-updated-listener"), exports);
36
35
  //enum
37
36
  __exportStar(require("./types/index"), exports);
38
- __exportStar(require("./types/events"), exports);
39
37
  //interface
40
38
  __exportStar(require("./types/events/tickets"), exports);
@@ -1,5 +1,7 @@
1
1
  export declare enum Subjects {
2
2
  TicketCreated = "ticket:created",
3
- TicketUpdated = "ticket:updated"
3
+ TicketUpdated = "ticket:updated",
4
+ OrderCreated = "order:created",
5
+ OrderCancelled = "order:cancelled"
4
6
  }
5
7
  export * from "./orders";
@@ -19,5 +19,7 @@ var Subjects;
19
19
  (function (Subjects) {
20
20
  Subjects["TicketCreated"] = "ticket:created";
21
21
  Subjects["TicketUpdated"] = "ticket:updated";
22
+ Subjects["OrderCreated"] = "order:created";
23
+ Subjects["OrderCancelled"] = "order:cancelled";
22
24
  })(Subjects || (exports.Subjects = Subjects = {}));
23
25
  __exportStar(require("./orders"), exports);
@@ -1,3 +1,4 @@
1
1
  export * from "../types/users";
2
2
  export * from "../types/events/tickets";
3
3
  export * from "../types/events";
4
+ export * from "../types/statusCode";
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("../types/users"), exports);
18
18
  __exportStar(require("../types/events/tickets"), exports);
19
19
  __exportStar(require("../types/events"), exports);
20
+ __exportStar(require("../types/statusCode"), exports);
@@ -0,0 +1,64 @@
1
+ export declare enum HttpStatus {
2
+ Continue = 100,
3
+ SwitchingProtocols = 101,
4
+ Processing = 102,// WebDAV, deprecated :contentReference[oaicite:1]{index=1}
5
+ EarlyHints = 103,
6
+ OK = 200,
7
+ Created = 201,
8
+ Accepted = 202,
9
+ NonAuthoritativeInformation = 203,
10
+ NoContent = 204,
11
+ ResetContent = 205,
12
+ PartialContent = 206,
13
+ MultiStatus = 207,// WebDAV
14
+ AlreadyReported = 208,// WebDAV
15
+ IMUsed = 226,// HTTP Delta encoding
16
+ MultipleChoices = 300,
17
+ MovedPermanently = 301,
18
+ Found = 302,
19
+ SeeOther = 303,
20
+ NotModified = 304,
21
+ UseProxy = 305,// Deprecated
22
+ TemporaryRedirect = 307,
23
+ PermanentRedirect = 308,
24
+ BadRequest = 400,
25
+ Unauthorized = 401,
26
+ PaymentRequired = 402,
27
+ Forbidden = 403,
28
+ NotFound = 404,
29
+ MethodNotAllowed = 405,
30
+ NotAcceptable = 406,
31
+ ProxyAuthenticationRequired = 407,
32
+ RequestTimeout = 408,
33
+ Conflict = 409,
34
+ Gone = 410,
35
+ LengthRequired = 411,
36
+ PreconditionFailed = 412,
37
+ ContentTooLarge = 413,
38
+ URITooLong = 414,
39
+ UnsupportedMediaType = 415,
40
+ RangeNotSatisfiable = 416,
41
+ ExpectationFailed = 417,
42
+ ImATeapot = 418,
43
+ MisdirectedRequest = 421,
44
+ UnprocessableContent = 422,// WebDAV
45
+ Locked = 423,// WebDAV
46
+ FailedDependency = 424,// WebDAV
47
+ TooEarly = 425,// Experimental :contentReference[oaicite:2]{index=2}
48
+ UpgradeRequired = 426,
49
+ PreconditionRequired = 428,
50
+ TooManyRequests = 429,
51
+ RequestHeaderFieldsTooLarge = 431,
52
+ UnavailableForLegalReasons = 451,
53
+ InternalServerError = 500,
54
+ NotImplemented = 501,
55
+ BadGateway = 502,
56
+ ServiceUnavailable = 503,
57
+ GatewayTimeout = 504,
58
+ HTTPVersionNotSupported = 505,
59
+ VariantAlsoNegotiates = 506,
60
+ InsufficientStorage = 507,// WebDAV
61
+ LoopDetected = 508,// WebDAV
62
+ NotExtended = 510,
63
+ NetworkAuthenticationRequired = 511
64
+ }
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpStatus = void 0;
4
+ var HttpStatus;
5
+ (function (HttpStatus) {
6
+ // Informational
7
+ HttpStatus[HttpStatus["Continue"] = 100] = "Continue";
8
+ HttpStatus[HttpStatus["SwitchingProtocols"] = 101] = "SwitchingProtocols";
9
+ HttpStatus[HttpStatus["Processing"] = 102] = "Processing";
10
+ HttpStatus[HttpStatus["EarlyHints"] = 103] = "EarlyHints";
11
+ // Successful
12
+ HttpStatus[HttpStatus["OK"] = 200] = "OK";
13
+ HttpStatus[HttpStatus["Created"] = 201] = "Created";
14
+ HttpStatus[HttpStatus["Accepted"] = 202] = "Accepted";
15
+ HttpStatus[HttpStatus["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation";
16
+ HttpStatus[HttpStatus["NoContent"] = 204] = "NoContent";
17
+ HttpStatus[HttpStatus["ResetContent"] = 205] = "ResetContent";
18
+ HttpStatus[HttpStatus["PartialContent"] = 206] = "PartialContent";
19
+ HttpStatus[HttpStatus["MultiStatus"] = 207] = "MultiStatus";
20
+ HttpStatus[HttpStatus["AlreadyReported"] = 208] = "AlreadyReported";
21
+ HttpStatus[HttpStatus["IMUsed"] = 226] = "IMUsed";
22
+ // Redirection
23
+ HttpStatus[HttpStatus["MultipleChoices"] = 300] = "MultipleChoices";
24
+ HttpStatus[HttpStatus["MovedPermanently"] = 301] = "MovedPermanently";
25
+ HttpStatus[HttpStatus["Found"] = 302] = "Found";
26
+ HttpStatus[HttpStatus["SeeOther"] = 303] = "SeeOther";
27
+ HttpStatus[HttpStatus["NotModified"] = 304] = "NotModified";
28
+ HttpStatus[HttpStatus["UseProxy"] = 305] = "UseProxy";
29
+ HttpStatus[HttpStatus["TemporaryRedirect"] = 307] = "TemporaryRedirect";
30
+ HttpStatus[HttpStatus["PermanentRedirect"] = 308] = "PermanentRedirect";
31
+ // Client Errors
32
+ HttpStatus[HttpStatus["BadRequest"] = 400] = "BadRequest";
33
+ HttpStatus[HttpStatus["Unauthorized"] = 401] = "Unauthorized";
34
+ HttpStatus[HttpStatus["PaymentRequired"] = 402] = "PaymentRequired";
35
+ HttpStatus[HttpStatus["Forbidden"] = 403] = "Forbidden";
36
+ HttpStatus[HttpStatus["NotFound"] = 404] = "NotFound";
37
+ HttpStatus[HttpStatus["MethodNotAllowed"] = 405] = "MethodNotAllowed";
38
+ HttpStatus[HttpStatus["NotAcceptable"] = 406] = "NotAcceptable";
39
+ HttpStatus[HttpStatus["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
40
+ HttpStatus[HttpStatus["RequestTimeout"] = 408] = "RequestTimeout";
41
+ HttpStatus[HttpStatus["Conflict"] = 409] = "Conflict";
42
+ HttpStatus[HttpStatus["Gone"] = 410] = "Gone";
43
+ HttpStatus[HttpStatus["LengthRequired"] = 411] = "LengthRequired";
44
+ HttpStatus[HttpStatus["PreconditionFailed"] = 412] = "PreconditionFailed";
45
+ HttpStatus[HttpStatus["ContentTooLarge"] = 413] = "ContentTooLarge";
46
+ HttpStatus[HttpStatus["URITooLong"] = 414] = "URITooLong";
47
+ HttpStatus[HttpStatus["UnsupportedMediaType"] = 415] = "UnsupportedMediaType";
48
+ HttpStatus[HttpStatus["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable";
49
+ HttpStatus[HttpStatus["ExpectationFailed"] = 417] = "ExpectationFailed";
50
+ HttpStatus[HttpStatus["ImATeapot"] = 418] = "ImATeapot";
51
+ HttpStatus[HttpStatus["MisdirectedRequest"] = 421] = "MisdirectedRequest";
52
+ HttpStatus[HttpStatus["UnprocessableContent"] = 422] = "UnprocessableContent";
53
+ HttpStatus[HttpStatus["Locked"] = 423] = "Locked";
54
+ HttpStatus[HttpStatus["FailedDependency"] = 424] = "FailedDependency";
55
+ HttpStatus[HttpStatus["TooEarly"] = 425] = "TooEarly";
56
+ HttpStatus[HttpStatus["UpgradeRequired"] = 426] = "UpgradeRequired";
57
+ HttpStatus[HttpStatus["PreconditionRequired"] = 428] = "PreconditionRequired";
58
+ HttpStatus[HttpStatus["TooManyRequests"] = 429] = "TooManyRequests";
59
+ HttpStatus[HttpStatus["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge";
60
+ HttpStatus[HttpStatus["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons";
61
+ // Server Errors
62
+ HttpStatus[HttpStatus["InternalServerError"] = 500] = "InternalServerError";
63
+ HttpStatus[HttpStatus["NotImplemented"] = 501] = "NotImplemented";
64
+ HttpStatus[HttpStatus["BadGateway"] = 502] = "BadGateway";
65
+ HttpStatus[HttpStatus["ServiceUnavailable"] = 503] = "ServiceUnavailable";
66
+ HttpStatus[HttpStatus["GatewayTimeout"] = 504] = "GatewayTimeout";
67
+ HttpStatus[HttpStatus["HTTPVersionNotSupported"] = 505] = "HTTPVersionNotSupported";
68
+ HttpStatus[HttpStatus["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates";
69
+ HttpStatus[HttpStatus["InsufficientStorage"] = 507] = "InsufficientStorage";
70
+ HttpStatus[HttpStatus["LoopDetected"] = 508] = "LoopDetected";
71
+ HttpStatus[HttpStatus["NotExtended"] = 510] = "NotExtended";
72
+ HttpStatus[HttpStatus["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired";
73
+ })(HttpStatus || (exports.HttpStatus = HttpStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@articketing2021/common",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Common reusable utilities, middlewares, and types for Articketing microservices.",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",