@togatherlabs/shared-utils 1.2.0 โ†’ 1.4.0

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/README.md CHANGED
@@ -2,28 +2,24 @@
2
2
 
3
3
  Shared utilities library for Togather services, providing production-grade utilities including logger, validators, and common helpers.
4
4
 
5
- ## ๐Ÿ“ฆ Installation
5
+ # Togather Shared Utilities
6
+
7
+ A collection of shared utilities and helpers for Togather services. This library provides production-ready, reusable components to maintain consistency across the infrastructure.
8
+
9
+ ## Installation
6
10
 
7
11
  ```bash
8
12
  pnpm add @togatherlabs/shared-utils
9
13
  ```
10
14
 
11
- ## ๐Ÿš€ Features
12
-
13
- ### Logger Module
14
- Production-ready logging built on [Pino](https://getpino.io/) with:
15
- - ๐Ÿ”’ Automatic sensitive data redaction
16
- - ๐Ÿ“Š Structured logging with context
17
- - ๐ŸŽจ Environment-aware (pretty dev logs, JSON production logs)
18
- - ๐Ÿ”ง Fully configurable
19
- - โšก High performance
20
-
21
- ## ๐Ÿ“š Available Modules
15
+ ## Available Modules
22
16
 
23
17
  ### Logger
24
18
 
19
+ Production-ready structured logging built on [Pino](https://getpino.io/). Features include automatic sensitive data redaction, environment-aware formatting (pretty logs in development, JSON in production), and full configurability.
20
+
25
21
  ```typescript
26
- import { Logger, ILogger } from '@togatherlabs/shared-utils/logger';
22
+ import { Logger, type LoggerConfig } from '@togatherlabs/shared-utils/logger';
27
23
 
28
24
  // Minimal - uses defaults
29
25
  const logger = new Logger();
@@ -41,7 +37,7 @@ logger.error({ err, label: 'database' }, 'Connection failed');
41
37
 
42
38
  **Full documentation**: [Logger README](./src/logger/README.md)
43
39
 
44
- ## ๐Ÿ”ง Usage
40
+ ## Usage
45
41
 
46
42
  ### Basic Import
47
43
 
@@ -96,7 +92,7 @@ class UserService {
96
92
  }
97
93
  ```
98
94
 
99
- ## ๐Ÿ› ๏ธ Development
95
+ ## Development
100
96
 
101
97
  ### Setup
102
98
 
@@ -138,7 +134,7 @@ togather-shared-utils/
138
134
  โ””โ”€โ”€ README.md
139
135
  ```
140
136
 
141
- ## ๐Ÿ“ค Publishing
137
+ ## Publishing
142
138
 
143
139
  ### Version Bumping
144
140
 
@@ -175,7 +171,7 @@ The publish script automatically:
175
171
  - โœ… Publishes to npm
176
172
  - โœ… Creates and pushes git tag
177
173
 
178
- ## ๐Ÿ”„ Workflow
174
+ ## Workflow
179
175
 
180
176
  ### Adding a New Feature
181
177
 
@@ -206,7 +202,7 @@ The publish script automatically:
206
202
  pnpm run publish:npm
207
203
  ```
208
204
 
209
- ## ๐Ÿ“‹ Commit Convention
205
+ ## Commit Convention
210
206
 
211
207
  This project uses [Conventional Commits](https://www.conventionalcommits.org/):
212
208
 
@@ -236,7 +232,7 @@ integration with external logging services.
236
232
 
237
233
  Use `pnpm run commit` for an interactive commit prompt.
238
234
 
239
- ## ๐Ÿงช Testing
235
+ ## Testing
240
236
 
241
237
  ```bash
242
238
  # Run tests (when available)
@@ -246,26 +242,26 @@ pnpm test
246
242
  pnpm test:coverage
247
243
  ```
248
244
 
249
- ## ๐Ÿ“– Documentation
245
+ ## Documentation
250
246
 
251
247
  - [Logger Documentation](./src/logger/README.md)
252
248
 
253
- ## ๐Ÿค Contributing
249
+ ## Contributing
254
250
 
255
251
  1. Follow the commit convention
256
252
  2. Write tests for new features
257
253
  3. Update documentation
258
254
  4. Ensure all checks pass before publishing
259
255
 
260
- ## ๐Ÿ“„ License
256
+ ## License
261
257
 
262
258
  Internal use only - Togather Infrastructure
263
259
 
264
- ## ๐Ÿ†˜ Support
260
+ ## Support
265
261
 
266
262
  For questions or issues, contact the platform team.
267
263
 
268
- ## ๐Ÿ”— Related Packages
264
+ ## Related Packages
269
265
 
270
266
  - [@togatherlabs/shared-protos](../togather-shared-protos) - Shared Protocol Buffers
271
267
  - [@togatherlabs/event-sdk](../togather-shared-events) - Event handling SDK
@@ -0,0 +1,2 @@
1
+ export * from './sample.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './sample.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const SAMPLE: {
2
+ Char: string;
3
+ };
4
+ //# sourceMappingURL=sample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../src/constants/sample.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;CAElB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export const SAMPLE = {
2
+ Char: 'A',
3
+ };
4
+ //# sourceMappingURL=sample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample.js","sourceRoot":"","sources":["../../src/constants/sample.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,IAAI,EAAE,GAAG;CACT,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function formatDate(date: Date, locale?: string): string;
2
+ //# sourceMappingURL=formatDate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDate.d.ts","sourceRoot":"","sources":["../../src/helpers/formatDate.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,SAAU,GAAG,MAAM,CAU/D"}
@@ -0,0 +1,11 @@
1
+ export function formatDate(date, locale = 'en-IN') {
2
+ if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
3
+ throw new Error('Invalid Date');
4
+ }
5
+ return date.toLocaleDateString(locale, {
6
+ year: 'numeric',
7
+ month: 'short',
8
+ day: 'numeric',
9
+ });
10
+ }
11
+ //# sourceMappingURL=formatDate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../../src/helpers/formatDate.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,MAAM,GAAG,OAAO;IACtD,IAAI,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE;QACtC,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;KACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './formatDate.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './formatDate.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './user.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './user.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface UserDTO {
2
+ id: string;
3
+ name: string;
4
+ email: string;
5
+ }
6
+ //# sourceMappingURL=user.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@togatherlabs/shared-utils",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Shared utilities for Togather services including logger, validators, and common helpers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",