@aws-sdk/add-glacier-checksum-headers-node
Advanced tools
Comparing version 0.1.0-preview.4 to 0.1.0-preview.5
/// <reference types="node" /> | ||
import { Readable } from 'stream'; | ||
import { BuildHandler, BuildHandlerArguments, Decoder, HashConstructor } from '@aws-sdk/types'; | ||
import { Readable } from "stream"; | ||
import { BuildHandler, BuildHandlerArguments, Decoder, HashConstructor } from "@aws-sdk/types"; | ||
export declare function addChecksumHeaders(Sha256: HashConstructor, fromUtf8: Decoder): (next: BuildHandler<any, any, Readable>) => ({ request: { body, headers, ...requestRest }, ...rest }: BuildHandlerArguments<any, Readable>) => Promise<any>; |
@@ -18,9 +18,9 @@ "use strict"; | ||
if (!body) return [3 /*break*/, 10]; | ||
treeHash_1 = !('x-amz-sha256-tree-hash' in headers) | ||
treeHash_1 = !("x-amz-sha256-tree-hash" in headers) | ||
? new sha256_tree_hash_1.TreeHash(Sha256, fromUtf8) | ||
: null; | ||
contentHash_1 = !('x-amz-content-sha256' in headers) | ||
contentHash_1 = !("x-amz-content-sha256" in headers) | ||
? new Sha256() | ||
: null; | ||
if (!(typeof body === 'string' || | ||
if (!(typeof body === "string" || | ||
ArrayBuffer.isView(body) || | ||
@@ -34,3 +34,3 @@ is_array_buffer_1.isArrayBuffer(body))) return [3 /*break*/, 1]; | ||
if (!isReadStream(body)) { | ||
throw new Error('Unable to calculate checksums for non-file streams.'); | ||
throw new Error("Unable to calculate checksums for non-file streams."); | ||
} | ||
@@ -51,4 +51,4 @@ bodyTee = fs_1.createReadStream(body.path, { | ||
_e = tslib_1.__values([ | ||
['x-amz-content-sha256', contentHash_1], | ||
['x-amz-sha256-tree-hash', treeHash_1], | ||
["x-amz-content-sha256", contentHash_1], | ||
["x-amz-sha256-tree-hash", treeHash_1] | ||
]), _f = _e.next(); | ||
@@ -89,4 +89,4 @@ _l.label = 4; | ||
function isReadStream(stream) { | ||
return typeof stream.path === 'string'; | ||
return typeof stream.path === "string"; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2Z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iBEZWNvZGVyLFxuKSB7XG4gICAgcmV0dXJuIChuZXh0OiBCdWlsZEhhbmRsZXI8YW55LCBhbnksIFJlYWRhYmxlPikgPT4gYXN5bmMgKHtcbiAgICAgICAgcmVxdWVzdDogeyBib2R5LCBoZWFkZXJzLCAuLi5yZXF1ZXN0UmVzdCB9LFxuICAgICAgICAuLi5yZXN0XG4gICAgfTogQnVpbGRIYW5kbGVyQXJndW1lbnRzPGFueSwgUmVhZGFibGU+KSA9PiB7XG4gICAgICAgIGlmIChib2R5KSB7XG4gICAgICAgICAgICBjb25zdCB0cmVlSGFzaCA9ICEoJ3gtYW16LXNoYTI1Ni10cmVlLWhhc2gnIGluIGhlYWRlcnMpXG4gICAgICAgICAgICAgICAgPyBuZXcgVHJlZUhhc2goU2hhMjU2LCBmcm9tVXRmOClcbiAgICAgICAgICAgICAgICA6IG51bGw7XG4gICAgICAgICAgICBjb25zdCBjb250ZW50SGFzaCA9ICEoJ3gtYW16LWNvbnRlbnQtc2hhMjU2JyBpbiBoZWFkZXJzKVxuICAgICAgICAgICAgICAgID8gbmV3IFNoYTI1NigpXG4gICAgICAgICAgICAgICAgOiBudWxsO1xuXG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgdHlwZW9mIGJvZHkgPT09ICdzdHJpbmcnIHx8XG4gICAgICAgICAgICAgICAgQXJyYXlCdWZmZXIuaXNWaWV3KGJvZHkpIHx8XG4gICAgICAgICAgICAgICAgaXNBcnJheUJ1ZmZlcihib2R5KVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgY29udGVudEhhc2ggJiYgY29udGVudEhhc2gudXBkYXRlKGJvZHkpO1xuICAgICAgICAgICAgICAgIHRyZWVIYXNoICYmIHRyZWVIYXNoLnVwZGF0ZShib2R5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gZXZlbnR1YWxseSB3ZSdsbCB3YW50IHRvIHN1cHBvcnQgcmV3aW5kYWJsZSBzdHJlYW1zIGFzIHdlbGxcbiAgICAgICAgICAgICAgICBpZiAoIWlzUmVhZFN0cmVhbShib2R5KSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAnVW5hYmxlIHRvIGNhbGN1bGF0ZSBjaGVja3N1bXMgZm9yIG5vbi1maWxlIHN0cmVhbXMuJ1xuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25zdCBib2R5VGVlID0gY3JlYXRlUmVhZFN0cmVhbShib2R5LnBhdGgsIHtcbiAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IChib2R5IGFzIGFueSkuc3RhcnQsXG4gICAgICAgICAgICAgICAgICAgIGVuZDogKGJvZHkgYXMgYW55KS5lbmRcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIGF3YWl0IHN0cmVhbVJlYWRlcihcbiAgICAgICAgICAgICAgICAgICAgYm9keVRlZSxcbiAgICAgICAgICAgICAgICAgICAgKGNodW5rKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmVlSGFzaCAmJiB0cmVlSGFzaC51cGRhdGUoY2h1bmspO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudEhhc2ggJiYgY29udGVudEhhc2gudXBkYXRlKGNodW5rKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAoY29uc3QgW2hlYWRlck5hbWUsIGhhc2hdIG9mIDxBcnJheTxbc3RyaW5nLCBIYXNoXT4+W1xuICAgICAgICAgICAgICAgIFsneC1hbXotY29udGVudC1zaGEyNTYnLCBjb250ZW50SGFzaF0sXG4gICAgICAgICAgICAgICAgWyd4LWFtei1zaGEyNTYtdHJlZS1oYXNoJywgdHJlZUhhc2hdLFxuICAgICAgICAgICAgXSkge1xuICAgICAgICAgICAgICAgIGlmIChoYXNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAuLi5oZWFkZXJzLFxuICAgICAgICAgICAgICAgICAgICAgICAgW2hlYWRlck5hbWVdOiB0b0hleChhd2FpdCBoYXNoLmRpZ2VzdCgpKSxcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBuZXh0KHtcbiAgICAgICAgICAgIC4uLnJlc3QsXG4gICAgICAgICAgICByZXF1ZXN0OiB7XG4gICAgICAgICAgICAgICAgLi4ucmVxdWVzdFJlc3QsXG4gICAgICAgICAgICAgICAgaGVhZGVycyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxufVxuXG5mdW5jdGlvbiBpc1JlYWRTdHJlYW0oc3RyZWFtOiBSZWFkYWJsZSk6IHN0cmVhbSBpcyBSZWFkU3RyZWFtIHtcbiAgICByZXR1cm4gdHlwZW9mIChzdHJlYW0gYXMgUmVhZFN0cmVhbSkucGF0aCA9PT0gJ3N0cmluZyc7XG59XG4iXX0= | ||
//# sourceMappingURL=index.js.map |
@@ -6,12 +6,24 @@ # Change Log | ||
# [0.1.0-preview.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.3...@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.4) (2019-04-19) | ||
# [0.1.0-preview.5](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.3...@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.5) (2019-07-12) | ||
**Note:** Version bump only for package @aws-sdk/add-glacier-checksum-headers-node | ||
### Features | ||
* add npm badges for individual packages ([#251](https://github.com/aws/aws-sdk-js-v3/issues/251)) ([8adc10c](https://github.com/aws/aws-sdk-js-v3/commit/8adc10c)) | ||
* update jest v20 to v24 ([#243](https://github.com/aws/aws-sdk-js-v3/issues/243)) ([1e156ab](https://github.com/aws/aws-sdk-js-v3/commit/1e156ab)) | ||
# 0.1.0 (2019-04-19) | ||
# [0.1.0-preview.4](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.3...@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.4) (2019-04-19) | ||
**Note:** Version bump only for package @aws-sdk/add-glacier-checksum-headers-node | ||
# [0.1.0-preview.3](https://github.com/aws/aws-sdk-js-v3/compare/@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.2...@aws-sdk/add-glacier-checksum-headers-node@0.1.0-preview.3) (2019-03-27) | ||
**Note:** Version bump only for package @aws-sdk/add-glacier-checksum-headers-node |
{ | ||
"name": "@aws-sdk/add-glacier-checksum-headers-node", | ||
"version": "0.1.0-preview.4", | ||
"scripts": { | ||
"prepublishOnly": "tsc", | ||
"pretest": "tsc -p tsconfig.test.json", | ||
"test": "jest" | ||
}, | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"author": { | ||
"name": "AWS SDK for JavaScript Team", | ||
"email": "aws-sdk-js@amazon.com", | ||
"url": "https://aws.amazon.com/javascript/" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@aws-sdk/chunked-stream-reader-node": "^0.1.0-preview.1", | ||
"@aws-sdk/is-array-buffer": "^0.1.0-preview.1", | ||
"@aws-sdk/sha256-tree-hash": "^0.1.0-preview.4", | ||
"@aws-sdk/types": "^0.1.0-preview.3", | ||
"@aws-sdk/util-hex-encoding": "^0.1.0-preview.1", | ||
"tslib": "^1.8.0" | ||
}, | ||
"devDependencies": { | ||
"@aws-crypto/sha256-js": "^0.1.0-preview.1", | ||
"@aws-sdk/util-utf8-node": "^0.1.0-preview.1", | ||
"@types/jest": "^20.0.2", | ||
"@types/node": "^8.10.29", | ||
"jest": "^20.0.4", | ||
"typescript": "^3.0.0" | ||
} | ||
"name": "@aws-sdk/add-glacier-checksum-headers-node", | ||
"version": "0.1.0-preview.5", | ||
"scripts": { | ||
"prepublishOnly": "tsc", | ||
"pretest": "tsc -p tsconfig.test.json", | ||
"test": "jest" | ||
}, | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"author": { | ||
"name": "AWS SDK for JavaScript Team", | ||
"email": "", | ||
"url": "https://aws.amazon.com/javascript/" | ||
}, | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@aws-sdk/chunked-stream-reader-node": "^0.1.0-preview.2", | ||
"@aws-sdk/is-array-buffer": "^0.1.0-preview.2", | ||
"@aws-sdk/sha256-tree-hash": "^0.1.0-preview.5", | ||
"@aws-sdk/types": "^0.1.0-preview.4", | ||
"@aws-sdk/util-hex-encoding": "^0.1.0-preview.2", | ||
"tslib": "^1.8.0" | ||
}, | ||
"devDependencies": { | ||
"@aws-crypto/sha256-js": "^0.1.0-preview.1", | ||
"@aws-sdk/util-utf8-node": "^0.1.0-preview.2", | ||
"@types/jest": "^24.0.12", | ||
"@types/node": "^10.0.0", | ||
"jest": "^24.7.1", | ||
"typescript": "~3.4.0" | ||
} | ||
} |
@@ -1,1 +0,4 @@ | ||
# add-glacier-checksum-headers-node | ||
# @aws-sdk/add-glacier-checksum-headers-node | ||
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/add-glacier-checksum-headers-node/preview.svg)](https://www.npmjs.com/package/@aws-sdk/add-glacier-checksum-headers-node) | ||
[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/add-glacier-checksum-headers-node.svg)](https://www.npmjs.com/package/@aws-sdk/add-glacier-checksum-headers-node) |
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"strict": true, | ||
"sourceMap": true, | ||
"downlevelIteration": true, | ||
"importHelpers": true, | ||
"noEmitHelpers": true, | ||
"lib": [ | ||
"es5", | ||
"es2015.promise", | ||
"es2015.collection", | ||
"es2015.iterable", | ||
"es2015.symbol.wellknown" | ||
], | ||
"rootDir": "./src", | ||
"outDir": "./build" | ||
} | ||
} | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"strict": true, | ||
"sourceMap": true, | ||
"downlevelIteration": true, | ||
"importHelpers": true, | ||
"noEmitHelpers": true, | ||
"lib": [ | ||
"es5", | ||
"es2015.promise", | ||
"es2015.collection", | ||
"es2015.iterable", | ||
"es2015.symbol.wellknown" | ||
], | ||
"rootDir": "./src", | ||
"outDir": "./build" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9
116
5
21153