@flusys/ng-storage 9.1.0 → 9.1.2

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 (33) hide show
  1. package/fesm2022/flusys-ng-storage-file-manager-api.service-DJ9uP3aN.mjs +43 -0
  2. package/fesm2022/flusys-ng-storage-file-manager-api.service-DJ9uP3aN.mjs.map +1 -0
  3. package/fesm2022/{flusys-ng-storage-file-manager-form.component-DaO-9wKM.mjs → flusys-ng-storage-file-manager-form.component-Bvhewt3f.mjs} +411 -231
  4. package/fesm2022/flusys-ng-storage-file-manager-form.component-Bvhewt3f.mjs.map +1 -0
  5. package/fesm2022/{flusys-ng-storage-file-manager-list.component-a7YHw1Gz.mjs → flusys-ng-storage-file-manager-list.component-4_LdJOtH.mjs} +355 -145
  6. package/fesm2022/flusys-ng-storage-file-manager-list.component-4_LdJOtH.mjs.map +1 -0
  7. package/fesm2022/flusys-ng-storage-folder-api.service-D_fFEuO6.mjs +33 -0
  8. package/fesm2022/flusys-ng-storage-folder-api.service-D_fFEuO6.mjs.map +1 -0
  9. package/fesm2022/flusys-ng-storage-folder-form.component-7C2oWijb.mjs +298 -0
  10. package/fesm2022/flusys-ng-storage-folder-form.component-7C2oWijb.mjs.map +1 -0
  11. package/fesm2022/{flusys-ng-storage-folder-list.component-BDrBAcCS.mjs → flusys-ng-storage-folder-list.component-BdSBM_DB.mjs} +284 -77
  12. package/fesm2022/flusys-ng-storage-folder-list.component-BdSBM_DB.mjs.map +1 -0
  13. package/fesm2022/flusys-ng-storage-storage-config-api.service-Bl4asniq.mjs +33 -0
  14. package/fesm2022/flusys-ng-storage-storage-config-api.service-Bl4asniq.mjs.map +1 -0
  15. package/fesm2022/{flusys-ng-storage-storage-config-form.component-B4wBfzVs.mjs → flusys-ng-storage-storage-config-form.component-De5h8JY-.mjs} +369 -214
  16. package/fesm2022/flusys-ng-storage-storage-config-form.component-De5h8JY-.mjs.map +1 -0
  17. package/fesm2022/{flusys-ng-storage-storage-config-list.component-CCkZY--j.mjs → flusys-ng-storage-storage-config-list.component-Dh9JkuZP.mjs} +303 -83
  18. package/fesm2022/flusys-ng-storage-storage-config-list.component-Dh9JkuZP.mjs.map +1 -0
  19. package/fesm2022/flusys-ng-storage-storage-container.component-EWGNoozU.mjs +124 -0
  20. package/fesm2022/flusys-ng-storage-storage-container.component-EWGNoozU.mjs.map +1 -0
  21. package/fesm2022/flusys-ng-storage-upload.service-CIcEL_Kr.mjs +113 -0
  22. package/fesm2022/flusys-ng-storage-upload.service-CIcEL_Kr.mjs.map +1 -0
  23. package/fesm2022/flusys-ng-storage.mjs +611 -876
  24. package/fesm2022/flusys-ng-storage.mjs.map +1 -1
  25. package/package.json +5 -5
  26. package/types/flusys-ng-storage.d.ts +254 -292
  27. package/fesm2022/flusys-ng-storage-file-manager-form.component-DaO-9wKM.mjs.map +0 -1
  28. package/fesm2022/flusys-ng-storage-file-manager-list.component-a7YHw1Gz.mjs.map +0 -1
  29. package/fesm2022/flusys-ng-storage-folder-form.component-BCzVzmRn.mjs +0 -225
  30. package/fesm2022/flusys-ng-storage-folder-form.component-BCzVzmRn.mjs.map +0 -1
  31. package/fesm2022/flusys-ng-storage-folder-list.component-BDrBAcCS.mjs.map +0 -1
  32. package/fesm2022/flusys-ng-storage-storage-config-form.component-B4wBfzVs.mjs.map +0 -1
  33. package/fesm2022/flusys-ng-storage-storage-config-list.component-CCkZY--j.mjs.map +0 -1
