@kipicore/dbcore 1.1.356 → 1.1.358

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.
@@ -5,4 +5,5 @@ export declare const awsClient: {
5
5
  s3(): Promise<S3Client>;
6
6
  ses(): Promise<SESClient>;
7
7
  sns(): Promise<SNSClient>;
8
+ expiry(): Promise<number>;
8
9
  };
@@ -65,4 +65,8 @@ exports.awsClient = {
65
65
  await ensureClients();
66
66
  return cached.sns;
67
67
  },
68
+ async expiry() {
69
+ await ensureClients();
70
+ return cached.expiry;
71
+ },
68
72
  };
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ const up = async (queryInterface, Sequelize) => {
3
+ const table = await queryInterface.describeTable('lectures');
4
+ if (!table.substitute_date) {
5
+ await queryInterface.addColumn('lectures', 'substitute_date', {
6
+ type: Sequelize.DATE,
7
+ allowNull: true,
8
+ field: 'substitute_date',
9
+ });
10
+ }
11
+ };
12
+ const down = async (queryInterface) => {
13
+ const table = await queryInterface.describeTable('lectures');
14
+ if (table.substitute_date) {
15
+ await queryInterface.removeColumn('lectures', 'substitute_date');
16
+ }
17
+ };
18
+ module.exports = {
19
+ up,
20
+ down,
21
+ };
@@ -39,6 +39,7 @@ const getPresignedUrl = async (bucket, fileStorage, expiresIn = 60 * 60 * 24) =>
39
39
  if (fileStorage.filePath)
40
40
  return fileStorage.filePath;
41
41
  const s3 = await configs_1.awsClient.s3();
42
+ expiresIn = await configs_1.awsClient.expiry();
42
43
  const s3Key = `${fileStorage.storagePath}/${fileStorage.storageFileName}`;
43
44
  const command = new client_s3_1.GetObjectCommand({
44
45
  Bucket: bucket,
@@ -24,4 +24,5 @@ export interface ILectureModelAttributes extends IDefaultAttributes {
24
24
  shiftId?: string;
25
25
  slotId?: string;
26
26
  academicCalendarId?: string;
27
+ substituteDate?: Date;
27
28
  }
@@ -232,5 +232,6 @@ LectureModel.init({
232
232
  field: 'academic_calendar_id',
233
233
  allowNull: true,
234
234
  },
235
+ substituteDate: { type: sequelize_1.DataTypes.DATE, field: 'substitute_date', allowNull: true },
235
236
  }, { modelName: 'LectureModel', tableName: 'lectures', timestamps: true, sequelize: index_1.sequelize });
236
237
  exports.default = LectureModel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kipicore/dbcore",
3
- "version": "1.1.356",
3
+ "version": "1.1.358",
4
4
  "description": "Reusable DB core package with Postgres, MongoDB, models, services, interfaces, and types",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",