lesgo 0.7.8 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/bin/lesgo-scripts.sh +52 -7
- package/dist/config/app.d.ts +7 -0
- package/dist/config/app.js +9 -0
- package/dist/config/aws.d.ts +5 -0
- package/dist/config/aws.js +4 -0
- package/dist/config/basicAuth.d.ts +7 -0
- package/dist/config/basicAuth.js +8 -0
- package/dist/config/crypto.d.ts +10 -0
- package/dist/config/crypto.js +9 -0
- package/dist/config/dynamodb.d.ts +8 -0
- package/dist/config/dynamodb.js +14 -0
- package/dist/config/elasticache.d.ts +7 -0
- package/dist/config/elasticache.js +6 -0
- package/dist/config/index.d.ts +11 -0
- package/dist/config/index.js +11 -0
- package/dist/config/jwt.d.ts +12 -0
- package/dist/config/jwt.js +16 -0
- package/dist/config/rds.d.ts +12 -0
- package/dist/config/rds.js +13 -0
- package/dist/config/s3.d.ts +5 -0
- package/dist/config/s3.js +5 -0
- package/dist/config/secretsManager.d.ts +4 -0
- package/dist/config/secretsManager.js +4 -0
- package/dist/config/sqs.d.ts +9 -0
- package/dist/config/sqs.js +18 -0
- package/dist/exceptions/LesgoException.d.ts +6 -0
- package/{src → dist}/exceptions/LesgoException.js +5 -4
- package/dist/exceptions/index.d.ts +1 -0
- package/dist/exceptions/index.js +1 -0
- package/dist/middlewares/disconnectMiddleware.d.ts +8 -0
- package/dist/middlewares/disconnectMiddleware.js +78 -0
- package/dist/middlewares/httpMiddleware.d.ts +12 -0
- package/dist/middlewares/httpMiddleware.js +74 -0
- package/dist/middlewares/httpResponseMiddleware.d.ts +7 -0
- package/dist/middlewares/httpResponseMiddleware.js +128 -0
- package/dist/middlewares/index.d.ts +7 -0
- package/dist/middlewares/index.js +7 -0
- package/dist/middlewares/invokeCommandMiddleware.d.ts +12 -0
- package/dist/middlewares/invokeCommandMiddleware.js +70 -0
- package/dist/middlewares/sqsMiddleware.d.ts +10 -0
- package/dist/middlewares/sqsMiddleware.js +70 -0
- package/dist/middlewares/verifyBasicAuthMiddleware.d.ts +8 -0
- package/dist/middlewares/verifyBasicAuthMiddleware.js +59 -0
- package/dist/middlewares/verifyJwtMiddleware.d.ts +6 -0
- package/dist/middlewares/verifyJwtMiddleware.js +37 -0
- package/dist/services/DynamoDbService/deleteRecord.d.ts +8 -0
- package/dist/services/DynamoDbService/deleteRecord.js +69 -0
- package/dist/services/DynamoDbService/getClient.d.ts +7 -0
- package/dist/services/DynamoDbService/getClient.js +30 -0
- package/dist/services/DynamoDbService/getTableName.d.ts +2 -0
- package/dist/services/DynamoDbService/getTableName.js +15 -0
- package/dist/services/DynamoDbService/index.d.ts +6 -0
- package/dist/services/DynamoDbService/index.js +6 -0
- package/dist/services/DynamoDbService/putRecord.d.ts +8 -0
- package/dist/services/DynamoDbService/putRecord.js +64 -0
- package/dist/services/DynamoDbService/query.d.ts +7 -0
- package/dist/services/DynamoDbService/query.js +78 -0
- package/dist/services/DynamoDbService/scan.d.ts +7 -0
- package/dist/services/DynamoDbService/scan.js +60 -0
- package/dist/services/DynamoDbService/updateRecord.d.ts +9 -0
- package/dist/services/DynamoDbService/updateRecord.js +89 -0
- package/dist/services/ElastiCacheRedisService/deleteRedisCache.d.ts +3 -0
- package/dist/services/ElastiCacheRedisService/deleteRedisCache.js +62 -0
- package/dist/services/ElastiCacheRedisService/disconnectElastiCacheRedisClient.d.ts +11 -0
- package/dist/services/ElastiCacheRedisService/disconnectElastiCacheRedisClient.js +69 -0
- package/dist/services/ElastiCacheRedisService/getElastiCacheRedisClient.d.ts +12 -0
- package/dist/services/ElastiCacheRedisService/getElastiCacheRedisClient.js +114 -0
- package/dist/services/ElastiCacheRedisService/getRedisCache.d.ts +3 -0
- package/dist/services/ElastiCacheRedisService/getRedisCache.js +70 -0
- package/dist/services/ElastiCacheRedisService/index.d.ts +5 -0
- package/dist/services/ElastiCacheRedisService/index.js +5 -0
- package/dist/services/ElastiCacheRedisService/setRedisCache.d.ts +6 -0
- package/dist/services/ElastiCacheRedisService/setRedisCache.js +77 -0
- package/dist/services/JWTService/decodeJwt.d.ts +7 -0
- package/dist/services/JWTService/decodeJwt.js +9 -0
- package/dist/services/JWTService/getJwtSecret.d.ts +13 -0
- package/dist/services/JWTService/getJwtSecret.js +54 -0
- package/dist/services/JWTService/index.d.ts +2 -0
- package/dist/services/JWTService/index.js +2 -0
- package/dist/services/JWTService/sign.d.ts +3 -0
- package/dist/services/JWTService/sign.js +31 -0
- package/dist/services/JWTService/verify.d.ts +7 -0
- package/dist/services/JWTService/verify.js +61 -0
- package/dist/services/LoggerService.d.ts +46 -0
- package/{src → dist}/services/LoggerService.js +36 -60
- package/dist/services/RDSAuroraMySQLProxyService/disconnectMySQLProxyClient.d.ts +2 -0
- package/dist/services/RDSAuroraMySQLProxyService/disconnectMySQLProxyClient.js +60 -0
- package/dist/services/RDSAuroraMySQLProxyService/getMySQLProxyClient.d.ts +8 -0
- package/dist/services/RDSAuroraMySQLProxyService/getMySQLProxyClient.js +87 -0
- package/dist/services/RDSAuroraMySQLProxyService/index.d.ts +3 -0
- package/dist/services/RDSAuroraMySQLProxyService/index.js +3 -0
- package/dist/services/RDSAuroraMySQLProxyService/query.d.ts +4 -0
- package/dist/services/RDSAuroraMySQLProxyService/query.js +63 -0
- package/dist/services/S3Service/getClient.d.ts +4 -0
- package/dist/services/S3Service/getClient.js +28 -0
- package/dist/services/S3Service/getDownloadSignedUrl.d.ts +7 -0
- package/dist/services/S3Service/getDownloadSignedUrl.js +58 -0
- package/dist/services/S3Service/getHeadObject.d.ts +13 -0
- package/dist/services/S3Service/getHeadObject.js +83 -0
- package/dist/services/S3Service/getObject.d.ts +10 -0
- package/dist/services/S3Service/getObject.js +89 -0
- package/dist/services/S3Service/getUploadSignedUrl.d.ts +7 -0
- package/dist/services/S3Service/getUploadSignedUrl.js +61 -0
- package/dist/services/S3Service/index.d.ts +6 -0
- package/dist/services/S3Service/index.js +6 -0
- package/dist/services/S3Service/putObject.d.ts +9 -0
- package/dist/services/S3Service/putObject.js +77 -0
- package/dist/services/SQSService/deleteMessage.d.ts +9 -0
- package/dist/services/SQSService/deleteMessage.js +69 -0
- package/dist/services/SQSService/dispatch.d.ts +9 -0
- package/dist/services/SQSService/dispatch.js +71 -0
- package/dist/services/SQSService/getClient.d.ts +4 -0
- package/dist/services/SQSService/getClient.js +28 -0
- package/dist/services/SQSService/getQueueUrl.d.ts +7 -0
- package/dist/services/SQSService/getQueueUrl.js +25 -0
- package/dist/services/SQSService/index.d.ts +4 -0
- package/dist/services/SQSService/index.js +4 -0
- package/dist/services/SQSService/receiveMessages.d.ts +8 -0
- package/dist/services/SQSService/receiveMessages.js +65 -0
- package/dist/services/SecretsManagerService/getClient.d.ts +7 -0
- package/dist/services/SecretsManagerService/getClient.js +28 -0
- package/dist/services/SecretsManagerService/getSecretValue.d.ts +7 -0
- package/dist/services/SecretsManagerService/getSecretValue.js +65 -0
- package/dist/services/SecretsManagerService/index.d.ts +2 -0
- package/dist/services/SecretsManagerService/index.js +2 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +1 -0
- package/dist/types/aws.d.ts +8 -0
- package/dist/types/aws.js +1 -0
- package/dist/utils/cache/redis/deleteCache.d.ts +19 -0
- package/dist/utils/cache/redis/deleteCache.js +21 -0
- package/dist/utils/cache/redis/getCache.d.ts +22 -0
- package/dist/utils/cache/redis/getCache.js +24 -0
- package/dist/utils/cache/redis/getClient.d.ts +30 -0
- package/dist/utils/cache/redis/getClient.js +32 -0
- package/dist/utils/cache/redis/index.d.ts +4 -0
- package/dist/utils/cache/redis/index.js +4 -0
- package/dist/utils/cache/redis/setCache.d.ts +25 -0
- package/dist/utils/cache/redis/setCache.js +26 -0
- package/dist/utils/crypto/decrypt.d.ts +33 -0
- package/dist/utils/crypto/decrypt.js +59 -0
- package/dist/utils/crypto/encrypt.d.ts +31 -0
- package/dist/utils/crypto/encrypt.js +41 -0
- package/dist/utils/crypto/hash.d.ts +31 -0
- package/dist/utils/crypto/hash.js +56 -0
- package/dist/utils/crypto/index.d.ts +3 -0
- package/dist/utils/crypto/index.js +3 -0
- package/dist/utils/crypto/validateEncryptionFields.d.ts +19 -0
- package/dist/utils/crypto/validateEncryptionFields.js +71 -0
- package/dist/utils/db/mysql/proxy/disconnect.d.ts +2 -0
- package/dist/utils/db/mysql/proxy/disconnect.js +5 -0
- package/dist/utils/db/mysql/proxy/disconnectDb.d.ts +2 -0
- package/dist/utils/db/mysql/proxy/disconnectDb.js +5 -0
- package/dist/utils/db/mysql/proxy/getClient.d.ts +4 -0
- package/dist/utils/db/mysql/proxy/getClient.js +5 -0
- package/dist/utils/db/mysql/proxy/index.d.ts +3 -0
- package/dist/utils/db/mysql/proxy/index.js +3 -0
- package/dist/utils/db/mysql/proxy/query.d.ts +4 -0
- package/dist/utils/db/mysql/proxy/query.js +45 -0
- package/dist/utils/dynamodb/deleteRecord.d.ts +5 -0
- package/dist/utils/dynamodb/deleteRecord.js +39 -0
- package/dist/utils/dynamodb/getClient.d.ts +3 -0
- package/dist/utils/dynamodb/getClient.js +5 -0
- package/dist/utils/dynamodb/index.d.ts +6 -0
- package/dist/utils/dynamodb/index.js +6 -0
- package/dist/utils/dynamodb/putRecord.d.ts +4 -0
- package/dist/utils/dynamodb/putRecord.js +39 -0
- package/dist/utils/dynamodb/query.d.ts +5 -0
- package/dist/utils/dynamodb/query.js +52 -0
- package/dist/utils/dynamodb/scan.d.ts +4 -0
- package/dist/utils/dynamodb/scan.js +40 -0
- package/dist/utils/dynamodb/updateRecord.d.ts +5 -0
- package/dist/utils/dynamodb/updateRecord.js +53 -0
- package/dist/utils/formatUnixTimestamp.d.ts +8 -0
- package/dist/utils/formatUnixTimestamp.js +17 -0
- package/dist/utils/generateUid.d.ts +13 -0
- package/{src → dist}/utils/generateUid.js +9 -4
- package/dist/utils/getCurrentDatetime.d.ts +2 -0
- package/dist/utils/getCurrentDatetime.js +4 -0
- package/dist/utils/getCurrentTimestamp.d.ts +7 -0
- package/dist/utils/getCurrentTimestamp.js +9 -0
- package/dist/utils/getJwtSubFromAuthHeader.d.ts +9 -0
- package/dist/utils/getJwtSubFromAuthHeader.js +24 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/isDecimal.d.ts +8 -0
- package/dist/utils/isDecimal.js +9 -0
- package/dist/utils/isEmail.d.ts +9 -0
- package/{src → dist}/utils/isEmail.js +9 -4
- package/dist/utils/isEmpty.d.ts +8 -0
- package/dist/utils/isEmpty.js +19 -0
- package/dist/utils/jwt/index.d.ts +2 -0
- package/dist/utils/jwt/index.js +2 -0
- package/dist/utils/jwt/sign.d.ts +3 -0
- package/dist/utils/jwt/sign.js +5 -0
- package/dist/utils/jwt/verify.d.ts +3 -0
- package/dist/utils/jwt/verify.js +12 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.js +38 -0
- package/dist/utils/s3/getClient.d.ts +3 -0
- package/dist/utils/s3/getClient.js +5 -0
- package/dist/utils/s3/getDownloadSignedUrl.d.ts +5 -0
- package/dist/utils/s3/getDownloadSignedUrl.js +39 -0
- package/dist/utils/s3/getHeadObject.d.ts +10 -0
- package/dist/utils/s3/getHeadObject.js +39 -0
- package/dist/utils/s3/getObject.d.ts +13 -0
- package/dist/utils/s3/getObject.js +51 -0
- package/dist/utils/s3/getUploadSignedUrl.d.ts +5 -0
- package/dist/utils/s3/getUploadSignedUrl.js +39 -0
- package/dist/utils/s3/index.d.ts +6 -0
- package/dist/utils/s3/index.js +6 -0
- package/dist/utils/s3/putObject.d.ts +5 -0
- package/dist/utils/s3/putObject.js +39 -0
- package/dist/utils/secretsmanager/getClient.d.ts +3 -0
- package/dist/utils/secretsmanager/getClient.js +5 -0
- package/dist/utils/secretsmanager/getSecretValue.d.ts +4 -0
- package/dist/utils/secretsmanager/getSecretValue.js +68 -0
- package/dist/utils/secretsmanager/index.d.ts +2 -0
- package/dist/utils/secretsmanager/index.js +2 -0
- package/dist/utils/sqs/deleteMessage.d.ts +5 -0
- package/dist/utils/sqs/deleteMessage.js +39 -0
- package/dist/utils/sqs/dispatch.d.ts +5 -0
- package/dist/utils/sqs/dispatch.js +39 -0
- package/dist/utils/sqs/getClient.d.ts +3 -0
- package/dist/utils/sqs/getClient.js +5 -0
- package/dist/utils/sqs/index.d.ts +4 -0
- package/dist/utils/sqs/index.js +4 -0
- package/dist/utils/sqs/receiveMessages.d.ts +5 -0
- package/dist/utils/sqs/receiveMessages.js +39 -0
- package/dist/utils/validateFields.d.ts +22 -0
- package/{src → dist}/utils/validateFields.js +13 -19
- package/package.json +145 -34
- package/CHANGELOG.md +0 -9
- package/src/exceptions/__tests__/LesgoException.spec.js +0 -24
- package/src/exceptions/index.js +0 -4
- package/src/index.js +0 -4
- package/src/middlewares/__mocks__/ValidationErrorException.js +0 -18
- package/src/middlewares/__tests__/basicAuthMiddleware.spec.js +0 -225
- package/src/middlewares/__tests__/clientAuthMiddleware.spec.js +0 -137
- package/src/middlewares/__tests__/errorHttpResponseMiddleware.spec.js +0 -190
- package/src/middlewares/__tests__/gzipHttpResponse.spec.js +0 -185
- package/src/middlewares/__tests__/httpNoOutputMiddleware.spec.js +0 -199
- package/src/middlewares/__tests__/normalizeHttpRequestMiddleware.spec.js +0 -181
- package/src/middlewares/__tests__/normalizeSQSMessageMiddleware.spec.js +0 -120
- package/src/middlewares/__tests__/serverAuthMiddleware.spec.js +0 -170
- package/src/middlewares/__tests__/successHttpResponseMiddleware.spec.js +0 -159
- package/src/middlewares/__tests__/verifyJwtMiddleware.spec.js +0 -222
- package/src/middlewares/basicAuthMiddleware.js +0 -145
- package/src/middlewares/clientAuthMiddleware.js +0 -82
- package/src/middlewares/errorHttpResponseMiddleware.js +0 -99
- package/src/middlewares/gzipHttpResponse.js +0 -98
- package/src/middlewares/httpMiddleware.js +0 -19
- package/src/middlewares/httpNoOutputMiddleware.js +0 -87
- package/src/middlewares/index.js +0 -15
- package/src/middlewares/normalizeHttpRequestMiddleware.js +0 -101
- package/src/middlewares/normalizeSQSMessageMiddleware.js +0 -67
- package/src/middlewares/serverAuthMiddleware.js +0 -29
- package/src/middlewares/successHttpResponseMiddleware.js +0 -83
- package/src/middlewares/verifyJwtMiddleware.js +0 -62
- package/src/services/AuroraDbRDSProxyService.js +0 -182
- package/src/services/AuroraDbService.js +0 -111
- package/src/services/DynamoDbService.js +0 -177
- package/src/services/ElastiCacheService.js +0 -17
- package/src/services/ElasticsearchService.js +0 -181
- package/src/services/FirebaseAdminService.js +0 -108
- package/src/services/JwtService.js +0 -52
- package/src/services/S3Service.js +0 -59
- package/src/services/SQSService.js +0 -65
- package/src/services/__tests__/AuroraDbRDSProxyService.spec.js +0 -278
- package/src/services/__tests__/AuroraDbService.spec.js +0 -211
- package/src/services/__tests__/AwsElasticsearchConnection.spec.js +0 -89
- package/src/services/__tests__/DynamoDbService.spec.js +0 -314
- package/src/services/__tests__/ElasticsearchService.spec.js +0 -201
- package/src/services/__tests__/FirebaseAdminService.spec.js +0 -356
- package/src/services/__tests__/JwtService.spec.js +0 -35
- package/src/services/__tests__/LengthAwarePaginator.spec.js +0 -223
- package/src/services/__tests__/LoggerService.spec.js +0 -252
- package/src/services/__tests__/Paginator.spec.js +0 -383
- package/src/services/__tests__/S3Service.spec.js +0 -55
- package/src/services/__tests__/SQSService.spec.js +0 -47
- package/src/services/__tests__/SignedRequest.spec.js +0 -103
- package/src/services/aws/AwsElasticsearchConnection.js +0 -59
- package/src/services/aws/SignedRequest.js +0 -158
- package/src/services/index.js +0 -19
- package/src/services/pagination/LengthAwarePaginator.js +0 -49
- package/src/services/pagination/Paginator.js +0 -260
- package/src/utils/__mocks__/db.js +0 -109
- package/src/utils/__tests__/cache.spec.js +0 -131
- package/src/utils/__tests__/crypto.spec.js +0 -122
- package/src/utils/__tests__/db.spec.js +0 -70
- package/src/utils/__tests__/dynamodb.spec.js +0 -27
- package/src/utils/__tests__/elasticsearch.spec.js +0 -43
- package/src/utils/__tests__/generateUid.spec.js +0 -36
- package/src/utils/__tests__/getJwtSubFromAuthHeader.spec.js +0 -20
- package/src/utils/__tests__/isDecimal.spec.js +0 -12
- package/src/utils/__tests__/isEmail.spec.js +0 -28
- package/src/utils/__tests__/isEmpty.spec.js +0 -31
- package/src/utils/__tests__/logger.spec.js +0 -11
- package/src/utils/__tests__/objectStore.spec.js +0 -67
- package/src/utils/__tests__/prepSQLInsertParams.spec.js +0 -46
- package/src/utils/__tests__/prepSQLUpdateParams.spec.js +0 -36
- package/src/utils/__tests__/queue.spec.js +0 -54
- package/src/utils/__tests__/validateFields.spec.js +0 -374
- package/src/utils/cache.js +0 -215
- package/src/utils/crypto.js +0 -77
- package/src/utils/db.js +0 -17
- package/src/utils/dynamodb.js +0 -6
- package/src/utils/elasticsearch.js +0 -20
- package/src/utils/getJwtSubFromAuthHeader.js +0 -18
- package/src/utils/index.js +0 -26
- package/src/utils/isDecimal.js +0 -2
- package/src/utils/isEmpty.js +0 -6
- package/src/utils/logger.js +0 -25
- package/src/utils/objectStore.js +0 -11
- package/src/utils/prepSQLInsertParams.js +0 -21
- package/src/utils/prepSQLUpdateParams.js +0 -25
- package/src/utils/queue.js +0 -11
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __awaiter =
|
|
2
|
+
(this && this.__awaiter) ||
|
|
3
|
+
function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P
|
|
6
|
+
? value
|
|
7
|
+
: new P(function (resolve) {
|
|
8
|
+
resolve(value);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function rejected(value) {
|
|
20
|
+
try {
|
|
21
|
+
step(generator['throw'](value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function step(result) {
|
|
27
|
+
result.done
|
|
28
|
+
? resolve(result.value)
|
|
29
|
+
: adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
import updateRecordService from '../../services/DynamoDbService/updateRecord';
|
|
35
|
+
export const updateRecord = (
|
|
36
|
+
key,
|
|
37
|
+
tableAlias,
|
|
38
|
+
updateExpression,
|
|
39
|
+
expressionAttributeValues,
|
|
40
|
+
opts,
|
|
41
|
+
clientOpts
|
|
42
|
+
) =>
|
|
43
|
+
__awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
return updateRecordService(
|
|
45
|
+
key,
|
|
46
|
+
tableAlias,
|
|
47
|
+
updateExpression,
|
|
48
|
+
expressionAttributeValues,
|
|
49
|
+
opts,
|
|
50
|
+
clientOpts
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
export default updateRecord;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a Unix timestamp into a string representation.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} timestamp - The Unix timestamp to format.
|
|
5
|
+
* @returns {string} The formatted timestamp string in UTC in the format "YYYY-MM-DD HH:MM:SS".
|
|
6
|
+
*/
|
|
7
|
+
declare const formatUnixTimestamp: (timestamp: number) => string;
|
|
8
|
+
export default formatUnixTimestamp;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a Unix timestamp into a string representation.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} timestamp - The Unix timestamp to format.
|
|
5
|
+
* @returns {string} The formatted timestamp string in UTC in the format "YYYY-MM-DD HH:MM:SS".
|
|
6
|
+
*/
|
|
7
|
+
const formatUnixTimestamp = timestamp => {
|
|
8
|
+
const date = new Date(timestamp * 1000); // Convert to milliseconds
|
|
9
|
+
const year = date.getUTCFullYear();
|
|
10
|
+
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
|
11
|
+
const day = String(date.getUTCDate()).padStart(2, '0');
|
|
12
|
+
const hours = String(date.getUTCHours()).padStart(2, '0');
|
|
13
|
+
const minutes = String(date.getUTCMinutes()).padStart(2, '0');
|
|
14
|
+
const seconds = String(date.getUTCSeconds()).padStart(2, '0');
|
|
15
|
+
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
16
|
+
};
|
|
17
|
+
export default formatUnixTimestamp;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface GenerateUidParams {
|
|
2
|
+
prefix?: string;
|
|
3
|
+
suffix?: string;
|
|
4
|
+
length?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Generates a unique identifier with optional prefix, suffix, and length.
|
|
8
|
+
*
|
|
9
|
+
* @param params - The parameters for generating the unique identifier.
|
|
10
|
+
* @returns The generated unique identifier.
|
|
11
|
+
*/
|
|
12
|
+
declare const generateUid: (params?: GenerateUidParams) => string;
|
|
13
|
+
export default generateUid;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { customAlphabet } from 'nanoid';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Generates a unique identifier with optional prefix, suffix, and length.
|
|
4
|
+
*
|
|
5
|
+
* @param params - The parameters for generating the unique identifier.
|
|
6
|
+
* @returns The generated unique identifier.
|
|
7
|
+
*/
|
|
8
|
+
const generateUid = (params = {}) => {
|
|
4
9
|
const { prefix, suffix, length } = params;
|
|
5
|
-
|
|
6
10
|
const nanoid = customAlphabet(
|
|
7
11
|
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
|
|
8
12
|
!length ? 21 : length
|
|
9
13
|
);
|
|
10
|
-
const uid =
|
|
14
|
+
const uid = nanoid();
|
|
11
15
|
return `${!prefix ? '' : `${prefix}-`}${uid}${!suffix ? '' : `-${suffix}`}`;
|
|
12
16
|
};
|
|
17
|
+
export default generateUid;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getTokenData: (authHeader: string) => any;
|
|
2
|
+
/**
|
|
3
|
+
* Extracts the subject (sub) claim from the JWT token in the provided authorization header.
|
|
4
|
+
*
|
|
5
|
+
* @param authHeader - The authorization header containing the JWT token.
|
|
6
|
+
* @returns The subject (sub) claim from the JWT token, or null if the header is empty or the subject claim is not present.
|
|
7
|
+
*/
|
|
8
|
+
declare const getJwtSubFromAuthHeader: (authHeader: string) => any;
|
|
9
|
+
export default getJwtSubFromAuthHeader;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import isEmpty from './isEmpty';
|
|
2
|
+
export const getTokenData = authHeader => {
|
|
3
|
+
try {
|
|
4
|
+
return JSON.parse(
|
|
5
|
+
Buffer.from(authHeader.split('.')[1], 'base64').toString()
|
|
6
|
+
);
|
|
7
|
+
} catch (err) {
|
|
8
|
+
return {};
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Extracts the subject (sub) claim from the JWT token in the provided authorization header.
|
|
13
|
+
*
|
|
14
|
+
* @param authHeader - The authorization header containing the JWT token.
|
|
15
|
+
* @returns The subject (sub) claim from the JWT token, or null if the header is empty or the subject claim is not present.
|
|
16
|
+
*/
|
|
17
|
+
const getJwtSubFromAuthHeader = authHeader => {
|
|
18
|
+
if (isEmpty(authHeader)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const data = getTokenData(authHeader);
|
|
22
|
+
return data.sub || null;
|
|
23
|
+
};
|
|
24
|
+
export default getJwtSubFromAuthHeader;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as formatUnixTimestamp } from './formatUnixTimestamp';
|
|
2
|
+
export { default as generateUid } from './generateUid';
|
|
3
|
+
export { default as getCurrentDatetime } from './getCurrentDatetime';
|
|
4
|
+
export { default as getCurrentTimestamp } from './getCurrentTimestamp';
|
|
5
|
+
export { default as isDecimal } from './isDecimal';
|
|
6
|
+
export { default as isEmail } from './isEmail';
|
|
7
|
+
export { default as isEmpty } from './isEmpty';
|
|
8
|
+
export { default as logger } from './logger';
|
|
9
|
+
export { default as validateFields } from './validateFields';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as formatUnixTimestamp } from './formatUnixTimestamp';
|
|
2
|
+
export { default as generateUid } from './generateUid';
|
|
3
|
+
export { default as getCurrentDatetime } from './getCurrentDatetime';
|
|
4
|
+
export { default as getCurrentTimestamp } from './getCurrentTimestamp';
|
|
5
|
+
export { default as isDecimal } from './isDecimal';
|
|
6
|
+
export { default as isEmail } from './isEmail';
|
|
7
|
+
export { default as isEmpty } from './isEmpty';
|
|
8
|
+
export { default as logger } from './logger';
|
|
9
|
+
export { default as validateFields } from './validateFields';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given number or string representation of a number is a decimal.
|
|
3
|
+
*
|
|
4
|
+
* @param number - The number or string representation of a number to check.
|
|
5
|
+
* @returns A boolean indicating whether the number is a decimal or not.
|
|
6
|
+
*/
|
|
7
|
+
declare const isDecimal: (number: number | string) => boolean;
|
|
8
|
+
export default isDecimal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given number or string representation of a number is a decimal.
|
|
3
|
+
*
|
|
4
|
+
* @param number - The number or string representation of a number to check.
|
|
5
|
+
* @returns A boolean indicating whether the number is a decimal or not.
|
|
6
|
+
*/
|
|
7
|
+
const isDecimal = number =>
|
|
8
|
+
typeof number !== 'string' && number.toString().indexOf('.') !== -1;
|
|
9
|
+
export default isDecimal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given string is a valid email address.
|
|
3
|
+
*
|
|
4
|
+
* @param email - The email address to validate.
|
|
5
|
+
* @returns `true` if the email is valid, `false` otherwise.
|
|
6
|
+
* @throws {LesgoException} If the `email` parameter is empty.
|
|
7
|
+
*/
|
|
8
|
+
declare const isEmail: (email: string) => boolean;
|
|
9
|
+
export default isEmail;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import isEmpty from './isEmpty';
|
|
2
2
|
import LesgoException from '../exceptions/LesgoException';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a given string is a valid email address.
|
|
5
|
+
*
|
|
6
|
+
* @param email - The email address to validate.
|
|
7
|
+
* @returns `true` if the email is valid, `false` otherwise.
|
|
8
|
+
* @throws {LesgoException} If the `email` parameter is empty.
|
|
9
|
+
*/
|
|
10
|
+
const isEmail = email => {
|
|
5
11
|
const pattern = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,5}$/; // eslint-disable-line no-useless-escape
|
|
6
|
-
|
|
7
12
|
if (isEmpty(email)) {
|
|
8
13
|
throw new LesgoException(
|
|
9
14
|
'Empty parameter supplied',
|
|
10
15
|
'IS_EMAIL_EMPTY_PARAMETER'
|
|
11
16
|
);
|
|
12
17
|
}
|
|
13
|
-
|
|
14
18
|
return pattern.test(email);
|
|
15
19
|
};
|
|
20
|
+
export default isEmail;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a value is empty.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The value to check.
|
|
5
|
+
* @returns Returns `true` if the value is empty, otherwise `false`.
|
|
6
|
+
*/
|
|
7
|
+
const isEmpty = value => {
|
|
8
|
+
if (value === undefined || value === null || value === '') {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (typeof value === 'object' && Object.keys(value).length === 0) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
export default isEmpty;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import verifyService from '../../services/JWTService/verify';
|
|
2
|
+
import logger from '../logger';
|
|
3
|
+
const FILE = 'lesgo.utils.jwt.verify';
|
|
4
|
+
const verify = (token, secret, opts) => {
|
|
5
|
+
logger.debug(`${FILE}::REQUEST_RECEIVED`, { token, opts });
|
|
6
|
+
if (token.includes('Bearer')) {
|
|
7
|
+
token = token.replace('Bearer ', '');
|
|
8
|
+
}
|
|
9
|
+
const decoded = verifyService(token, secret, opts);
|
|
10
|
+
return decoded;
|
|
11
|
+
};
|
|
12
|
+
export default verify;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LoggerService } from '../services';
|
|
2
|
+
/**
|
|
3
|
+
* Logger module for handling application logs.
|
|
4
|
+
*
|
|
5
|
+
* @module logger
|
|
6
|
+
*
|
|
7
|
+
* @usage
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import logger from './utils/logger';
|
|
10
|
+
*
|
|
11
|
+
* logger.error('This is an error message');
|
|
12
|
+
* logger.warn('This is a warning message');
|
|
13
|
+
* logger.info('This is an info message');
|
|
14
|
+
* logger.debug('This is a debug message');
|
|
15
|
+
* logger.notice('This is a notice message');
|
|
16
|
+
* logger.log('info', 'This is a log message');
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const logger: LoggerService;
|
|
20
|
+
export default logger;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import appConfig from '../config/app';
|
|
2
|
+
import { LoggerService } from '../services';
|
|
3
|
+
const transports = [
|
|
4
|
+
{
|
|
5
|
+
logType: 'console',
|
|
6
|
+
level: appConfig.debug ? 'debug' : 'info',
|
|
7
|
+
config: {
|
|
8
|
+
getCreatedAt: true,
|
|
9
|
+
tags: {
|
|
10
|
+
env: appConfig.env,
|
|
11
|
+
service: appConfig.name,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
const loggerOptions = {
|
|
17
|
+
defaultMeta: {},
|
|
18
|
+
transports,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Logger module for handling application logs.
|
|
22
|
+
*
|
|
23
|
+
* @module logger
|
|
24
|
+
*
|
|
25
|
+
* @usage
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import logger from './utils/logger';
|
|
28
|
+
*
|
|
29
|
+
* logger.error('This is an error message');
|
|
30
|
+
* logger.warn('This is a warning message');
|
|
31
|
+
* logger.info('This is an info message');
|
|
32
|
+
* logger.debug('This is a debug message');
|
|
33
|
+
* logger.notice('This is a notice message');
|
|
34
|
+
* logger.log('info', 'This is a log message');
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const logger = new LoggerService(loggerOptions);
|
|
38
|
+
export default logger;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetSignedUrlOptions } from '../../services/S3Service/getDownloadSignedUrl';
|
|
2
|
+
import { GetObjectOptions } from '../../services/S3Service/getObject';
|
|
3
|
+
import { ClientOptions } from '../../types/aws';
|
|
4
|
+
declare const getDownloadSignedUrl: (key: string, opts?: GetObjectOptions, signingOpts?: GetSignedUrlOptions, clientOpts?: ClientOptions) => Promise<string>;
|
|
5
|
+
export default getDownloadSignedUrl;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __awaiter =
|
|
2
|
+
(this && this.__awaiter) ||
|
|
3
|
+
function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P
|
|
6
|
+
? value
|
|
7
|
+
: new P(function (resolve) {
|
|
8
|
+
resolve(value);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function rejected(value) {
|
|
20
|
+
try {
|
|
21
|
+
step(generator['throw'](value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function step(result) {
|
|
27
|
+
result.done
|
|
28
|
+
? resolve(result.value)
|
|
29
|
+
: adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
import getDownloadSignedUrlService from '../../services/S3Service/getDownloadSignedUrl';
|
|
35
|
+
const getDownloadSignedUrl = (key, opts, signingOpts, clientOpts) =>
|
|
36
|
+
__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
return getDownloadSignedUrlService(key, opts, signingOpts, clientOpts);
|
|
38
|
+
});
|
|
39
|
+
export default getDownloadSignedUrl;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HeadObjectOptions } from '../../services/S3Service/getHeadObject';
|
|
2
|
+
import { ClientOptions } from '../../types/aws';
|
|
3
|
+
declare const getHeadObject: (key: string, opts?: HeadObjectOptions, clientOpts?: ClientOptions) => Promise<{
|
|
4
|
+
LastModified: Date | undefined;
|
|
5
|
+
ContentLength: number | undefined;
|
|
6
|
+
ETag: string | undefined;
|
|
7
|
+
ContentType: string | undefined;
|
|
8
|
+
Metadata: Record<string, string> | undefined;
|
|
9
|
+
}>;
|
|
10
|
+
export default getHeadObject;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __awaiter =
|
|
2
|
+
(this && this.__awaiter) ||
|
|
3
|
+
function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P
|
|
6
|
+
? value
|
|
7
|
+
: new P(function (resolve) {
|
|
8
|
+
resolve(value);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function rejected(value) {
|
|
20
|
+
try {
|
|
21
|
+
step(generator['throw'](value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function step(result) {
|
|
27
|
+
result.done
|
|
28
|
+
? resolve(result.value)
|
|
29
|
+
: adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
import getHeadObjectService from '../../services/S3Service/getHeadObject';
|
|
35
|
+
const getHeadObject = (key, opts, clientOpts) =>
|
|
36
|
+
__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
return getHeadObjectService(key, opts, clientOpts);
|
|
38
|
+
});
|
|
39
|
+
export default getHeadObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { GetObjectOptions } from '../../services/S3Service/getObject';
|
|
3
|
+
import { ClientOptions } from '../../types/aws';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves an object from S3 based on the provided key.
|
|
6
|
+
*
|
|
7
|
+
* @param key - The key of the object to retrieve.
|
|
8
|
+
* @param opts - Optional parameters for retrieving the object.
|
|
9
|
+
* @param clientOpts - Optional client options for the S3 client.
|
|
10
|
+
* @returns A Promise that resolves to the body of the retrieved object.
|
|
11
|
+
*/
|
|
12
|
+
declare const getObject: (key: string, opts?: GetObjectOptions, clientOpts?: ClientOptions) => Promise<Buffer>;
|
|
13
|
+
export default getObject;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __awaiter =
|
|
2
|
+
(this && this.__awaiter) ||
|
|
3
|
+
function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P
|
|
6
|
+
? value
|
|
7
|
+
: new P(function (resolve) {
|
|
8
|
+
resolve(value);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function rejected(value) {
|
|
20
|
+
try {
|
|
21
|
+
step(generator['throw'](value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function step(result) {
|
|
27
|
+
result.done
|
|
28
|
+
? resolve(result.value)
|
|
29
|
+
: adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
import getObjectService, {
|
|
35
|
+
streamToBuffer,
|
|
36
|
+
} from '../../services/S3Service/getObject';
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves an object from S3 based on the provided key.
|
|
39
|
+
*
|
|
40
|
+
* @param key - The key of the object to retrieve.
|
|
41
|
+
* @param opts - Optional parameters for retrieving the object.
|
|
42
|
+
* @param clientOpts - Optional client options for the S3 client.
|
|
43
|
+
* @returns A Promise that resolves to the body of the retrieved object.
|
|
44
|
+
*/
|
|
45
|
+
const getObject = (key, opts, clientOpts) =>
|
|
46
|
+
__awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
const { Body } = yield getObjectService(key, opts, clientOpts);
|
|
48
|
+
const objectBody = yield streamToBuffer(Body);
|
|
49
|
+
return objectBody;
|
|
50
|
+
});
|
|
51
|
+
export default getObject;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetSignedUrlOptions } from '../../services/S3Service/getUploadSignedUrl';
|
|
2
|
+
import { ClientOptions } from '../../types/aws';
|
|
3
|
+
import { PutObjectOptions } from '../../services/S3Service/putObject';
|
|
4
|
+
declare const getUploadSignedUrl: (key: string, opts?: PutObjectOptions, signingOpts?: GetSignedUrlOptions, clientOpts?: ClientOptions) => Promise<string>;
|
|
5
|
+
export default getUploadSignedUrl;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __awaiter =
|
|
2
|
+
(this && this.__awaiter) ||
|
|
3
|
+
function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) {
|
|
5
|
+
return value instanceof P
|
|
6
|
+
? value
|
|
7
|
+
: new P(function (resolve) {
|
|
8
|
+
resolve(value);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function rejected(value) {
|
|
20
|
+
try {
|
|
21
|
+
step(generator['throw'](value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function step(result) {
|
|
27
|
+
result.done
|
|
28
|
+
? resolve(result.value)
|
|
29
|
+
: adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
import getUploadSignedUrlService from '../../services/S3Service/getUploadSignedUrl';
|
|
35
|
+
const getUploadSignedUrl = (key, opts, signingOpts, clientOpts) =>
|
|
36
|
+
__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
return getUploadSignedUrlService(key, opts, signingOpts, clientOpts);
|
|
38
|
+
});
|
|
39
|
+
export default getUploadSignedUrl;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as getClient } from './getClient';
|
|
2
|
+
export { default as getObject } from './getObject';
|
|
3
|
+
export { default as getHeadObject } from './getHeadObject';
|
|
4
|
+
export { default as getDownloadSignedUrl } from './getDownloadSignedUrl';
|
|
5
|
+
export { default as getUploadSignedUrl } from './getUploadSignedUrl';
|
|
6
|
+
export { default as putObject } from './putObject';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as getClient } from './getClient';
|
|
2
|
+
export { default as getObject } from './getObject';
|
|
3
|
+
export { default as getHeadObject } from './getHeadObject';
|
|
4
|
+
export { default as getDownloadSignedUrl } from './getDownloadSignedUrl';
|
|
5
|
+
export { default as getUploadSignedUrl } from './getUploadSignedUrl';
|
|
6
|
+
export { default as putObject } from './putObject';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PutObjectOptions } from '../../services/S3Service/putObject';
|
|
3
|
+
import { ClientOptions } from '../../types/aws';
|
|
4
|
+
declare const putObject: (key: string, file: Buffer | Uint8Array | Blob | string, opts?: PutObjectOptions, clientOpts?: ClientOptions) => Promise<import("@aws-sdk/client-s3").PutObjectCommandOutput>;
|
|
5
|
+
export default putObject;
|