Skip to content

feat: add useAccelerateEndpoint option to S3 Config #85

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
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions .eslintrc.json

This file was deleted.

3 changes: 1 addition & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env bash

./node_modules/.bin/commitlint -e $1
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env bash

npx lint-staged
49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { defineConfig } from 'eslint/config';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default defineConfig([
{
extends: compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'prettier',
),

plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
globals: {
...globals.node,
},

parser: tsParser,
ecmaVersion: 12,
sourceType: 'module',
},

rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
},
},
]);
70 changes: 36 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,42 +45,44 @@
"@nestjs/common": ">=8.0.0"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.623.0",
"@aws-sdk/client-s3": "^3.800.0",
"@aws-sdk/node-http-handler": "^3.374.0",
"@aws-sdk/s3-request-presigner": "^3.623.0",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@hkdobrev/run-if-changed": "^0.5.2",
"@nestjs/axios": "^3.0.2",
"@nestjs/common": "^10.3.10",
"@nestjs/core": "^10.3.10",
"@nestjs/platform-express": "^10.3.10",
"@nestjs/testing": "^10.3.10",
"@types/express": "4.17.15",
"@types/jest": "^29.5.12",
"@types/node": "^18.11.15",
"@types/supertest": "2.0.12",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"axios": "^1.7.3",
"commitlint": "^19.4.0",
"dotenv": "^16.0.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.5.0",
"husky": "^8.0.2",
"@aws-sdk/s3-request-presigner": "^3.800.0",
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.25.1",
"@hkdobrev/run-if-changed": "^0.6.3",
"@nestjs/axios": "^4.0.0",
"@nestjs/common": "^11.1.0",
"@nestjs/core": "^11.1.0",
"@nestjs/platform-express": "^11.1.0",
"@nestjs/testing": "^11.1.0",
"@types/express": "5.0.1",
"@types/jest": "^29.5.14",
"@types/node": "^22.15.3",
"@types/supertest": "6.0.3",
"@typescript-eslint/eslint-plugin": "^8.31.1",
"@typescript-eslint/parser": "^8.31.1",
"axios": "^1.9.0",
"commitlint": "^19.8.0",
"dotenv": "^16.5.0",
"eslint": "^9.25.1",
"eslint-config-prettier": "^10.1.2",
"globals": "^16.0.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lint-staged": "^15.2.8",
"prettier": "^2.8.1",
"reflect-metadata": "^0.1.13",
"rxjs": "7.6.0",
"supertest": "6.3.3",
"ts-jest": "^29.2.4",
"ts-node": "~10.8.2",
"tsc-watch": "5.0.3",
"tsconfig-paths": "4.0.0",
"tslint": "6.1.3",
"typescript": "~4.7.4",
"uuid": "^8.3.2"
"lint-staged": "^15.5.1",
"prettier": "^3.5.3",
"reflect-metadata": "^0.2.2",
"rxjs": "7.8.2",
"supertest": "7.1.0",
"ts-jest": "^29.3.2",
"ts-node": "~10.9.2",
"tsc-watch": "6.2.1",
"tsconfig-paths": "4.2.0",
"typescript": "~5.8.3",
"uuid": "^11.1.0"
},
"lint-staged": {
"*.ts": [
Expand Down
1 change: 1 addition & 0 deletions src/s3-service.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const createS3ServiceProvider = (): Provider => ({
new S3Client({
endpoint: config.endPoint ?? null,
region: config.region,
useAccelerateEndpoint: config.useAccelerateEndpoint ?? false,
credentials: {
accessKeyId: config.accessKeyId,
secretAccessKey: config.secretAccessKey,
Expand Down
1 change: 1 addition & 0 deletions src/types/s3-config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type S3Config = {
prefix?: string;
endPoint?: string;
prefixAlgorithm?: IPrefixAlgorithm;
useAccelerateEndpoint?: boolean;
};

export type S3AsyncConfig = Pick<ModuleMetadata, 'imports' | 'providers'> & {
Expand Down
Loading
Loading