@easyweb/rabbitmq-utils 1.0.12 → 1.0.13

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/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./events";
2
+ export * from "./observability";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Events - RabbitMQ Event System
18
18
  __exportStar(require("./events"), exports);
19
+ // Observability - Types & Constants
20
+ __exportStar(require("./observability"), exports);
19
21
  //# 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,iCAAiC;AACjC,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,2CAAyB;AAEzB,oCAAoC;AACpC,kDAAgC"}
@@ -0,0 +1,22 @@
1
+ export declare const SERVICE_NAMES: {
2
+ readonly AUTH: "auth-service";
3
+ readonly PAYMENT: "payment-gateway";
4
+ readonly WEBSITE_BUILDER: "website-builder";
5
+ readonly INSTAGRAM_SCRAPER: "instagram-scraper";
6
+ readonly WORKER: "website-builder-worker";
7
+ };
8
+ export declare const OTEL_ATTR: {
9
+ readonly SERVICE_NAMESPACE: "easyweb";
10
+ readonly REQUEST_ID: "easyweb.request_id";
11
+ readonly USER_ID: "easyweb.user_id";
12
+ readonly SUBSCRIPTION_ID: "easyweb.subscription_id";
13
+ readonly INVOICE_ID: "easyweb.invoice_id";
14
+ readonly PROJECT_ID: "easyweb.project_id";
15
+ };
16
+ export declare const PII_ATTRIBUTE_KEYS: readonly ["user.password", "user.password_hash", "payment.card_number", "payment.card_cvv", "http.request.header.authorization", "http.request.header.cookie", "db.statement"];
17
+ export declare const LOG_RETENTION_DAYS: {
18
+ readonly HOT: 7;
19
+ readonly WARM: 30;
20
+ readonly COLD: 730;
21
+ };
22
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/observability/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAGX,eAAO,MAAM,kBAAkB,gLAQrB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOG_RETENTION_DAYS = exports.PII_ATTRIBUTE_KEYS = exports.OTEL_ATTR = exports.SERVICE_NAMES = void 0;
4
+ exports.SERVICE_NAMES = {
5
+ AUTH: "auth-service",
6
+ PAYMENT: "payment-gateway",
7
+ WEBSITE_BUILDER: "website-builder",
8
+ INSTAGRAM_SCRAPER: "instagram-scraper",
9
+ WORKER: "website-builder-worker",
10
+ };
11
+ exports.OTEL_ATTR = {
12
+ SERVICE_NAMESPACE: "easyweb",
13
+ REQUEST_ID: "easyweb.request_id",
14
+ USER_ID: "easyweb.user_id",
15
+ SUBSCRIPTION_ID: "easyweb.subscription_id",
16
+ INVOICE_ID: "easyweb.invoice_id",
17
+ PROJECT_ID: "easyweb.project_id",
18
+ };
19
+ // Sensitive attribute keys the OTel Collector must redact
20
+ exports.PII_ATTRIBUTE_KEYS = [
21
+ "user.password",
22
+ "user.password_hash",
23
+ "payment.card_number",
24
+ "payment.card_cvv",
25
+ "http.request.header.authorization",
26
+ "http.request.header.cookie",
27
+ "db.statement",
28
+ ];
29
+ exports.LOG_RETENTION_DAYS = {
30
+ HOT: 7,
31
+ WARM: 30,
32
+ COLD: 730,
33
+ };
34
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/observability/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,iBAAiB;IAC1B,eAAe,EAAE,iBAAiB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,MAAM,EAAE,wBAAwB;CACxB,CAAC;AAEE,QAAA,SAAS,GAAG;IACvB,iBAAiB,EAAE,SAAS;IAC5B,UAAU,EAAE,oBAAoB;IAChC,OAAO,EAAE,iBAAiB;IAC1B,eAAe,EAAE,yBAAyB;IAC1C,UAAU,EAAE,oBAAoB;IAChC,UAAU,EAAE,oBAAoB;CACxB,CAAC;AAEX,0DAA0D;AAC7C,QAAA,kBAAkB,GAAG;IAChC,eAAe;IACf,oBAAoB;IACpB,qBAAqB;IACrB,kBAAkB;IAClB,mCAAmC;IACnC,4BAA4B;IAC5B,cAAc;CACN,CAAC;AAEE,QAAA,kBAAkB,GAAG;IAChC,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,GAAG;CACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./constants";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/observability/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,19 @@
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("./types"), exports);
18
+ __exportStar(require("./constants"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/observability/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B"}
@@ -0,0 +1,40 @@
1
+ export type LogSeverity = "trace" | "debug" | "info" | "warn" | "error" | "fatal";
2
+ export type LogTier = "hot" | "warm" | "cold";
3
+ /**
4
+ * Base fields present on every structured log line.
5
+ * NOTE: trace_id and span_id use snake_case intentionally — this matches the
6
+ * W3C OpenTelemetry wire format and Grafana Loki label conventions. All other
7
+ * fields follow camelCase per TypeScript project conventions.
8
+ */
9
+ export interface BaseLogFields {
10
+ service: string;
11
+ env: string;
12
+ requestId: string;
13
+ trace_id?: string;
14
+ span_id?: string;
15
+ userId?: string;
16
+ correlationId?: string;
17
+ }
18
+ export interface HttpLogFields extends BaseLogFields {
19
+ method: string;
20
+ url: string;
21
+ status: number;
22
+ duration: string;
23
+ ip?: string;
24
+ userAgent?: string;
25
+ }
26
+ export interface AuditLogFields extends BaseLogFields {
27
+ action: string;
28
+ resourceType: string;
29
+ resourceId: string;
30
+ actor: string;
31
+ outcome: "success" | "failure";
32
+ metadata?: Record<string, unknown>;
33
+ }
34
+ export interface PaymentAuditFields extends AuditLogFields {
35
+ invoiceId?: string;
36
+ amount?: number;
37
+ currency?: string;
38
+ paymentMethod?: string;
39
+ }
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/observability/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,OAAO,CAAC;AAEZ,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/observability/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyweb/rabbitmq-utils",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Common utilities and middleware for Easyweb microservices architecture",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",