@flusys/nestjs-storage 2.0.0-rc.0 → 3.0.0-rc

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.
@@ -133,7 +133,7 @@ _ts_decorate([
133
133
  }),
134
134
  (0, _classvalidator.IsOptional)(),
135
135
  (0, _classvalidator.IsEnum)(_enums.FileLocationEnum),
136
- _ts_metadata("design:type", typeof _enums.FileLocationEnum === "undefined" ? Object : _enums.FileLocationEnum)
136
+ _ts_metadata("design:type", String)
137
137
  ], CreateFileManagerDto.prototype, "location", void 0);
138
138
  let UpdateFileManagerDto = class UpdateFileManagerDto extends (0, _swagger.PartialType)(CreateFileManagerDto) {
139
139
  constructor(...args){
@@ -197,7 +197,7 @@ _ts_decorate([
197
197
  ], FileManagerResponseDto.prototype, "storageConfigId", void 0);
198
198
  _ts_decorate([
199
199
  (0, _swagger.ApiPropertyOptional)(),
200
- _ts_metadata("design:type", typeof _enums.FileLocationEnum === "undefined" ? Object : _enums.FileLocationEnum)
200
+ _ts_metadata("design:type", String)
201
201
  ], FileManagerResponseDto.prototype, "location", void 0);
202
202
  _ts_decorate([
203
203
  (0, _swagger.ApiPropertyOptional)({
@@ -71,7 +71,7 @@ _ts_decorate([
71
71
  }),
72
72
  (0, _classvalidator.IsEnum)(_enums.FileLocationEnum),
73
73
  (0, _classvalidator.IsNotEmpty)(),
74
- _ts_metadata("design:type", typeof _enums.FileLocationEnum === "undefined" ? Object : _enums.FileLocationEnum)
74
+ _ts_metadata("design:type", String)
75
75
  ], CreateStorageConfigDto.prototype, "storage", void 0);
76
76
  _ts_decorate([
77
77
  (0, _swagger.ApiProperty)({
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "FileManager", {
9
9
  }
10
10
  });
11
11
  const _entities = require("@flusys/nestjs-shared/entities");
12
- const _enums = require("../enums");
13
12
  const _typeorm = require("typeorm");
14
13
  function _define_property(obj, key, value) {
15
14
  if (key in obj) {
@@ -78,10 +77,11 @@ _ts_decorate([
78
77
  ], FileManager.prototype, "url", void 0);
79
78
  _ts_decorate([
80
79
  (0, _typeorm.Column)({
81
- type: 'text',
80
+ type: 'varchar',
81
+ length: 50,
82
82
  nullable: false
83
83
  }),
84
- _ts_metadata("design:type", typeof _enums.FileLocationEnum === "undefined" ? Object : _enums.FileLocationEnum)
84
+ _ts_metadata("design:type", String)
85
85
  ], FileManager.prototype, "location", void 0);
86
86
  _ts_decorate([
87
87
  (0, _typeorm.Column)({
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "StorageConfig", {
9
9
  }
10
10
  });
11
11
  const _entities = require("@flusys/nestjs-shared/entities");
12
- const _enums = require("../enums");
13
12
  const _typeorm = require("typeorm");
14
13
  function _define_property(obj, key, value) {
15
14
  if (key in obj) {
@@ -48,11 +47,11 @@ _ts_decorate([
48
47
  ], StorageConfig.prototype, "name", void 0);
49
48
  _ts_decorate([
50
49
  (0, _typeorm.Column)({
51
- type: 'enum',
52
- enum: _enums.FileLocationEnum,
50
+ type: 'varchar',
51
+ length: 50,
53
52
  nullable: false
54
53
  }),
55
- _ts_metadata("design:type", typeof _enums.FileLocationEnum === "undefined" ? Object : _enums.FileLocationEnum)
54
+ _ts_metadata("design:type", String)
56
55
  ], StorageConfig.prototype, "storage", void 0);
57
56
  _ts_decorate([
58
57
  (0, _typeorm.Column)({
@@ -1,4 +1,3 @@
1
- import { FileLocationEnum } from '../enums';
2
1
  export declare class CreateFileManagerDto {
3
2
  name: string;
4
3
  key: string;
@@ -7,7 +6,7 @@ export declare class CreateFileManagerDto {
7
6
  isPrivate: boolean;
8
7
  folderId?: string;
9
8
  storageConfigId?: string;
10
- location?: FileLocationEnum;
9
+ location?: string;
11
10
  }
12
11
  declare const UpdateFileManagerDto_base: import("@nestjs/common").Type<Partial<CreateFileManagerDto>>;
13
12
  export declare class UpdateFileManagerDto extends UpdateFileManagerDto_base {
@@ -22,7 +21,7 @@ export declare class FileManagerResponseDto {
22
21
  isPrivate: boolean;
23
22
  folderId?: string;
24
23
  storageConfigId?: string;
25
- location?: FileLocationEnum;
24
+ location?: string;
26
25
  providerName?: string;
27
26
  }
28
27
  export declare class GetFilesRequestDto {
@@ -1,8 +1,7 @@
1
1
  import { IdentityResponseDto } from '@flusys/nestjs-shared/dtos';
2
- import { FileLocationEnum } from '../enums';
3
2
  export declare class CreateStorageConfigDto {
4
3
  name: string;
5
- storage: FileLocationEnum;
4
+ storage: string;
6
5
  config: Record<string, unknown>;
7
6
  isActive?: boolean;
8
7
  isDefault?: boolean;
@@ -13,7 +12,7 @@ export declare class UpdateStorageConfigDto extends UpdateStorageConfigDto_base
13
12
  }
14
13
  export declare class StorageConfigResponseDto extends IdentityResponseDto {
15
14
  name: string;
16
- storage: FileLocationEnum;
15
+ storage: string;
17
16
  config: Record<string, unknown>;
18
17
  isActive: boolean;
19
18
  isDefault: boolean;
@@ -1,5 +1,4 @@
1
1
  import { Identity } from '@flusys/nestjs-shared/entities';
2
- import { FileLocationEnum } from '../enums';
3
2
  import { Folder } from './folder.entity';
4
3
  export declare class FileManager extends Identity {
5
4
  name: string;
@@ -7,7 +6,7 @@ export declare class FileManager extends Identity {
7
6
  size: string;
8
7
  key: string;
9
8
  url: string | null;
10
- location: FileLocationEnum;
9
+ location: string;
11
10
  storageConfigId: string | null;
12
11
  expiresAt: number | null;
13
12
  isPrivate: boolean;
@@ -1,8 +1,7 @@
1
1
  import { Identity } from '@flusys/nestjs-shared/entities';
2
- import { FileLocationEnum } from '../enums';
3
2
  export declare class StorageConfig extends Identity {
4
3
  name: string;
5
- storage: FileLocationEnum;
4
+ storage: string;
6
5
  config: Record<string, any>;
7
6
  isActive: boolean;
8
7
  isDefault: boolean;
@@ -106,7 +106,7 @@ _ts_decorate([
106
106
  }),
107
107
  IsOptional(),
108
108
  IsEnum(FileLocationEnum),
109
- _ts_metadata("design:type", typeof FileLocationEnum === "undefined" ? Object : FileLocationEnum)
109
+ _ts_metadata("design:type", String)
110
110
  ], CreateFileManagerDto.prototype, "location", void 0);
111
111
  export class UpdateFileManagerDto extends PartialType(CreateFileManagerDto) {
112
112
  constructor(...args){
@@ -170,7 +170,7 @@ _ts_decorate([
170
170
  ], FileManagerResponseDto.prototype, "storageConfigId", void 0);
171
171
  _ts_decorate([
172
172
  ApiPropertyOptional(),
173
- _ts_metadata("design:type", typeof FileLocationEnum === "undefined" ? Object : FileLocationEnum)
173
+ _ts_metadata("design:type", String)
174
174
  ], FileManagerResponseDto.prototype, "location", void 0);
175
175
  _ts_decorate([
176
176
  ApiPropertyOptional({
@@ -50,7 +50,7 @@ _ts_decorate([
50
50
  }),
51
51
  IsEnum(FileLocationEnum),
52
52
  IsNotEmpty(),
53
- _ts_metadata("design:type", typeof FileLocationEnum === "undefined" ? Object : FileLocationEnum)
53
+ _ts_metadata("design:type", String)
54
54
  ], CreateStorageConfigDto.prototype, "storage", void 0);
55
55
  _ts_decorate([
56
56
  ApiProperty({
@@ -21,7 +21,6 @@ function _ts_metadata(k, v) {
21
21
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
22
  }
23
23
  import { Identity } from '@flusys/nestjs-shared/entities';
24
- import { FileLocationEnum } from '../enums';
25
24
  import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
26
25
  export class FileManager extends Identity {
27
26
  constructor(...args){
@@ -68,10 +67,11 @@ _ts_decorate([
68
67
  ], FileManager.prototype, "url", void 0);
69
68
  _ts_decorate([
70
69
  Column({
71
- type: 'text',
70
+ type: 'varchar',
71
+ length: 50,
72
72
  nullable: false
73
73
  }),
74
- _ts_metadata("design:type", typeof FileLocationEnum === "undefined" ? Object : FileLocationEnum)
74
+ _ts_metadata("design:type", String)
75
75
  ], FileManager.prototype, "location", void 0);
76
76
  _ts_decorate([
77
77
  Column({
@@ -21,7 +21,6 @@ function _ts_metadata(k, v) {
21
21
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
22
22
  }
23
23
  import { Identity } from '@flusys/nestjs-shared/entities';
24
- import { FileLocationEnum } from '../enums';
25
24
  import { Column, Entity, Index } from 'typeorm';
26
25
  export class StorageConfig extends Identity {
27
26
  constructor(...args){
@@ -38,11 +37,11 @@ _ts_decorate([
38
37
  ], StorageConfig.prototype, "name", void 0);
39
38
  _ts_decorate([
40
39
  Column({
41
- type: 'enum',
42
- enum: FileLocationEnum,
40
+ type: 'varchar',
41
+ length: 50,
43
42
  nullable: false
44
43
  }),
45
- _ts_metadata("design:type", typeof FileLocationEnum === "undefined" ? Object : FileLocationEnum)
44
+ _ts_metadata("design:type", String)
46
45
  ], StorageConfig.prototype, "storage", void 0);
47
46
  _ts_decorate([
48
47
  Column({
@@ -1,8 +1,7 @@
1
1
  import { IIdentity } from '@flusys/nestjs-shared/interfaces';
2
- import { FileLocationEnum } from '../enums';
3
2
  export interface IStorageConfig extends IIdentity {
4
3
  name: string;
5
- storage: FileLocationEnum;
4
+ storage: string;
6
5
  config: Record<string, any>;
7
6
  isActive: boolean;
8
7
  isDefault: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/nestjs-storage",
3
- "version": "2.0.0-rc.0",
3
+ "version": "3.0.0-rc",
4
4
  "description": "Modular storage package with optional AWS S3, Azure Blob, and SFTP providers",
5
5
  "main": "cjs/index.js",
6
6
  "module": "fesm/index.js",
@@ -128,7 +128,7 @@
128
128
  }
129
129
  },
130
130
  "dependencies": {
131
- "@flusys/nestjs-core": "2.0.0-rc.0",
132
- "@flusys/nestjs-shared": "2.0.0-rc.0"
131
+ "@flusys/nestjs-core": "3.0.0-rc",
132
+ "@flusys/nestjs-shared": "3.0.0-rc"
133
133
  }
134
134
  }
@@ -5,7 +5,6 @@ import { EntityTarget, Repository, SelectQueryBuilder } from 'typeorm';
5
5
  import { StorageConfigService } from './storage-config.service';
6
6
  import { CreateStorageConfigDto, UpdateStorageConfigDto } from '../dtos';
7
7
  import { StorageConfig, StorageConfigBase } from '../entities';
8
- import { FileLocationEnum } from '../enums';
9
8
  import { IStorageConfig } from '../interfaces';
10
9
  import { StorageDataSourceProvider } from './storage-datasource.provider';
11
10
  export declare class StorageProviderConfigService extends RequestScopedApiService<CreateStorageConfigDto, UpdateStorageConfigDto, IStorageConfig, StorageConfigBase, Repository<StorageConfigBase>> {
@@ -27,5 +26,5 @@ export declare class StorageProviderConfigService extends RequestScopedApiServic
27
26
  }>;
28
27
  findByIdDirect(id: string): Promise<StorageConfigBase | null>;
29
28
  getDefaultConfig(user?: ILoggedUserInfo): Promise<StorageConfigBase | null>;
30
- getConfigByType(storage: FileLocationEnum, user?: ILoggedUserInfo): Promise<StorageConfigBase[]>;
29
+ getConfigByType(storage: string, user?: ILoggedUserInfo): Promise<StorageConfigBase[]>;
31
30
  }
@@ -1,7 +1,6 @@
1
1
  import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
2
2
  import { StorageConfigService } from './storage-config.service';
3
3
  import { UploadOptionsDto } from '../dtos/upload.dto';
4
- import { FileLocationEnum } from '../enums/file-location.enum';
5
4
  import { IUploadedFileInfo } from '../interfaces/storage-provider.interface';
6
5
  import { StorageFactoryService } from '../providers/storage-factory.service';
7
6
  import { StorageProviderConfigService } from './storage-provider-config.service';
@@ -18,8 +17,8 @@ export declare class UploadService {
18
17
  private getStorageProviderForDelete;
19
18
  uploadSingleFile(file: Express.Multer.File, options: UploadOptionsDto, user?: ILoggedUserInfo): Promise<IUploadedFileInfo>;
20
19
  uploadMultipleFiles(files: Express.Multer.File[], options: UploadOptionsDto, user?: ILoggedUserInfo): Promise<IUploadedFileInfo[]>;
21
- deleteSingleFile(key: string, storageConfigId?: string, user?: ILoggedUserInfo, locationHint?: FileLocationEnum): Promise<boolean>;
22
- deleteMultipleFile(keys: string[], storageConfigId?: string, user?: ILoggedUserInfo, locationHint?: FileLocationEnum): Promise<boolean>;
20
+ deleteSingleFile(key: string, storageConfigId?: string, user?: ILoggedUserInfo, locationHint?: string): Promise<boolean>;
21
+ deleteMultipleFile(keys: string[], storageConfigId?: string, user?: ILoggedUserInfo, locationHint?: string): Promise<boolean>;
23
22
  bytesToKb(bytes: number): number;
24
23
  getLocalStorageBasePath(): Promise<string | null>;
25
24
  makeFileUrl(key: string, storageConfigId: string, expiresIn?: number, user?: ILoggedUserInfo): Promise<string>;