-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #504 from andrechristikan/development
Development
- Loading branch information
Showing
54 changed files
with
2,486 additions
and
2,198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const APP_LANGUAGE = 'en'; | ||
|
||
export const APP_TZ = 'Asia/Jakarta'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { ObjectCannedACL } from '@aws-sdk/client-s3'; | ||
|
||
export interface IAwsS3PutItemOptions { | ||
path: string; | ||
path?: string; | ||
customFilename?: string; | ||
acl?: ObjectCannedACL; | ||
} | ||
|
||
export interface IAwsS3RandomFilename { | ||
path: string; | ||
customFilename: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,43 @@ | ||
import { | ||
CompletedPart, | ||
HeadBucketCommandOutput, | ||
UploadPartRequest, | ||
} from '@aws-sdk/client-s3'; | ||
import { HeadBucketCommandOutput, UploadPartRequest } from '@aws-sdk/client-s3'; | ||
import { IAwsS3PutItemOptions } from 'src/common/aws/interfaces/aws.interface'; | ||
import { | ||
AwsS3MultipartPartsSerialization, | ||
AwsS3MultipartSerialization, | ||
} from 'src/common/aws/serializations/aws.s3-multipart.serialization'; | ||
import { AwsS3Serialization } from 'src/common/aws/serializations/aws.s3.serialization'; | ||
import { IFile } from 'src/common/file/interfaces/file.interface'; | ||
import { Readable } from 'stream'; | ||
|
||
export interface IAwsS3Service { | ||
checkBucketExistence(): Promise<HeadBucketCommandOutput>; | ||
listBucket(): Promise<string[]>; | ||
listItemInBucket(prefix?: string): Promise<AwsS3Serialization[]>; | ||
getItemInBucket( | ||
filename: string, | ||
path?: string | ||
pathWithFilename: string | ||
): Promise<Readable | ReadableStream<any> | Blob>; | ||
putItemInBucket( | ||
filename: string, | ||
content: | ||
| string | ||
| Uint8Array | ||
| Buffer | ||
| Readable | ||
| ReadableStream | ||
| Blob, | ||
file: IFile, | ||
options?: IAwsS3PutItemOptions | ||
): Promise<AwsS3Serialization>; | ||
deleteItemInBucket(filename: string): Promise<void>; | ||
deleteItemsInBucket(filenames: string[]): Promise<void>; | ||
deleteItemInBucket(pathWithFilename: string): Promise<void>; | ||
deleteItemsInBucket(pathWithFilename: string[]): Promise<void>; | ||
deleteFolder(dir: string): Promise<void>; | ||
createMultiPart( | ||
filename: string, | ||
file: IFile, | ||
maxPartNumber: number, | ||
options?: IAwsS3PutItemOptions | ||
): Promise<AwsS3MultipartSerialization>; | ||
uploadPart( | ||
path: string, | ||
content: UploadPartRequest['Body'] | string | Uint8Array | Buffer, | ||
uploadId: string, | ||
partNumber: number | ||
multipart: AwsS3MultipartSerialization, | ||
partNumber: number, | ||
content: UploadPartRequest['Body'] | string | Uint8Array | Buffer | ||
): Promise<AwsS3MultipartPartsSerialization>; | ||
completeMultipart( | ||
path: string, | ||
uploadId: string, | ||
parts: CompletedPart[] | ||
): Promise<void>; | ||
abortMultipart(path: string, uploadId: string): Promise<void>; | ||
updateMultiPart( | ||
{ size, parts, ...others }: AwsS3MultipartSerialization, | ||
part: AwsS3MultipartPartsSerialization | ||
): Promise<AwsS3MultipartSerialization>; | ||
completeMultipart(multipart: AwsS3MultipartSerialization): Promise<void>; | ||
abortMultipart(multipart: AwsS3MultipartSerialization): Promise<void>; | ||
getFilenameFromCompletedUrl(completedUrl: string): Promise<string>; | ||
createRandomFilename(path?: string): Promise<Record<string, any>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.