pg-mvc-service 2.0.27 → 2.0.28

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,6 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.BaseCron = void 0;
16
16
  const PoolManager_1 = __importDefault(require("../PoolManager"));
17
+ const AwsS3Client_1 = require("../clients/AwsS3Client");
18
+ const Base64Client_1 = require("../clients/Base64Client");
17
19
  class BaseCron {
18
20
  constructor() {
19
21
  this.isTest = process.env.NODE_ENV === 'test';
@@ -102,5 +104,22 @@ class BaseCron {
102
104
  }
103
105
  });
104
106
  }
107
+ get S3Client() {
108
+ if (this.s3Client === undefined) {
109
+ this.s3Client = new AwsS3Client_1.AwsS3Client({
110
+ bucketName: process.env.S3_BUCKET_NAME,
111
+ region: process.env.S3_REGION,
112
+ accessKeyId: process.env.S3_ACCESS_KEY_ID,
113
+ secretAccessKey: process.env.S3_SECRET_ACCESS_KEY
114
+ });
115
+ }
116
+ return this.s3Client;
117
+ }
118
+ get Base64Client() {
119
+ if (this.base64Client === undefined) {
120
+ this.base64Client = new Base64Client_1.Base64Client();
121
+ }
122
+ return this.base64Client;
123
+ }
105
124
  }
106
125
  exports.BaseCron = BaseCron;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "2.0.27",
3
+ "version": "2.0.28",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -1,6 +1,8 @@
1
1
  import { Pool, PoolClient } from "pg";
2
2
  import { DateType, DayType, HourType, MinuteSecondType, MonthType } from "./CronType";
3
3
  import PoolManager from "../PoolManager";
4
+ import { AwsS3Client } from "../clients/AwsS3Client";
5
+ import { Base64Client } from "../clients/Base64Client";
4
6
 
5
7
  export class BaseCron {
6
8
 
@@ -88,4 +90,25 @@ export class BaseCron {
88
90
  this.rollback();
89
91
  }
90
92
  }
93
+
94
+ private s3Client?: AwsS3Client;
95
+ get S3Client(): AwsS3Client {
96
+ if (this.s3Client === undefined) {
97
+ this.s3Client = new AwsS3Client({
98
+ bucketName: process.env.S3_BUCKET_NAME,
99
+ region: process.env.S3_REGION,
100
+ accessKeyId: process.env.S3_ACCESS_KEY_ID,
101
+ secretAccessKey: process.env.S3_SECRET_ACCESS_KEY
102
+ });
103
+ }
104
+ return this.s3Client;
105
+ }
106
+
107
+ private base64Client? : Base64Client;
108
+ get Base64Client(): Base64Client {
109
+ if (this.base64Client === undefined) {
110
+ this.base64Client = new Base64Client();
111
+ }
112
+ return this.base64Client;
113
+ }
91
114
  }