@tomei/media 0.8.7-beta.0 → 0.8.8

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/eslint.config.mjs CHANGED
@@ -1,58 +1,58 @@
1
- import eslintPlugin from "@typescript-eslint/eslint-plugin";
2
- import parser from "@typescript-eslint/parser";
3
- import importPlugin from 'eslint-plugin-import'
4
- import path from 'path';
5
- import { fileURLToPath } from 'url';
6
-
7
- const __filename = fileURLToPath(import.meta.url);
8
- const __dirname = path.dirname(__filename);
9
-
10
- export default [
11
- {
12
- languageOptions: {
13
- parser: parser,
14
- ecmaVersion: "latest", // Allows modern ECMAScript features
15
- sourceType: "module", // Allows for the use of imports
16
- parserOptions: {
17
- tsconfigRootDir: __dirname,
18
- project: './tsconfig.json'
19
- },
20
- },
21
- plugins: {
22
- "@typescript-eslint": eslintPlugin,
23
- import: importPlugin
24
- },
25
- rules: {
26
- "no-console": "off",
27
- "@typescript-eslint/no-explicit-any": "off",
28
- "@typescript-eslint/no-var-requires": "off",
29
- "@typescript-eslint/explicit-module-boundary-types": "off",
30
- "import/prefer-default-export": "off",
31
- "@typescript-eslint/no-unused-vars": "warn",
32
- "no-useless-catch": "off",
33
- "@typescript-eslint/no-non-null-assertion": "off",
34
- "@typescript-eslint/no-empty-function": "off",
35
- "@typescript-eslint/no-empty-interface": "off",
36
- "@typescript-eslint/no-inferrable-types": "off",
37
- "@typescript-eslint/no-namespace": "off",
38
- "@typescript-eslint/no-use-before-define": "off",
39
- "@typescript-eslint/no-unsafe-assignment": "off",
40
- "@typescript-eslint/no-unsafe-call": "off",
41
- "@typescript-eslint/no-unsafe-member-access": "off",
42
- "@typescript-eslint/no-unsafe-return": "off",
43
- "@typescript-eslint/restrict-template-expressions": "off",
44
- "no-useless-escape": "off",
45
- "import/no-relative-parent-imports": "error", // Enforce relative imports only
46
- "import/no-absolute-path": "error", // Block absolute imports outside aliases
47
- "import/no-unresolved": ["error", { commonjs: true }],
48
- },
49
- settings: {
50
- "import/resolver": {
51
- typescript: {
52
- alwaysTryTypes: true,
53
- }
54
- }
55
- },
56
- ignores: ["node_modules", "dist/**/*", "eslint.config.mjs"],
57
- },
58
- ];
1
+ import eslintPlugin from "@typescript-eslint/eslint-plugin";
2
+ import parser from "@typescript-eslint/parser";
3
+ import importPlugin from 'eslint-plugin-import'
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ export default [
11
+ {
12
+ languageOptions: {
13
+ parser: parser,
14
+ ecmaVersion: "latest", // Allows modern ECMAScript features
15
+ sourceType: "module", // Allows for the use of imports
16
+ parserOptions: {
17
+ tsconfigRootDir: __dirname,
18
+ project: './tsconfig.json'
19
+ },
20
+ },
21
+ plugins: {
22
+ "@typescript-eslint": eslintPlugin,
23
+ import: importPlugin
24
+ },
25
+ rules: {
26
+ "no-console": "off",
27
+ "@typescript-eslint/no-explicit-any": "off",
28
+ "@typescript-eslint/no-var-requires": "off",
29
+ "@typescript-eslint/explicit-module-boundary-types": "off",
30
+ "import/prefer-default-export": "off",
31
+ "@typescript-eslint/no-unused-vars": "warn",
32
+ "no-useless-catch": "off",
33
+ "@typescript-eslint/no-non-null-assertion": "off",
34
+ "@typescript-eslint/no-empty-function": "off",
35
+ "@typescript-eslint/no-empty-interface": "off",
36
+ "@typescript-eslint/no-inferrable-types": "off",
37
+ "@typescript-eslint/no-namespace": "off",
38
+ "@typescript-eslint/no-use-before-define": "off",
39
+ "@typescript-eslint/no-unsafe-assignment": "off",
40
+ "@typescript-eslint/no-unsafe-call": "off",
41
+ "@typescript-eslint/no-unsafe-member-access": "off",
42
+ "@typescript-eslint/no-unsafe-return": "off",
43
+ "@typescript-eslint/restrict-template-expressions": "off",
44
+ "no-useless-escape": "off",
45
+ "import/no-relative-parent-imports": "error", // Enforce relative imports only
46
+ "import/no-absolute-path": "error", // Block absolute imports outside aliases
47
+ "import/no-unresolved": ["error", { commonjs: true }],
48
+ },
49
+ settings: {
50
+ "import/resolver": {
51
+ typescript: {
52
+ alwaysTryTypes: true,
53
+ }
54
+ }
55
+ },
56
+ ignores: ["node_modules", "dist/**/*", "eslint.config.mjs"],
57
+ },
58
+ ];
@@ -1,36 +1,36 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- async up(queryInterface, Sequelize) {
5
- const table = await queryInterface.describeTable('common_Media');
6
-
7
- if (!table.hasOwnProperty('DefaultYN')) {
8
- queryInterface.addColumn('common_Media', 'DefaultYN', {
9
- type: Sequelize.ENUM(['Y', 'N']),
10
- allowNull: true,
11
- defaultValue: 'N',
12
- });
13
- }
14
-
15
- if (!table.hasOwnProperty('HiddenYN')) {
16
- queryInterface.addColumn('common_Media', 'HiddenYN', {
17
- type: Sequelize.ENUM(['Y', 'N']),
18
- allowNull: true,
19
- defaultValue: 'N',
20
- });
21
- }
22
- },
23
-
24
- down(queryInterface) {
25
- return queryInterface.sequelize.transaction((t) => {
26
- return Promise.all([
27
- queryInterface.removeColumn('common_Media', 'DefaultYN', {
28
- transaction: t,
29
- }),
30
- queryInterface.removeColumn('common_Media', 'HiddenYN', {
31
- transaction: t,
32
- }),
33
- ]);
34
- });
35
- },
36
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ const table = await queryInterface.describeTable('common_Media');
6
+
7
+ if (!table.hasOwnProperty('DefaultYN')) {
8
+ queryInterface.addColumn('common_Media', 'DefaultYN', {
9
+ type: Sequelize.ENUM(['Y', 'N']),
10
+ allowNull: true,
11
+ defaultValue: 'N',
12
+ });
13
+ }
14
+
15
+ if (!table.hasOwnProperty('HiddenYN')) {
16
+ queryInterface.addColumn('common_Media', 'HiddenYN', {
17
+ type: Sequelize.ENUM(['Y', 'N']),
18
+ allowNull: true,
19
+ defaultValue: 'N',
20
+ });
21
+ }
22
+ },
23
+
24
+ down(queryInterface) {
25
+ return queryInterface.sequelize.transaction((t) => {
26
+ return Promise.all([
27
+ queryInterface.removeColumn('common_Media', 'DefaultYN', {
28
+ transaction: t,
29
+ }),
30
+ queryInterface.removeColumn('common_Media', 'HiddenYN', {
31
+ transaction: t,
32
+ }),
33
+ ]);
34
+ });
35
+ },
36
+ };
@@ -1,83 +1,83 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- async up(queryInterface, Sequelize) {
5
- await queryInterface.createTable('common_Media', {
6
- MediaId: {
7
- type: Sequelize.STRING(30),
8
- primaryKey: true,
9
- allowNull: false,
10
- },
11
- ObjectId: {
12
- type: Sequelize.STRING(30),
13
- allowNull: false,
14
- },
15
- ObjectType: {
16
- type: Sequelize.STRING(200),
17
- allowNull: false,
18
- },
19
- Title: {
20
- type: Sequelize.STRING(200),
21
- allowNull: false,
22
- },
23
- Description: {
24
- type: Sequelize.TEXT,
25
- allowNull: true,
26
- },
27
- Type: {
28
- type: Sequelize.ENUM(['Photo', 'Video', 'Document']),
29
- allowNull: false,
30
- },
31
- IsExternalYN: {
32
- type: Sequelize.ENUM(['Y', 'N']),
33
- allowNull: false,
34
- },
35
- ExternalSource: {
36
- type: Sequelize.STRING(200),
37
- allowNull: true,
38
- },
39
- IsEncryptedYN: {
40
- type: Sequelize.ENUM(['Y', 'N']),
41
- allowNull: false,
42
- },
43
- FileName: {
44
- type: Sequelize.STRING(200),
45
- allowNull: true,
46
- },
47
- FileExtension: {
48
- type: Sequelize.STRING(10),
49
- allowNull: true,
50
- },
51
- FilePath: {
52
- type: Sequelize.STRING(200),
53
- allowNull: true,
54
- },
55
- URL: {
56
- type: Sequelize.STRING(200),
57
- allowNull: true,
58
- },
59
- CreatedAt: {
60
- allowNull: false,
61
- defaultValue: new Date(),
62
- type: Sequelize.DATE,
63
- },
64
- CreatedById: {
65
- allowNull: false,
66
- type: Sequelize.STRING,
67
- },
68
- UpdatedAt: {
69
- allowNull: false,
70
- defaultValue: new Date(),
71
- type: Sequelize.DATE,
72
- },
73
- UpdatedById: {
74
- allowNull: false,
75
- type: Sequelize.STRING,
76
- },
77
- });
78
- },
79
-
80
- async down(queryInterface) {
81
- await queryInterface.dropTable('common_Media');
82
- },
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ await queryInterface.createTable('common_Media', {
6
+ MediaId: {
7
+ type: Sequelize.STRING(30),
8
+ primaryKey: true,
9
+ allowNull: false,
10
+ },
11
+ ObjectId: {
12
+ type: Sequelize.STRING(30),
13
+ allowNull: false,
14
+ },
15
+ ObjectType: {
16
+ type: Sequelize.STRING(200),
17
+ allowNull: false,
18
+ },
19
+ Title: {
20
+ type: Sequelize.STRING(200),
21
+ allowNull: false,
22
+ },
23
+ Description: {
24
+ type: Sequelize.TEXT,
25
+ allowNull: true,
26
+ },
27
+ Type: {
28
+ type: Sequelize.ENUM(['Photo', 'Video', 'Document']),
29
+ allowNull: false,
30
+ },
31
+ IsExternalYN: {
32
+ type: Sequelize.ENUM(['Y', 'N']),
33
+ allowNull: false,
34
+ },
35
+ ExternalSource: {
36
+ type: Sequelize.STRING(200),
37
+ allowNull: true,
38
+ },
39
+ IsEncryptedYN: {
40
+ type: Sequelize.ENUM(['Y', 'N']),
41
+ allowNull: false,
42
+ },
43
+ FileName: {
44
+ type: Sequelize.STRING(200),
45
+ allowNull: true,
46
+ },
47
+ FileExtension: {
48
+ type: Sequelize.STRING(10),
49
+ allowNull: true,
50
+ },
51
+ FilePath: {
52
+ type: Sequelize.STRING(200),
53
+ allowNull: true,
54
+ },
55
+ URL: {
56
+ type: Sequelize.STRING(200),
57
+ allowNull: true,
58
+ },
59
+ CreatedAt: {
60
+ allowNull: false,
61
+ defaultValue: new Date(),
62
+ type: Sequelize.DATE,
63
+ },
64
+ CreatedById: {
65
+ allowNull: false,
66
+ type: Sequelize.STRING,
67
+ },
68
+ UpdatedAt: {
69
+ allowNull: false,
70
+ defaultValue: new Date(),
71
+ type: Sequelize.DATE,
72
+ },
73
+ UpdatedById: {
74
+ allowNull: false,
75
+ type: Sequelize.STRING,
76
+ },
77
+ });
78
+ },
79
+
80
+ async down(queryInterface) {
81
+ await queryInterface.dropTable('common_Media');
82
+ },
83
83
  };
package/nest-cli.json CHANGED
@@ -1,19 +1,19 @@
1
- {
2
- "language": "ts",
3
- "collection": "@nestjs/schematics",
4
- "sourceRoot": "src",
5
- "projects": {
6
- "media": {
7
- "type": "library",
8
- "root": "libs/media",
9
- "entryFile": "index",
10
- "sourceRoot": "libs/media/src",
11
- "compilerOptions": {
12
- "tsConfigPath": "libs/media/tsconfig.lib.json"
13
- }
14
- }
15
- },
16
- "compilerOptions": {
17
- "webpack": true
18
- }
1
+ {
2
+ "language": "ts",
3
+ "collection": "@nestjs/schematics",
4
+ "sourceRoot": "src",
5
+ "projects": {
6
+ "media": {
7
+ "type": "library",
8
+ "root": "libs/media",
9
+ "entryFile": "index",
10
+ "sourceRoot": "libs/media/src",
11
+ "compilerOptions": {
12
+ "tsConfigPath": "libs/media/tsconfig.lib.json"
13
+ }
14
+ }
15
+ },
16
+ "compilerOptions": {
17
+ "webpack": true
18
+ }
19
19
  }
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "@tomei/media",
3
- "version": "0.8.7-beta.0",
4
- "description": "NestJS package for media module",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "start:dev": "tsc -w",
8
- "build": "tsc",
9
- "prepare": "husky install",
10
- "format": "prettier --write \"src/**/*.ts\"",
11
- "lint": "npx eslint . --fix"
12
- },
13
- "keywords": [
14
- "nestjs",
15
- "tomei",
16
- "media"
17
- ],
18
- "author": "ITD Developer <itd+developers@tomei.com.my>",
19
- "license": "ISC",
20
- "repository": {
21
- "type": "git",
22
- "url": "https://gitlab.com/tomei-package/media.git"
23
- },
24
- "peerDependencies": {
25
- "@azure/storage-blob": "^12.26.0",
26
- "@nestjs/common": "^10.4.15",
27
- "@nestjs/config": "^3.3.0",
28
- "@nestjs/core": "^10.4.15",
29
- "@nestjs/platform-express": "^10.4.15",
30
- "@nestjs/sequelize": "^10.0.1",
31
- "@nestjs/swagger": "^8.1.0",
32
- "@tomei/activity-history": "^0.4.1",
33
- "@tomei/config": "^0.3.21",
34
- "@tomei/general": "^0.21.7",
35
- "@tomei/mailer": "^0.5.21",
36
- "@tomei/sso": "^0.58.12",
37
- "axios": "^1.7.9",
38
- "class-transformer": "^0.5.1",
39
- "class-validator": "^0.14.1",
40
- "cuid": "^3.0.0",
41
- "multer": "^1.4.5-lts.1",
42
- "sequelize": "^6.37.5",
43
- "sequelize-typescript": "^2.1.6"
44
- },
45
- "devDependencies": {
46
- "@commitlint/config-conventional": "^19.6.0",
47
- "@eslint/js": "^9.17.0",
48
- "@types/express": "^5.0.0",
49
- "@types/multer": "^1.4.12",
50
- "@types/node": "^22.10.5",
51
- "@types/sequelize": "^4.28.20",
52
- "@typescript-eslint/eslint-plugin": "^8.19.0",
53
- "eslint": "^9.17.0",
54
- "eslint-config-prettier": "^9.1.0",
55
- "eslint-plugin-import": "^2.31.0",
56
- "eslint-plugin-prettier": "^5.2.1",
57
- "globals": "^15.14.0",
58
- "husky": "^9.1.7",
59
- "lint-staged": "^15.3.0",
60
- "prettier": "^3.4.2",
61
- "ts-node": "^10.9.2",
62
- "tsc-watch": "^6.2.1",
63
- "tsconfig-paths": "^4.2.0",
64
- "typescript": "^5.7.2",
65
- "typescript-eslint": "^8.19.0"
66
- },
67
- "publishConfig": {
68
- "access": "public"
69
- },
70
- "lint-staged": {
71
- "*/**/*.{js,ts,tsx}": [
72
- "npm run lint",
73
- "npm run eslint",
74
- "npm run format",
75
- "npm run build",
76
- "git add ."
77
- ]
78
- }
79
- }
1
+ {
2
+ "name": "@tomei/media",
3
+ "version": "0.8.8",
4
+ "description": "NestJS package for media module",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "start:dev": "tsc -w",
8
+ "build": "tsc",
9
+ "prepare": "husky install",
10
+ "format": "prettier --write \"src/**/*.ts\"",
11
+ "lint": "npx eslint . --fix"
12
+ },
13
+ "keywords": [
14
+ "nestjs",
15
+ "tomei",
16
+ "media"
17
+ ],
18
+ "author": "ITD Developer <itd+developers@tomei.com.my>",
19
+ "license": "ISC",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://gitlab.com/tomei-package/media.git"
23
+ },
24
+ "peerDependencies": {
25
+ "@azure/storage-blob": "^12.26.0",
26
+ "@nestjs/common": "^10.4.15",
27
+ "@nestjs/config": "^3.3.0",
28
+ "@nestjs/core": "^10.4.15",
29
+ "@nestjs/platform-express": "^10.4.15",
30
+ "@nestjs/sequelize": "^10.0.1",
31
+ "@nestjs/swagger": "^8.1.0",
32
+ "@tomei/activity-history": "^0.4.1",
33
+ "@tomei/config": "^0.3.21",
34
+ "@tomei/general": "^0.21.7",
35
+ "@tomei/mailer": "^0.5.21",
36
+ "@tomei/sso": "^0.58.12",
37
+ "axios": "^1.7.9",
38
+ "class-transformer": "^0.5.1",
39
+ "class-validator": "^0.14.1",
40
+ "cuid": "^3.0.0",
41
+ "multer": "^1.4.5-lts.1",
42
+ "sequelize": "^6.37.5",
43
+ "sequelize-typescript": "^2.1.6"
44
+ },
45
+ "devDependencies": {
46
+ "@commitlint/config-conventional": "^19.6.0",
47
+ "@eslint/js": "^9.17.0",
48
+ "@types/express": "^5.0.0",
49
+ "@types/multer": "^1.4.12",
50
+ "@types/node": "^22.10.5",
51
+ "@types/sequelize": "^4.28.20",
52
+ "@typescript-eslint/eslint-plugin": "^8.19.0",
53
+ "eslint": "^9.17.0",
54
+ "eslint-config-prettier": "^9.1.0",
55
+ "eslint-plugin-import": "^2.31.0",
56
+ "eslint-plugin-prettier": "^5.2.1",
57
+ "globals": "^15.14.0",
58
+ "husky": "^9.1.7",
59
+ "lint-staged": "^15.3.0",
60
+ "prettier": "^3.4.2",
61
+ "ts-node": "^10.9.2",
62
+ "tsc-watch": "^6.2.1",
63
+ "tsconfig-paths": "^4.2.0",
64
+ "typescript": "^5.7.2",
65
+ "typescript-eslint": "^8.19.0"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ },
70
+ "lint-staged": {
71
+ "*/**/*.{js,ts,tsx}": [
72
+ "npm run lint",
73
+ "npm run eslint",
74
+ "npm run format",
75
+ "npm run build",
76
+ "git add ."
77
+ ]
78
+ }
79
+ }
@@ -1,13 +1,13 @@
1
- sonar.projectKey=all-tomei-projects_media
2
- sonar.organization=all-tomei-projects
3
-
4
- # This is the name and version displayed in the SonarCloud UI.
5
- #sonar.projectName=Media
6
- #sonar.projectVersion=1.0
7
-
8
-
9
- # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10
- #sonar.sources=.
11
-
12
- # Encoding of the source code. Default is default system encoding
1
+ sonar.projectKey=all-tomei-projects_media
2
+ sonar.organization=all-tomei-projects
3
+
4
+ # This is the name and version displayed in the SonarCloud UI.
5
+ #sonar.projectName=Media
6
+ #sonar.projectVersion=1.0
7
+
8
+
9
+ # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10
+ #sonar.sources=.
11
+
12
+ # Encoding of the source code. Default is default system encoding
13
13
  #sonar.sourceEncoding=UTF-8
package/src/medias.ts CHANGED
@@ -397,7 +397,7 @@ export class Medias extends BaseMedias {
397
397
  isEncrypted: false,
398
398
  };
399
399
 
400
- await this.uploadFileToLocal(file);
400
+ this.uploadFileToLocal(file);
401
401
  } else {
402
402
  throw error;
403
403
  }
@@ -431,7 +431,7 @@ export class Medias extends BaseMedias {
431
431
  'iv',
432
432
  );
433
433
 
434
- await this.uploadFileToLocal(file);
434
+ this.uploadFileToLocal(file);
435
435
  } else {
436
436
  throw error;
437
437
  }
@@ -1,4 +1,4 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4
+ }