@trash-streamers/common 1.2.11 → 1.2.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.
@@ -14,4 +14,9 @@ export declare const GRPC_CLIENTS: {
14
14
  readonly protoPath: string;
15
15
  readonly env: "USERS_GRPC_URL";
16
16
  };
17
+ readonly MEDIA_PACKAGE: {
18
+ readonly package: "media.v1";
19
+ readonly protoPath: string;
20
+ readonly env: "MEDIA_GRPC_URL";
21
+ };
17
22
  };
@@ -4,18 +4,23 @@ exports.GRPC_CLIENTS = void 0;
4
4
  const contracts_1 = require("@trash-streamers/contracts");
5
5
  exports.GRPC_CLIENTS = {
6
6
  AUTH_PACKAGE: {
7
- package: 'auth.v1',
7
+ package: "auth.v1",
8
8
  protoPath: contracts_1.PROTO_PATHS.AUTH,
9
- env: 'AUTH_GRPC_URL'
9
+ env: "AUTH_GRPC_URL",
10
10
  },
11
11
  ACCOUNT_PACKAGE: {
12
- package: 'account.v1',
12
+ package: "account.v1",
13
13
  protoPath: contracts_1.PROTO_PATHS.ACCOUNT,
14
- env: 'AUTH_GRPC_URL'
14
+ env: "AUTH_GRPC_URL",
15
15
  },
16
16
  USERS_PACKAGE: {
17
- package: 'users.v1',
17
+ package: "users.v1",
18
18
  protoPath: contracts_1.PROTO_PATHS.USERS,
19
- env: 'USERS_GRPC_URL'
20
- }
19
+ env: "USERS_GRPC_URL",
20
+ },
21
+ MEDIA_PACKAGE: {
22
+ package: "media.v1",
23
+ protoPath: contracts_1.PROTO_PATHS.MEDIA,
24
+ env: "MEDIA_GRPC_URL",
25
+ },
21
26
  };
@@ -1 +1,3 @@
1
- export * from './env';
1
+ export * from "./env";
2
+ export * from "./to-timestamp";
3
+ export * from "./timestamp-to-date";
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./env"), exports);
18
+ __exportStar(require("./to-timestamp"), exports);
19
+ __exportStar(require("./timestamp-to-date"), exports);
@@ -0,0 +1 @@
1
+ export declare function timestampToDate(timestamp: any): Date | undefined;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timestampToDate = timestampToDate;
4
+ function timestampToDate(timestamp) {
5
+ if (!timestamp)
6
+ return undefined;
7
+ if (timestamp instanceof Date)
8
+ return timestamp;
9
+ if (typeof timestamp === "object" && "seconds" in timestamp) {
10
+ return new Date(timestamp.seconds * 1000 + (timestamp.nanos || 0) / 1_000_000);
11
+ }
12
+ return undefined;
13
+ }
@@ -0,0 +1,4 @@
1
+ export declare function toTimestamp(date: Date): {
2
+ seconds: number;
3
+ nanos: number;
4
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toTimestamp = toTimestamp;
4
+ function toTimestamp(date) {
5
+ return {
6
+ seconds: Math.floor(date.getTime() / 1000),
7
+ nanos: (date.getTime() % 1000) * 1_000_000,
8
+ };
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trash-streamers/common",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
4
4
  "description": "Core shared component for Trash-streamers microservice ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,6 +29,6 @@
29
29
  "dependencies": {
30
30
  "@nestjs/common": "^11.1.12",
31
31
  "@nestjs/config": "^4.0.2",
32
- "@trash-streamers/contracts": "^1.1.27"
32
+ "@trash-streamers/contracts": "^1.1.30"
33
33
  }
34
34
  }