@@ -1,907 +1,642 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, signal, computed, Directive, DestroyRef, Service, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import { Router, RouterOutlet } from '@angular/router';
5
- import { APP_CONFIG, DEFAULT_APP_NAME, BaseApiService, getDefaultStorageConfigId } from '@flusys/ng-core';
6
- import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
7
- import { TranslateService, ApiResourceService, FILE_PROVIDER, PermissionValidatorService, FILE_PERMISSIONS, FOLDER_PERMISSIONS, STORAGE_CONFIG_PERMISSIONS, permissionGuard, resolveTranslationModule, SHARED_MESSAGES, RouterTabsComponent, TranslatePipe } from '@flusys/ng-shared';
8
- import { MessageService, ConfirmationService } from '@flusys/ng-ui';
9
- import { from, switchMap, map } from 'rxjs';
10
-
1
+ import { t as FileManagerApiService } from "./flusys-ng-storage-file-manager-api.service-DJ9uP3aN.mjs";
2
+ import { t as FolderApiService } from "./flusys-ng-storage-folder-api.service-D_fFEuO6.mjs";
3
+ import { t as StorageConfigApiService } from "./flusys-ng-storage-storage-config-api.service-Bl4asniq.mjs";
4
+ import { t as UploadService } from "./flusys-ng-storage-upload.service-CIcEL_Kr.mjs";
5
+ import * as i0 from "@angular/core";
6
+ import { DestroyRef, Directive, Service, computed, inject, signal } from "@angular/core";
7
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
8
+ import { Router } from "@angular/router";
9
+ import { APP_CONFIG, DEFAULT_APP_NAME } from "@flusys/ng-core";
10
+ import { LAYOUT_AUTH_STATE } from "@flusys/ng-layout";
11
+ import { FILE_PERMISSIONS, FILE_PROVIDER, FOLDER_PERMISSIONS, PermissionValidatorService, SHARED_MESSAGES, STORAGE_CONFIG_PERMISSIONS, TranslateService, permissionGuard, resolveTranslationModule } from "@flusys/ng-shared";
12
+ import { ConfirmationService, MessageService } from "@flusys/ng-ui";
13
+ import { from, map } from "rxjs";
11
14
  const STORAGE_MESSAGES = {
12
- // File entity CRUD (API keys)
13
- 'file.create.success': 'File created successfully',
14
- 'file.create.many.success': '{{count}} files created successfully',
15
- 'file.get.success': 'File retrieved successfully',
16
- 'file.get.by.ids.success': 'Files retrieved successfully by Ids',
17
- 'file.get.by.filter.success': 'Files retrieved successfully by filter',
18
- 'file.get.all.success': 'Files retrieved successfully',
19
- 'file.update.success': 'File updated successfully',
20
- 'file.update.many.success': '{{count}} files updated successfully',
21
- 'file.delete.success': 'File deleted successfully',
22
- 'file.restore.success': 'File restored successfully',
23
- 'file.not.found': 'File not found',
24
- // Folder entity CRUD (API keys)
25
- 'folder.create.success': 'Folder created successfully',
26
- 'folder.create.many.success': '{{count}} folders created successfully',
27
- 'folder.get.success': 'Folder retrieved successfully',
28
- 'folder.get.by.ids.success': 'Folders retrieved successfully by Ids',
29
- 'folder.get.by.filter.success': 'Folders retrieved successfully by filter',
30
- 'folder.get.all.success': 'Folders retrieved successfully',
31
- 'folder.update.success': 'Folder updated successfully',
32
- 'folder.update.many.success': '{{count}} folders updated successfully',
33
- 'folder.delete.success': 'Folder deleted successfully',
34
- 'folder.restore.success': 'Folder restored successfully',
35
- 'folder.not.found': 'Folder not found',
36
- // Storage config CRUD (API keys)
37
- 'storage.config.create.success': 'Storage configuration created successfully',
38
- 'storage.config.create.many.success': '{{count}} storage configurations created successfully',
39
- 'storage.config.get.success': 'Storage configuration retrieved successfully',
40
- 'storage.config.get.by.ids.success': 'Storage configurations retrieved successfully by Ids',
41
- 'storage.config.get.by.filter.success': 'Storage configurations retrieved successfully by filter',
42
- 'storage.config.get.all.success': 'Storage configurations retrieved successfully',
43
- 'storage.config.update.success': 'Storage configuration updated successfully',
44
- 'storage.config.update.many.success': '{{count}} storage configurations updated successfully',
45
- 'storage.config.delete.success': 'Storage configuration deleted successfully',
46
- 'storage.config.restore.success': 'Storage configuration restored successfully',
47
- // Upload (API keys)
48
- 'upload.success': 'File uploaded successfully',
49
- 'upload.many.success': 'Files uploaded successfully',
50
- 'upload.file.too.large': 'File size ({{fileSize}}MB) exceeds maximum {{maxSize}}MB',
51
- 'upload.invalid.type': 'File type "{{mimeType}}" not allowed. Allowed: {{allowedTypes}}',
52
- 'upload.no.files.provided': 'No files provided',
53
- 'upload.no.file.path': 'File path is required',
54
- 'upload.invalid.file.path': 'Invalid file path',
55
- 'upload.config.not.found': 'Upload configuration not found',
56
- // pages/storage-container/storage-container.component.ts
57
- 'storage.title': 'Storage',
58
- 'storage.subtitle': 'Manage files, folders, and storage configurations',
59
- 'storage.file.title': 'Files',
60
- 'storage.folder.title': 'Folder Setup',
61
- 'storage.config.title': 'Storage Configurations',
62
- // pages/storage-config/storage-config-list.component.ts
63
- 'storage.button.new.configuration': 'New Configuration',
64
- 'storage.table.provider': 'Provider',
65
- 'storage.table.created': 'Created',
66
- 'storage.empty.configs.in.company': 'No storage configurations found in current company',
67
- 'storage.empty.configs': 'No storage configurations found',
68
- 'storage.config.load.failed': 'Failed to load storage configurations',
69
- 'storage.config.delete.title': 'Delete Configuration',
70
- 'storage.config.default.delete.forbidden': 'Cannot delete the default configuration. Set another as default first.',
71
- // pages/storage-config/storage-config-form.component.ts
72
- 'storage.config.edit.config': 'Edit Storage Configuration',
73
- 'storage.config.new.config': 'New Configuration',
74
- 'storage.config.config.name.required': 'Configuration Name *',
75
- 'storage.config.config.name.placeholder': 'e.g., Production AWS S3',
76
- 'storage.config.provider.required': 'Storage Provider *',
77
- 'storage.set.as.default': 'Set as Default',
78
- 'storage.aws.title': 'AWS S3 Configuration',
79
- 'storage.config.region.required': 'AWS Region *',
80
- 'storage.aws.region.placeholder': 'us-east-1',
81
- 'storage.config.bucket.required': 'Bucket Name *',
82
- 'storage.aws.bucket.placeholder': 'my-bucket',
83
- 'storage.config.access.key.required': 'Access Key ID *',
84
- 'storage.config.secret.key.required': 'Secret Access Key *',
85
- 'storage.config.endpoint.optional': 'Custom Endpoint (Optional)',
86
- 'storage.config.endpoint.placeholder': 'https://s3.custom-endpoint.com',
87
- 'storage.azure.title': 'Azure Blob Configuration',
88
- 'storage.azure.account.name.required': 'Account Name *',
89
- 'storage.azure.container.name.required': 'Container Name *',
90
- 'storage.azure.account.key.required': 'Account Key *',
91
- 'storage.sftp.title': 'SFTP Configuration',
92
- 'storage.sftp.host.required': 'Host *',
93
- 'storage.sftp.host.placeholder': 'sftp.example.com',
94
- 'storage.sftp.port.required': 'Port *',
95
- 'storage.sftp.port.placeholder': '22',
96
- 'storage.sftp.username.required': 'Username *',
97
- 'storage.sftp.password.required': 'Password *',
98
- 'storage.sftp.base.path.required': 'Base Path *',
99
- 'storage.sftp.base.path.placeholder': '/uploads',
100
- 'storage.local.title': 'Local Storage Configuration',
101
- 'storage.local.base.path.required': 'Base Path *',
102
- 'storage.local.base.path.placeholder': '/var/www/uploads',
103
- 'storage.config.endpoint': 'Endpoint URL',
104
- 'storage.validation.config.name.required': 'Configuration name is required',
105
- // pages/file-manager/file-manager-list.component.ts
106
- 'storage.file.manager.title': 'File Manager',
107
- 'storage.button.upload.file': 'Upload File',
108
- 'storage.table.size': 'Size',
109
- 'storage.table.location': 'Location',
110
- 'storage.table.config': 'Config',
111
- 'storage.table.private': 'Private',
112
- 'storage.private': 'Private',
113
- 'storage.public': 'Public',
114
- 'storage.tooltip.trash': 'Trash',
115
- 'storage.empty.files.in.company': 'No files found in current company',
116
- 'storage.empty.files': 'No files found',
117
- 'storage.file.url.not.available': 'File URL is not available',
118
- 'storage.delete.move.to.trash.confirm': 'Move "{{name}}" to trash? You can recover it later.',
119
- 'storage.delete.move.to.trash': 'Move to Trash',
120
- 'storage.delete.permanent.delete.confirm': 'Permanently delete "{{name}}"? This action CANNOT be undone and will delete the file from storage.',
121
- 'storage.delete.permanent.delete': 'Permanent Delete',
122
- 'storage.delete.permanent.delete.button': 'Delete Permanently',
123
- // pages/file-manager/file-manager-form.component.ts
124
- 'storage.file.manager.edit.file': 'Edit File',
125
- 'storage.file.manager.upload.file': 'Upload File',
126
- 'storage.config.select.config': 'Select storage configuration...',
127
- 'storage.config.no.configs': 'No storage configurations found. Please create one first.',
128
- 'storage.folder.optional': 'Folder (Optional)',
129
- 'storage.folder.no.folder': 'No folder (root level)',
130
- 'storage.folder.no.folders.available': 'No folders available. File will be uploaded to root level.',
131
- 'storage.folder.no.folders.edit': 'No folders available.',
132
- 'storage.file.select.required': 'Select File *',
133
- 'storage.button.choose.file': 'Choose File',
134
- 'storage.upload.drag.drop': 'Drag and drop file here or click to browse',
135
- 'storage.upload.max.size': 'Maximum file size: {{size}}',
136
- 'storage.upload.please.select': 'Please select a file to upload',
137
- 'storage.file.name.required': 'File Name *',
138
- 'storage.file.placeholder.edit': 'Enter file name',
139
- 'storage.file.placeholder': 'Will be auto-filled from selected file',
140
- 'storage.file.private': 'Private File',
141
- 'storage.file.private.hint': 'Only users with permission can access',
142
- 'storage.file.public.hint': 'File is publicly accessible',
143
- 'storage.validation.file.name.required': 'File name is required',
144
- 'storage.error.no.file': 'Please select a file',
145
- 'storage.error.no.config': 'Please select a storage configuration',
146
- 'storage.upload.failed': 'Failed to upload file',
147
- // pages/folder/folder-list.component.ts
148
- 'storage.button.new.folder': 'New Folder',
149
- 'storage.table.slug': 'Slug',
150
- 'storage.empty.folders.in.company': 'No folders found in current company',
151
- 'storage.empty.folders': 'No folders found',
152
- 'storage.folder.delete.title': 'Delete Folder',
153
- // pages/folder/folder-form.component.ts
154
- 'storage.folder.edit.folder': 'Edit Folder',
155
- 'storage.folder.new.folder': 'New Folder',
156
- 'storage.folder.name.required': 'Folder Name *',
157
- 'storage.folder.name.placeholder': 'Enter folder name',
158
- 'storage.validation.folder.name.required': 'Folder name is required',
159
- // utils/base-storage-page.ts
160
- 'storage.delete.this.item': 'this item',
161
- // utils/storage-utils.ts
162
- 'storage.size.bytes': 'Bytes',
163
- 'storage.size.gb': 'GB',
15
+ "file.create.success": "File created successfully",
16
+ "file.create.many.success": "{{count}} files created successfully",
17
+ "file.get.success": "File retrieved successfully",
18
+ "file.get.by.ids.success": "Files retrieved successfully by Ids",
19
+ "file.get.by.filter.success": "Files retrieved successfully by filter",
20
+ "file.get.all.success": "Files retrieved successfully",
21
+ "file.update.success": "File updated successfully",
22
+ "file.update.many.success": "{{count}} files updated successfully",
23
+ "file.delete.success": "File deleted successfully",
24
+ "file.restore.success": "File restored successfully",
25
+ "file.not.found": "File not found",
26
+ "folder.create.success": "Folder created successfully",
27
+ "folder.create.many.success": "{{count}} folders created successfully",
28
+ "folder.get.success": "Folder retrieved successfully",
29
+ "folder.get.by.ids.success": "Folders retrieved successfully by Ids",
30
+ "folder.get.by.filter.success": "Folders retrieved successfully by filter",
31
+ "folder.get.all.success": "Folders retrieved successfully",
32
+ "folder.update.success": "Folder updated successfully",
33
+ "folder.update.many.success": "{{count}} folders updated successfully",
34
+ "folder.delete.success": "Folder deleted successfully",
35
+ "folder.restore.success": "Folder restored successfully",
36
+ "folder.not.found": "Folder not found",
37
+ "storage.config.create.success": "Storage configuration created successfully",
38
+ "storage.config.create.many.success": "{{count}} storage configurations created successfully",
39
+ "storage.config.get.success": "Storage configuration retrieved successfully",
40
+ "storage.config.get.by.ids.success": "Storage configurations retrieved successfully by Ids",
41
+ "storage.config.get.by.filter.success": "Storage configurations retrieved successfully by filter",
42
+ "storage.config.get.all.success": "Storage configurations retrieved successfully",
43
+ "storage.config.update.success": "Storage configuration updated successfully",
44
+ "storage.config.update.many.success": "{{count}} storage configurations updated successfully",
45
+ "storage.config.delete.success": "Storage configuration deleted successfully",
46
+ "storage.config.restore.success": "Storage configuration restored successfully",
47
+ "upload.success": "File uploaded successfully",
48
+ "upload.many.success": "Files uploaded successfully",
49
+ "upload.file.too.large": "File size ({{fileSize}}MB) exceeds maximum {{maxSize}}MB",
50
+ "upload.invalid.type": "File type \"{{mimeType}}\" not allowed. Allowed: {{allowedTypes}}",
51
+ "upload.no.files.provided": "No files provided",
52
+ "upload.no.file.path": "File path is required",
53
+ "upload.invalid.file.path": "Invalid file path",
54
+ "upload.config.not.found": "Upload configuration not found",
55
+ "storage.title": "Storage",
56
+ "storage.subtitle": "Manage files, folders, and storage configurations",
57
+ "storage.file.title": "Files",
58
+ "storage.folder.title": "Folder Setup",
59
+ "storage.config.title": "Storage Configurations",
60
+ "storage.button.new.configuration": "New Configuration",
61
+ "storage.table.provider": "Provider",
62
+ "storage.table.created": "Created",
63
+ "storage.empty.configs.in.company": "No storage configurations found in current company",
64
+ "storage.empty.configs": "No storage configurations found",
65
+ "storage.config.load.failed": "Failed to load storage configurations",
66
+ "storage.config.delete.title": "Delete Configuration",
67
+ "storage.config.default.delete.forbidden": "Cannot delete the default configuration. Set another as default first.",
68
+ "storage.config.edit.config": "Edit Storage Configuration",
69
+ "storage.config.new.config": "New Configuration",
70
+ "storage.config.config.name.required": "Configuration Name *",
71
+ "storage.config.config.name.placeholder": "e.g., Production AWS S3",
72
+ "storage.config.provider.required": "Storage Provider *",
73
+ "storage.set.as.default": "Set as Default",
74
+ "storage.aws.title": "AWS S3 Configuration",
75
+ "storage.config.region.required": "AWS Region *",
76
+ "storage.aws.region.placeholder": "us-east-1",
77
+ "storage.config.bucket.required": "Bucket Name *",
78
+ "storage.aws.bucket.placeholder": "my-bucket",
79
+ "storage.config.access.key.required": "Access Key ID *",
80
+ "storage.config.secret.key.required": "Secret Access Key *",
81
+ "storage.config.endpoint.optional": "Custom Endpoint (Optional)",
82
+ "storage.config.endpoint.placeholder": "https://s3.custom-endpoint.com",
83
+ "storage.azure.title": "Azure Blob Configuration",
84
+ "storage.azure.account.name.required": "Account Name *",
85
+ "storage.azure.container.name.required": "Container Name *",
86
+ "storage.azure.account.key.required": "Account Key *",
87
+ "storage.sftp.title": "SFTP Configuration",
88
+ "storage.sftp.host.required": "Host *",
89
+ "storage.sftp.host.placeholder": "sftp.example.com",
90
+ "storage.sftp.port.required": "Port *",
91
+ "storage.sftp.port.placeholder": "22",
92
+ "storage.sftp.username.required": "Username *",
93
+ "storage.sftp.password.required": "Password *",
94
+ "storage.sftp.base.path.required": "Base Path *",
95
+ "storage.sftp.base.path.placeholder": "/uploads",
96
+ "storage.local.title": "Local Storage Configuration",
97
+ "storage.local.base.path.required": "Base Path *",
98
+ "storage.local.base.path.placeholder": "/var/www/uploads",
99
+ "storage.config.endpoint": "Endpoint URL",
100
+ "storage.validation.config.name.required": "Configuration name is required",
101
+ "storage.file.manager.title": "File Manager",
102
+ "storage.button.upload.file": "Upload File",
103
+ "storage.table.size": "Size",
104
+ "storage.table.location": "Location",
105
+ "storage.table.config": "Config",
106
+ "storage.table.private": "Private",
107
+ "storage.private": "Private",
108
+ "storage.public": "Public",
109
+ "storage.tooltip.trash": "Trash",
110
+ "storage.empty.files.in.company": "No files found in current company",
111
+ "storage.empty.files": "No files found",
112
+ "storage.file.url.not.available": "File URL is not available",
113
+ "storage.delete.move.to.trash.confirm": "Move \"{{name}}\" to trash? You can recover it later.",
114
+ "storage.delete.move.to.trash": "Move to Trash",
115
+ "storage.delete.permanent.delete.confirm": "Permanently delete \"{{name}}\"? This action CANNOT be undone and will delete the file from storage.",
116
+ "storage.delete.permanent.delete": "Permanent Delete",
117
+ "storage.delete.permanent.delete.button": "Delete Permanently",
118
+ "storage.file.manager.edit.file": "Edit File",
119
+ "storage.file.manager.upload.file": "Upload File",
120
+ "storage.config.select.config": "Select storage configuration...",
121
+ "storage.config.no.configs": "No storage configurations found. Please create one first.",
122
+ "storage.folder.optional": "Folder (Optional)",
123
+ "storage.folder.no.folder": "No folder (root level)",
124
+ "storage.folder.no.folders.available": "No folders available. File will be uploaded to root level.",
125
+ "storage.folder.no.folders.edit": "No folders available.",
126
+ "storage.file.select.required": "Select File *",
127
+ "storage.button.choose.file": "Choose File",
128
+ "storage.upload.drag.drop": "Drag and drop file here or click to browse",
129
+ "storage.upload.max.size": "Maximum file size: {{size}}",
130
+ "storage.upload.please.select": "Please select a file to upload",
131
+ "storage.file.name.required": "File Name *",
132
+ "storage.file.placeholder.edit": "Enter file name",
133
+ "storage.file.placeholder": "Will be auto-filled from selected file",
134
+ "storage.file.private": "Private File",
135
+ "storage.file.private.hint": "Only users with permission can access",
136
+ "storage.file.public.hint": "File is publicly accessible",
137
+ "storage.validation.file.name.required": "File name is required",
138
+ "storage.error.no.file": "Please select a file",
139
+ "storage.error.no.config": "Please select a storage configuration",
140
+ "storage.upload.failed": "Failed to upload file",
141
+ "storage.button.new.folder": "New Folder",
142
+ "storage.table.slug": "Slug",
143
+ "storage.empty.folders.in.company": "No folders found in current company",
144
+ "storage.empty.folders": "No folders found",
145
+ "storage.folder.delete.title": "Delete Folder",
146
+ "storage.folder.edit.folder": "Edit Folder",
147
+ "storage.folder.new.folder": "New Folder",
148
+ "storage.folder.name.required": "Folder Name *",
149
+ "storage.folder.name.placeholder": "Enter folder name",
150
+ "storage.validation.folder.name.required": "Folder name is required",
151
+ "storage.delete.this.item": "this item",
152
+ "storage.size.bytes": "Bytes",
153
+ "storage.size.gb": "GB"
164
154
  };
165
-
166
- /**
167
- * File Location Enum
168
- * Storage provider types (matches backend FileLocationEnum)
169
- */
170
155
  var FileLocationEnum;
171
- (function (FileLocationEnum) {
172
- FileLocationEnum["LOCAL"] = "local";
173
- FileLocationEnum["AWS"] = "aws";
174
- FileLocationEnum["AZURE"] = "azure";
175
- FileLocationEnum["SFTP"] = "sftp";
156
+ (function(FileLocationEnum) {
157
+ FileLocationEnum["LOCAL"] = "local";
158
+ FileLocationEnum["AWS"] = "aws";
159
+ FileLocationEnum["AZURE"] = "azure";
160
+ FileLocationEnum["SFTP"] = "sftp";
176
161
  })(FileLocationEnum || (FileLocationEnum = {}));
177
- /**
178
- * Image Format Enum
179
- * Supported image output formats for compression
180
- */
181
162
  var ImageFormat;
182
- (function (ImageFormat) {
183
- ImageFormat["ORIGINAL"] = "original";
184
- ImageFormat["JPEG"] = "jpeg";
185
- ImageFormat["PNG"] = "png";
186
- ImageFormat["WEBP"] = "webp";
163
+ (function(ImageFormat) {
164
+ ImageFormat["ORIGINAL"] = "original";
165
+ ImageFormat["JPEG"] = "jpeg";
166
+ ImageFormat["PNG"] = "png";
167
+ ImageFormat["WEBP"] = "webp";
187
168
  })(ImageFormat || (ImageFormat = {}));
188
-
189
- /**
190
- * Provider label translation keys
191
- */
192
169
  const PROVIDER_LABEL_KEYS = {
193
- [FileLocationEnum.LOCAL]: 'storage.local.title',
194
- [FileLocationEnum.AWS]: 'storage.aws.title',
195
- [FileLocationEnum.AZURE]: 'storage.azure.title',
196
- [FileLocationEnum.SFTP]: 'storage.sftp.title',
170
+ [FileLocationEnum.LOCAL]: "storage.local.title",
171
+ [FileLocationEnum.AWS]: "storage.aws.title",
172
+ [FileLocationEnum.AZURE]: "storage.azure.title",
173
+ [FileLocationEnum.SFTP]: "storage.sftp.title"
197
174
  };
198
- /**
199
- * Provider configurations for all storage types
200
- */
201
175
  const PROVIDER_CONFIGS = {
202
- [FileLocationEnum.LOCAL]: {
203
- labelKey: 'storage.local.title',
204
- icon: 'folder',
205
- severity: 'secondary',
206
- },
207
- [FileLocationEnum.AWS]: {
208
- labelKey: 'storage.aws.title',
209
- icon: 'cloud',
210
- severity: 'warn',
211
- },
212
- [FileLocationEnum.AZURE]: {
213
- labelKey: 'storage.azure.title',
214
- icon: 'cloud',
215
- severity: 'info',
216
- },
217
- [FileLocationEnum.SFTP]: {
218
- labelKey: 'storage.sftp.title',
219
- icon: 'server',
220
- severity: 'contrast',
221
- },
176
+ [FileLocationEnum.LOCAL]: {
177
+ labelKey: "storage.local.title",
178
+ icon: "folder",
179
+ severity: "secondary"
180
+ },
181
+ [FileLocationEnum.AWS]: {
182
+ labelKey: "storage.aws.title",
183
+ icon: "cloud",
184
+ severity: "warn"
185
+ },
186
+ [FileLocationEnum.AZURE]: {
187
+ labelKey: "storage.azure.title",
188
+ icon: "cloud",
189
+ severity: "info"
190
+ },
191
+ [FileLocationEnum.SFTP]: {
192
+ labelKey: "storage.sftp.title",
193
+ icon: "server",
194
+ severity: "contrast"
195
+ }
222
196
  };
223
- /**
224
- * Get provider label translation key
225
- */
226
197
  function getProviderLabelKey(storage) {
227
- const enumValue = storage;
228
- return PROVIDER_CONFIGS[enumValue]?.labelKey ?? storage;
198
+ return PROVIDER_CONFIGS[storage]?.labelKey ?? storage;
229
199
  }
230
- /**
231
- * Get provider icon class
232
- */
233
200
  function getProviderIcon(storage) {
234
- const enumValue = storage;
235
- return PROVIDER_CONFIGS[enumValue]?.icon ?? 'database';
201
+ return PROVIDER_CONFIGS[storage]?.icon ?? "database";
236
202
  }
237
- /**
238
- * Get provider severity for f-tag
239
- */
240
203
  function getProviderSeverity(storage) {
241
- const enumValue = storage;
242
- return PROVIDER_CONFIGS[enumValue]?.severity ?? 'secondary';
204
+ return PROVIDER_CONFIGS[storage]?.severity ?? "secondary";
243
205
  }
244
- /**
245
- * Get file icon based on content type
246
- */
247
206
  function getFileIcon(contentType) {
248
- if (contentType.startsWith('image/'))
249
- return 'image';
250
- if (contentType.startsWith('video/'))
251
- return 'video';
252
- if (contentType.startsWith('audio/'))
253
- return 'volume-up';
254
- if (contentType.includes('pdf'))
255
- return 'file-pdf';
256
- if (contentType.includes('excel') || contentType.includes('spreadsheet'))
257
- return 'file-excel';
258
- if (contentType.includes('word') || contentType.includes('document'))
259
- return 'file-word';
260
- return 'file';
207
+ if (contentType.startsWith("image/")) return "image";
208
+ if (contentType.startsWith("video/")) return "video";
209
+ if (contentType.startsWith("audio/")) return "volume-up";
210
+ if (contentType.includes("pdf")) return "file-pdf";
211
+ if (contentType.includes("excel") || contentType.includes("spreadsheet")) return "file-excel";
212
+ if (contentType.includes("word") || contentType.includes("document")) return "file-word";
213
+ return "file";
261
214
  }
262
- /** File size unit keys for translation */
263
215
  const FILE_SIZE_UNIT_KEYS = [
264
- 'storage.size.bytes',
265
- 'shared.size.kb',
266
- 'shared.size.mb',
267
- 'storage.size.gb',
216
+ "storage.size.bytes",
217
+ "shared.size.kb",
218
+ "shared.size.mb",
219
+ "storage.size.gb"
268
220
  ];
269
- /**
270
- * Format file size from bytes to human readable format
271
- * Returns an object with value and unitKey for translation
272
- */
273
221
  function formatFileSizeWithKey(bytes) {
274
- if (bytes <= 0)
275
- return { value: '0', unitKey: 'storage.size.bytes' };
276
- const k = 1024;
277
- const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), FILE_SIZE_UNIT_KEYS.length - 1);
278
- const value = (Math.round((bytes / Math.pow(k, i)) * 100) / 100).toString();
279
- return { value, unitKey: FILE_SIZE_UNIT_KEYS[i] };
222
+ if (bytes <= 0) return {
223
+ value: "0",
224
+ unitKey: "storage.size.bytes"
225
+ };
226
+ const k = 1024;
227
+ const i = Math.min(Math.floor(Math.log(bytes) / Math.log(k)), FILE_SIZE_UNIT_KEYS.length - 1);
228
+ return {
229
+ value: (Math.round(bytes / Math.pow(k, i) * 100) / 100).toString(),
230
+ unitKey: FILE_SIZE_UNIT_KEYS[i]
231
+ };
280
232
  }
281
- /**
282
- * Format file size from bytes to human readable string
283
- * @deprecated Use formatFileSizeWithKey for localization support
284
- */
285
233
  function formatFileSize(bytes) {
286
- const { value, unitKey } = formatFileSizeWithKey(bytes);
287
- // Fallback to non-translated units for backward compatibility
288
- const unitMap = {
289
- 'storage.size.bytes': 'Bytes',
290
- 'shared.size.kb': 'KB',
291
- 'shared.size.mb': 'MB',
292
- 'storage.size.gb': 'GB',
293
- };
294
- return `${value} ${unitMap[unitKey]}`;
234
+ const { value, unitKey } = formatFileSizeWithKey(bytes);
235
+ return `${value} ${{
236
+ "storage.size.bytes": "Bytes",
237
+ "shared.size.kb": "KB",
238
+ "shared.size.mb": "MB",
239
+ "storage.size.gb": "GB"
240
+ }[unitKey]}`;
295
241
  }
296
- /**
297
- * Storage provider options for dropdown selects
298
- * Labels are translation keys - components should translate them
299
- */
300
242
  const STORAGE_PROVIDER_OPTIONS = [
301
- { labelKey: 'storage.aws.title', value: FileLocationEnum.AWS },
302
- { labelKey: 'storage.azure.title', value: FileLocationEnum.AZURE },
303
- { labelKey: 'storage.sftp.title', value: FileLocationEnum.SFTP },
304
- { labelKey: 'storage.local.title', value: FileLocationEnum.LOCAL },
243
+ {
244
+ labelKey: "storage.aws.title",
245
+ value: FileLocationEnum.AWS
246
+ },
247
+ {
248
+ labelKey: "storage.azure.title",
249
+ value: FileLocationEnum.AZURE
250
+ },
251
+ {
252
+ labelKey: "storage.sftp.title",
253
+ value: FileLocationEnum.SFTP
254
+ },
255
+ {
256
+ labelKey: "storage.local.title",
257
+ value: FileLocationEnum.LOCAL
258
+ }
305
259
  ];
306
-
307
- class BaseStoragePage {
308
- router = inject(Router);
309
- messageService = inject(MessageService);
310
- appConfig = inject(APP_CONFIG);
311
- companyContext = inject(LAYOUT_AUTH_STATE);
312
- translateAdapter = inject(TranslateService);
313
- isLoading = signal(false, /* @ts-ignore */
314
- ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
315
- showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, /* @ts-ignore */
316
- ...(ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []));
317
- currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, /* @ts-ignore */
318
- ...(ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []));
319
- showSuccess(detail, summaryKey = 'shared.success') {
320
- const summary = this.translateAdapter.translate(summaryKey);
321
- this.messageService.add({ severity: 'success', summary, detail });
322
- }
323
- showError(detail, summaryKey = 'shared.error') {
324
- const summary = this.translateAdapter.translate(summaryKey);
325
- this.messageService.add({ severity: 'error', summary, detail });
326
- }
327
- navigateTo(path) {
328
- this.router.navigate(path);
329
- }
330
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BaseStoragePage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
331
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: BaseStoragePage, isStandalone: true, ngImport: i0 });
332
- }
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BaseStoragePage, decorators: [{
334
- type: Directive
335
- }] });
336
- class BaseStorageListPage {
337
- router = inject(Router);
338
- messageService = inject(MessageService);
339
- appConfig = inject(APP_CONFIG);
340
- confirmationService = inject(ConfirmationService);
341
- destroyRef = inject(DestroyRef);
342
- translateAdapter = inject(TranslateService);
343
- companyContext = inject(LAYOUT_AUTH_STATE);
344
- items = signal([], /* @ts-ignore */
345
- ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
346
- isLoading = signal(false, /* @ts-ignore */
347
- ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
348
- total = signal(0, /* @ts-ignore */
349
- ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
350
- pageSize = signal(50, /* @ts-ignore */
351
- ...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
352
- first = signal(0, /* @ts-ignore */
353
- ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
354
- currentPage = computed(() => Math.floor(this.first() / this.pageSize()), /* @ts-ignore */
355
- ...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
356
- showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, /* @ts-ignore */
357
- ...(ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []));
358
- totalRecords = this.total;
359
- currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, /* @ts-ignore */
360
- ...(ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []));
361
- getDeleteConfirmMessage(item) {
362
- const itemName = item.name;
363
- const name = itemName ?? this.translateAdapter.translate('storage.delete.this.item');
364
- return this.translateAdapter.translate('shared.confirm.delete.item', { name });
365
- }
366
- onCreate() {
367
- this.router.navigate([this.getResourceRoute(), 'new']);
368
- }
369
- onEdit(id) {
370
- this.router.navigate([this.getResourceRoute(), id]);
371
- }
372
- onPageChange(event) {
373
- this.first.set(event.first ?? 0);
374
- this.pageSize.set(event.rows ?? 10);
375
- this.loadData();
376
- }
377
- getPaginationParams() {
378
- return { currentPage: this.currentPage(), pageSize: this.pageSize() };
379
- }
380
- showSuccess(detail, summary) {
381
- this.messageService.add({
382
- severity: 'success',
383
- summary: summary ?? this.t('shared.success'),
384
- detail,
385
- });
386
- }
387
- showError(detail, summary) {
388
- this.messageService.add({
389
- severity: 'error',
390
- summary: summary ?? this.t('shared.error'),
391
- detail,
392
- });
393
- }
394
- showInfo(detail, summary) {
395
- this.messageService.add({
396
- severity: 'info',
397
- summary: summary ?? this.t('shared.info'),
398
- detail,
399
- });
400
- }
401
- showWarn(detail, summary) {
402
- this.messageService.add({
403
- severity: 'warn',
404
- summary: summary ?? this.t('shared.warning'),
405
- detail,
406
- });
407
- }
408
- onDelete(item, idGetter, deleteApiCall, options) {
409
- this.confirmationService.confirm({
410
- message: this.getDeleteConfirmMessage(item),
411
- header: options?.header ?? this.t('shared.confirm.delete.header'),
412
- icon: 'exclamation-triangle',
413
- acceptButtonStyleClass: 'p-button-danger',
414
- accept: () => {
415
- from(deleteApiCall(idGetter(item)))
416
- .pipe(takeUntilDestroyed(this.destroyRef))
417
- .subscribe({
418
- next: (res) => {
419
- const r = res;
420
- this.showSuccess(r?.messageKey ? this.t(r.messageKey, r.messageVariables) : (r?.message ?? ''));
421
- this.loadData();
422
- },
423
- });
424
- },
425
- });
426
- }
427
- async onDeleteAsync(item, idGetter, deleteApiCall, options) {
428
- this.confirmationService.confirm({
429
- message: this.getDeleteConfirmMessage(item),
430
- header: options?.header ?? this.t('shared.confirm.delete.header'),
431
- icon: 'exclamation-triangle',
432
- acceptButtonStyleClass: 'p-button-danger',
433
- accept: async () => {
434
- const res = await deleteApiCall(idGetter(item));
435
- const r = res;
436
- this.showSuccess(r?.messageKey ? this.t(r.messageKey, r.messageVariables) : (r?.message ?? ''));
437
- await this.loadData();
438
- },
439
- });
440
- }
441
- navigateTo(path) {
442
- this.router.navigate(path);
443
- }
444
- t(key, variables) {
445
- return this.translateAdapter?.translate(key, variables) ?? key;
446
- }
447
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BaseStorageListPage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
448
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.5", type: BaseStorageListPage, isStandalone: true, ngImport: i0 });
449
- }
450
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BaseStorageListPage, decorators: [{
451
- type: Directive
452
- }] });
453
-
454
- class FileManagerApiService extends ApiResourceService {
455
- constructor() {
456
- super('file-manager', 'storage');
457
- }
458
- getFiles(fileIds) {
459
- const requests = fileIds.map((id) => ({ id }));
460
- return this.http.post(`${this.baseUrl}/get-files`, requests);
461
- }
462
- createFile(dto) {
463
- return this.http.post(`${this.baseUrl}/insert`, dto);
464
- }
465
- createFiles(dtos) {
466
- return this.http.post(`${this.baseUrl}/insert-many`, dtos);
467
- }
468
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FileManagerApiService, deps: [], target: i0.ɵɵFactoryTarget.Service });
469
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: FileManagerApiService });
470
- }
471
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FileManagerApiService, decorators: [{
472
- type: Service
473
- }], ctorParameters: () => [] });
474
-
475
- /**
476
- * Folder API Service
477
- * Handles folder CRUD operations
478
- * Endpoint: POST /storage/folder/*
479
- *
480
- * Note: Company feature enabled - all queries automatically scoped to user's company
481
- */
482
- class FolderApiService extends ApiResourceService {
483
- constructor() {
484
- super('folder', 'storage');
485
- }
486
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FolderApiService, deps: [], target: i0.ɵɵFactoryTarget.Service });
487
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: FolderApiService });
488
- }
489
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FolderApiService, decorators: [{
490
- type: Service
491
- }], ctorParameters: () => [] });
492
-
493
- /**
494
- * Storage Config API Service
495
- * Handles storage configuration CRUD operations
496
- * Endpoint: POST /storage/storage-config/*
497
- *
498
- * Note: Company feature enabled - all queries automatically scoped to user's company
499
- */
500
- class StorageConfigApiService extends ApiResourceService {
501
- constructor() {
502
- super('storage-config', 'storage');
503
- }
504
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: StorageConfigApiService, deps: [], target: i0.ɵɵFactoryTarget.Service });
505
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: StorageConfigApiService });
506
- }
507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: StorageConfigApiService, decorators: [{
508
- type: Service
509
- }], ctorParameters: () => [] });
510
-
511
- /**
512
- * Upload Service - File upload/delete operations
513
- * Endpoint: POST /storage/upload/*
514
- */
515
- class UploadService extends BaseApiService {
516
- fileManagerApi = inject(FileManagerApiService);
517
- constructor() {
518
- super('storage');
519
- }
520
- /** Get default storage config ID from app config */
521
- getDefaultConfigId() {
522
- return getDefaultStorageConfigId(this.appConfig);
523
- }
524
- /** Upload single file - POST /storage/upload/single-file */
525
- uploadSingleFile(file, options) {
526
- const formData = new FormData();
527
- formData.append('file', file);
528
- return this.http.post(this.buildUploadUrl('single-file', options), formData);
529
- }
530
- /** Upload multiple files (max 50) - POST /storage/upload/multiple-file */
531
- uploadMultipleFiles(files, options) {
532
- const formData = new FormData();
533
- files.forEach((file) => formData.append('files', file));
534
- return this.http.post(this.buildUploadUrl('multiple-file', options), formData);
535
- }
536
- /** Delete single file - POST /storage/upload/delete-single-file */
537
- deleteSingleFile(key, storageConfigId) {
538
- return this.http.post(this.getUrl('upload/delete-single-file'), this.buildDeleteBody({ key }, storageConfigId));
539
- }
540
- /** Delete multiple files - POST /storage/upload/delete-multiple-file */
541
- deleteMultipleFiles(keys, storageConfigId) {
542
- return this.http.post(this.getUrl('upload/delete-multiple-file'), this.buildDeleteBody({ keys }, storageConfigId));
543
- }
544
- /** Get file download URL - GET /storage/upload/file/:filePath */
545
- getFileUrl(key) {
546
- return this.getUrl(`upload/file/${key}`);
547
- }
548
- /** Upload file and register in file manager - returns file manager ID (UUID) */
549
- uploadAndRegister(file, options) {
550
- return this.uploadSingleFile(file, options).pipe(switchMap((response) => {
551
- if (!response.success || !response.data) {
552
- throw new Error(response.message || 'upload.failed');
553
- }
554
- return this.fileManagerApi.createFile(this.toCreateFileDto(response.data, options));
555
- }));
556
- }
557
- /** Upload multiple files and register in file manager - batch upload (2 API calls total) */
558
- uploadAndRegisterMultiple(files, options) {
559
- return this.uploadMultipleFiles(files, options).pipe(switchMap((response) => {
560
- if (!response.success || !response.data) {
561
- throw new Error(response.message || 'upload.failed');
562
- }
563
- const dtos = response.data.map((fileInfo) => this.toCreateFileDto(fileInfo, options));
564
- return this.fileManagerApi.createFiles(dtos).pipe(map((bulkResponse) => ({
565
- success: bulkResponse.success,
566
- data: bulkResponse.data ?? [],
567
- message: bulkResponse.message,
568
- })));
569
- }));
570
- }
571
- // ─── Private Helpers ───────────────────────────────────────────────────────
572
- resolveConfigId(storageConfigId) {
573
- return storageConfigId ?? this.getDefaultConfigId();
574
- }
575
- toCreateFileDto(fileInfo, options) {
576
- return {
577
- name: fileInfo.name,
578
- key: fileInfo.key,
579
- size: String(fileInfo.size),
580
- contentType: fileInfo.contentType,
581
- isPrivate: options?.isPrivate ?? false,
582
- folderId: options?.folderId,
583
- storageConfigId: this.resolveConfigId(options?.storageConfigId),
584
- };
585
- }
586
- buildUploadUrl(endpoint, options) {
587
- const params = this.buildQueryParams(options);
588
- const baseUrl = this.getUrl(`upload/${endpoint}`);
589
- return params ? `${baseUrl}?${params}` : baseUrl;
590
- }
591
- buildQueryParams(options) {
592
- const params = new URLSearchParams();
593
- const configId = this.resolveConfigId(options?.storageConfigId);
594
- if (configId)
595
- params.append('storageConfigId', configId);
596
- if (options?.folderPath)
597
- params.append('folderPath', options.folderPath);
598
- if (options?.maxWidth)
599
- params.append('maxWidth', options.maxWidth.toString());
600
- if (options?.maxHeight)
601
- params.append('maxHeight', options.maxHeight.toString());
602
- if (options?.quality)
603
- params.append('quality', options.quality.toString());
604
- if (options?.format)
605
- params.append('format', options.format);
606
- if (options?.compress !== undefined)
607
- params.append('compress', options.compress.toString());
608
- return params.toString();
609
- }
610
- buildDeleteBody(data, storageConfigId) {
611
- const configId = this.resolveConfigId(storageConfigId);
612
- return { ...data, ...(configId && { storageConfigId: configId }) };
613
- }
614
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UploadService, deps: [], target: i0.ɵɵFactoryTarget.Service });
615
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: UploadService });
616
- }
617
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UploadService, decorators: [{
618
- type: Service
619
- }], ctorParameters: () => [] });
620
-
621
- class FileProviderAdapter {
622
- fileManagerApi = inject(FileManagerApiService);
623
- uploadService = inject(UploadService);
624
- folderApi = inject(FolderApiService);
625
- storageConfigApi = inject(StorageConfigApiService);
626
- loadFiles(filter) {
627
- const filterObj = this.buildFileFilter(filter);
628
- return from(this.fileManagerApi
629
- .getAll({ pagination: { currentPage: filter.page, pageSize: filter.pageSize }, filter: Object.keys(filterObj).length > 0 ? filterObj : undefined }, filter.search || ''))
630
- .pipe(map((res) => ({ ...res, data: res.data?.map(this.mapToFileBasicInfo) })));
631
- }
632
- uploadFile(file, options) {
633
- return this.uploadService
634
- .uploadAndRegister(file, options)
635
- .pipe(map((res) => ({ ...res, data: res.data ? this.mapToUploadedFile(res.data) : undefined })));
636
- }
637
- uploadMultipleFiles(files, options) {
638
- return this.uploadService
639
- .uploadAndRegisterMultiple(files, options)
640
- .pipe(map((res) => ({ ...res, data: res.data?.map(this.mapToUploadedFile) })));
641
- }
642
- getFileUrls(fileIds) {
643
- return this.fileManagerApi.getFiles(fileIds).pipe(map((res) => ({
644
- ...res,
645
- data: res.data?.map((f) => ({ id: f.id, name: f.name, contentType: f.contentType, size: '0', url: f.url })),
646
- })));
647
- }
648
- loadFolders(filter) {
649
- return from(this.folderApi
650
- .getAll({ pagination: { currentPage: filter.page, pageSize: filter.pageSize } }, filter.search || ''))
651
- .pipe(map((res) => ({ ...res, data: res.data?.map((f) => ({ id: f.id, name: f.name, slug: f.slug })) })));
652
- }
653
- loadStorageConfigs(filter) {
654
- return from(this.storageConfigApi
655
- .getAll({ pagination: { currentPage: filter.page, pageSize: filter.pageSize } }, filter.search || ''))
656
- .pipe(map((res) => ({ ...res, data: res.data?.map((c) => ({ id: c.id, name: c.name, isDefault: c.isDefault })) })));
657
- }
658
- // ─── Private Helpers ────────────────────────────────────────────────────────
659
- buildFileFilter(filter) {
660
- const filterObj = {};
661
- if (filter.folderId)
662
- filterObj['folderId'] = filter.folderId;
663
- if (filter.storageConfigId)
664
- filterObj['storageConfigId'] = filter.storageConfigId;
665
- if (filter.contentTypes?.length)
666
- filterObj['contentType'] = filter.contentTypes.join(',');
667
- return filterObj;
668
- }
669
- mapToFileBasicInfo = (f) => ({
670
- id: f.id,
671
- name: f.name,
672
- contentType: f.contentType,
673
- size: f.size,
674
- url: f.url,
675
- });
676
- mapToUploadedFile = (f) => ({
677
- id: f.id,
678
- name: f.name,
679
- key: f.key,
680
- size: parseFloat(f.size) * 1024,
681
- contentType: f.contentType,
682
- });
683
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FileProviderAdapter, deps: [], target: i0.ɵɵFactoryTarget.Service });
684
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.5", ngImport: i0, type: FileProviderAdapter, autoProvided: false });
685
- }
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: FileProviderAdapter, decorators: [{
687
- type: Service,
688
- args: [{ autoProvided: false }]
689
- }] });
690
-
691
- /**
692
- * Provide Storage Providers
693
- *
694
- * Registers storage-related provider implementations.
695
- * Call this in app.config.ts to enable storage features in other packages.
696
- *
697
- * @example
698
- * // In app.config.ts
699
- * export const appConfig: ApplicationConfig = {
700
- * providers: [
701
- * ...provideStorageProviders(),
702
- * ],
703
- * };
704
- *
705
- * @returns Array of providers for storage functionality
706
- */
260
+ var BaseStoragePage = class BaseStoragePage {
261
+ router = inject(Router);
262
+ messageService = inject(MessageService);
263
+ appConfig = inject(APP_CONFIG);
264
+ companyContext = inject(LAYOUT_AUTH_STATE);
265
+ translateAdapter = inject(TranslateService);
266
+ isLoading = signal(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
267
+ showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, ...ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []);
268
+ currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, ...ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []);
269
+ showSuccess(detail, summaryKey = "shared.success") {
270
+ const summary = this.translateAdapter.translate(summaryKey);
271
+ this.messageService.add({
272
+ severity: "success",
273
+ summary,
274
+ detail
275
+ });
276
+ }
277
+ showError(detail, summaryKey = "shared.error") {
278
+ const summary = this.translateAdapter.translate(summaryKey);
279
+ this.messageService.add({
280
+ severity: "error",
281
+ summary,
282
+ detail
283
+ });
284
+ }
285
+ navigateTo(path) {
286
+ this.router.navigate(path);
287
+ }
288
+ static ɵfac = i0.ɵɵngDeclareFactory({
289
+ minVersion: "12.0.0",
290
+ version: "22.2.1",
291
+ ngImport: i0,
292
+ type: BaseStoragePage,
293
+ deps: [],
294
+ target: i0.ɵɵFactoryTarget.Directive
295
+ });
296
+ static ɵdir = i0.ɵɵngDeclareDirective({
297
+ minVersion: "14.0.0",
298
+ version: "22.2.1",
299
+ type: BaseStoragePage,
300
+ isStandalone: true,
301
+ ngImport: i0
302
+ });
303
+ };
304
+ i0.ɵɵngDeclareClassMetadata({
305
+ minVersion: "12.0.0",
306
+ version: "22.2.1",
307
+ ngImport: i0,
308
+ type: BaseStoragePage,
309
+ decorators: [{ type: Directive }]
310
+ });
311
+ var BaseStorageListPage = class BaseStorageListPage {
312
+ router = inject(Router);
313
+ messageService = inject(MessageService);
314
+ appConfig = inject(APP_CONFIG);
315
+ confirmationService = inject(ConfirmationService);
316
+ destroyRef = inject(DestroyRef);
317
+ translateAdapter = inject(TranslateService);
318
+ companyContext = inject(LAYOUT_AUTH_STATE);
319
+ items = signal([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
320
+ isLoading = signal(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
321
+ total = signal(0, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
322
+ pageSize = signal(50, ...ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []);
323
+ first = signal(0, ...ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []);
324
+ currentPage = computed(() => Math.floor(this.first() / this.pageSize()), ...ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []);
325
+ showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, ...ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []);
326
+ totalRecords = this.total;
327
+ currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, ...ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []);
328
+ getDeleteConfirmMessage(item) {
329
+ const name = item.name ?? this.translateAdapter.translate("storage.delete.this.item");
330
+ return this.translateAdapter.translate("shared.confirm.delete.item", { name });
331
+ }
332
+ onCreate() {
333
+ this.router.navigate([this.getResourceRoute(), "new"]);
334
+ }
335
+ onEdit(id) {
336
+ this.router.navigate([this.getResourceRoute(), id]);
337
+ }
338
+ onPageChange(event) {
339
+ this.first.set(event.first ?? 0);
340
+ this.pageSize.set(event.rows ?? 10);
341
+ this.loadData();
342
+ }
343
+ getPaginationParams() {
344
+ return {
345
+ currentPage: this.currentPage(),
346
+ pageSize: this.pageSize()
347
+ };
348
+ }
349
+ showSuccess(detail, summary) {
350
+ this.messageService.add({
351
+ severity: "success",
352
+ summary: summary ?? this.t("shared.success"),
353
+ detail
354
+ });
355
+ }
356
+ showError(detail, summary) {
357
+ this.messageService.add({
358
+ severity: "error",
359
+ summary: summary ?? this.t("shared.error"),
360
+ detail
361
+ });
362
+ }
363
+ showInfo(detail, summary) {
364
+ this.messageService.add({
365
+ severity: "info",
366
+ summary: summary ?? this.t("shared.info"),
367
+ detail
368
+ });
369
+ }
370
+ showWarn(detail, summary) {
371
+ this.messageService.add({
372
+ severity: "warn",
373
+ summary: summary ?? this.t("shared.warning"),
374
+ detail
375
+ });
376
+ }
377
+ onDelete(item, idGetter, deleteApiCall, options) {
378
+ this.confirmationService.confirm({
379
+ message: this.getDeleteConfirmMessage(item),
380
+ header: options?.header ?? this.t("shared.confirm.delete.header"),
381
+ icon: "exclamation-triangle",
382
+ acceptButtonStyleClass: "p-button-danger",
383
+ accept: () => {
384
+ from(deleteApiCall(idGetter(item))).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({ next: (res) => {
385
+ const r = res;
386
+ this.showSuccess(r?.messageKey ? this.t(r.messageKey, r.messageVariables) : r?.message ?? "");
387
+ this.loadData();
388
+ } });
389
+ }
390
+ });
391
+ }
392
+ async onDeleteAsync(item, idGetter, deleteApiCall, options) {
393
+ this.confirmationService.confirm({
394
+ message: this.getDeleteConfirmMessage(item),
395
+ header: options?.header ?? this.t("shared.confirm.delete.header"),
396
+ icon: "exclamation-triangle",
397
+ acceptButtonStyleClass: "p-button-danger",
398
+ accept: async () => {
399
+ const r = await deleteApiCall(idGetter(item));
400
+ this.showSuccess(r?.messageKey ? this.t(r.messageKey, r.messageVariables) : r?.message ?? "");
401
+ await this.loadData();
402
+ }
403
+ });
404
+ }
405
+ navigateTo(path) {
406
+ this.router.navigate(path);
407
+ }
408
+ t(key, variables) {
409
+ return this.translateAdapter?.translate(key, variables) ?? key;
410
+ }
411
+ static ɵfac = i0.ɵɵngDeclareFactory({
412
+ minVersion: "12.0.0",
413
+ version: "22.2.1",
414
+ ngImport: i0,
415
+ type: BaseStorageListPage,
416
+ deps: [],
417
+ target: i0.ɵɵFactoryTarget.Directive
418
+ });
419
+ static ɵdir = i0.ɵɵngDeclareDirective({
420
+ minVersion: "14.0.0",
421
+ version: "22.2.1",
422
+ type: BaseStorageListPage,
423
+ isStandalone: true,
424
+ ngImport: i0
425
+ });
426
+ };
427
+ i0.ɵɵngDeclareClassMetadata({
428
+ minVersion: "12.0.0",
429
+ version: "22.2.1",
430
+ ngImport: i0,
431
+ type: BaseStorageListPage,
432
+ decorators: [{ type: Directive }]
433
+ });
434
+ var FileProviderAdapter = class FileProviderAdapter {
435
+ fileManagerApi = inject(FileManagerApiService);
436
+ uploadService = inject(UploadService);
437
+ folderApi = inject(FolderApiService);
438
+ storageConfigApi = inject(StorageConfigApiService);
439
+ loadFiles(filter) {
440
+ const filterObj = this.buildFileFilter(filter);
441
+ return from(this.fileManagerApi.getAll({
442
+ pagination: {
443
+ currentPage: filter.page,
444
+ pageSize: filter.pageSize
445
+ },
446
+ filter: Object.keys(filterObj).length > 0 ? filterObj : void 0
447
+ }, filter.search || "")).pipe(map((res) => ({
448
+ ...res,
449
+ data: res.data?.map(this.mapToFileBasicInfo)
450
+ })));
451
+ }
452
+ uploadFile(file, options) {
453
+ return this.uploadService.uploadAndRegister(file, options).pipe(map((res) => ({
454
+ ...res,
455
+ data: res.data ? this.mapToUploadedFile(res.data) : void 0
456
+ })));
457
+ }
458
+ uploadMultipleFiles(files, options) {
459
+ return this.uploadService.uploadAndRegisterMultiple(files, options).pipe(map((res) => ({
460
+ ...res,
461
+ data: res.data?.map(this.mapToUploadedFile)
462
+ })));
463
+ }
464
+ getFileUrls(fileIds) {
465
+ return this.fileManagerApi.getFiles(fileIds).pipe(map((res) => ({
466
+ ...res,
467
+ data: res.data?.map((f) => ({
468
+ id: f.id,
469
+ name: f.name,
470
+ contentType: f.contentType,
471
+ size: "0",
472
+ url: f.url
473
+ }))
474
+ })));
475
+ }
476
+ loadFolders(filter) {
477
+ return from(this.folderApi.getAll({ pagination: {
478
+ currentPage: filter.page,
479
+ pageSize: filter.pageSize
480
+ } }, filter.search || "")).pipe(map((res) => ({
481
+ ...res,
482
+ data: res.data?.map((f) => ({
483
+ id: f.id,
484
+ name: f.name,
485
+ slug: f.slug
486
+ }))
487
+ })));
488
+ }
489
+ loadStorageConfigs(filter) {
490
+ return from(this.storageConfigApi.getAll({ pagination: {
491
+ currentPage: filter.page,
492
+ pageSize: filter.pageSize
493
+ } }, filter.search || "")).pipe(map((res) => ({
494
+ ...res,
495
+ data: res.data?.map((c) => ({
496
+ id: c.id,
497
+ name: c.name,
498
+ isDefault: c.isDefault
499
+ }))
500
+ })));
501
+ }
502
+ buildFileFilter(filter) {
503
+ const filterObj = {};
504
+ if (filter.folderId) filterObj["folderId"] = filter.folderId;
505
+ if (filter.storageConfigId) filterObj["storageConfigId"] = filter.storageConfigId;
506
+ if (filter.contentTypes?.length) filterObj["contentType"] = filter.contentTypes.join(",");
507
+ return filterObj;
508
+ }
509
+ mapToFileBasicInfo = (f) => ({
510
+ id: f.id,
511
+ name: f.name,
512
+ contentType: f.contentType,
513
+ size: f.size,
514
+ url: f.url
515
+ });
516
+ mapToUploadedFile = (f) => ({
517
+ id: f.id,
518
+ name: f.name,
519
+ key: f.key,
520
+ size: parseFloat(f.size) * 1024,
521
+ contentType: f.contentType
522
+ });
523
+ static ɵfac = i0.ɵɵngDeclareFactory({
524
+ minVersion: "12.0.0",
525
+ version: "22.2.1",
526
+ ngImport: i0,
527
+ type: FileProviderAdapter,
528
+ deps: [],
529
+ target: i0.ɵɵFactoryTarget.Service
530
+ });
531
+ static ɵprov = i0.ɵɵngDeclareService({
532
+ minVersion: "22.0.0",
533
+ version: "22.2.1",
534
+ ngImport: i0,
535
+ type: FileProviderAdapter,
536
+ autoProvided: false
537
+ });
538
+ };
539
+ i0.ɵɵngDeclareClassMetadata({
540
+ minVersion: "12.0.0",
541
+ version: "22.2.1",
542
+ ngImport: i0,
543
+ type: FileProviderAdapter,
544
+ decorators: [{
545
+ type: Service,
546
+ args: [{ autoProvided: false }]
547
+ }]
548
+ });
707
549
  function provideStorageProviders() {
708
- return [
709
- {
710
- provide: FILE_PROVIDER,
711
- useClass: FileProviderAdapter,
712
- },
713
- ];
550
+ return [{
551
+ provide: FILE_PROVIDER,
552
+ useClass: FileProviderAdapter
553
+ }];
714
554
  }
715
-
716
- /**
717
- * Resolves which storage tab the current user should land on when navigating
718
- * to the bare `/storage` route. Mirrors the tab visibility order in
719
- * StorageContainerComponent.visibleTabs so the redirect never points at a
720
- * tab the user can't actually see.
721
- */
722
555
  function resolveStorageDefaultTab() {
723
- const permissionValidator = inject(PermissionValidatorService);
724
- if (permissionValidator.hasPermission(FILE_PERMISSIONS.READ)) {
725
- return 'files';
726
- }
727
- if (permissionValidator.hasPermission(FOLDER_PERMISSIONS.READ)) {
728
- return 'folders';
729
- }
730
- if (permissionValidator.hasPermission(STORAGE_CONFIG_PERMISSIONS.READ)) {
731
- return 'configs';
732
- }
733
- return 'files';
556
+ const permissionValidator = inject(PermissionValidatorService);
557
+ if (permissionValidator.hasPermission(FILE_PERMISSIONS.READ)) return "files";
558
+ if (permissionValidator.hasPermission(FOLDER_PERMISSIONS.READ)) return "folders";
559
+ if (permissionValidator.hasPermission(STORAGE_CONFIG_PERMISSIONS.READ)) return "configs";
560
+ return "files";
734
561
  }
735
- /**
736
- * Storage Module Routes
737
- * All routes protected by permission guards
738
- */
739
- const STORAGE_ROUTES = [
740
- {
741
- path: '',
742
- resolve: { translations: resolveTranslationModule({ modules: ['storage'], fallbackMessages: { ...STORAGE_MESSAGES, ...SHARED_MESSAGES } }) },
743
- loadComponent: () => Promise.resolve().then(function () { return storageContainer_component; }).then((m) => m.StorageContainerComponent),
744
- children: [
745
- // File Manager Routes
746
- {
747
- path: 'files',
748
- canActivate: [permissionGuard(FILE_PERMISSIONS.READ)],
749
- children: [
750
- {
751
- path: '',
752
- loadComponent: () => import('./flusys-ng-storage-file-manager-list.component-a7YHw1Gz.mjs').then((m) => m.FileManagerListComponent),
753
- },
754
- {
755
- path: 'new',
756
- canActivate: [permissionGuard(FILE_PERMISSIONS.CREATE)],
757
- loadComponent: () => import('./flusys-ng-storage-file-manager-form.component-DaO-9wKM.mjs').then((m) => m.FileManagerFormComponent),
758
- },
759
- {
760
- path: ':id',
761
- canActivate: [permissionGuard(FILE_PERMISSIONS.UPDATE)],
762
- loadComponent: () => import('./flusys-ng-storage-file-manager-form.component-DaO-9wKM.mjs').then((m) => m.FileManagerFormComponent),
763
- },
764
- ],
765
- },
766
- // Folder Routes
767
- {
768
- path: 'folders',
769
- canActivate: [permissionGuard(FOLDER_PERMISSIONS.READ)],
770
- children: [
771
- {
772
- path: '',
773
- loadComponent: () => import('./flusys-ng-storage-folder-list.component-BDrBAcCS.mjs').then((m) => m.FolderListComponent),
774
- },
775
- {
776
- path: 'new',
777
- canActivate: [permissionGuard(FOLDER_PERMISSIONS.CREATE)],
778
- loadComponent: () => import('./flusys-ng-storage-folder-form.component-BCzVzmRn.mjs').then((m) => m.FolderFormComponent),
779
- },
780
- {
781
- path: ':id',
782
- canActivate: [permissionGuard(FOLDER_PERMISSIONS.UPDATE)],
783
- loadComponent: () => import('./flusys-ng-storage-folder-form.component-BCzVzmRn.mjs').then((m) => m.FolderFormComponent),
784
- },
785
- ],
786
- },
787
- // Storage Config Routes
788
- {
789
- path: 'configs',
790
- canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.READ)],
791
- children: [
792
- {
793
- path: '',
794
- loadComponent: () => import('./flusys-ng-storage-storage-config-list.component-CCkZY--j.mjs').then((m) => m.StorageConfigListComponent),
795
- },
796
- {
797
- path: 'new',
798
- canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.CREATE)],
799
- loadComponent: () => import('./flusys-ng-storage-storage-config-form.component-B4wBfzVs.mjs').then((m) => m.StorageConfigFormComponent),
800
- },
801
- {
802
- path: ':id',
803
- canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.UPDATE)],
804
- loadComponent: () => import('./flusys-ng-storage-storage-config-form.component-B4wBfzVs.mjs').then((m) => m.StorageConfigFormComponent),
805
- },
806
- ],
807
- },
808
- // Default redirect to the first tab the user has permission to see
809
- { path: '', redirectTo: () => resolveStorageDefaultTab(), pathMatch: 'full' },
810
- ],
811
- },
812
- ];
813
-
814
- /**
815
- * Storage Container Component
816
- *
817
- * Main container for Storage module with tab navigation
818
- * Routes: Files | Folders | Configurations
819
- * Tabs are filtered based on user permissions
820
- */
821
- class StorageContainerComponent {
822
- permissionValidator = inject(PermissionValidatorService);
823
- translateService = inject(TranslateService);
824
- /** All available tabs with required permissions */
825
- allTabs = [
826
- {
827
- id: 'files',
828
- labelKey: 'storage.file.title',
829
- icon: 'file',
830
- route: 'files',
831
- permission: FILE_PERMISSIONS.READ,
832
- },
833
- {
834
- id: 'folders',
835
- labelKey: 'storage.folder.title',
836
- icon: 'folder',
837
- route: 'folders',
838
- permission: FOLDER_PERMISSIONS.READ,
839
- },
840
- {
841
- id: 'configs',
842
- labelKey: 'storage.config.title',
843
- icon: 'cog',
844
- route: 'configs',
845
- permission: STORAGE_CONFIG_PERMISSIONS.READ,
846
- },
847
- ];
848
- /** Visible tabs based on user permissions */
849
- visibleTabs = computed(() => this.allTabs
850
- .filter((tab) => this.permissionValidator.hasPermission(tab.permission))
851
- .map((tab) => ({
852
- id: tab.id,
853
- label: this.translateService.translate(tab.labelKey),
854
- icon: tab.icon,
855
- route: tab.route,
856
- })), /* @ts-ignore */
857
- ...(ngDevMode ? [{ debugName: "visibleTabs" }] : /* istanbul ignore next */ []));
858
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: StorageContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
859
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.5", type: StorageContainerComponent, isStandalone: true, selector: "lib-storage-container", ngImport: i0, template: `
860
- <div class="p-2 sm:p-4">
861
- <div class="mb-4">
862
- <h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'storage.title' | translate }}</h1>
863
- <p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'storage.subtitle' | translate }}</p>
864
- </div>
865
-
866
- <lib-router-tabs [tabs]="visibleTabs()" class="mb-4" />
867
-
868
- <router-outlet />
869
- </div>
870
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: RouterTabsComponent, selector: "lib-router-tabs", inputs: ["tabs"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
871
- }
872
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: StorageContainerComponent, decorators: [{
873
- type: Component,
874
- args: [{
875
- selector: 'lib-storage-container',
876
- imports: [RouterOutlet, TranslatePipe, RouterTabsComponent],
877
- template: `
878
- <div class="p-2 sm:p-4">
879
- <div class="mb-4">
880
- <h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'storage.title' | translate }}</h1>
881
- <p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'storage.subtitle' | translate }}</p>
882
- </div>
883
-
884
- <lib-router-tabs [tabs]="visibleTabs()" class="mb-4" />
885
-
886
- <router-outlet />
887
- </div>
888
- `,
889
- }]
890
- }] });
891
-
892
- var storageContainer_component = /*#__PURE__*/Object.freeze({
893
- __proto__: null,
894
- StorageContainerComponent: StorageContainerComponent
895
- });
896
-
897
- // =============================================================================
898
- // @flusys/ng-storage - Storage Package
899
- // =============================================================================
900
- // Constants
901
-
902
- /**
903
- * Generated bundle index. Do not edit.
904
- */
562
+ const STORAGE_ROUTES = [{
563
+ path: "",
564
+ resolve: { translations: resolveTranslationModule({
565
+ modules: ["storage"],
566
+ fallbackMessages: {
567
+ ...STORAGE_MESSAGES,
568
+ ...SHARED_MESSAGES
569
+ }
570
+ }) },
571
+ loadComponent: () => import("./flusys-ng-storage-storage-container.component-EWGNoozU.mjs").then((m) => m.StorageContainerComponent),
572
+ children: [
573
+ {
574
+ path: "files",
575
+ canActivate: [permissionGuard(FILE_PERMISSIONS.READ)],
576
+ children: [
577
+ {
578
+ path: "",
579
+ loadComponent: () => import("./flusys-ng-storage-file-manager-list.component-4_LdJOtH.mjs").then((m) => m.FileManagerListComponent)
580
+ },
581
+ {
582
+ path: "new",
583
+ canActivate: [permissionGuard(FILE_PERMISSIONS.CREATE)],
584
+ loadComponent: () => import("./flusys-ng-storage-file-manager-form.component-Bvhewt3f.mjs").then((m) => m.FileManagerFormComponent)
585
+ },
586
+ {
587
+ path: ":id",
588
+ canActivate: [permissionGuard(FILE_PERMISSIONS.UPDATE)],
589
+ loadComponent: () => import("./flusys-ng-storage-file-manager-form.component-Bvhewt3f.mjs").then((m) => m.FileManagerFormComponent)
590
+ }
591
+ ]
592
+ },
593
+ {
594
+ path: "folders",
595
+ canActivate: [permissionGuard(FOLDER_PERMISSIONS.READ)],
596
+ children: [
597
+ {
598
+ path: "",
599
+ loadComponent: () => import("./flusys-ng-storage-folder-list.component-BdSBM_DB.mjs").then((m) => m.FolderListComponent)
600
+ },
601
+ {
602
+ path: "new",
603
+ canActivate: [permissionGuard(FOLDER_PERMISSIONS.CREATE)],
604
+ loadComponent: () => import("./flusys-ng-storage-folder-form.component-7C2oWijb.mjs").then((m) => m.FolderFormComponent)
605
+ },
606
+ {
607
+ path: ":id",
608
+ canActivate: [permissionGuard(FOLDER_PERMISSIONS.UPDATE)],
609
+ loadComponent: () => import("./flusys-ng-storage-folder-form.component-7C2oWijb.mjs").then((m) => m.FolderFormComponent)
610
+ }
611
+ ]
612
+ },
613
+ {
614
+ path: "configs",
615
+ canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.READ)],
616
+ children: [
617
+ {
618
+ path: "",
619
+ loadComponent: () => import("./flusys-ng-storage-storage-config-list.component-Dh9JkuZP.mjs").then((m) => m.StorageConfigListComponent)
620
+ },
621
+ {
622
+ path: "new",
623
+ canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.CREATE)],
624
+ loadComponent: () => import("./flusys-ng-storage-storage-config-form.component-De5h8JY-.mjs").then((m) => m.StorageConfigFormComponent)
625
+ },
626
+ {
627
+ path: ":id",
628
+ canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.UPDATE)],
629
+ loadComponent: () => import("./flusys-ng-storage-storage-config-form.component-De5h8JY-.mjs").then((m) => m.StorageConfigFormComponent)
630
+ }
631
+ ]
632
+ },
633
+ {
634
+ path: "",
635
+ redirectTo: () => resolveStorageDefaultTab(),
636
+ pathMatch: "full"
637
+ }
638
+ ]
639
+ }];
640
+ export { BaseStorageListPage, BaseStoragePage, FILE_SIZE_UNIT_KEYS, FileLocationEnum, FileManagerApiService, FileProviderAdapter, FolderApiService, ImageFormat, PROVIDER_LABEL_KEYS, STORAGE_MESSAGES, STORAGE_PROVIDER_OPTIONS, STORAGE_ROUTES, StorageConfigApiService, UploadService, formatFileSize, formatFileSizeWithKey, getFileIcon, getProviderIcon, getProviderLabelKey, getProviderSeverity, provideStorageProviders };
905
641
 
906
- export { BaseStorageListPage, BaseStoragePage, FILE_SIZE_UNIT_KEYS, FileLocationEnum, FileManagerApiService, FileProviderAdapter, FolderApiService, ImageFormat, PROVIDER_LABEL_KEYS, STORAGE_MESSAGES, STORAGE_PROVIDER_OPTIONS, STORAGE_ROUTES, StorageConfigApiService, StorageContainerComponent, UploadService, formatFileSize, formatFileSizeWithKey, getFileIcon, getProviderIcon, getProviderLabelKey, getProviderSeverity, provideStorageProviders };
907
- //# sourceMappingURL=flusys-ng-storage.mjs.map
642
+ //# sourceMappingURL=flusys-ng-storage.mjs.map