Skip to content

Commit e2b7de6

Browse files
author
bigint
committed
feat(constants): replace S3_BUCKET with EVER_BUCKET constant for uniformity and update related imports across the codebase
1 parent 1debb71 commit e2b7de6

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

apps/api/src/routes/sts/token.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Request, Response } from 'express';
22

33
import { AssumeRoleCommand, STSClient } from '@aws-sdk/client-sts';
4-
import { EVER_API, EVER_REGION, S3_BUCKET } from '@hey/data/constants';
4+
import { EVER_API, EVER_BUCKET, EVER_REGION } from '@hey/data/constants';
55
import logger from '@hey/helpers/logger';
66
import catchedError from 'src/helpers/catchedError';
77
import { rateLimiter } from 'src/helpers/middlewares/rateLimiter';
@@ -19,7 +19,7 @@ const params = {
1919
"s3:AbortMultipartUpload"
2020
],
2121
"Resource": [
22-
"arn:aws:s3:::${S3_BUCKET.HEY_MEDIA}/*"
22+
"arn:aws:s3:::${EVER_BUCKET}/*"
2323
]
2424
}
2525
]

apps/cron/src/truncate4EverlandBucket.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ListObjectsV2Command,
66
S3
77
} from '@aws-sdk/client-s3';
8-
import { EVER_API, EVER_REGION, S3_BUCKET } from '@hey/data/constants';
8+
import { EVER_API, EVER_BUCKET, EVER_REGION } from '@hey/data/constants';
99
import logger from '@hey/helpers/logger';
1010

1111
const truncate4EverlandBucket = async () => {
@@ -26,7 +26,7 @@ const truncate4EverlandBucket = async () => {
2626
currentDate.setDate(currentDate.getDate() - daysToSubtract)
2727
);
2828

29-
const Bucket = S3_BUCKET.HEY_MEDIA;
29+
const Bucket = EVER_BUCKET;
3030
let ContinuationToken: string | undefined;
3131
let objectsToDelete: { Key: string }[] = [];
3232

apps/web/src/helpers/uploadToIPFS.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { S3 } from '@aws-sdk/client-s3';
44
import { Upload } from '@aws-sdk/lib-storage';
55
import {
66
EVER_API,
7+
EVER_BUCKET,
78
EVER_REGION,
8-
HEY_API_URL,
9-
S3_BUCKET
9+
HEY_API_URL
1010
} from '@hey/data/constants';
1111
import axios from 'axios';
1212
import { v4 as uuid } from 'uuid';
@@ -73,7 +73,7 @@ const uploadToIPFS = async (
7373
const file = data[i];
7474
const params = {
7575
Body: file,
76-
Bucket: S3_BUCKET.HEY_MEDIA,
76+
Bucket: EVER_BUCKET,
7777
ContentType: file.type,
7878
Key: `${currentDate}/${uuid()}`
7979
};

packages/data/constants.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const IPFS_GATEWAY = 'https://gw.ipfs-lens.dev/ipfs';
9595
export const ARWEAVE_GATEWAY = 'https://gateway.irys.xyz';
9696
export const EVER_API = 'https://endpoint.4everland.co';
9797
export const EVER_REGION = '4EVERLAND';
98+
export const EVER_BUCKET = 'hey-media';
9899
export const DEFAULT_OG = `${STATIC_IMAGES_URL}/og/cover.png`;
99100
export const PLACEHOLDER_IMAGE = `${STATIC_IMAGES_URL}/placeholder.webp`;
100101
export const MOONPAY_URL = IS_MAINNET
@@ -119,11 +120,6 @@ export const COVER = 'tr:w-1350,h-350';
119120
export const VIDEO_THUMBNAIL = 'tr:h-1000';
120121
export const ATTACHMENT = 'tr:w-1000';
121122

122-
// S3 bucket
123-
export const S3_BUCKET = {
124-
HEY_MEDIA: 'hey-media'
125-
};
126-
127123
// Known Lens Protocol Attributes
128124
export const KNOWN_ATTRIBUTES = {
129125
HIDE_OEMBED: 'hideOembed',

0 commit comments

Comments
 (0)