@cdklabs/cdk-ecs-codedeploy 0.0.265 → 0.0.267
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/.jsii +2 -2
- package/.jsii.tabl.json +1 -1
- package/lib/api-canary/index.js +1 -1
- package/lib/ecs-appspec/index.js +1 -1
- package/lib/ecs-deployment/index.js +1 -1
- package/lib/ecs-patterns/application-load-balanced-codedeployed-fargate-service.js +1 -1
- package/node_modules/@smithy/core/package.json +4 -4
- package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +3 -3
- package/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js +3 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +1 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/CHANGELOG.md +45 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/README.md +36 -75
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/index.js +79 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/md5.js +223 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/native.js +11 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/nil.js +8 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/parse.js +45 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/regex.js +8 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/rng.js +25 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/sha1.js +104 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/stringify.js +44 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/v1.js +107 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/v3.js +16 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/v35.js +80 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/v4.js +43 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/v5.js +16 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/validate.js +17 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/commonjs-browser/version.js +21 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/md5.js +23 -23
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/parse.js +2 -2
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/rng.js +4 -5
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/sha1.js +26 -26
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/stringify.js +9 -6
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/v1.js +17 -17
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/v3.js +1 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/v35.js +12 -10
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/v4.js +9 -4
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/v5.js +1 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-browser/version.js +1 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-node/stringify.js +7 -3
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-node/v1.js +2 -2
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-node/v35.js +6 -4
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-node/v4.js +7 -2
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/esm-node/version.js +1 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/index.js +18 -18
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/native-browser.js +11 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/native.js +15 -0
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/rng-browser.js +2 -3
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/stringify.js +8 -3
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/v1.js +2 -2
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/v35.js +7 -5
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/v4.js +8 -2
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/version.js +1 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/package.json +41 -41
- package/node_modules/@smithy/middleware-retry/package.json +3 -3
- package/node_modules/@smithy/signature-v4/dist-cjs/index.js +128 -7
- package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +125 -0
- package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +4 -4
- package/node_modules/@smithy/signature-v4/dist-types/HeaderFormatter.d.ts +24 -0
- package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +1 -1
- package/node_modules/@smithy/signature-v4/dist-types/ts3.4/HeaderFormatter.d.ts +24 -0
- package/node_modules/@smithy/signature-v4/dist-types/ts3.4/SignatureV4.d.ts +1 -1
- package/node_modules/@smithy/signature-v4/package.json +1 -2
- package/node_modules/@smithy/smithy-client/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/package.json +4 -4
- package/node_modules/@aws-crypto/crc32/CHANGELOG.md +0 -76
- package/node_modules/@aws-crypto/crc32/LICENSE +0 -201
- package/node_modules/@aws-crypto/crc32/README.md +0 -16
- package/node_modules/@aws-crypto/crc32/build/aws_crc32.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/aws_crc32.js +0 -31
- package/node_modules/@aws-crypto/crc32/build/aws_crc32.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/build/index.d.ts +0 -7
- package/node_modules/@aws-crypto/crc32/build/index.js +0 -108
- package/node_modules/@aws-crypto/crc32/build/index.js.map +0 -1
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/LICENSE.txt +0 -12
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/README.md +0 -142
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/modules/index.js +0 -51
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/modules/package.json +0 -3
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/package.json +0 -37
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js +0 -23
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json +0 -6
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/tslib.d.ts +0 -37
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/tslib.es6.html +0 -1
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/tslib.es6.js +0 -218
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/tslib.html +0 -1
- package/node_modules/@aws-crypto/crc32/node_modules/tslib/tslib.js +0 -284
- package/node_modules/@aws-crypto/crc32/package.json +0 -28
- package/node_modules/@aws-crypto/crc32/src/aws_crc32.ts +0 -24
- package/node_modules/@aws-crypto/crc32/src/index.ts +0 -92
- package/node_modules/@aws-crypto/crc32/tsconfig.json +0 -23
- package/node_modules/@smithy/eventstream-codec/LICENSE +0 -201
- package/node_modules/@smithy/eventstream-codec/README.md +0 -4
- package/node_modules/@smithy/eventstream-codec/dist-cjs/HeaderMarshaller.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/Int64.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/Message.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/MessageDecoderStream.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/MessageEncoderStream.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/SmithyMessageDecoderStream.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/SmithyMessageEncoderStream.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/TestVectors.fixture.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/index.js +0 -468
- package/node_modules/@smithy/eventstream-codec/dist-cjs/splitMessage.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-cjs/vectorTypes.fixture.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js +0 -62
- package/node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js +0 -182
- package/node_modules/@smithy/eventstream-codec/dist-es/Int64.js +0 -43
- package/node_modules/@smithy/eventstream-codec/dist-es/Message.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js +0 -14
- package/node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js +0 -16
- package/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js +0 -14
- package/node_modules/@smithy/eventstream-codec/dist-es/TestVectors.fixture.js +0 -690
- package/node_modules/@smithy/eventstream-codec/dist-es/index.js +0 -8
- package/node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js +0 -30
- package/node_modules/@smithy/eventstream-codec/dist-es/vectorTypes.fixture.js +0 -1
- package/node_modules/@smithy/eventstream-codec/dist-types/EventStreamCodec.d.ts +0 -31
- package/node_modules/@smithy/eventstream-codec/dist-types/HeaderMarshaller.d.ts +0 -12
- package/node_modules/@smithy/eventstream-codec/dist-types/Int64.d.ts +0 -20
- package/node_modules/@smithy/eventstream-codec/dist-types/Message.d.ts +0 -26
- package/node_modules/@smithy/eventstream-codec/dist-types/MessageDecoderStream.d.ts +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-types/MessageEncoderStream.d.ts +0 -18
- package/node_modules/@smithy/eventstream-codec/dist-types/SmithyMessageDecoderStream.d.ts +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-types/SmithyMessageEncoderStream.d.ts +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-types/TestVectors.fixture.d.ts +0 -2
- package/node_modules/@smithy/eventstream-codec/dist-types/index.d.ts +0 -8
- package/node_modules/@smithy/eventstream-codec/dist-types/splitMessage.d.ts +0 -11
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/EventStreamCodec.d.ts +0 -31
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/HeaderMarshaller.d.ts +0 -12
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/Int64.d.ts +0 -20
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/Message.d.ts +0 -26
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/MessageDecoderStream.d.ts +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/MessageEncoderStream.d.ts +0 -18
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/SmithyMessageDecoderStream.d.ts +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/SmithyMessageEncoderStream.d.ts +0 -17
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/TestVectors.fixture.d.ts +0 -2
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/index.d.ts +0 -8
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/splitMessage.d.ts +0 -11
- package/node_modules/@smithy/eventstream-codec/dist-types/ts3.4/vectorTypes.fixture.d.ts +0 -12
- package/node_modules/@smithy/eventstream-codec/dist-types/vectorTypes.fixture.d.ts +0 -12
- package/node_modules/@smithy/eventstream-codec/package.json +0 -61
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuid.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidNIL.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidParse.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidStringify.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidValidate.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidVersion.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidv1.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidv3.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidv4.min.js +0 -1
- package/node_modules/@smithy/middleware-retry/node_modules/uuid/dist/umd/uuidv5.min.js +0 -1
- /package/node_modules/@smithy/{eventstream-codec/dist-cjs/EventStreamCodec.js → signature-v4/dist-cjs/HeaderFormatter.js} +0 -0
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { fromHex, toHex } from "@smithy/util-hex-encoding";
|
|
2
|
-
import { Int64 } from "./Int64";
|
|
3
|
-
export class HeaderMarshaller {
|
|
4
|
-
constructor(toUtf8, fromUtf8) {
|
|
5
|
-
this.toUtf8 = toUtf8;
|
|
6
|
-
this.fromUtf8 = fromUtf8;
|
|
7
|
-
}
|
|
8
|
-
format(headers) {
|
|
9
|
-
const chunks = [];
|
|
10
|
-
for (const headerName of Object.keys(headers)) {
|
|
11
|
-
const bytes = this.fromUtf8(headerName);
|
|
12
|
-
chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
|
|
13
|
-
}
|
|
14
|
-
const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
|
|
15
|
-
let position = 0;
|
|
16
|
-
for (const chunk of chunks) {
|
|
17
|
-
out.set(chunk, position);
|
|
18
|
-
position += chunk.byteLength;
|
|
19
|
-
}
|
|
20
|
-
return out;
|
|
21
|
-
}
|
|
22
|
-
formatHeaderValue(header) {
|
|
23
|
-
switch (header.type) {
|
|
24
|
-
case "boolean":
|
|
25
|
-
return Uint8Array.from([header.value ? 0 : 1]);
|
|
26
|
-
case "byte":
|
|
27
|
-
return Uint8Array.from([2, header.value]);
|
|
28
|
-
case "short":
|
|
29
|
-
const shortView = new DataView(new ArrayBuffer(3));
|
|
30
|
-
shortView.setUint8(0, 3);
|
|
31
|
-
shortView.setInt16(1, header.value, false);
|
|
32
|
-
return new Uint8Array(shortView.buffer);
|
|
33
|
-
case "integer":
|
|
34
|
-
const intView = new DataView(new ArrayBuffer(5));
|
|
35
|
-
intView.setUint8(0, 4);
|
|
36
|
-
intView.setInt32(1, header.value, false);
|
|
37
|
-
return new Uint8Array(intView.buffer);
|
|
38
|
-
case "long":
|
|
39
|
-
const longBytes = new Uint8Array(9);
|
|
40
|
-
longBytes[0] = 5;
|
|
41
|
-
longBytes.set(header.value.bytes, 1);
|
|
42
|
-
return longBytes;
|
|
43
|
-
case "binary":
|
|
44
|
-
const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
|
|
45
|
-
binView.setUint8(0, 6);
|
|
46
|
-
binView.setUint16(1, header.value.byteLength, false);
|
|
47
|
-
const binBytes = new Uint8Array(binView.buffer);
|
|
48
|
-
binBytes.set(header.value, 3);
|
|
49
|
-
return binBytes;
|
|
50
|
-
case "string":
|
|
51
|
-
const utf8Bytes = this.fromUtf8(header.value);
|
|
52
|
-
const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
|
|
53
|
-
strView.setUint8(0, 7);
|
|
54
|
-
strView.setUint16(1, utf8Bytes.byteLength, false);
|
|
55
|
-
const strBytes = new Uint8Array(strView.buffer);
|
|
56
|
-
strBytes.set(utf8Bytes, 3);
|
|
57
|
-
return strBytes;
|
|
58
|
-
case "timestamp":
|
|
59
|
-
const tsBytes = new Uint8Array(9);
|
|
60
|
-
tsBytes[0] = 8;
|
|
61
|
-
tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
|
|
62
|
-
return tsBytes;
|
|
63
|
-
case "uuid":
|
|
64
|
-
if (!UUID_PATTERN.test(header.value)) {
|
|
65
|
-
throw new Error(`Invalid UUID received: ${header.value}`);
|
|
66
|
-
}
|
|
67
|
-
const uuidBytes = new Uint8Array(17);
|
|
68
|
-
uuidBytes[0] = 9;
|
|
69
|
-
uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
|
|
70
|
-
return uuidBytes;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
parse(headers) {
|
|
74
|
-
const out = {};
|
|
75
|
-
let position = 0;
|
|
76
|
-
while (position < headers.byteLength) {
|
|
77
|
-
const nameLength = headers.getUint8(position++);
|
|
78
|
-
const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
|
|
79
|
-
position += nameLength;
|
|
80
|
-
switch (headers.getUint8(position++)) {
|
|
81
|
-
case 0:
|
|
82
|
-
out[name] = {
|
|
83
|
-
type: BOOLEAN_TAG,
|
|
84
|
-
value: true,
|
|
85
|
-
};
|
|
86
|
-
break;
|
|
87
|
-
case 1:
|
|
88
|
-
out[name] = {
|
|
89
|
-
type: BOOLEAN_TAG,
|
|
90
|
-
value: false,
|
|
91
|
-
};
|
|
92
|
-
break;
|
|
93
|
-
case 2:
|
|
94
|
-
out[name] = {
|
|
95
|
-
type: BYTE_TAG,
|
|
96
|
-
value: headers.getInt8(position++),
|
|
97
|
-
};
|
|
98
|
-
break;
|
|
99
|
-
case 3:
|
|
100
|
-
out[name] = {
|
|
101
|
-
type: SHORT_TAG,
|
|
102
|
-
value: headers.getInt16(position, false),
|
|
103
|
-
};
|
|
104
|
-
position += 2;
|
|
105
|
-
break;
|
|
106
|
-
case 4:
|
|
107
|
-
out[name] = {
|
|
108
|
-
type: INT_TAG,
|
|
109
|
-
value: headers.getInt32(position, false),
|
|
110
|
-
};
|
|
111
|
-
position += 4;
|
|
112
|
-
break;
|
|
113
|
-
case 5:
|
|
114
|
-
out[name] = {
|
|
115
|
-
type: LONG_TAG,
|
|
116
|
-
value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),
|
|
117
|
-
};
|
|
118
|
-
position += 8;
|
|
119
|
-
break;
|
|
120
|
-
case 6:
|
|
121
|
-
const binaryLength = headers.getUint16(position, false);
|
|
122
|
-
position += 2;
|
|
123
|
-
out[name] = {
|
|
124
|
-
type: BINARY_TAG,
|
|
125
|
-
value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength),
|
|
126
|
-
};
|
|
127
|
-
position += binaryLength;
|
|
128
|
-
break;
|
|
129
|
-
case 7:
|
|
130
|
-
const stringLength = headers.getUint16(position, false);
|
|
131
|
-
position += 2;
|
|
132
|
-
out[name] = {
|
|
133
|
-
type: STRING_TAG,
|
|
134
|
-
value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)),
|
|
135
|
-
};
|
|
136
|
-
position += stringLength;
|
|
137
|
-
break;
|
|
138
|
-
case 8:
|
|
139
|
-
out[name] = {
|
|
140
|
-
type: TIMESTAMP_TAG,
|
|
141
|
-
value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),
|
|
142
|
-
};
|
|
143
|
-
position += 8;
|
|
144
|
-
break;
|
|
145
|
-
case 9:
|
|
146
|
-
const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
|
|
147
|
-
position += 16;
|
|
148
|
-
out[name] = {
|
|
149
|
-
type: UUID_TAG,
|
|
150
|
-
value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,
|
|
151
|
-
};
|
|
152
|
-
break;
|
|
153
|
-
default:
|
|
154
|
-
throw new Error(`Unrecognized header type tag`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return out;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
var HEADER_VALUE_TYPE;
|
|
161
|
-
(function (HEADER_VALUE_TYPE) {
|
|
162
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolTrue"] = 0] = "boolTrue";
|
|
163
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolFalse"] = 1] = "boolFalse";
|
|
164
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byte"] = 2] = "byte";
|
|
165
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["short"] = 3] = "short";
|
|
166
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["integer"] = 4] = "integer";
|
|
167
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["long"] = 5] = "long";
|
|
168
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byteArray"] = 6] = "byteArray";
|
|
169
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["string"] = 7] = "string";
|
|
170
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["timestamp"] = 8] = "timestamp";
|
|
171
|
-
HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["uuid"] = 9] = "uuid";
|
|
172
|
-
})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
|
|
173
|
-
const BOOLEAN_TAG = "boolean";
|
|
174
|
-
const BYTE_TAG = "byte";
|
|
175
|
-
const SHORT_TAG = "short";
|
|
176
|
-
const INT_TAG = "integer";
|
|
177
|
-
const LONG_TAG = "long";
|
|
178
|
-
const BINARY_TAG = "binary";
|
|
179
|
-
const STRING_TAG = "string";
|
|
180
|
-
const TIMESTAMP_TAG = "timestamp";
|
|
181
|
-
const UUID_TAG = "uuid";
|
|
182
|
-
const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { toHex } from "@smithy/util-hex-encoding";
|
|
2
|
-
export class Int64 {
|
|
3
|
-
constructor(bytes) {
|
|
4
|
-
this.bytes = bytes;
|
|
5
|
-
if (bytes.byteLength !== 8) {
|
|
6
|
-
throw new Error("Int64 buffers must be exactly 8 bytes");
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
static fromNumber(number) {
|
|
10
|
-
if (number > 9223372036854776000 || number < -9223372036854776000) {
|
|
11
|
-
throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
|
|
12
|
-
}
|
|
13
|
-
const bytes = new Uint8Array(8);
|
|
14
|
-
for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
|
|
15
|
-
bytes[i] = remaining;
|
|
16
|
-
}
|
|
17
|
-
if (number < 0) {
|
|
18
|
-
negate(bytes);
|
|
19
|
-
}
|
|
20
|
-
return new Int64(bytes);
|
|
21
|
-
}
|
|
22
|
-
valueOf() {
|
|
23
|
-
const bytes = this.bytes.slice(0);
|
|
24
|
-
const negative = bytes[0] & 0b10000000;
|
|
25
|
-
if (negative) {
|
|
26
|
-
negate(bytes);
|
|
27
|
-
}
|
|
28
|
-
return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
|
|
29
|
-
}
|
|
30
|
-
toString() {
|
|
31
|
-
return String(this.valueOf());
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function negate(bytes) {
|
|
35
|
-
for (let i = 0; i < 8; i++) {
|
|
36
|
-
bytes[i] ^= 0xff;
|
|
37
|
-
}
|
|
38
|
-
for (let i = 7; i > -1; i--) {
|
|
39
|
-
bytes[i]++;
|
|
40
|
-
if (bytes[i] !== 0)
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class MessageDecoderStream {
|
|
2
|
-
constructor(options) {
|
|
3
|
-
this.options = options;
|
|
4
|
-
}
|
|
5
|
-
[Symbol.asyncIterator]() {
|
|
6
|
-
return this.asyncIterator();
|
|
7
|
-
}
|
|
8
|
-
async *asyncIterator() {
|
|
9
|
-
for await (const bytes of this.options.inputStream) {
|
|
10
|
-
const decoded = this.options.decoder.decode(bytes);
|
|
11
|
-
yield decoded;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export class MessageEncoderStream {
|
|
2
|
-
constructor(options) {
|
|
3
|
-
this.options = options;
|
|
4
|
-
}
|
|
5
|
-
[Symbol.asyncIterator]() {
|
|
6
|
-
return this.asyncIterator();
|
|
7
|
-
}
|
|
8
|
-
async *asyncIterator() {
|
|
9
|
-
for await (const msg of this.options.messageStream) {
|
|
10
|
-
const encoded = this.options.encoder.encode(msg);
|
|
11
|
-
yield encoded;
|
|
12
|
-
}
|
|
13
|
-
if (this.options.includeEndFrame) {
|
|
14
|
-
yield new Uint8Array(0);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export class SmithyMessageDecoderStream {
|
|
2
|
-
constructor(options) {
|
|
3
|
-
this.options = options;
|
|
4
|
-
}
|
|
5
|
-
[Symbol.asyncIterator]() {
|
|
6
|
-
return this.asyncIterator();
|
|
7
|
-
}
|
|
8
|
-
async *asyncIterator() {
|
|
9
|
-
for await (const message of this.options.messageStream) {
|
|
10
|
-
const deserialized = await this.options.deserializer(message);
|
|
11
|
-
if (deserialized === undefined)
|
|
12
|
-
continue;
|
|
13
|
-
yield deserialized;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class SmithyMessageEncoderStream {
|
|
2
|
-
constructor(options) {
|
|
3
|
-
this.options = options;
|
|
4
|
-
}
|
|
5
|
-
[Symbol.asyncIterator]() {
|
|
6
|
-
return this.asyncIterator();
|
|
7
|
-
}
|
|
8
|
-
async *asyncIterator() {
|
|
9
|
-
for await (const chunk of this.options.inputStream) {
|
|
10
|
-
const payloadBuf = this.options.serializer(chunk);
|
|
11
|
-
yield payloadBuf;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|