express-sharp
Advanced tools
Comparing version 4.2.39 to 4.2.40
@@ -0,1 +1,10 @@ | ||
## [4.2.40](https://github.com/pmb0/express-sharp/compare/v4.2.39...v4.2.40) (2021-10-18) | ||
### Bug Fixes | ||
* import optional deps gracefully ([#554](https://github.com/pmb0/express-sharp/issues/554)) ([e2254dc](https://github.com/pmb0/express-sharp/commit/e2254dc0c1528f709f61ca50a61691218603aed7)) | ||
* keyv is a prod dependency ([4998f56](https://github.com/pmb0/express-sharp/commit/4998f566399b44893df889f68d0d78845d1ecc5a)) | ||
* upgrade deps ([972babb](https://github.com/pmb0/express-sharp/commit/972babbf2a701bd0b78feffbaa07883735a5c9e1)) | ||
## [4.2.39](https://github.com/pmb0/express-sharp/compare/v4.2.38...v4.2.39) (2021-09-05) | ||
@@ -2,0 +11,0 @@ |
/// <reference types="node" /> | ||
import type { ExtendOptions } from 'got'; | ||
import { ImageAdapter } from '../interfaces'; | ||
import { ExtendOptions } from 'got'; | ||
export declare class HttpAdapter implements ImageAdapter { | ||
@@ -5,0 +5,0 @@ private client; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HttpAdapter = void 0; | ||
const got_1 = __importDefault(require("got")); | ||
const logger_1 = require("../logger"); | ||
const optional_require_1 = require("../optional-require"); | ||
class HttpAdapter { | ||
constructor(gotOptions) { | ||
this.log = (0, logger_1.getLogger)('adapter:http'); | ||
this.client = got_1.default.extend({ | ||
const got = (0, optional_require_1.optionalRequire)('got').default; | ||
this.client = got.extend({ | ||
...gotOptions, | ||
@@ -14,0 +12,0 @@ }); |
/// <reference types="node" /> | ||
import { S3 } from 'aws-sdk'; | ||
import type { S3 as S3Type } from 'aws-sdk'; | ||
import { ImageAdapter } from '../interfaces'; | ||
export declare class S3Adapter implements ImageAdapter { | ||
readonly bucketName: string; | ||
private readonly s3client; | ||
private readonly s3client?; | ||
private log; | ||
constructor(bucketName: string, s3client?: S3); | ||
constructor(bucketName: string, s3client?: S3Type | undefined); | ||
fetch(id: string): Promise<Buffer | undefined>; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.S3Adapter = void 0; | ||
const aws_sdk_1 = require("aws-sdk"); | ||
const logger_1 = require("../logger"); | ||
const optional_require_1 = require("../optional-require"); | ||
class S3Adapter { | ||
constructor(bucketName, s3client = new aws_sdk_1.S3()) { | ||
constructor(bucketName, s3client) { | ||
var _a; | ||
this.bucketName = bucketName; | ||
this.s3client = s3client; | ||
this.log = (0, logger_1.getLogger)('adapter:s3'); | ||
const { S3 } = (0, optional_require_1.optionalRequire)('aws-sdk'); | ||
(_a = this.s3client) !== null && _a !== void 0 ? _a : (this.s3client = new S3()); | ||
this.log(`Using bucket name: ${bucketName}`); | ||
@@ -16,5 +19,7 @@ } | ||
try { | ||
const object = await this.s3client | ||
.getObject({ Bucket: this.bucketName, Key: id }) | ||
.promise(); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const object = await this.s3client.getObject({ | ||
Bucket: this.bucketName, | ||
Key: id, | ||
}).promise(); | ||
if (!Buffer.isBuffer(object.Body)) { | ||
@@ -21,0 +26,0 @@ return undefined; |
@@ -32,1 +32,4 @@ /// <reference types="node" /> | ||
} | ||
export interface Type<T = unknown> extends Function { | ||
new (...args: unknown[]): T; | ||
} |
{ | ||
"name": "express-sharp", | ||
"version": "4.2.39", | ||
"version": "4.2.40", | ||
"description": "Real-time image processing for your express application", | ||
@@ -13,16 +13,17 @@ "main": "dist/index.js", | ||
"etag": "^1.8.1", | ||
"keyv": "^4.0.3", | ||
"reflect-metadata": "^0.1.13", | ||
"sharp": "^0.29.0", | ||
"sharp": "^0.29.1", | ||
"tsyringe": "^4.6.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^13.1.0", | ||
"@commitlint/config-conventional": "^13.1.0", | ||
"@heise/eslint-config": "^19.0.4", | ||
"@keyv/redis": "^2.1.2", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/commit-analyzer": "^8.0.1", | ||
"@semantic-release/git": "^9.0.1", | ||
"@semantic-release/npm": "^7.1.3", | ||
"@semantic-release/release-notes-generator": "^9.0.3", | ||
"@commitlint/cli": "^13.2.1", | ||
"@commitlint/config-conventional": "^13.2.0", | ||
"@heise/eslint-config": "^19.0.13", | ||
"@keyv/redis": "^2.1.3", | ||
"@semantic-release/changelog": "^6.0.0", | ||
"@semantic-release/commit-analyzer": "^9.0.1", | ||
"@semantic-release/git": "^10.0.0", | ||
"@semantic-release/npm": "^8.0.1", | ||
"@semantic-release/release-notes-generator": "^10.0.2", | ||
"@types/cache-manager": "^3.4.2", | ||
@@ -34,8 +35,8 @@ "@types/cors": "^2.8.12", | ||
"@types/got": "^9.6.12", | ||
"@types/jest": "^27.0.1", | ||
"@types/keyv": "^3.1.2", | ||
"@types/node": "^14.17.14", | ||
"@types/sharp": "^0.28.6", | ||
"@types/jest": "^27.0.2", | ||
"@types/keyv": "^3.1.3", | ||
"@types/node": "^14.17.27", | ||
"@types/sharp": "^0.29.2", | ||
"@types/supertest": "^2.0.11", | ||
"aws-sdk": "^2.983.0", | ||
"aws-sdk": "^2.1009.0", | ||
"eslint-plugin-no-only-tests": "^2.6.0", | ||
@@ -46,14 +47,13 @@ "eslint-plugin-sort-keys-fix": "^1.1.2", | ||
"husky": "^7.0.2", | ||
"jest": "^27.1.0", | ||
"keyv": "^4.0.3", | ||
"lint-staged": "^11.1.2", | ||
"nodemon": "^2.0.12", | ||
"prettier": "^2.3.2", | ||
"jest": "^27.3.0", | ||
"lint-staged": "^11.2.3", | ||
"nodemon": "^2.0.13", | ||
"prettier": "^2.4.1", | ||
"pug": "^3.0.2", | ||
"rimraf": "^3.0.2", | ||
"semantic-release": "^17.4.7", | ||
"semantic-release": "^18.0.0", | ||
"supertest": "^6.1.6", | ||
"ts-jest": "^27.0.5", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.4.2" | ||
"ts-jest": "^27.0.7", | ||
"ts-node": "^10.3.0", | ||
"typescript": "^4.4.4" | ||
}, | ||
@@ -60,0 +60,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
94354
37
85
1102
12
3
+ Addedkeyv@^4.0.3
+ Added@types/node@22.13.2(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedfor-each@0.3.5(transitive)
- Removed@types/node@22.13.1(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedfor-each@0.3.4(transitive)
Updatedsharp@^0.29.1