Run prettier
This commit is contained in:
parent
8999e69f26
commit
adc58476ff
|
@ -3,17 +3,20 @@ import { InjectRepository } from '@nestjs/typeorm';
|
|||
import {
|
||||
DecodedSysPref,
|
||||
PrefValueType,
|
||||
PrefValueTypeStrings
|
||||
PrefValueTypeStrings,
|
||||
} from 'picsur-shared/dist/dto/preferences.dto';
|
||||
import {
|
||||
SysPreference,
|
||||
SysPreferenceList,
|
||||
SysPreferenceValidators,
|
||||
SysPreferenceValueTypes
|
||||
SysPreferenceValueTypes,
|
||||
} from 'picsur-shared/dist/dto/sys-preferences.enum';
|
||||
import { AsyncFailable, Fail, FT, HasFailed } from 'picsur-shared/dist/types';
|
||||
import { Repository } from 'typeorm';
|
||||
import { ESysPreferenceBackend, ESysPreferenceSchema } from '../../database/entities/system/sys-preference.entity';
|
||||
import {
|
||||
ESysPreferenceBackend,
|
||||
ESysPreferenceSchema,
|
||||
} from '../../database/entities/system/sys-preference.entity';
|
||||
import { MutexFallBack } from '../../util/mutex-fallback';
|
||||
import { PreferenceCommonService } from './preference-common.service';
|
||||
import { PreferenceDefaultsService } from './preference-defaults.service';
|
||||
|
|
|
@ -3,19 +3,19 @@ import { InjectRepository } from '@nestjs/typeorm';
|
|||
import {
|
||||
DecodedUsrPref,
|
||||
PrefValueType,
|
||||
PrefValueTypeStrings
|
||||
PrefValueTypeStrings,
|
||||
} from 'picsur-shared/dist/dto/preferences.dto';
|
||||
import {
|
||||
UsrPreference,
|
||||
UsrPreferenceList,
|
||||
UsrPreferenceValidators,
|
||||
UsrPreferenceValueTypes
|
||||
UsrPreferenceValueTypes,
|
||||
} from 'picsur-shared/dist/dto/usr-preferences.enum';
|
||||
import { AsyncFailable, Fail, FT, HasFailed } from 'picsur-shared/dist/types';
|
||||
import { Repository } from 'typeorm';
|
||||
import {
|
||||
EUsrPreferenceBackend,
|
||||
EUsrPreferenceSchema
|
||||
EUsrPreferenceSchema,
|
||||
} from '../../database/entities/system/usr-preference.entity';
|
||||
import { MutexFallBack } from '../../util/mutex-fallback';
|
||||
import { PreferenceCommonService } from './preference-common.service';
|
||||
|
|
|
@ -7,7 +7,7 @@ import { ERoleBackend } from '../../database/entities/users/role.entity';
|
|||
import {
|
||||
ImmutableRolesList,
|
||||
SystemRoleDefaults,
|
||||
SystemRolesList
|
||||
SystemRolesList,
|
||||
} from '../../models/constants/roles.const';
|
||||
import { RoleDbService } from './role-db.service';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
Fail,
|
||||
FT,
|
||||
HasFailed,
|
||||
HasSuccess
|
||||
HasSuccess,
|
||||
} from 'picsur-shared/dist/types';
|
||||
import { makeUnique } from 'picsur-shared/dist/util/unique';
|
||||
import { In, Repository } from 'typeorm';
|
||||
|
@ -14,7 +14,7 @@ import { ERoleBackend } from '../../database/entities/users/role.entity';
|
|||
import { Permissions } from '../../models/constants/permissions.const';
|
||||
import {
|
||||
ImmutableRolesList,
|
||||
UndeletableRolesList
|
||||
UndeletableRolesList,
|
||||
} from '../../models/constants/roles.const';
|
||||
|
||||
@Injectable()
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
Fail,
|
||||
FT,
|
||||
HasFailed,
|
||||
HasSuccess
|
||||
HasSuccess,
|
||||
} from 'picsur-shared/dist/types';
|
||||
import { FindResult } from 'picsur-shared/dist/types/find-result';
|
||||
import { makeUnique } from 'picsur-shared/dist/util/unique';
|
||||
|
@ -16,12 +16,12 @@ import { EUserBackend } from '../../database/entities/users/user.entity';
|
|||
import { Permissions } from '../../models/constants/permissions.const';
|
||||
import {
|
||||
DefaultRolesList,
|
||||
SoulBoundRolesList
|
||||
SoulBoundRolesList,
|
||||
} from '../../models/constants/roles.const';
|
||||
import {
|
||||
ImmutableUsersList,
|
||||
LockedLoginUsersList,
|
||||
UndeletableUsersList
|
||||
UndeletableUsersList,
|
||||
} from '../../models/constants/special-users.const';
|
||||
import { GetCols } from '../../util/collection';
|
||||
import { SysPreferenceDbService } from '../preference-db/sys-preference-db.service';
|
||||
|
|
|
@ -22,7 +22,7 @@ import { TypeOrmConfigService } from './type-orm.config.service';
|
|||
HostConfigService,
|
||||
AuthConfigService,
|
||||
MultipartConfigService,
|
||||
RedisConfigService
|
||||
RedisConfigService,
|
||||
],
|
||||
exports: [
|
||||
ConfigModule,
|
||||
|
@ -32,7 +32,7 @@ import { TypeOrmConfigService } from './type-orm.config.service';
|
|||
HostConfigService,
|
||||
AuthConfigService,
|
||||
MultipartConfigService,
|
||||
RedisConfigService
|
||||
RedisConfigService,
|
||||
],
|
||||
})
|
||||
export class EarlyConfigModule {}
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
Entity,
|
||||
Index,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { z } from 'zod';
|
||||
import { EUserBackend } from './users/user.entity';
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
Unique
|
||||
Unique,
|
||||
} from 'typeorm';
|
||||
import { EImageBackend } from './image.entity';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
Unique
|
||||
Unique,
|
||||
} from 'typeorm';
|
||||
import z from 'zod';
|
||||
import { EUserBackend } from '../users/user.entity';
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
Entity,
|
||||
Index,
|
||||
OneToMany,
|
||||
PrimaryGeneratedColumn
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { z } from 'zod';
|
||||
import { EApiKeyBackend } from '../apikey.entity';
|
||||
|
|
|
@ -4,4 +4,5 @@ import { MultiPartPipe } from './postfiles.pipe';
|
|||
|
||||
export const PostFile = () => InjectRequest(PostFilePipe);
|
||||
|
||||
export const PostFiles = (maxFiles?: number) => InjectRequest(maxFiles, MultiPartPipe);
|
||||
export const PostFiles = (maxFiles?: number) =>
|
||||
InjectRequest(maxFiles, MultiPartPipe);
|
||||
|
|
|
@ -12,7 +12,7 @@ export class PostFilePipe implements PipeTransform {
|
|||
private readonly multipartConfigService: MultipartConfigService,
|
||||
) {}
|
||||
|
||||
async transform({ request, data }: { data: any; request: FastifyRequest },) {
|
||||
async transform({ request, data }: { data: any; request: FastifyRequest }) {
|
||||
if (!request.isMultipart()) throw Fail(FT.UsrValidation, 'Invalid file');
|
||||
|
||||
// Only one file is allowed
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
Injectable,
|
||||
Logger,
|
||||
PipeTransform,
|
||||
Scope
|
||||
Scope,
|
||||
} from '@nestjs/common';
|
||||
import { FastifyRequest } from 'fastify';
|
||||
import { Fail, FT } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -6,10 +6,12 @@ import { PicsurThrottlerGuard } from './throttler/PicsurThrottler.guard';
|
|||
import { ZodValidationPipe } from './validate/zod-validator.pipe';
|
||||
|
||||
@Module({
|
||||
imports: [ThrottlerModule.forRoot({
|
||||
ttl: 60,
|
||||
limit: 60,
|
||||
})],
|
||||
imports: [
|
||||
ThrottlerModule.forRoot({
|
||||
ttl: 60,
|
||||
limit: 60,
|
||||
}),
|
||||
],
|
||||
providers: [
|
||||
PicsurThrottlerGuard,
|
||||
MainExceptionFilter,
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
Logger,
|
||||
MethodNotAllowedException,
|
||||
NotFoundException,
|
||||
UnauthorizedException
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common';
|
||||
import { FastifyReply, FastifyRequest } from 'fastify';
|
||||
import { ApiErrorResponse } from 'picsur-shared/dist/dto/api/api.dto';
|
||||
|
@ -14,7 +14,7 @@ import {
|
|||
Fail,
|
||||
Failure,
|
||||
FT,
|
||||
IsFailure
|
||||
IsFailure,
|
||||
} from 'picsur-shared/dist/types/failable';
|
||||
|
||||
// This will catch any exception that is made in any request
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
Injectable,
|
||||
Logger,
|
||||
NestInterceptor,
|
||||
Optional
|
||||
Optional,
|
||||
} from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
import { FastifyReply } from 'fastify';
|
||||
|
|
|
@ -4,7 +4,7 @@ import fastifyReplyFrom from '@fastify/reply-from';
|
|||
import { NestFactory } from '@nestjs/core';
|
||||
import {
|
||||
FastifyAdapter,
|
||||
NestFastifyApplication
|
||||
NestFastifyApplication,
|
||||
} from '@nestjs/platform-fastify';
|
||||
import { AppModule } from './app.module';
|
||||
import { HostConfigService } from './config/early/host.config.service';
|
||||
|
|
|
@ -3,7 +3,7 @@ import ms from 'ms';
|
|||
import { ImageRequestParams } from 'picsur-shared/dist/dto/api/image.dto';
|
||||
import {
|
||||
FileType,
|
||||
SupportedFileTypeCategory
|
||||
SupportedFileTypeCategory,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { SysPreference } from 'picsur-shared/dist/dto/sys-preferences.enum';
|
||||
import { AsyncFailable, Fail, FT, HasFailed } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
|
|||
import {
|
||||
FileType,
|
||||
ImageFileType,
|
||||
SupportedFileTypeCategory
|
||||
SupportedFileTypeCategory,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
|
||||
import { AsyncFailable, Fail, FT, HasFailed } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
AnimFileType,
|
||||
FileType,
|
||||
ImageFileType,
|
||||
Mime2FileType
|
||||
Mime2FileType,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { SysPreference } from 'picsur-shared/dist/dto/sys-preferences.enum';
|
||||
import { UsrPreference } from 'picsur-shared/dist/dto/usr-preferences.enum';
|
||||
|
|
|
@ -9,14 +9,14 @@ import {
|
|||
ApiKeyListRequest,
|
||||
ApiKeyListResponse,
|
||||
ApiKeyUpdateRequest,
|
||||
ApiKeyUpdateResponse
|
||||
ApiKeyUpdateResponse,
|
||||
} from 'picsur-shared/dist/dto/api/apikeys.dto';
|
||||
import { Permission } from 'picsur-shared/dist/dto/permissions.enum';
|
||||
import { ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
import { ApiKeyDbService } from '../../../collections/apikey-db/apikey-db.service';
|
||||
import {
|
||||
HasPermission,
|
||||
RequiredPermissions
|
||||
RequiredPermissions,
|
||||
} from '../../../decorators/permissions.decorator';
|
||||
import { ReqUserID } from '../../../decorators/request-user.decorator';
|
||||
import { Returns } from '../../../decorators/returns.decorator';
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
GetPreferenceResponse,
|
||||
MultiplePreferencesResponse,
|
||||
UpdatePreferenceRequest,
|
||||
UpdatePreferenceResponse
|
||||
UpdatePreferenceResponse,
|
||||
} from 'picsur-shared/dist/dto/api/pref.dto';
|
||||
import { ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
import { SysPreferenceDbService } from '../../../collections/preference-db/sys-preference-db.service';
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
GetPreferenceResponse,
|
||||
MultiplePreferencesResponse,
|
||||
UpdatePreferenceRequest,
|
||||
UpdatePreferenceResponse
|
||||
UpdatePreferenceResponse,
|
||||
} from 'picsur-shared/dist/dto/api/pref.dto';
|
||||
import { ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
import { UsrPreferenceDbService } from '../../../collections/preference-db/usr-preference-db.service';
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
RoleListResponse,
|
||||
RoleUpdateRequest,
|
||||
RoleUpdateResponse,
|
||||
SpecialRolesResponse
|
||||
SpecialRolesResponse,
|
||||
} from 'picsur-shared/dist/dto/api/roles.dto';
|
||||
import { Fail, FT, ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
import { RoleDbService } from '../../../collections/role-db/role-db.service';
|
||||
|
@ -22,7 +22,7 @@ import {
|
|||
DefaultRolesList,
|
||||
ImmutableRolesList,
|
||||
SoulBoundRolesList,
|
||||
UndeletableRolesList
|
||||
UndeletableRolesList,
|
||||
} from '../../../models/constants/roles.const';
|
||||
import { isPermissionsArray } from '../../../models/validators/permissions.validator';
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
UserListRequest,
|
||||
UserListResponse,
|
||||
UserUpdateRequest,
|
||||
UserUpdateResponse
|
||||
UserUpdateResponse,
|
||||
} from 'picsur-shared/dist/dto/api/user-manage.dto';
|
||||
import { ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
import { UserDbService } from '../../../collections/user-db/user-db.service';
|
||||
|
@ -21,7 +21,7 @@ import { Permission } from '../../../models/constants/permissions.const';
|
|||
import {
|
||||
ImmutableUsersList,
|
||||
LockedLoginUsersList,
|
||||
UndeletableUsersList
|
||||
UndeletableUsersList,
|
||||
} from '../../../models/constants/special-users.const';
|
||||
import { EUserBackend2EUser } from '../../../models/transformers/user.transformer';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
UserMePermissionsResponse,
|
||||
UserMeResponse,
|
||||
UserRegisterRequest,
|
||||
UserRegisterResponse
|
||||
UserRegisterResponse,
|
||||
} from 'picsur-shared/dist/dto/api/user.dto';
|
||||
import type { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||
import { ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
|
@ -15,7 +15,7 @@ import { UserDbService } from '../../../collections/user-db/user-db.service';
|
|||
import {
|
||||
NoPermissions,
|
||||
RequiredPermissions,
|
||||
UseLocalAuth
|
||||
UseLocalAuth,
|
||||
} from '../../../decorators/permissions.decorator';
|
||||
import { ReqUser, ReqUserID } from '../../../decorators/request-user.decorator';
|
||||
import { Returns } from '../../../decorators/returns.decorator';
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
Logger,
|
||||
Param,
|
||||
Post,
|
||||
Res
|
||||
Res,
|
||||
} from '@nestjs/common';
|
||||
import { Throttle } from '@nestjs/throttler';
|
||||
import type { FastifyReply } from 'fastify';
|
||||
|
@ -18,7 +18,7 @@ import {
|
|||
ImageListResponse,
|
||||
ImageUpdateRequest,
|
||||
ImageUpdateResponse,
|
||||
ImageUploadResponse
|
||||
ImageUploadResponse,
|
||||
} from 'picsur-shared/dist/dto/api/image-manage.dto';
|
||||
import { Permission } from 'picsur-shared/dist/dto/permissions.enum';
|
||||
import { Fail, FT, HasFailed, ThrowIfFailed } from 'picsur-shared/dist/types';
|
||||
|
@ -26,7 +26,7 @@ import { PostFiles } from '../../decorators/multipart/multipart.decorator';
|
|||
import type { FileIterator } from '../../decorators/multipart/postfiles.pipe';
|
||||
import {
|
||||
HasPermission,
|
||||
RequiredPermissions
|
||||
RequiredPermissions,
|
||||
} from '../../decorators/permissions.decorator';
|
||||
import { ReqUserID } from '../../decorators/request-user.decorator';
|
||||
import { Returns } from '../../decorators/returns.decorator';
|
||||
|
@ -54,7 +54,7 @@ export class ImageManageController {
|
|||
buffer = await file.toBuffer();
|
||||
} catch (e) {
|
||||
throw Fail(FT.Internal, e);
|
||||
};
|
||||
}
|
||||
|
||||
const image = ThrowIfFailed(
|
||||
await this.imagesService.upload(
|
||||
|
|
|
@ -3,7 +3,7 @@ import { SkipThrottle } from '@nestjs/throttler';
|
|||
import type { FastifyReply } from 'fastify';
|
||||
import {
|
||||
ImageMetaResponse,
|
||||
ImageRequestParams
|
||||
ImageRequestParams,
|
||||
} from 'picsur-shared/dist/dto/api/image.dto';
|
||||
import { ImageEntryVariant } from 'picsur-shared/dist/dto/image-entry-variant.enum';
|
||||
import { FileType2Mime } from 'picsur-shared/dist/dto/mimes.dto';
|
||||
|
|
|
@ -6,11 +6,7 @@ import { ImageManageController } from './image-manage.controller';
|
|||
import { ImageController } from './image.controller';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
ImageManagerModule,
|
||||
UserDbModule,
|
||||
DecoratorsModule,
|
||||
],
|
||||
imports: [ImageManagerModule, UserDbModule, DecoratorsModule],
|
||||
controllers: [ImageController, ImageManageController],
|
||||
})
|
||||
export class ImageModule {}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { BMPdecode, BMPencode } from 'bmp-img';
|
|||
import {
|
||||
AnimFileType,
|
||||
FileType,
|
||||
ImageFileType
|
||||
ImageFileType,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { QOIdecode, QOIencode } from 'qoi-img';
|
||||
import sharp, { Sharp, SharpOptions } from 'sharp';
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
Input,
|
||||
OnChanges,
|
||||
SimpleChanges,
|
||||
ViewChild
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { FileType, ImageFileType } from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { AsyncFailable, HasFailed } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
merge,
|
||||
Observable,
|
||||
switchMap,
|
||||
timer
|
||||
timer,
|
||||
} from 'rxjs';
|
||||
import { ImageService } from 'src/app/services/api/image.service';
|
||||
import { UserService } from 'src/app/services/api/user.service';
|
||||
|
|
|
@ -17,11 +17,11 @@ import { ErrorService } from 'src/app/util/error-manager/error.service';
|
|||
import { UtilService } from 'src/app/util/util.service';
|
||||
import {
|
||||
CustomizeDialogComponent,
|
||||
CustomizeDialogData
|
||||
CustomizeDialogData,
|
||||
} from '../customize-dialog/customize-dialog.component';
|
||||
import {
|
||||
EditDialogComponent,
|
||||
EditDialogData
|
||||
EditDialogData,
|
||||
} from '../edit-dialog/edit-dialog.component';
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
ChangeDetectorRef,
|
||||
Component,
|
||||
OnDestroy,
|
||||
OnInit
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ImageMetaResponse } from 'picsur-shared/dist/dto/api/image.dto';
|
||||
|
@ -11,7 +11,7 @@ import { ImageLinks } from 'picsur-shared/dist/dto/image-links.class';
|
|||
import {
|
||||
AnimFileType,
|
||||
ImageFileType,
|
||||
SupportedFileTypeCategory
|
||||
SupportedFileTypeCategory,
|
||||
} from 'picsur-shared/dist/dto/mimes.dto';
|
||||
import { EImage } from 'picsur-shared/dist/entities/image.entity';
|
||||
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||
|
|
|
@ -3,7 +3,7 @@ import { WINDOW } from '@ng-web-apis/common';
|
|||
import axios, {
|
||||
AxiosRequestConfig,
|
||||
AxiosResponse,
|
||||
AxiosResponseHeaders
|
||||
AxiosResponseHeaders,
|
||||
} from 'axios';
|
||||
import { ApiResponseSchema } from 'picsur-shared/dist/dto/api/api.dto';
|
||||
import { FileType2Ext } from 'picsur-shared/dist/dto/mimes.dto';
|
||||
|
@ -13,7 +13,7 @@ import {
|
|||
Failure,
|
||||
FT,
|
||||
HasFailed,
|
||||
HasSuccess
|
||||
HasSuccess,
|
||||
} from 'picsur-shared/dist/types';
|
||||
import { ZodDtoStatic } from 'picsur-shared/dist/util/create-zod-dto';
|
||||
import { ParseMime2FileType } from 'picsur-shared/dist/util/parse-mime';
|
||||
|
@ -237,10 +237,10 @@ export class ApiService {
|
|||
const result = await axios.request({
|
||||
url,
|
||||
onDownloadProgress: (e) => {
|
||||
downloadProgress.next(e.loaded / (e.total ?? 1000000) * 100);
|
||||
downloadProgress.next((e.loaded / (e.total ?? 1000000)) * 100);
|
||||
},
|
||||
onUploadProgress: (e) => {
|
||||
uploadProgress.next(e.loaded / (e.total ?? 1000000) * 100);
|
||||
uploadProgress.next((e.loaded / (e.total ?? 1000000)) * 100);
|
||||
},
|
||||
signal: abortController.signal,
|
||||
...options,
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
ApiKeyListRequest,
|
||||
ApiKeyListResponse,
|
||||
ApiKeyUpdateRequest,
|
||||
ApiKeyUpdateResponse
|
||||
ApiKeyUpdateResponse,
|
||||
} from 'picsur-shared/dist/dto/api/apikeys.dto';
|
||||
import { EApiKey } from 'picsur-shared/dist/entities/apikey.entity';
|
||||
import { AsyncFailable } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -6,11 +6,11 @@ import {
|
|||
ImageListResponse,
|
||||
ImageUpdateRequest,
|
||||
ImageUpdateResponse,
|
||||
ImageUploadResponse
|
||||
ImageUploadResponse,
|
||||
} from 'picsur-shared/dist/dto/api/image-manage.dto';
|
||||
import {
|
||||
ImageMetaResponse,
|
||||
ImageRequestParams
|
||||
ImageRequestParams,
|
||||
} from 'picsur-shared/dist/dto/api/image.dto';
|
||||
import { ImageLinks } from 'picsur-shared/dist/dto/image-links.class';
|
||||
import { FileType2Ext } from 'picsur-shared/dist/dto/mimes.dto';
|
||||
|
@ -21,7 +21,7 @@ import {
|
|||
FT,
|
||||
HasFailed,
|
||||
HasSuccess,
|
||||
Open
|
||||
Open,
|
||||
} from 'picsur-shared/dist/types/failable';
|
||||
import { ImagesUploadRequest } from 'src/app/models/dto/images-upload-request.dto';
|
||||
import { ImageUploadRequest } from '../../models/dto/image-upload-request.dto';
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
RoleInfoResponse,
|
||||
RoleListResponse,
|
||||
RoleUpdateRequest,
|
||||
RoleUpdateResponse
|
||||
RoleUpdateResponse,
|
||||
} from 'picsur-shared/dist/dto/api/roles.dto';
|
||||
import { ERole } from 'picsur-shared/dist/entities/role.entity';
|
||||
import { AsyncFailable, Open } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -4,19 +4,19 @@ import {
|
|||
GetPreferenceResponse,
|
||||
MultiplePreferencesResponse,
|
||||
UpdatePreferenceRequest,
|
||||
UpdatePreferenceResponse
|
||||
UpdatePreferenceResponse,
|
||||
} from 'picsur-shared/dist/dto/api/pref.dto';
|
||||
import { Permission } from 'picsur-shared/dist/dto/permissions.enum';
|
||||
import {
|
||||
DecodedPref,
|
||||
PrefValueType
|
||||
PrefValueType,
|
||||
} from 'picsur-shared/dist/dto/preferences.dto';
|
||||
import {
|
||||
AsyncFailable,
|
||||
Fail,
|
||||
FT,
|
||||
HasFailed,
|
||||
Map
|
||||
Map,
|
||||
} from 'picsur-shared/dist/types';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { ErrorService } from 'src/app/util/error-manager/error.service';
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
UserListRequest,
|
||||
UserListResponse,
|
||||
UserUpdateRequest,
|
||||
UserUpdateResponse
|
||||
UserUpdateResponse,
|
||||
} from 'picsur-shared/dist/dto/api/user-manage.dto';
|
||||
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||
import { AsyncFailable } from 'picsur-shared/dist/types';
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
UserLoginResponse,
|
||||
UserMeResponse,
|
||||
UserRegisterRequest,
|
||||
UserRegisterResponse
|
||||
UserRegisterResponse,
|
||||
} from 'picsur-shared/dist/dto/api/user.dto';
|
||||
import { JwtDataSchema } from 'picsur-shared/dist/dto/jwt.dto';
|
||||
import { EUser } from 'picsur-shared/dist/entities/user.entity';
|
||||
|
@ -16,7 +16,7 @@ import {
|
|||
Fail,
|
||||
FT,
|
||||
HasFailed,
|
||||
Open
|
||||
Open,
|
||||
} from 'picsur-shared/dist/types';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { Logger } from '../logger/logger.service';
|
||||
|
|
|
@ -4,19 +4,19 @@ import {
|
|||
GetPreferenceResponse,
|
||||
MultiplePreferencesResponse,
|
||||
UpdatePreferenceRequest,
|
||||
UpdatePreferenceResponse
|
||||
UpdatePreferenceResponse,
|
||||
} from 'picsur-shared/dist/dto/api/pref.dto';
|
||||
import { Permission } from 'picsur-shared/dist/dto/permissions.enum';
|
||||
import {
|
||||
DecodedPref,
|
||||
PrefValueType
|
||||
PrefValueType,
|
||||
} from 'picsur-shared/dist/dto/preferences.dto';
|
||||
import {
|
||||
AsyncFailable,
|
||||
Fail,
|
||||
FT,
|
||||
HasFailed,
|
||||
Map
|
||||
Map,
|
||||
} from 'picsur-shared/dist/types';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { ErrorService } from 'src/app/util/error-manager/error.service';
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<div class="dialog-text">
|
||||
<h2>Downloading {{ data.name }}...</h2>
|
||||
<mat-progress-bar mode="determinate" [value]="progress | async"></mat-progress-bar>
|
||||
<mat-progress-bar
|
||||
mode="determinate"
|
||||
[value]="progress | async"
|
||||
></mat-progress-bar>
|
||||
</div>
|
||||
<div class="dialog-buttons"></div>
|
||||
|
|
|
@ -35,14 +35,15 @@ export class DownloadService {
|
|||
}
|
||||
|
||||
public async downloadFile(url: string) {
|
||||
|
||||
|
||||
const request = this.api.getBuffer(url);
|
||||
const closeDialog = this.showDownloadDialog('image', request.downloadProgress);
|
||||
const closeDialog = this.showDownloadDialog(
|
||||
'image',
|
||||
request.downloadProgress,
|
||||
);
|
||||
|
||||
const file = await request.result;
|
||||
|
||||
if (HasFailed(file)){
|
||||
if (HasFailed(file)) {
|
||||
closeDialog();
|
||||
return this.errorService.showFailure(file, this.logger);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue