@dignite-ng/expand.file-explorer 0.0.1 → 0.0.3
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/config/ng-package.json +7 -0
- package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
- package/config/src/enums/route-names.ts +15 -0
- package/config/src/file-config.module.ts +12 -0
- package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
- package/config/src/providers/route.provider.ts +26 -0
- package/config/{public-api.d.ts → src/public-api.ts} +3 -3
- package/ng-package.json +7 -0
- package/package.json +3 -27
- package/src/lib/components/dome/file-dome.component.html +18 -0
- package/src/lib/components/dome/file-dome.component.scss +0 -0
- package/src/lib/components/dome/file-dome.component.spec.ts +21 -0
- package/src/lib/components/dome/file-dome.component.ts +33 -0
- package/src/lib/components/file-edit/file-edit.component.html +29 -0
- package/src/lib/components/file-edit/file-edit.component.scss +0 -0
- package/src/lib/components/file-edit/file-edit.component.spec.ts +21 -0
- package/src/lib/components/file-edit/file-edit.component.ts +98 -0
- package/src/lib/components/file-modal/file-modal.component.html +112 -0
- package/src/lib/components/file-modal/file-modal.component.scss +56 -0
- package/src/lib/components/file-modal/file-modal.component.spec.ts +21 -0
- package/src/lib/components/file-modal/file-modal.component.ts +284 -0
- package/src/lib/components/file-modal-tree/file-modal-tree.component.html +63 -0
- package/src/lib/components/file-modal-tree/file-modal-tree.component.scss +0 -0
- package/src/lib/components/file-modal-tree/file-modal-tree.component.spec.ts +21 -0
- package/src/lib/components/file-modal-tree/file-modal-tree.component.ts +207 -0
- package/src/lib/components/file-picker/file-picker.component.html +28 -0
- package/src/lib/components/file-picker/file-picker.component.scss +0 -0
- package/src/lib/components/file-picker/file-picker.component.spec.ts +21 -0
- package/src/lib/components/file-picker/file-picker.component.ts +58 -0
- package/src/lib/components/index.ts +5 -0
- package/src/lib/file-explorer-routing.module.ts +18 -0
- package/src/lib/file-explorer.module.ts +46 -0
- package/src/lib/proxy/README.md +17 -0
- package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +65 -0
- package/{lib/proxy/dignite/file-explorer/directories/models.d.ts → src/lib/proxy/dignite/file-explorer/directories/models.ts} +35 -29
- package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +86 -0
- package/src/lib/proxy/dignite/file-explorer/files/models.ts +58 -0
- package/src/lib/proxy/generate-proxy.json +11810 -0
- package/{lib/proxy/microsoft/asp-net-core/mvc/models.d.ts → src/lib/proxy/microsoft/asp-net-core/mvc/models.ts} +12 -10
- package/src/lib/proxy/microsoft/extensions/primitives/models.ts +9 -0
- package/{lib/proxy/microsoft/net/http/headers/models.d.ts → src/lib/proxy/microsoft/net/http/headers/models.ts} +7 -6
- package/src/lib/proxy/volo/abp/content/models.ts +6 -0
- package/src/lib/services/file-api.service.ts +59 -0
- package/src/lib/services/index.ts +1 -0
- package/{public-api.d.ts → src/public-api.ts} +5 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/config/enums/route-names.d.ts +0 -3
- package/config/file-config.module.d.ts +0 -8
- package/config/index.d.ts +0 -5
- package/config/providers/route.provider.d.ts +0 -8
- package/esm2022/config/dignite-ng-expand.file-explorer-config.mjs +0 -5
- package/esm2022/config/enums/index.mjs +0 -2
- package/esm2022/config/enums/route-names.mjs +0 -2
- package/esm2022/config/file-config.module.mjs +0 -19
- package/esm2022/config/providers/index.mjs +0 -2
- package/esm2022/config/providers/route.provider.mjs +0 -24
- package/esm2022/config/public-api.mjs +0 -4
- package/esm2022/dignite-ng-expand.file-explorer.mjs +0 -5
- package/esm2022/lib/components/dome/file-dome.component.mjs +0 -32
- package/esm2022/lib/components/file-edit/file-edit.component.mjs +0 -102
- package/esm2022/lib/components/file-modal/file-modal.component.mjs +0 -271
- package/esm2022/lib/components/file-modal-tree/file-modal-tree.component.mjs +0 -195
- package/esm2022/lib/components/file-picker/file-picker.component.mjs +0 -57
- package/esm2022/lib/components/index.mjs +0 -6
- package/esm2022/lib/file-explorer-routing.module.mjs +0 -25
- package/esm2022/lib/file-explorer.module.mjs +0 -83
- package/esm2022/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.mjs +0 -48
- package/esm2022/lib/proxy/dignite/file-explorer/directories/index.mjs +0 -3
- package/esm2022/lib/proxy/dignite/file-explorer/directories/models.mjs +0 -2
- package/esm2022/lib/proxy/dignite/file-explorer/files/file-descriptor.service.mjs +0 -60
- package/esm2022/lib/proxy/dignite/file-explorer/files/index.mjs +0 -3
- package/esm2022/lib/proxy/dignite/file-explorer/files/models.mjs +0 -2
- package/esm2022/lib/proxy/dignite/file-explorer/index.mjs +0 -4
- package/esm2022/lib/proxy/dignite/index.mjs +0 -3
- package/esm2022/lib/proxy/index.mjs +0 -5
- package/esm2022/lib/proxy/microsoft/asp-net-core/index.mjs +0 -3
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/index.mjs +0 -2
- package/esm2022/lib/proxy/microsoft/asp-net-core/mvc/models.mjs +0 -2
- package/esm2022/lib/proxy/microsoft/extensions/index.mjs +0 -3
- package/esm2022/lib/proxy/microsoft/extensions/primitives/index.mjs +0 -2
- package/esm2022/lib/proxy/microsoft/extensions/primitives/models.mjs +0 -2
- package/esm2022/lib/proxy/microsoft/index.mjs +0 -5
- package/esm2022/lib/proxy/microsoft/net/http/headers/index.mjs +0 -2
- package/esm2022/lib/proxy/microsoft/net/http/headers/models.mjs +0 -2
- package/esm2022/lib/proxy/microsoft/net/http/index.mjs +0 -3
- package/esm2022/lib/proxy/microsoft/net/index.mjs +0 -3
- package/esm2022/lib/proxy/volo/abp/content/index.mjs +0 -2
- package/esm2022/lib/proxy/volo/abp/content/models.mjs +0 -2
- package/esm2022/lib/proxy/volo/abp/index.mjs +0 -3
- package/esm2022/lib/proxy/volo/index.mjs +0 -3
- package/esm2022/lib/services/file-api.service.mjs +0 -66
- package/esm2022/lib/services/index.mjs +0 -2
- package/esm2022/public-api.mjs +0 -8
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs +0 -47
- package/fesm2022/dignite-ng-expand.file-explorer-config.mjs.map +0 -1
- package/fesm2022/dignite-ng-expand.file-explorer.mjs +0 -972
- package/fesm2022/dignite-ng-expand.file-explorer.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/dome/file-dome.component.d.ts +0 -19
- package/lib/components/file-edit/file-edit.component.d.ts +0 -38
- package/lib/components/file-modal/file-modal.component.d.ts +0 -93
- package/lib/components/file-modal-tree/file-modal-tree.component.d.ts +0 -66
- package/lib/components/file-picker/file-picker.component.d.ts +0 -23
- package/lib/components/index.d.ts +0 -5
- package/lib/file-explorer-routing.module.d.ts +0 -7
- package/lib/file-explorer.module.d.ts +0 -18
- package/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.d.ts +0 -17
- package/lib/proxy/dignite/file-explorer/files/file-descriptor.service.d.ts +0 -20
- package/lib/proxy/dignite/file-explorer/files/models.d.ts +0 -50
- package/lib/proxy/microsoft/extensions/primitives/models.d.ts +0 -8
- package/lib/proxy/volo/abp/content/models.d.ts +0 -5
- package/lib/services/file-api.service.d.ts +0 -14
- package/lib/services/index.d.ts +0 -1
- /package/{lib/proxy/dignite/file-explorer/directories/index.d.ts → src/lib/proxy/dignite/file-explorer/directories/index.ts} +0 -0
- /package/{lib/proxy/dignite/file-explorer/files/index.d.ts → src/lib/proxy/dignite/file-explorer/files/index.ts} +0 -0
- /package/{lib/proxy/dignite/file-explorer/index.d.ts → src/lib/proxy/dignite/file-explorer/index.ts} +0 -0
- /package/{lib/proxy/dignite/index.d.ts → src/lib/proxy/dignite/index.ts} +0 -0
- /package/{lib/proxy/index.d.ts → src/lib/proxy/index.ts} +0 -0
- /package/{lib/proxy/microsoft/asp-net-core/index.d.ts → src/lib/proxy/microsoft/asp-net-core/index.ts} +0 -0
- /package/{lib/proxy/microsoft/asp-net-core/mvc/index.d.ts → src/lib/proxy/microsoft/asp-net-core/mvc/index.ts} +0 -0
- /package/{lib/proxy/microsoft/extensions/index.d.ts → src/lib/proxy/microsoft/extensions/index.ts} +0 -0
- /package/{lib/proxy/microsoft/extensions/primitives/index.d.ts → src/lib/proxy/microsoft/extensions/primitives/index.ts} +0 -0
- /package/{lib/proxy/microsoft/index.d.ts → src/lib/proxy/microsoft/index.ts} +0 -0
- /package/{lib/proxy/microsoft/net/http/headers/index.d.ts → src/lib/proxy/microsoft/net/http/headers/index.ts} +0 -0
- /package/{lib/proxy/microsoft/net/http/index.d.ts → src/lib/proxy/microsoft/net/http/index.ts} +0 -0
- /package/{lib/proxy/microsoft/net/index.d.ts → src/lib/proxy/microsoft/net/index.ts} +0 -0
- /package/{lib/proxy/volo/abp/content/index.d.ts → src/lib/proxy/volo/abp/content/index.ts} +0 -0
- /package/{lib/proxy/volo/abp/index.d.ts → src/lib/proxy/volo/abp/index.ts} +0 -0
- /package/{lib/proxy/volo/index.d.ts → src/lib/proxy/volo/index.ts} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { Router, RouterModule, Routes } from '@angular/router';
|
|
3
|
+
import { FileDomeComponent } from './components/dome/file-dome.component';
|
|
4
|
+
|
|
5
|
+
const routes: Routes = [
|
|
6
|
+
{
|
|
7
|
+
path: 'file-dome',
|
|
8
|
+
component: FileDomeComponent
|
|
9
|
+
},
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
@NgModule({
|
|
13
|
+
imports: [RouterModule.forChild(routes)],
|
|
14
|
+
exports: [RouterModule]
|
|
15
|
+
})
|
|
16
|
+
export class FileExplorerRoutingModule {
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CoreModule, LIST_QUERY_DEBOUNCE_TIME, ListService } from '@abp/ng.core';
|
|
3
|
+
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
4
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
6
|
+
import { NzTreeModule } from 'ng-zorro-antd/tree';
|
|
7
|
+
import { NgxValidateCoreModule } from '@ngx-validate/core';
|
|
8
|
+
import { FileExplorerRoutingModule } from './file-explorer-routing.module';
|
|
9
|
+
import { FileEditComponent, FilePickerComponent, FileModalComponent, FileModalTreeComponent, FileDomeComponent } from './components';
|
|
10
|
+
@NgModule({
|
|
11
|
+
declarations: [
|
|
12
|
+
FileEditComponent,
|
|
13
|
+
FilePickerComponent,
|
|
14
|
+
FileModalComponent,
|
|
15
|
+
FileModalTreeComponent,
|
|
16
|
+
FileDomeComponent,
|
|
17
|
+
],
|
|
18
|
+
imports: [
|
|
19
|
+
FormsModule,
|
|
20
|
+
CoreModule,
|
|
21
|
+
ThemeSharedModule,
|
|
22
|
+
ReactiveFormsModule,
|
|
23
|
+
NgbDropdownModule,
|
|
24
|
+
NzTreeModule,
|
|
25
|
+
NgxValidateCoreModule,
|
|
26
|
+
FileExplorerRoutingModule,
|
|
27
|
+
],
|
|
28
|
+
exports: [
|
|
29
|
+
FileEditComponent,
|
|
30
|
+
FilePickerComponent,
|
|
31
|
+
FileModalComponent,
|
|
32
|
+
FileModalTreeComponent,
|
|
33
|
+
FileDomeComponent
|
|
34
|
+
],
|
|
35
|
+
providers: [
|
|
36
|
+
// [Required]
|
|
37
|
+
ListService,
|
|
38
|
+
// [Optional]
|
|
39
|
+
// Provide this token if you want a different debounce time.
|
|
40
|
+
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
41
|
+
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
export class FileExplorerModule {
|
|
45
|
+
|
|
46
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Proxy Generation Output
|
|
2
|
+
|
|
3
|
+
This directory includes the output of the latest proxy generation.
|
|
4
|
+
The files and folders in it will be overwritten when proxy generation is run again.
|
|
5
|
+
Therefore, please do not place your own content in this folder.
|
|
6
|
+
|
|
7
|
+
In addition, `generate-proxy.json` works like a lock file.
|
|
8
|
+
It includes information used by the proxy generator, so please do not delete or modify it.
|
|
9
|
+
|
|
10
|
+
Finally, the name of the files and folders should not be changed for two reasons:
|
|
11
|
+
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
|
|
12
|
+
- ABP Suite generates files which include imports from this folder.
|
|
13
|
+
|
|
14
|
+
> **Important Notice:** If you are building a module and are planning to publish to npm,
|
|
15
|
+
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
|
|
16
|
+
> please make sure you export files directly and not from barrel exports. In other words,
|
|
17
|
+
> do not include index.ts exports in your public-api.ts exports.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CreateDirectoryInput, DirectoryDescriptorDto, DirectoryDescriptorInfoDto, GetDirectoriesInput, MoveDirectoryInput, UpdateDirectoryInput } from './models';
|
|
2
|
+
import { RestService, Rest } from '@abp/ng.core';
|
|
3
|
+
import type { PagedResultDto } from '@abp/ng.core';
|
|
4
|
+
import { Injectable } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
@Injectable({
|
|
7
|
+
providedIn: 'root',
|
|
8
|
+
})
|
|
9
|
+
export class FileDescriptorService {
|
|
10
|
+
apiName = 'FileExplorer';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
create = (input: CreateDirectoryInput, config?: Partial<Rest.Config>) =>
|
|
14
|
+
this.restService.request<any, DirectoryDescriptorDto>({
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/api/file-explorer/directories',
|
|
17
|
+
body: input,
|
|
18
|
+
},
|
|
19
|
+
{ apiName: this.apiName,...config });
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
delete = (id: string, config?: Partial<Rest.Config>) =>
|
|
23
|
+
this.restService.request<any, void>({
|
|
24
|
+
method: 'DELETE',
|
|
25
|
+
url: `/api/file-explorer/directories/${id}`,
|
|
26
|
+
},
|
|
27
|
+
{ apiName: this.apiName,...config });
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
get = (id: string, config?: Partial<Rest.Config>) =>
|
|
31
|
+
this.restService.request<any, DirectoryDescriptorDto>({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
url: `/api/file-explorer/directories/${id}`,
|
|
34
|
+
},
|
|
35
|
+
{ apiName: this.apiName,...config });
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
getList = (input: GetDirectoriesInput, config?: Partial<Rest.Config>) =>
|
|
39
|
+
this.restService.request<any, PagedResultDto<DirectoryDescriptorInfoDto>>({
|
|
40
|
+
method: 'GET',
|
|
41
|
+
url: '/api/file-explorer/directories',
|
|
42
|
+
params: { containerName: input.containerName },
|
|
43
|
+
},
|
|
44
|
+
{ apiName: this.apiName,...config });
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
move = (id: string, input: MoveDirectoryInput, config?: Partial<Rest.Config>) =>
|
|
48
|
+
this.restService.request<any, DirectoryDescriptorDto>({
|
|
49
|
+
method: 'PUT',
|
|
50
|
+
url: `/api/file-explorer/directories/${id}/move`,
|
|
51
|
+
body: input,
|
|
52
|
+
},
|
|
53
|
+
{ apiName: this.apiName,...config });
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
update = (id: string, input: UpdateDirectoryInput, config?: Partial<Rest.Config>) =>
|
|
57
|
+
this.restService.request<any, DirectoryDescriptorDto>({
|
|
58
|
+
method: 'PUT',
|
|
59
|
+
url: `/api/file-explorer/directories/${id}`,
|
|
60
|
+
body: input,
|
|
61
|
+
},
|
|
62
|
+
{ apiName: this.apiName,...config });
|
|
63
|
+
|
|
64
|
+
constructor(private restService: RestService) {}
|
|
65
|
+
}
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import type { ExtensibleAuditedEntityDto, ExtensibleEntityDto } from '@abp/ng.core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import type { ExtensibleAuditedEntityDto, ExtensibleEntityDto } from '@abp/ng.core';
|
|
2
|
+
|
|
3
|
+
export interface CreateDirectoryInput {
|
|
4
|
+
containerName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
parentId?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface DirectoryDescriptorDto extends ExtensibleAuditedEntityDto<string> {
|
|
10
|
+
containerName?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
parentId?: string;
|
|
13
|
+
order: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface DirectoryDescriptorInfoDto extends ExtensibleEntityDto<string> {
|
|
17
|
+
containerName?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
parentId?: string;
|
|
20
|
+
order: number;
|
|
21
|
+
children: DirectoryDescriptorInfoDto[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface GetDirectoriesInput {
|
|
25
|
+
containerName: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface MoveDirectoryInput {
|
|
29
|
+
parentId?: string;
|
|
30
|
+
order: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface UpdateDirectoryInput {
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { CreateFileInput, FileContainerConfigurationDto, FileDescriptorDto, GetFilesInput, ImageResizeInput, UpdateFileInput } from './models';
|
|
2
|
+
import { RestService, Rest } from '@abp/ng.core';
|
|
3
|
+
import type { PagedResultDto } from '@abp/ng.core';
|
|
4
|
+
import { Injectable } from '@angular/core';
|
|
5
|
+
import type { FileResult } from '../../../microsoft/asp-net-core/mvc/models';
|
|
6
|
+
|
|
7
|
+
@Injectable({
|
|
8
|
+
providedIn: 'root',
|
|
9
|
+
})
|
|
10
|
+
export class FileDescriptorService {
|
|
11
|
+
apiName = 'FileExplorer';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
create = (input: CreateFileInput, config?: Partial<Rest.Config>) =>
|
|
15
|
+
this.restService.request<any, FileDescriptorDto>({
|
|
16
|
+
method: 'POST',
|
|
17
|
+
url: '/api/file-explorer/files',
|
|
18
|
+
params: { containerName: input.containerName, cellName: input.cellName, directoryId: input.directoryId, entityId: input.entityId },
|
|
19
|
+
body: input.file,
|
|
20
|
+
},
|
|
21
|
+
{ apiName: this.apiName,...config });
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
delete = (id: string, config?: Partial<Rest.Config>) =>
|
|
25
|
+
this.restService.request<any, void>({
|
|
26
|
+
method: 'DELETE',
|
|
27
|
+
url: `/api/file-explorer/files/${id}`,
|
|
28
|
+
},
|
|
29
|
+
{ apiName: this.apiName,...config });
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
download = (containerName: string, blobName: string, fileName: string, config?: Partial<Rest.Config>) =>
|
|
33
|
+
this.restService.request<any, FileResult>({
|
|
34
|
+
method: 'GET',
|
|
35
|
+
url: `/api/file-explorer/files/download/${containerName}/${blobName}`,
|
|
36
|
+
params: { fileName },
|
|
37
|
+
},
|
|
38
|
+
{ apiName: this.apiName,...config });
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
get = (id: string, config?: Partial<Rest.Config>) =>
|
|
42
|
+
this.restService.request<any, FileDescriptorDto>({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
url: `/api/file-explorer/files/${id}`,
|
|
45
|
+
},
|
|
46
|
+
{ apiName: this.apiName,...config });
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
getFileContainerConfiguration = (containerName: string, config?: Partial<Rest.Config>) =>
|
|
50
|
+
this.restService.request<any, FileContainerConfigurationDto>({
|
|
51
|
+
method: 'GET',
|
|
52
|
+
url: '/api/file-explorer/files/configuration',
|
|
53
|
+
params: { containerName },
|
|
54
|
+
},
|
|
55
|
+
{ apiName: this.apiName,...config });
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
getList = (input: GetFilesInput, config?: Partial<Rest.Config>) =>
|
|
59
|
+
this.restService.request<any, PagedResultDto<FileDescriptorDto>>({
|
|
60
|
+
method: 'GET',
|
|
61
|
+
url: '/api/file-explorer/files',
|
|
62
|
+
params: { containerName: input.containerName, directoryId: input.directoryId, creatorId: input.creatorId, filter: input.filter, entityId: input.entityId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
63
|
+
},
|
|
64
|
+
{ apiName: this.apiName,...config });
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
getStream = (containerName: string, blobName: string, imageResize?: ImageResizeInput, config?: Partial<Rest.Config>) =>
|
|
68
|
+
this.restService.request<any, Blob>({
|
|
69
|
+
method: 'GET',
|
|
70
|
+
responseType: 'blob',
|
|
71
|
+
url: `/api/file-explorer/files/${containerName}/${blobName}`,
|
|
72
|
+
params: { width: imageResize.width, height: imageResize.height },
|
|
73
|
+
},
|
|
74
|
+
{ apiName: this.apiName,...config });
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
update = (id: string, input: UpdateFileInput, config?: Partial<Rest.Config>) =>
|
|
78
|
+
this.restService.request<any, FileDescriptorDto>({
|
|
79
|
+
method: 'PUT',
|
|
80
|
+
url: `/api/file-explorer/files/${id}`,
|
|
81
|
+
body: input,
|
|
82
|
+
},
|
|
83
|
+
{ apiName: this.apiName,...config });
|
|
84
|
+
|
|
85
|
+
constructor(private restService: RestService) {}
|
|
86
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { IRemoteStreamContent } from '../../../volo/abp/content/models';
|
|
2
|
+
import type { CreationAuditedEntityDto, PagedAndSortedResultRequestDto } from '@abp/ng.core';
|
|
3
|
+
|
|
4
|
+
export interface CreateFileInput {
|
|
5
|
+
containerName: string;
|
|
6
|
+
cellName?: string;
|
|
7
|
+
directoryId?: string;
|
|
8
|
+
entityId?: string;
|
|
9
|
+
// file: any;
|
|
10
|
+
file: IRemoteStreamContent;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface FileCellDto {
|
|
14
|
+
name?: string;
|
|
15
|
+
displayName?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface FileContainerConfigurationDto {
|
|
19
|
+
maxBlobSize: number;
|
|
20
|
+
allowedFileTypeNames: string[];
|
|
21
|
+
fileCells: FileCellDto[];
|
|
22
|
+
createDirectoryPermissionName?: string;
|
|
23
|
+
createFilePermissionName?: string;
|
|
24
|
+
updateFilePermissionName?: string;
|
|
25
|
+
deleteFilePermissionName?: string;
|
|
26
|
+
getFilePermissionName?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface FileDescriptorDto extends CreationAuditedEntityDto<string> {
|
|
30
|
+
entityId?: string;
|
|
31
|
+
containerName?: string;
|
|
32
|
+
blobName?: string;
|
|
33
|
+
cellName?: string;
|
|
34
|
+
directoryId?: string;
|
|
35
|
+
size: number;
|
|
36
|
+
name?: string;
|
|
37
|
+
mimeType?: string;
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetFilesInput extends PagedAndSortedResultRequestDto {
|
|
42
|
+
containerName: string;
|
|
43
|
+
directoryId?: string;
|
|
44
|
+
creatorId?: string;
|
|
45
|
+
filter?: string;
|
|
46
|
+
entityId?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ImageResizeInput {
|
|
50
|
+
width?: number;
|
|
51
|
+
height?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface UpdateFileInput {
|
|
55
|
+
cellName?: string;
|
|
56
|
+
directoryId?: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
}
|