@laboratory-one/api-components 0.0.4 → 0.0.6

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.
Files changed (29) hide show
  1. package/dist/cjs/health/dtos/health.response.dto.d.ts +6 -7
  2. package/dist/cjs/health/dtos/health.response.dto.d.ts.map +1 -1
  3. package/dist/cjs/health/dtos/health.response.dto.js +0 -2
  4. package/dist/cjs/health/dtos/health.response.dto.js.map +1 -1
  5. package/dist/cjs/health/health.service.d.ts +2 -3
  6. package/dist/cjs/health/health.service.d.ts.map +1 -1
  7. package/dist/cjs/health/health.service.js +1 -4
  8. package/dist/cjs/health/health.service.js.map +1 -1
  9. package/dist/cjs/push/push.service.d.ts +2 -1
  10. package/dist/cjs/push/push.service.d.ts.map +1 -1
  11. package/dist/cjs/push/push.service.js +2 -2
  12. package/dist/cjs/push/push.service.js.map +1 -1
  13. package/dist/esm/health/dtos/health.response.dto.d.ts +6 -7
  14. package/dist/esm/health/dtos/health.response.dto.d.ts.map +1 -1
  15. package/dist/esm/health/dtos/health.response.dto.js +0 -2
  16. package/dist/esm/health/dtos/health.response.dto.js.map +1 -1
  17. package/dist/esm/health/health.service.d.ts +2 -3
  18. package/dist/esm/health/health.service.d.ts.map +1 -1
  19. package/dist/esm/health/health.service.js +2 -5
  20. package/dist/esm/health/health.service.js.map +1 -1
  21. package/dist/esm/push/push.service.d.ts +2 -1
  22. package/dist/esm/push/push.service.d.ts.map +1 -1
  23. package/dist/esm/push/push.service.js +2 -2
  24. package/dist/esm/push/push.service.js.map +1 -1
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +11 -11
  27. package/src/health/dtos/health.response.dto.ts +10 -9
  28. package/src/health/health.service.ts +1 -4
  29. package/src/push/push.service.ts +3 -1
