-
Notifications
You must be signed in to change notification settings - Fork 0
1st release #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
venu123143
wants to merge
24
commits into
main
Choose a base branch
from
development
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
1st release #18
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8894742
Merge pull request #5 from venu123143/refresh_tokens
venu123143 c535a2b
Merge pull request #6 from venu123143/refresh_tokens
venu123143 d31ce20
Merge pull request #7 from venu123143/refresh_tokens
venu123143 11f0207
Merge pull request #9 from venu123143/refresh_tokens
venu123143 496469e
revoke share api changes
venu123143 5af0973
revoke access changes
venu123143 d667fa5
Merge pull request #10 from venu123143/refresh_tokens
venu123143 0193222
backend changes for the dashboard
venu123143 18a8fd1
Merge pull request #11 from venu123143/refresh_tokens
venu123143 a9c736c
get api changes
venu123143 498699d
Merge pull request #12 from venu123143/refresh_tokens
venu123143 0763c7b
bakend get all files api changes
venu123143 ae442f7
Merge pull request #13 from venu123143/refresh_tokens
venu123143 7065193
commented the with ip code
venu123143 8b7a905
edn url changes
venu123143 9bdf819
code changes
venu123143 c777db1
Merge pull request #14 from venu123143/refresh_tokens
venu123143 7b41d67
docker compose changes
venu123143 9239757
Merge pull request #15 from venu123143/refresh_tokens
venu123143 09bb41c
ci-cd modified
venu123143 d39fb9f
Merge pull request #16 from venu123143/refresh_tokens
venu123143 baf0acc
conflicts resolved
venu123143 9d251f1
backend api changes
venu123143 99d5c7e
Merge pull request #17 from venu123143/refresh_tokens
venu123143 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| import { | ||
| S3Client, | ||
| PutObjectCommand, | ||
| GetObjectCommand, | ||
| DeleteObjectCommand, | ||
| DeleteObjectsCommand, | ||
| ListObjectsV2Command, | ||
| type PutObjectCommandInput, | ||
| HeadObjectCommand, | ||
| } from "@aws-sdk/client-s3"; | ||
| import { FolderNameEnum } from "@/config/s3.config"; | ||
|
|
||
| // export enum SecondaryFolderNameEnum { | ||
| // FILES = "files", | ||
| // VIDEOS = "videos", | ||
| // IMAGES = "images", | ||
| // DOCUMENTS = "documents", | ||
| // RECORDINGS = "recordings" | ||
| // } | ||
|
|
||
| export class SecondaryS3Service { | ||
| private s3Client: S3Client; | ||
| private bucketName: string; | ||
|
|
||
| constructor() { | ||
| this.bucketName = process.env.SECONDARY_S3_BUCKET_NAME!; | ||
|
|
||
| this.s3Client = new S3Client({ | ||
| endpoint: process.env.SECONDARY_S3_ENDPOINT!, | ||
| region: process.env.SECONDARY_S3_REGION || 'auto', | ||
| credentials: { | ||
| accessKeyId: process.env.SECONDARY_S3_TOKEN_ID!, | ||
| secretAccessKey: process.env.SECONDARY_S3_SECRET_KEY!, | ||
| }, | ||
| forcePathStyle: true, | ||
| requestHandler: { | ||
| requestTimeout: 300000, // 5 minutes timeout | ||
| } as any, | ||
| }); | ||
| } | ||
|
|
||
| public async listFiles(folder?: FolderNameEnum, maxKeys: number = 1000, continuationToken?: string) { | ||
| const command = new ListObjectsV2Command({ | ||
| Bucket: this.bucketName, | ||
| Prefix: folder ? `${folder}/` : undefined, | ||
| MaxKeys: maxKeys, | ||
| ContinuationToken: continuationToken, | ||
| }); | ||
|
|
||
| const response = await this.s3Client.send(command); | ||
| return { | ||
| files: response.Contents?.map(obj => ({ | ||
| key: obj.Key!, | ||
| size: obj.Size!, | ||
| lastModified: obj.LastModified!, | ||
| etag: obj.ETag!, | ||
| })) || [], | ||
| isTruncated: response.IsTruncated || false, | ||
| nextContinuationToken: response.NextContinuationToken, | ||
| }; | ||
| } | ||
|
|
||
| public async getFile(key: string): Promise<Buffer> { | ||
| const command = new GetObjectCommand({ | ||
| Bucket: this.bucketName, | ||
| Key: key, | ||
| }); | ||
|
|
||
| const response = await this.s3Client.send(command); | ||
|
|
||
| if (!response.Body) { | ||
| throw new Error(`No body returned for key: ${key}`); | ||
| } | ||
|
|
||
| // Convert stream to buffer | ||
| const chunks: Uint8Array[] = []; | ||
| for await (const chunk of response.Body as any) { | ||
| chunks.push(chunk); | ||
| } | ||
| return Buffer.concat(chunks); | ||
| } | ||
|
|
||
| public async getFileStream(key: string) { | ||
| const command = new GetObjectCommand({ | ||
| Bucket: this.bucketName, | ||
| Key: key, | ||
| }); | ||
|
|
||
| const response = await this.s3Client.send(command); | ||
|
|
||
| if (!response.Body) { | ||
| throw new Error(`No body returned for key: ${key}`); | ||
| } | ||
|
|
||
| return response.Body; | ||
| } | ||
|
|
||
| public async getMetadata(key: string) { | ||
| const command = new HeadObjectCommand({ | ||
| Bucket: this.bucketName, | ||
| Key: key, | ||
| }); | ||
| const response = await this.s3Client.send(command); | ||
| return { | ||
| contentType: response.ContentType, | ||
| contentLength: response.ContentLength, | ||
| lastModified: response.LastModified, | ||
| metadata: response.Metadata, | ||
| etag: response.ETag, | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| export default new SecondaryS3Service(); | ||
|
|
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Ignoring all
.mdand.txtfiles will block essential documentation.The patterns
*.mdand*.txtwill prevent version control of README.md, CONTRIBUTING.md, CHANGELOG.md, and other important documentation. This will block documentation commits and violate repository best practices.If you need to ignore specific markdown/text files (e.g., generated reports or local notes), use more specific patterns instead:
🔧 Suggested fix: use specific patterns
Or if these are truly temporary local files, add them to your personal
.git/info/excludeinstead.🤖 Prompt for AI Agents