@@ -1,10 +1,9 @@
1
- import * as healthCheckResultInterface from '@nestjs/terminus/dist/health-check/health-check-result.interface';
2
- import * as healthIndicator from '@nestjs/terminus/dist/health-indicator';
3
- export declare class HealthResponseDto implements healthCheckResultInterface.HealthCheckResult {
4
- status: healthCheckResultInterface.HealthCheckStatus;
5
- info?: healthIndicator.HealthIndicatorResult;
6
- error?: healthIndicator.HealthIndicatorResult;
7
- details: healthIndicator.HealthIndicatorResult;
1
+ import type { HealthCheckResult, HealthCheckStatus, HealthIndicatorResult } from '@nestjs/terminus';
2
+ export declare class HealthResponseDto implements HealthCheckResult {
3
+ status: HealthCheckStatus;
4
+ info?: HealthIndicatorResult;
5
+ error?: HealthIndicatorResult;
6
+ details: HealthIndicatorResult;
8
7
  environment: string;
9
8
  }
10
9
  //# sourceMappingURL=health.response.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.response.dto.d.ts","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,0BAA0B,MAAM,kEAAkE,CAAC;AAG/G,OAAO,KAAK,eAAe,MAAM,wCAAwC,CAAC;AAE1E,qBAAa,iBACX,YAAW,0BAA0B,CAAC,iBAAiB;IAGvD,MAAM,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;IAGrD,IAAI,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAG7C,KAAK,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAG9C,OAAO,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAI/C,WAAW,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"health.response.dto.d.ts","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,iBAAkB,YAAW,iBAAiB;IAEzD,MAAM,EAAE,iBAAiB,CAAC;IAG1B,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAG7B,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAG9B,OAAO,EAAE,qBAAqB,CAAC;IAI/B,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -2,10 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HealthResponseDto = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const healthCheckResultInterface = tslib_1.__importStar(require("@nestjs/terminus/dist/health-check/health-check-result.interface"));
6
5
  const class_validator_1 = require("class-validator");
7
6
  const swagger_1 = require("@nestjs/swagger");
8
- const healthIndicator = tslib_1.__importStar(require("@nestjs/terminus/dist/health-indicator"));
9
7
  class HealthResponseDto {
10
8
  }
11
9
  exports.HealthResponseDto = HealthResponseDto;
@@ -1 +1 @@
1
- {"version":3,"file":"health.response.dto.js","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":";;;;AAAA,qIAA+G;AAC/G,qDAA2C;AAC3C,6CAA8C;AAC9C,gGAA0E;AAE1E,MAAa,iBAAiB;CAkB7B;AAlBD,8CAkBC;AAdC;IADC,IAAA,qBAAW,GAAE;;iDACuC;AAGrD;IADC,IAAA,qBAAW,GAAE;;+CAC+B;AAG7C;IADC,IAAA,qBAAW,GAAE;;gDACgC;AAG9C;IADC,IAAA,qBAAW,GAAE;;kDACiC;AAI/C;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;sDACM","sourcesContent":["import * as healthCheckResultInterface from '@nestjs/terminus/dist/health-check/health-check-result.interface';\nimport { IsString } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport * as healthIndicator from '@nestjs/terminus/dist/health-indicator';\n\nexport class HealthResponseDto\n implements healthCheckResultInterface.HealthCheckResult\n{\n @ApiProperty()\n status: healthCheckResultInterface.HealthCheckStatus;\n\n @ApiProperty()\n info?: healthIndicator.HealthIndicatorResult;\n\n @ApiProperty()\n error?: healthIndicator.HealthIndicatorResult;\n\n @ApiProperty()\n details: healthIndicator.HealthIndicatorResult;\n\n @IsString()\n @ApiProperty()\n environment: string;\n}\n"]}
1
+ {"version":3,"file":"health.response.dto.js","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":";;;;AAAA,qDAA2C;AAC3C,6CAA8C;AAO9C,MAAa,iBAAiB;CAgB7B;AAhBD,8CAgBC;AAdC;IADC,IAAA,qBAAW,GAAE;;iDACY;AAG1B;IADC,IAAA,qBAAW,GAAE;;+CACe;AAG7B;IADC,IAAA,qBAAW,GAAE;;gDACgB;AAG9B;IADC,IAAA,qBAAW,GAAE;;kDACiB;AAI/B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,GAAE;;sDACM","sourcesContent":["import { IsString } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport type {\n HealthCheckResult,\n HealthCheckStatus,\n HealthIndicatorResult,\n} from '@nestjs/terminus';\n\nexport class HealthResponseDto implements HealthCheckResult {\n @ApiProperty()\n status: HealthCheckStatus;\n\n @ApiProperty()\n info?: HealthIndicatorResult;\n\n @ApiProperty()\n error?: HealthIndicatorResult;\n\n @ApiProperty()\n details: HealthIndicatorResult;\n\n @IsString()\n @ApiProperty()\n environment: string;\n}\n"]}
@@ -1,13 +1,12 @@
1
- import { HealthCheckService, HttpHealthIndicator, MemoryHealthIndicator } from '@nestjs/terminus';
1
+ import { HealthCheckService, MemoryHealthIndicator } from '@nestjs/terminus';
2
2
  import { ConfigService } from '@nestjs/config';
3
3
  import { HealthResponseDto } from './dtos/health.response.dto';
4
4
  export declare class HealthService {
5
5
  private readonly configService;
6
6
  private readonly health;
7
- private readonly http;
8
7
  private readonly memory;
9
8
  private readonly logger;
10
- constructor(configService: ConfigService, health: HealthCheckService, http: HttpHealthIndicator, memory: MemoryHealthIndicator);
9
+ constructor(configService: ConfigService, health: HealthCheckService, memory: MemoryHealthIndicator);
11
10
  check(): Promise<HealthResponseDto>;
12
11
  }
13
12
  //# sourceMappingURL=health.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.service.d.ts","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,qBACa,aAAa;IAKtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAG9C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,qBAAqB;IAG1C,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAiB1C"}
1
+ {"version":3,"file":"health.service.d.ts","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,qBACa,aAAa;IAKtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAG9C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,qBAAqB;IAG1C,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAgB1C"}
@@ -7,17 +7,15 @@ const common_1 = require("@nestjs/common");
7
7
  const terminus_1 = require("@nestjs/terminus");
8
8
  const config_1 = require("@nestjs/config");
9
9
  let HealthService = HealthService_1 = class HealthService {
10
- constructor(configService, health, http, memory) {
10
+ constructor(configService, health, memory) {
11
11
  this.configService = configService;
12
12
  this.health = health;
13
- this.http = http;
14
13
  this.memory = memory;
15
14
  this.logger = new common_1.Logger(HealthService_1.name);
16
15
  }
17
16
  async check() {
18
17
  this.logger.log('check');
19
18
  const statuses = await this.health.check([
20
- async () => this.http.pingCheck('website', 'https://google.com'),
21
19
  async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),
22
20
  async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),
23
21
  ]);
@@ -30,7 +28,6 @@ exports.HealthService = HealthService = HealthService_1 = tslib_1.__decorate([
30
28
  (0, common_1.Injectable)(),
31
29
  tslib_1.__metadata("design:paramtypes", [config_1.ConfigService,
32
30
  terminus_1.HealthCheckService,
33
- terminus_1.HttpHealthIndicator,
34
31
  terminus_1.MemoryHealthIndicator])
35
32
  ], HealthService);
36
33
  //# sourceMappingURL=health.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.service.js","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,+CAI0B;AAC1B,2CAA+C;AAQxC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAIxB,YACmB,aAA4B,EAC5B,MAA0B,EAC1B,IAAyB,EACzB,MAA6B;QAH7B,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAoB;QAC1B,SAAI,GAAJ,IAAI,CAAqB;QACzB,WAAM,GAAN,MAAM,CAAuB;QAN/B,WAAM,GAAW,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAO9D,CAAC;IAEJ,KAAK,CAAC,KAAK;QAET,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEzB,MAAM,QAAQ,GAAsB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1D,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,oBAAoB,CAAC;YAChE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;YAClE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;SAClE,CAAC,CAAC;QAEH,MAAM,WAAW,GAAW,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,CAAC;QAEvE,uBACE,WAAW,IACR,QAAQ,EACX;IACJ,CAAC;CACF,CAAA;AA5BY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;6CAMuB,sBAAa;QACpB,6BAAkB;QACpB,8BAAmB;QACjB,gCAAqB;GARrC,aAAa,CA4BzB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport {\n HealthCheckService,\n HttpHealthIndicator,\n MemoryHealthIndicator,\n} from '@nestjs/terminus';\nimport { ConfigService } from '@nestjs/config';\nimport { HealthCheckResult } from '@nestjs/terminus/dist/health-check/health-check-result.interface';\n\nimport { HealthResponseDto } from './dtos/health.response.dto';\n\n// this decorator indicates to nest that this class can be provided to a module\n// we want to handle logic in services to keep our resolvers and controllers clean\n@Injectable()\nexport class HealthService {\n // grab the global logger instance\n private readonly logger: Logger = new Logger(HealthService.name);\n\n constructor(\n private readonly configService: ConfigService,\n private readonly health: HealthCheckService,\n private readonly http: HttpHealthIndicator,\n private readonly memory: MemoryHealthIndicator,\n ) {}\n\n async check(): Promise<HealthResponseDto> {\n // this logger has several logging levels\n this.logger.log('check');\n\n const statuses: HealthCheckResult = await this.health.check([\n async () => this.http.pingCheck('website', 'https://google.com'),\n async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),\n async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),\n ]);\n\n const environment: string = this.configService.get<string>('NODE_ENV');\n\n return {\n environment,\n ...statuses,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"health.service.js","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,+CAI0B;AAC1B,2CAA+C;AAOxC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAIxB,YACmB,aAA4B,EAC5B,MAA0B,EAC1B,MAA6B;QAF7B,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAoB;QAC1B,WAAM,GAAN,MAAM,CAAuB;QAL/B,WAAM,GAAW,IAAI,eAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAM9D,CAAC;IAEJ,KAAK,CAAC,KAAK;QAET,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEzB,MAAM,QAAQ,GAAsB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1D,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;YAClE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;SAClE,CAAC,CAAC;QAEH,MAAM,WAAW,GAAW,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,CAAC;QAEvE,uBACE,WAAW,IACR,QAAQ,EACX;IACJ,CAAC;CACF,CAAA;AA1BY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;6CAMuB,sBAAa;QACpB,6BAAkB;QAClB,gCAAqB;GAPrC,aAAa,CA0BzB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport {\n HealthCheckResult,\n HealthCheckService,\n MemoryHealthIndicator,\n} from '@nestjs/terminus';\nimport { ConfigService } from '@nestjs/config';\n\nimport { HealthResponseDto } from './dtos/health.response.dto';\n\n// this decorator indicates to nest that this class can be provided to a module\n// we want to handle logic in services to keep our resolvers and controllers clean\n@Injectable()\nexport class HealthService {\n // grab the global logger instance\n private readonly logger: Logger = new Logger(HealthService.name);\n\n constructor(\n private readonly configService: ConfigService,\n private readonly health: HealthCheckService,\n private readonly memory: MemoryHealthIndicator,\n ) {}\n\n async check(): Promise<HealthResponseDto> {\n // this logger has several logging levels\n this.logger.log('check');\n\n const statuses: HealthCheckResult = await this.health.check([\n async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),\n async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),\n ]);\n\n const environment: string = this.configService.get<string>('NODE_ENV');\n\n return {\n environment,\n ...statuses,\n };\n }\n}\n"]}
@@ -3,9 +3,10 @@ export declare class PushService {
3
3
  private readonly logger;
4
4
  private readonly expo;
5
5
  constructor();
6
- createMessages({ body, pushTokens, }: {
6
+ createMessages({ body, pushTokens, data, }: {
7
7
  body: string;
8
8
  pushTokens: string[];
9
+ data?: Record<string, unknown>;
9
10
  }): ExpoPushMessage[];
10
11
  sendMessages(messages: ExpoPushMessage[]): Promise<undefined>;
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"push.service.d.ts","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExD,qBACa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;;IAQxC,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,GACX,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,GAAG,eAAe,EAAE;IAsBf,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;CAoBpE"}
1
+ {"version":3,"file":"push.service.d.ts","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExD,qBACa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;;IAQxC,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,EACV,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,GAAG,eAAe,EAAE;IAsBf,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;CAoBpE"}
@@ -12,7 +12,7 @@ let PushService = PushService_1 = class PushService {
12
12
  useFcmV1: true,
13
13
  });
14
14
  }
15
- createMessages({ body, pushTokens, }) {
15
+ createMessages({ body, pushTokens, data, }) {
16
16
  this.logger.debug('createMessage');
17
17
  const messages = [];
18
18
  for (const pushToken of pushTokens) {
@@ -23,7 +23,7 @@ let PushService = PushService_1 = class PushService {
23
23
  to: pushToken,
24
24
  sound: 'default',
25
25
  body,
26
- data: { withSome: 'data' },
26
+ data,
27
27
  });
28
28
  }
29
29
  return messages;
@@ -1 +1 @@
1
- {"version":3,"file":"push.service.js","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,qDAAwD;AAGjD,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB;QAHiB,WAAM,GAAW,IAAI,eAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;QAI7D,IAAI,CAAC,IAAI,GAAG,IAAI,sBAAI,CAAC;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,GAIX;QACC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAGnC,MAAM,QAAQ,GAAsB,EAAE,CAAC;QAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,sBAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;gBACrC,SAAS;YACX,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,SAAS;gBAChB,IAAI;gBACJ,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;aAC3B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA2B;;QAC5C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAElC,MAAM,MAAM,GACV,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;;gBAE7C,KAA0B,eAAA,WAAA,sBAAA,MAAM,CAAA,YAAA,4EAAE,CAAC;oBAAT,sBAAM;oBAAN,WAAM;oBAArB,MAAM,KAAK,KAAA,CAAA;oBACpB,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBACpD,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACvB,CAAC;gBACH,CAAC;;;;;;;;;YAED,OAAO;QACT,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AA1DY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;;GACA,WAAW,CA0DvB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { Expo, ExpoPushMessage } from 'expo-server-sdk';\n\n@Injectable()\nexport class PushService {\n private readonly logger: Logger = new Logger(PushService.name);\n private readonly expo: Expo | undefined;\n\n constructor() {\n this.expo = new Expo({\n useFcmV1: true,\n });\n }\n\n createMessages({\n body,\n pushTokens,\n }: {\n body: string;\n pushTokens: string[];\n }): ExpoPushMessage[] {\n this.logger.debug('createMessage');\n\n // Create the messages that you want to send to clients\n const messages: ExpoPushMessage[] = [];\n\n for (const pushToken of pushTokens) {\n if (!Expo.isExpoPushToken(pushToken)) {\n continue;\n }\n\n messages.push({\n to: pushToken,\n sound: 'default',\n body,\n data: { withSome: 'data' },\n });\n }\n\n return messages;\n }\n\n async sendMessages(messages: ExpoPushMessage[]): Promise<undefined> {\n try {\n this.logger.debug('sendMessages');\n\n const chunks: ExpoPushMessage[][] =\n this.expo.chunkPushNotifications(messages);\n\n for await (const chunk of chunks) {\n try {\n await this.expo.sendPushNotificationsAsync(chunk);\n } catch (error) {\n console.error(error);\n }\n }\n\n return;\n } catch (error) {\n this.logger.error(error);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"push.service.js","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":";;;;;AAAA,2CAAoD;AACpD,qDAAwD;AAGjD,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB;QAHiB,WAAM,GAAW,IAAI,eAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;QAI7D,IAAI,CAAC,IAAI,GAAG,IAAI,sBAAI,CAAC;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,EACV,IAAI,GAKL;QACC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAGnC,MAAM,QAAQ,GAAsB,EAAE,CAAC;QAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,sBAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;gBACrC,SAAS;YACX,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,SAAS;gBAChB,IAAI;gBACJ,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA2B;;QAC5C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAElC,MAAM,MAAM,GACV,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;;gBAE7C,KAA0B,eAAA,WAAA,sBAAA,MAAM,CAAA,YAAA,4EAAE,CAAC;oBAAT,sBAAM;oBAAN,WAAM;oBAArB,MAAM,KAAK,KAAA,CAAA;oBACpB,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBACpD,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACvB,CAAC;gBACH,CAAC;;;;;;;;;YAED,OAAO;QACT,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AA5DY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;;GACA,WAAW,CA4DvB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { Expo, ExpoPushMessage } from 'expo-server-sdk';\n\n@Injectable()\nexport class PushService {\n private readonly logger: Logger = new Logger(PushService.name);\n private readonly expo: Expo | undefined;\n\n constructor() {\n this.expo = new Expo({\n useFcmV1: true,\n });\n }\n\n createMessages({\n body,\n pushTokens,\n data,\n }: {\n body: string;\n pushTokens: string[];\n data?: Record<string, unknown>;\n }): ExpoPushMessage[] {\n this.logger.debug('createMessage');\n\n // Create the messages that you want to send to clients\n const messages: ExpoPushMessage[] = [];\n\n for (const pushToken of pushTokens) {\n if (!Expo.isExpoPushToken(pushToken)) {\n continue;\n }\n\n messages.push({\n to: pushToken,\n sound: 'default',\n body,\n data,\n });\n }\n\n return messages;\n }\n\n async sendMessages(messages: ExpoPushMessage[]): Promise<undefined> {\n try {\n this.logger.debug('sendMessages');\n\n const chunks: ExpoPushMessage[][] =\n this.expo.chunkPushNotifications(messages);\n\n for await (const chunk of chunks) {\n try {\n await this.expo.sendPushNotificationsAsync(chunk);\n } catch (error) {\n console.error(error);\n }\n }\n\n return;\n } catch (error) {\n this.logger.error(error);\n }\n }\n}\n"]}
@@ -1,10 +1,9 @@
1
- import * as healthCheckResultInterface from '@nestjs/terminus/dist/health-check/health-check-result.interface';
2
- import * as healthIndicator from '@nestjs/terminus/dist/health-indicator';
3
- export declare class HealthResponseDto implements healthCheckResultInterface.HealthCheckResult {
4
- status: healthCheckResultInterface.HealthCheckStatus;
5
- info?: healthIndicator.HealthIndicatorResult;
6
- error?: healthIndicator.HealthIndicatorResult;
7
- details: healthIndicator.HealthIndicatorResult;
1
+ import type { HealthCheckResult, HealthCheckStatus, HealthIndicatorResult } from '@nestjs/terminus';
2
+ export declare class HealthResponseDto implements HealthCheckResult {
3
+ status: HealthCheckStatus;
4
+ info?: HealthIndicatorResult;
5
+ error?: HealthIndicatorResult;
6
+ details: HealthIndicatorResult;
8
7
  environment: string;
9
8
  }
10
9
  //# sourceMappingURL=health.response.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.response.dto.d.ts","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,0BAA0B,MAAM,kEAAkE,CAAC;AAG/G,OAAO,KAAK,eAAe,MAAM,wCAAwC,CAAC;AAE1E,qBAAa,iBACX,YAAW,0BAA0B,CAAC,iBAAiB;IAGvD,MAAM,EAAE,0BAA0B,CAAC,iBAAiB,CAAC;IAGrD,IAAI,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAG7C,KAAK,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAG9C,OAAO,EAAE,eAAe,CAAC,qBAAqB,CAAC;IAI/C,WAAW,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"health.response.dto.d.ts","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,iBAAkB,YAAW,iBAAiB;IAEzD,MAAM,EAAE,iBAAiB,CAAC;IAG1B,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAG7B,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAG9B,OAAO,EAAE,qBAAqB,CAAC;IAI/B,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -1,8 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import * as healthCheckResultInterface from '@nestjs/terminus/dist/health-check/health-check-result.interface';
3
2
  import { IsString } from 'class-validator';
4
3
  import { ApiProperty } from '@nestjs/swagger';
5
- import * as healthIndicator from '@nestjs/terminus/dist/health-indicator';
6
4
  export class HealthResponseDto {
7
5
  }
8
6
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"health.response.dto.js","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,0BAA0B,MAAM,kEAAkE,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,eAAe,MAAM,wCAAwC,CAAC;AAE1E,MAAM,OAAO,iBAAiB;CAkB7B;AAdC;IADC,WAAW,EAAE;;iDACuC;AAGrD;IADC,WAAW,EAAE;;+CAC+B;AAG7C;IADC,WAAW,EAAE;;gDACgC;AAG9C;IADC,WAAW,EAAE;;kDACiC;AAI/C;IAFC,QAAQ,EAAE;IACV,WAAW,EAAE;;sDACM","sourcesContent":["import * as healthCheckResultInterface from '@nestjs/terminus/dist/health-check/health-check-result.interface';\nimport { IsString } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport * as healthIndicator from '@nestjs/terminus/dist/health-indicator';\n\nexport class HealthResponseDto\n implements healthCheckResultInterface.HealthCheckResult\n{\n @ApiProperty()\n status: healthCheckResultInterface.HealthCheckStatus;\n\n @ApiProperty()\n info?: healthIndicator.HealthIndicatorResult;\n\n @ApiProperty()\n error?: healthIndicator.HealthIndicatorResult;\n\n @ApiProperty()\n details: healthIndicator.HealthIndicatorResult;\n\n @IsString()\n @ApiProperty()\n environment: string;\n}\n"]}
1
+ {"version":3,"file":"health.response.dto.js","sourceRoot":"/","sources":["health/dtos/health.response.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAO9C,MAAM,OAAO,iBAAiB;CAgB7B;AAdC;IADC,WAAW,EAAE;;iDACY;AAG1B;IADC,WAAW,EAAE;;+CACe;AAG7B;IADC,WAAW,EAAE;;gDACgB;AAG9B;IADC,WAAW,EAAE;;kDACiB;AAI/B;IAFC,QAAQ,EAAE;IACV,WAAW,EAAE;;sDACM","sourcesContent":["import { IsString } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\nimport type {\n HealthCheckResult,\n HealthCheckStatus,\n HealthIndicatorResult,\n} from '@nestjs/terminus';\n\nexport class HealthResponseDto implements HealthCheckResult {\n @ApiProperty()\n status: HealthCheckStatus;\n\n @ApiProperty()\n info?: HealthIndicatorResult;\n\n @ApiProperty()\n error?: HealthIndicatorResult;\n\n @ApiProperty()\n details: HealthIndicatorResult;\n\n @IsString()\n @ApiProperty()\n environment: string;\n}\n"]}
@@ -1,13 +1,12 @@
1
- import { HealthCheckService, HttpHealthIndicator, MemoryHealthIndicator } from '@nestjs/terminus';
1
+ import { HealthCheckService, MemoryHealthIndicator } from '@nestjs/terminus';
2
2
  import { ConfigService } from '@nestjs/config';
3
3
  import { HealthResponseDto } from './dtos/health.response.dto';
4
4
  export declare class HealthService {
5
5
  private readonly configService;
6
6
  private readonly health;
7
- private readonly http;
8
7
  private readonly memory;
9
8
  private readonly logger;
10
- constructor(configService: ConfigService, health: HealthCheckService, http: HttpHealthIndicator, memory: MemoryHealthIndicator);
9
+ constructor(configService: ConfigService, health: HealthCheckService, memory: MemoryHealthIndicator);
11
10
  check(): Promise<HealthResponseDto>;
12
11
  }
13
12
  //# sourceMappingURL=health.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.service.d.ts","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,qBACa,aAAa;IAKtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAG9C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,qBAAqB;IAG1C,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAiB1C"}
1
+ {"version":3,"file":"health.service.d.ts","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,qBACa,aAAa;IAKtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAG9C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,qBAAqB;IAG1C,KAAK,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAgB1C"}
@@ -1,20 +1,18 @@
1
1
  var HealthService_1;
2
2
  import { __decorate, __metadata } from "tslib";
3
3
  import { Injectable, Logger } from '@nestjs/common';
4
- import { HealthCheckService, HttpHealthIndicator, MemoryHealthIndicator, } from '@nestjs/terminus';
4
+ import { HealthCheckService, MemoryHealthIndicator, } from '@nestjs/terminus';
5
5
  import { ConfigService } from '@nestjs/config';
6
6
  let HealthService = HealthService_1 = class HealthService {
7
- constructor(configService, health, http, memory) {
7
+ constructor(configService, health, memory) {
8
8
  this.configService = configService;
9
9
  this.health = health;
10
- this.http = http;
11
10
  this.memory = memory;
12
11
  this.logger = new Logger(HealthService_1.name);
13
12
  }
14
13
  async check() {
15
14
  this.logger.log('check');
16
15
  const statuses = await this.health.check([
17
- async () => this.http.pingCheck('website', 'https://google.com'),
18
16
  async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),
19
17
  async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),
20
18
  ]);
@@ -26,7 +24,6 @@ HealthService = HealthService_1 = __decorate([
26
24
  Injectable(),
27
25
  __metadata("design:paramtypes", [ConfigService,
28
26
  HealthCheckService,
29
- HttpHealthIndicator,
30
27
  MemoryHealthIndicator])
31
28
  ], HealthService);
32
29
  export { HealthService };
@@ -1 +1 @@
1
- {"version":3,"file":"health.service.js","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQxC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAIxB,YACmB,aAA4B,EAC5B,MAA0B,EAC1B,IAAyB,EACzB,MAA6B;QAH7B,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAoB;QAC1B,SAAI,GAAJ,IAAI,CAAqB;QACzB,WAAM,GAAN,MAAM,CAAuB;QAN/B,WAAM,GAAW,IAAI,MAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAO9D,CAAC;IAEJ,KAAK,CAAC,KAAK;QAET,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEzB,MAAM,QAAQ,GAAsB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1D,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,oBAAoB,CAAC;YAChE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;YAClE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;SAClE,CAAC,CAAC;QAEH,MAAM,WAAW,GAAW,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,CAAC;QAEvE,uBACE,WAAW,IACR,QAAQ,EACX;IACJ,CAAC;CACF,CAAA;AA5BY,aAAa;IADzB,UAAU,EAAE;qCAMuB,aAAa;QACpB,kBAAkB;QACpB,mBAAmB;QACjB,qBAAqB;GARrC,aAAa,CA4BzB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport {\n HealthCheckService,\n HttpHealthIndicator,\n MemoryHealthIndicator,\n} from '@nestjs/terminus';\nimport { ConfigService } from '@nestjs/config';\nimport { HealthCheckResult } from '@nestjs/terminus/dist/health-check/health-check-result.interface';\n\nimport { HealthResponseDto } from './dtos/health.response.dto';\n\n// this decorator indicates to nest that this class can be provided to a module\n// we want to handle logic in services to keep our resolvers and controllers clean\n@Injectable()\nexport class HealthService {\n // grab the global logger instance\n private readonly logger: Logger = new Logger(HealthService.name);\n\n constructor(\n private readonly configService: ConfigService,\n private readonly health: HealthCheckService,\n private readonly http: HttpHealthIndicator,\n private readonly memory: MemoryHealthIndicator,\n ) {}\n\n async check(): Promise<HealthResponseDto> {\n // this logger has several logging levels\n this.logger.log('check');\n\n const statuses: HealthCheckResult = await this.health.check([\n async () => this.http.pingCheck('website', 'https://google.com'),\n async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),\n async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),\n ]);\n\n const environment: string = this.configService.get<string>('NODE_ENV');\n\n return {\n environment,\n ...statuses,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"health.service.js","sourceRoot":"/","sources":["health/health.service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAEL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAOxC,IAAM,aAAa,qBAAnB,MAAM,aAAa;IAIxB,YACmB,aAA4B,EAC5B,MAA0B,EAC1B,MAA6B;QAF7B,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAoB;QAC1B,WAAM,GAAN,MAAM,CAAuB;QAL/B,WAAM,GAAW,IAAI,MAAM,CAAC,eAAa,CAAC,IAAI,CAAC,CAAC;IAM9D,CAAC;IAEJ,KAAK,CAAC,KAAK;QAET,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEzB,MAAM,QAAQ,GAAsB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAC1D,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;YAClE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;SAClE,CAAC,CAAC;QAEH,MAAM,WAAW,GAAW,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,UAAU,CAAC,CAAC;QAEvE,uBACE,WAAW,IACR,QAAQ,EACX;IACJ,CAAC;CACF,CAAA;AA1BY,aAAa;IADzB,UAAU,EAAE;qCAMuB,aAAa;QACpB,kBAAkB;QAClB,qBAAqB;GAPrC,aAAa,CA0BzB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport {\n HealthCheckResult,\n HealthCheckService,\n MemoryHealthIndicator,\n} from '@nestjs/terminus';\nimport { ConfigService } from '@nestjs/config';\n\nimport { HealthResponseDto } from './dtos/health.response.dto';\n\n// this decorator indicates to nest that this class can be provided to a module\n// we want to handle logic in services to keep our resolvers and controllers clean\n@Injectable()\nexport class HealthService {\n // grab the global logger instance\n private readonly logger: Logger = new Logger(HealthService.name);\n\n constructor(\n private readonly configService: ConfigService,\n private readonly health: HealthCheckService,\n private readonly memory: MemoryHealthIndicator,\n ) {}\n\n async check(): Promise<HealthResponseDto> {\n // this logger has several logging levels\n this.logger.log('check');\n\n const statuses: HealthCheckResult = await this.health.check([\n async () => this.memory.checkHeap('memoryHeap', 200 * 1024 * 1024),\n async () => this.memory.checkRSS('memoryRss', 3000 * 1024 * 1024),\n ]);\n\n const environment: string = this.configService.get<string>('NODE_ENV');\n\n return {\n environment,\n ...statuses,\n };\n }\n}\n"]}
@@ -3,9 +3,10 @@ export declare class PushService {
3
3
  private readonly logger;
4
4
  private readonly expo;
5
5
  constructor();
6
- createMessages({ body, pushTokens, }: {
6
+ createMessages({ body, pushTokens, data, }: {
7
7
  body: string;
8
8
  pushTokens: string[];
9
+ data?: Record<string, unknown>;
9
10
  }): ExpoPushMessage[];
10
11
  sendMessages(messages: ExpoPushMessage[]): Promise<undefined>;
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"push.service.d.ts","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExD,qBACa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;;IAQxC,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,GACX,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,GAAG,eAAe,EAAE;IAsBf,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;CAoBpE"}
1
+ {"version":3,"file":"push.service.d.ts","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExD,qBACa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;;IAQxC,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,EACV,IAAI,GACL,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,GAAG,eAAe,EAAE;IAsBf,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;CAoBpE"}
@@ -9,7 +9,7 @@ let PushService = PushService_1 = class PushService {
9
9
  useFcmV1: true,
10
10
  });
11
11
  }
12
- createMessages({ body, pushTokens, }) {
12
+ createMessages({ body, pushTokens, data, }) {
13
13
  this.logger.debug('createMessage');
14
14
  const messages = [];
15
15
  for (const pushToken of pushTokens) {
@@ -20,7 +20,7 @@ let PushService = PushService_1 = class PushService {
20
20
  to: pushToken,
21
21
  sound: 'default',
22
22
  body,
23
- data: { withSome: 'data' },
23
+ data,
24
24
  });
25
25
  }
26
26
  return messages;
@@ -1 +1 @@
1
- {"version":3,"file":"push.service.js","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAmB,MAAM,iBAAiB,CAAC;AAGjD,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB;QAHiB,WAAM,GAAW,IAAI,MAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;QAI7D,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,GAIX;QACC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAGnC,MAAM,QAAQ,GAAsB,EAAE,CAAC;QAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;gBACrC,SAAS;YACX,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,SAAS;gBAChB,IAAI;gBACJ,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;aAC3B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA2B;;QAC5C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAElC,MAAM,MAAM,GACV,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;;gBAE7C,KAA0B,eAAA,WAAA,cAAA,MAAM,CAAA,YAAA,4EAAE,CAAC;oBAAT,sBAAM;oBAAN,WAAM;oBAArB,MAAM,KAAK,KAAA,CAAA;oBACpB,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBACpD,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACvB,CAAC;gBACH,CAAC;;;;;;;;;YAED,OAAO;QACT,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AA1DY,WAAW;IADvB,UAAU,EAAE;;GACA,WAAW,CA0DvB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { Expo, ExpoPushMessage } from 'expo-server-sdk';\n\n@Injectable()\nexport class PushService {\n private readonly logger: Logger = new Logger(PushService.name);\n private readonly expo: Expo | undefined;\n\n constructor() {\n this.expo = new Expo({\n useFcmV1: true,\n });\n }\n\n createMessages({\n body,\n pushTokens,\n }: {\n body: string;\n pushTokens: string[];\n }): ExpoPushMessage[] {\n this.logger.debug('createMessage');\n\n // Create the messages that you want to send to clients\n const messages: ExpoPushMessage[] = [];\n\n for (const pushToken of pushTokens) {\n if (!Expo.isExpoPushToken(pushToken)) {\n continue;\n }\n\n messages.push({\n to: pushToken,\n sound: 'default',\n body,\n data: { withSome: 'data' },\n });\n }\n\n return messages;\n }\n\n async sendMessages(messages: ExpoPushMessage[]): Promise<undefined> {\n try {\n this.logger.debug('sendMessages');\n\n const chunks: ExpoPushMessage[][] =\n this.expo.chunkPushNotifications(messages);\n\n for await (const chunk of chunks) {\n try {\n await this.expo.sendPushNotificationsAsync(chunk);\n } catch (error) {\n console.error(error);\n }\n }\n\n return;\n } catch (error) {\n this.logger.error(error);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"push.service.js","sourceRoot":"/","sources":["push/push.service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAmB,MAAM,iBAAiB,CAAC;AAGjD,IAAM,WAAW,mBAAjB,MAAM,WAAW;IAItB;QAHiB,WAAM,GAAW,IAAI,MAAM,CAAC,aAAW,CAAC,IAAI,CAAC,CAAC;QAI7D,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,EACb,IAAI,EACJ,UAAU,EACV,IAAI,GAKL;QACC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAGnC,MAAM,QAAQ,GAAsB,EAAE,CAAC;QAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;gBACrC,SAAS;YACX,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,SAAS;gBAChB,IAAI;gBACJ,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAA2B;;QAC5C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAElC,MAAM,MAAM,GACV,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;;gBAE7C,KAA0B,eAAA,WAAA,cAAA,MAAM,CAAA,YAAA,4EAAE,CAAC;oBAAT,sBAAM;oBAAN,WAAM;oBAArB,MAAM,KAAK,KAAA,CAAA;oBACpB,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;oBACpD,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACvB,CAAC;gBACH,CAAC;;;;;;;;;YAED,OAAO;QACT,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AA5DY,WAAW;IADvB,UAAU,EAAE;;GACA,WAAW,CA4DvB","sourcesContent":["import { Injectable, Logger } from '@nestjs/common';\nimport { Expo, ExpoPushMessage } from 'expo-server-sdk';\n\n@Injectable()\nexport class PushService {\n private readonly logger: Logger = new Logger(PushService.name);\n private readonly expo: Expo | undefined;\n\n constructor() {\n this.expo = new Expo({\n useFcmV1: true,\n });\n }\n\n createMessages({\n body,\n pushTokens,\n data,\n }: {\n body: string;\n pushTokens: string[];\n data?: Record<string, unknown>;\n }): ExpoPushMessage[] {\n this.logger.debug('createMessage');\n\n // Create the messages that you want to send to clients\n const messages: ExpoPushMessage[] = [];\n\n for (const pushToken of pushTokens) {\n if (!Expo.isExpoPushToken(pushToken)) {\n continue;\n }\n\n messages.push({\n to: pushToken,\n sound: 'default',\n body,\n data,\n });\n }\n\n return messages;\n }\n\n async sendMessages(messages: ExpoPushMessage[]): Promise<undefined> {\n try {\n this.logger.debug('sendMessages');\n\n const chunks: ExpoPushMessage[][] =\n this.expo.chunkPushNotifications(messages);\n\n for await (const chunk of chunks) {\n try {\n await this.expo.sendPushNotificationsAsync(chunk);\n } catch (error) {\n console.error(error);\n }\n }\n\n return;\n } catch (error) {\n this.logger.error(error);\n }\n }\n}\n"]}