@cdk8s/awscdk-resolver 0.0.132 → 0.0.134
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/lib/resolve.js +1 -1
- package/node_modules/@smithy/core/package.json +4 -4
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-retry/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/protocol-http/dist-cjs/index.js +30 -8
- package/node_modules/@smithy/protocol-http/dist-es/httpRequest.js +13 -8
- package/node_modules/@smithy/protocol-http/dist-types/httpRequest.d.ts +31 -1
- package/node_modules/@smithy/protocol-http/dist-types/ts3.4/httpRequest.d.ts +31 -1
- package/node_modules/@smithy/protocol-http/package.json +1 -1
- package/node_modules/@smithy/smithy-client/package.json +3 -3
- 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/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +36 -0
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.js +46 -0
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +7 -1
- package/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js +3 -3
- package/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js +11 -0
- package/node_modules/@smithy/util-stream/dist-cjs/splitStream.js +17 -0
- package/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js +9 -0
- package/node_modules/@smithy/util-stream/dist-es/headStream.browser.js +31 -0
- package/node_modules/@smithy/util-stream/dist-es/headStream.js +41 -0
- package/node_modules/@smithy/util-stream/dist-es/index.js +3 -0
- package/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js +3 -3
- package/node_modules/@smithy/util-stream/dist-es/splitStream.browser.js +7 -0
- package/node_modules/@smithy/util-stream/dist-es/splitStream.js +13 -0
- package/node_modules/@smithy/util-stream/dist-es/stream-type-check.js +2 -0
- package/node_modules/@smithy/util-stream/dist-types/headStream.browser.d.ts +8 -0
- package/node_modules/@smithy/util-stream/dist-types/headStream.d.ts +9 -0
- package/node_modules/@smithy/util-stream/dist-types/index.d.ts +3 -0
- package/node_modules/@smithy/util-stream/dist-types/splitStream.browser.d.ts +5 -0
- package/node_modules/@smithy/util-stream/dist-types/splitStream.d.ts +8 -0
- package/node_modules/@smithy/util-stream/dist-types/stream-type-check.d.ts +4 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/headStream.browser.d.ts +8 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/headStream.d.ts +9 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/index.d.ts +3 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/splitStream.browser.d.ts +8 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/splitStream.d.ts +14 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/stream-type-check.d.ts +4 -0
- package/node_modules/@smithy/util-stream/package.json +12 -6
- package/package.json +5 -5
package/.jsii
CHANGED
@@ -3674,6 +3674,6 @@
|
|
3674
3674
|
"symbolId": "src/resolve:AwsCdkResolver"
|
3675
3675
|
}
|
3676
3676
|
},
|
3677
|
-
"version": "0.0.
|
3678
|
-
"fingerprint": "
|
3677
|
+
"version": "0.0.134",
|
3678
|
+
"fingerprint": "5V/3HnwnLOCSHJ6Jfj3hFEwmaIQ2EEEiv0oA5s9lckI="
|
3679
3679
|
}
|
package/lib/resolve.js
CHANGED
@@ -61,5 +61,5 @@ class AwsCdkResolver {
|
|
61
61
|
}
|
62
62
|
exports.AwsCdkResolver = AwsCdkResolver;
|
63
63
|
_a = JSII_RTTI_SYMBOL_1;
|
64
|
-
AwsCdkResolver[_a] = { fqn: "@cdk8s/awscdk-resolver.AwsCdkResolver", version: "0.0.
|
64
|
+
AwsCdkResolver[_a] = { f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2.
|
3
|
+
"version": "2.2.7",
|
4
4
|
"scripts": {
|
5
5
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline core",
|
@@ -39,10 +39,10 @@
|
|
39
39
|
"license": "Apache-2.0",
|
40
40
|
"dependencies": {
|
41
41
|
"@smithy/middleware-endpoint": "^3.0.5",
|
42
|
-
"@smithy/middleware-retry": "^3.0.
|
42
|
+
"@smithy/middleware-retry": "^3.0.10",
|
43
43
|
"@smithy/middleware-serde": "^3.0.3",
|
44
|
-
"@smithy/protocol-http": "^4.0.
|
45
|
-
"@smithy/smithy-client": "^3.1.
|
44
|
+
"@smithy/protocol-http": "^4.0.4",
|
45
|
+
"@smithy/smithy-client": "^3.1.8",
|
46
46
|
"@smithy/types": "^3.3.0",
|
47
47
|
"@smithy/util-middleware": "^3.0.3",
|
48
48
|
"tslib": "^2.6.2"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/fetch-http-handler",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.2",
|
4
4
|
"description": "Provides a way to make requests",
|
5
5
|
"scripts": {
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"module": "./dist-es/index.js",
|
25
25
|
"types": "./dist-types/index.d.ts",
|
26
26
|
"dependencies": {
|
27
|
-
"@smithy/protocol-http": "^4.0.
|
27
|
+
"@smithy/protocol-http": "^4.0.4",
|
28
28
|
"@smithy/querystring-builder": "^3.0.3",
|
29
29
|
"@smithy/types": "^3.3.0",
|
30
30
|
"@smithy/util-base64": "^3.0.0",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/middleware-content-length",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.4",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline middleware-content-length",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
},
|
24
24
|
"license": "Apache-2.0",
|
25
25
|
"dependencies": {
|
26
|
-
"@smithy/protocol-http": "^4.0.
|
26
|
+
"@smithy/protocol-http": "^4.0.4",
|
27
27
|
"@smithy/types": "^3.3.0",
|
28
28
|
"tslib": "^2.6.2"
|
29
29
|
},
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"directory": "packages/middleware-content-length"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
|
-
"@smithy/util-test": "^0.2.
|
50
|
+
"@smithy/util-test": "^0.2.5",
|
51
51
|
"concurrently": "7.0.0",
|
52
52
|
"downlevel-dts": "0.10.1",
|
53
53
|
"rimraf": "3.0.2",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/middleware-retry",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.10",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline middleware-retry",
|
@@ -32,9 +32,9 @@
|
|
32
32
|
"license": "Apache-2.0",
|
33
33
|
"dependencies": {
|
34
34
|
"@smithy/node-config-provider": "^3.1.4",
|
35
|
-
"@smithy/protocol-http": "^4.0.
|
35
|
+
"@smithy/protocol-http": "^4.0.4",
|
36
36
|
"@smithy/service-error-classification": "^3.0.3",
|
37
|
-
"@smithy/smithy-client": "^3.1.
|
37
|
+
"@smithy/smithy-client": "^3.1.8",
|
38
38
|
"@smithy/types": "^3.3.0",
|
39
39
|
"@smithy/util-middleware": "^3.0.3",
|
40
40
|
"@smithy/util-retry": "^3.0.3",
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"uuid": "^9.0.1"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
|
-
"@smithy/util-test": "^0.2.
|
45
|
+
"@smithy/util-test": "^0.2.5",
|
46
46
|
"@types/uuid": "^8.3.0",
|
47
47
|
"concurrently": "7.0.0",
|
48
48
|
"downlevel-dts": "0.10.1",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/node-http-handler",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.3",
|
4
4
|
"description": "Provides a way to make requests",
|
5
5
|
"scripts": {
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"types": "./dist-types/index.d.ts",
|
27
27
|
"dependencies": {
|
28
28
|
"@smithy/abort-controller": "^3.1.1",
|
29
|
-
"@smithy/protocol-http": "^4.0.
|
29
|
+
"@smithy/protocol-http": "^4.0.4",
|
30
30
|
"@smithy/querystring-builder": "^3.0.3",
|
31
31
|
"@smithy/types": "^3.3.0",
|
32
32
|
"tslib": "^2.6.2"
|
@@ -24,6 +24,7 @@ __export(src_exports, {
|
|
24
24
|
Fields: () => Fields,
|
25
25
|
HttpRequest: () => HttpRequest,
|
26
26
|
HttpResponse: () => HttpResponse,
|
27
|
+
IHttpRequest: () => import_types.HttpRequest,
|
27
28
|
getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration,
|
28
29
|
isValidHostname: () => isValidHostname,
|
29
30
|
resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig
|
@@ -156,6 +157,7 @@ __name(_Fields, "Fields");
|
|
156
157
|
var Fields = _Fields;
|
157
158
|
|
158
159
|
// src/httpRequest.ts
|
160
|
+
|
159
161
|
var _HttpRequest = class _HttpRequest {
|
160
162
|
constructor(options) {
|
161
163
|
this.method = options.method || "GET";
|
@@ -170,20 +172,40 @@ var _HttpRequest = class _HttpRequest {
|
|
170
172
|
this.password = options.password;
|
171
173
|
this.fragment = options.fragment;
|
172
174
|
}
|
175
|
+
/**
|
176
|
+
* Note: this does not deep-clone the body.
|
177
|
+
*/
|
178
|
+
static clone(request) {
|
179
|
+
const cloned = new _HttpRequest({
|
180
|
+
...request,
|
181
|
+
headers: { ...request.headers }
|
182
|
+
});
|
183
|
+
if (cloned.query) {
|
184
|
+
cloned.query = cloneQuery(cloned.query);
|
185
|
+
}
|
186
|
+
return cloned;
|
187
|
+
}
|
188
|
+
/**
|
189
|
+
* This method only actually asserts that request is the interface {@link IHttpRequest},
|
190
|
+
* and not necessarily this concrete class. Left in place for API stability.
|
191
|
+
*
|
192
|
+
* Do not call instance methods on the input of this function, and
|
193
|
+
* do not assume it has the HttpRequest prototype.
|
194
|
+
*/
|
173
195
|
static isInstance(request) {
|
174
|
-
if (!request)
|
196
|
+
if (!request) {
|
175
197
|
return false;
|
198
|
+
}
|
176
199
|
const req = request;
|
177
200
|
return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
|
178
201
|
}
|
202
|
+
/**
|
203
|
+
* @deprecated use static HttpRequest.clone(request) instead. It's not safe to call
|
204
|
+
* this method because {@link HttpRequest.isInstance} incorrectly
|
205
|
+
* asserts that IHttpRequest (interface) objects are of type HttpRequest (class).
|
206
|
+
*/
|
179
207
|
clone() {
|
180
|
-
|
181
|
-
...this,
|
182
|
-
headers: { ...this.headers }
|
183
|
-
});
|
184
|
-
if (cloned.query)
|
185
|
-
cloned.query = cloneQuery(cloned.query);
|
186
|
-
return cloned;
|
208
|
+
return _HttpRequest.clone(this);
|
187
209
|
}
|
188
210
|
};
|
189
211
|
__name(_HttpRequest, "HttpRequest");
|
@@ -16,9 +16,20 @@ export class HttpRequest {
|
|
16
16
|
this.password = options.password;
|
17
17
|
this.fragment = options.fragment;
|
18
18
|
}
|
19
|
+
static clone(request) {
|
20
|
+
const cloned = new HttpRequest({
|
21
|
+
...request,
|
22
|
+
headers: { ...request.headers },
|
23
|
+
});
|
24
|
+
if (cloned.query) {
|
25
|
+
cloned.query = cloneQuery(cloned.query);
|
26
|
+
}
|
27
|
+
return cloned;
|
28
|
+
}
|
19
29
|
static isInstance(request) {
|
20
|
-
if (!request)
|
30
|
+
if (!request) {
|
21
31
|
return false;
|
32
|
+
}
|
22
33
|
const req = request;
|
23
34
|
return ("method" in req &&
|
24
35
|
"protocol" in req &&
|
@@ -28,13 +39,7 @@ export class HttpRequest {
|
|
28
39
|
typeof req["headers"] === "object");
|
29
40
|
}
|
30
41
|
clone() {
|
31
|
-
|
32
|
-
...this,
|
33
|
-
headers: { ...this.headers },
|
34
|
-
});
|
35
|
-
if (cloned.query)
|
36
|
-
cloned.query = cloneQuery(cloned.query);
|
37
|
-
return cloned;
|
42
|
+
return HttpRequest.clone(this);
|
38
43
|
}
|
39
44
|
}
|
40
45
|
function cloneQuery(query) {
|
@@ -2,8 +2,23 @@ import { HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag,
|
|
2
2
|
type HttpRequestOptions = Partial<HttpMessage> & Partial<URI> & {
|
3
3
|
method?: string;
|
4
4
|
};
|
5
|
+
/**
|
6
|
+
* Use the distinct IHttpRequest interface from @smithy/types instead.
|
7
|
+
* This should not be used due to
|
8
|
+
* overlapping with the concrete class' name.
|
9
|
+
*
|
10
|
+
* This is not marked deprecated since that would mark the concrete class
|
11
|
+
* deprecated as well.
|
12
|
+
*/
|
5
13
|
export interface HttpRequest extends IHttpRequest {
|
6
14
|
}
|
15
|
+
/**
|
16
|
+
* @public
|
17
|
+
*/
|
18
|
+
export { IHttpRequest };
|
19
|
+
/**
|
20
|
+
* @public
|
21
|
+
*/
|
7
22
|
export declare class HttpRequest implements HttpMessage, URI {
|
8
23
|
method: string;
|
9
24
|
protocol: string;
|
@@ -17,7 +32,22 @@ export declare class HttpRequest implements HttpMessage, URI {
|
|
17
32
|
fragment?: string;
|
18
33
|
body?: any;
|
19
34
|
constructor(options: HttpRequestOptions);
|
35
|
+
/**
|
36
|
+
* Note: this does not deep-clone the body.
|
37
|
+
*/
|
38
|
+
static clone(request: IHttpRequest): HttpRequest;
|
39
|
+
/**
|
40
|
+
* This method only actually asserts that request is the interface {@link IHttpRequest},
|
41
|
+
* and not necessarily this concrete class. Left in place for API stability.
|
42
|
+
*
|
43
|
+
* Do not call instance methods on the input of this function, and
|
44
|
+
* do not assume it has the HttpRequest prototype.
|
45
|
+
*/
|
20
46
|
static isInstance(request: unknown): request is HttpRequest;
|
47
|
+
/**
|
48
|
+
* @deprecated use static HttpRequest.clone(request) instead. It's not safe to call
|
49
|
+
* this method because {@link HttpRequest.isInstance} incorrectly
|
50
|
+
* asserts that IHttpRequest (interface) objects are of type HttpRequest (class).
|
51
|
+
*/
|
21
52
|
clone(): HttpRequest;
|
22
53
|
}
|
23
|
-
export {};
|
@@ -2,8 +2,23 @@ import { HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag,
|
|
2
2
|
type HttpRequestOptions = Partial<HttpMessage> & Partial<URI> & {
|
3
3
|
method?: string;
|
4
4
|
};
|
5
|
+
/**
|
6
|
+
* Use the distinct IHttpRequest interface from @smithy/types instead.
|
7
|
+
* This should not be used due to
|
8
|
+
* overlapping with the concrete class' name.
|
9
|
+
*
|
10
|
+
* This is not marked deprecated since that would mark the concrete class
|
11
|
+
* deprecated as well.
|
12
|
+
*/
|
5
13
|
export interface HttpRequest extends IHttpRequest {
|
6
14
|
}
|
15
|
+
/**
|
16
|
+
* @public
|
17
|
+
*/
|
18
|
+
export { IHttpRequest };
|
19
|
+
/**
|
20
|
+
* @public
|
21
|
+
*/
|
7
22
|
export declare class HttpRequest implements HttpMessage, URI {
|
8
23
|
method: string;
|
9
24
|
protocol: string;
|
@@ -17,7 +32,22 @@ export declare class HttpRequest implements HttpMessage, URI {
|
|
17
32
|
fragment?: string;
|
18
33
|
body?: any;
|
19
34
|
constructor(options: HttpRequestOptions);
|
35
|
+
/**
|
36
|
+
* Note: this does not deep-clone the body.
|
37
|
+
*/
|
38
|
+
static clone(request: IHttpRequest): HttpRequest;
|
39
|
+
/**
|
40
|
+
* This method only actually asserts that request is the interface {@link IHttpRequest},
|
41
|
+
* and not necessarily this concrete class. Left in place for API stability.
|
42
|
+
*
|
43
|
+
* Do not call instance methods on the input of this function, and
|
44
|
+
* do not assume it has the HttpRequest prototype.
|
45
|
+
*/
|
20
46
|
static isInstance(request: unknown): request is HttpRequest;
|
47
|
+
/**
|
48
|
+
* @deprecated use static HttpRequest.clone(request) instead. It's not safe to call
|
49
|
+
* this method because {@link HttpRequest.isInstance} incorrectly
|
50
|
+
* asserts that IHttpRequest (interface) objects are of type HttpRequest (class).
|
51
|
+
*/
|
21
52
|
clone(): HttpRequest;
|
22
53
|
}
|
23
|
-
export {};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/smithy-client",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.8",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline smithy-client",
|
@@ -25,9 +25,9 @@
|
|
25
25
|
"dependencies": {
|
26
26
|
"@smithy/middleware-endpoint": "^3.0.5",
|
27
27
|
"@smithy/middleware-stack": "^3.0.3",
|
28
|
-
"@smithy/protocol-http": "^4.0.
|
28
|
+
"@smithy/protocol-http": "^4.0.4",
|
29
29
|
"@smithy/types": "^3.3.0",
|
30
|
-
"@smithy/util-stream": "^3.0
|
30
|
+
"@smithy/util-stream": "^3.1.0",
|
31
31
|
"tslib": "^2.6.2"
|
32
32
|
},
|
33
33
|
"engines": {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/util-defaults-mode-browser",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.10",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline util-defaults-mode-browser",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
"license": "Apache-2.0",
|
24
24
|
"dependencies": {
|
25
25
|
"@smithy/property-provider": "^3.1.3",
|
26
|
-
"@smithy/smithy-client": "^3.1.
|
26
|
+
"@smithy/smithy-client": "^3.1.8",
|
27
27
|
"@smithy/types": "^3.3.0",
|
28
28
|
"bowser": "^2.11.0",
|
29
29
|
"tslib": "^2.6.2"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/util-defaults-mode-node",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.10",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline util-defaults-mode-node",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"@smithy/credential-provider-imds": "^3.1.4",
|
27
27
|
"@smithy/node-config-provider": "^3.1.4",
|
28
28
|
"@smithy/property-provider": "^3.1.3",
|
29
|
-
"@smithy/smithy-client": "^3.1.
|
29
|
+
"@smithy/smithy-client": "^3.1.8",
|
30
30
|
"@smithy/types": "^3.3.0",
|
31
31
|
"tslib": "^2.6.2"
|
32
32
|
},
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.headStream = void 0;
|
4
|
+
async function headStream(stream, bytes) {
|
5
|
+
var _a;
|
6
|
+
let byteLengthCounter = 0;
|
7
|
+
const chunks = [];
|
8
|
+
const reader = stream.getReader();
|
9
|
+
let isDone = false;
|
10
|
+
while (!isDone) {
|
11
|
+
const { done, value } = await reader.read();
|
12
|
+
if (value) {
|
13
|
+
chunks.push(value);
|
14
|
+
byteLengthCounter += (_a = value === null || value === void 0 ? void 0 : value.byteLength) !== null && _a !== void 0 ? _a : 0;
|
15
|
+
}
|
16
|
+
if (byteLengthCounter >= bytes) {
|
17
|
+
break;
|
18
|
+
}
|
19
|
+
isDone = done;
|
20
|
+
}
|
21
|
+
reader.releaseLock();
|
22
|
+
const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
|
23
|
+
let offset = 0;
|
24
|
+
for (const chunk of chunks) {
|
25
|
+
if (chunk.byteLength > collected.byteLength - offset) {
|
26
|
+
collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
|
27
|
+
break;
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
collected.set(chunk, offset);
|
31
|
+
}
|
32
|
+
offset += chunk.length;
|
33
|
+
}
|
34
|
+
return collected;
|
35
|
+
}
|
36
|
+
exports.headStream = headStream;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.headStream = void 0;
|
4
|
+
const stream_1 = require("stream");
|
5
|
+
const headStream_browser_1 = require("./headStream.browser");
|
6
|
+
const stream_type_check_1 = require("./stream-type-check");
|
7
|
+
const headStream = (stream, bytes) => {
|
8
|
+
if ((0, stream_type_check_1.isReadableStream)(stream)) {
|
9
|
+
return (0, headStream_browser_1.headStream)(stream, bytes);
|
10
|
+
}
|
11
|
+
return new Promise((resolve, reject) => {
|
12
|
+
const collector = new Collector();
|
13
|
+
collector.limit = bytes;
|
14
|
+
stream.pipe(collector);
|
15
|
+
stream.on("error", (err) => {
|
16
|
+
collector.end();
|
17
|
+
reject(err);
|
18
|
+
});
|
19
|
+
collector.on("error", reject);
|
20
|
+
collector.on("finish", function () {
|
21
|
+
const bytes = new Uint8Array(Buffer.concat(this.buffers));
|
22
|
+
resolve(bytes);
|
23
|
+
});
|
24
|
+
});
|
25
|
+
};
|
26
|
+
exports.headStream = headStream;
|
27
|
+
class Collector extends stream_1.Writable {
|
28
|
+
constructor() {
|
29
|
+
super(...arguments);
|
30
|
+
this.buffers = [];
|
31
|
+
this.limit = Infinity;
|
32
|
+
this.bytesBuffered = 0;
|
33
|
+
}
|
34
|
+
_write(chunk, encoding, callback) {
|
35
|
+
var _a;
|
36
|
+
this.buffers.push(chunk);
|
37
|
+
this.bytesBuffered += (_a = chunk.byteLength) !== null && _a !== void 0 ? _a : 0;
|
38
|
+
if (this.bytesBuffered >= this.limit) {
|
39
|
+
const excess = this.bytesBuffered - this.limit;
|
40
|
+
const tailBuffer = this.buffers[this.buffers.length - 1];
|
41
|
+
this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
|
42
|
+
this.emit("finish");
|
43
|
+
}
|
44
|
+
callback();
|
45
|
+
}
|
46
|
+
}
|
@@ -79,11 +79,17 @@ var Uint8ArrayBlobAdapter = _Uint8ArrayBlobAdapter;
|
|
79
79
|
// src/index.ts
|
80
80
|
__reExport(src_exports, require("././getAwsChunkedEncodingStream"), module.exports);
|
81
81
|
__reExport(src_exports, require("././sdk-stream-mixin"), module.exports);
|
82
|
+
__reExport(src_exports, require("././splitStream"), module.exports);
|
83
|
+
__reExport(src_exports, require("././headStream"), module.exports);
|
84
|
+
__reExport(src_exports, require("././stream-type-check"), module.exports);
|
82
85
|
// Annotate the CommonJS export names for ESM import in node:
|
83
86
|
|
84
87
|
0 && (module.exports = {
|
85
88
|
Uint8ArrayBlobAdapter,
|
86
89
|
getAwsChunkedEncodingStream,
|
87
|
-
sdkStreamMixin
|
90
|
+
sdkStreamMixin,
|
91
|
+
splitStream,
|
92
|
+
headStream,
|
93
|
+
isReadableStream
|
88
94
|
});
|
89
95
|
|
@@ -5,10 +5,11 @@ const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
5
5
|
const util_base64_1 = require("@smithy/util-base64");
|
6
6
|
const util_hex_encoding_1 = require("@smithy/util-hex-encoding");
|
7
7
|
const util_utf8_1 = require("@smithy/util-utf8");
|
8
|
+
const stream_type_check_1 = require("./stream-type-check");
|
8
9
|
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
9
10
|
const sdkStreamMixin = (stream) => {
|
10
11
|
var _a, _b;
|
11
|
-
if (!isBlobInstance(stream) && !
|
12
|
+
if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) {
|
12
13
|
const name = ((_b = (_a = stream === null || stream === void 0 ? void 0 : stream.__proto__) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) || stream;
|
13
14
|
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
|
14
15
|
}
|
@@ -55,7 +56,7 @@ const sdkStreamMixin = (stream) => {
|
|
55
56
|
if (isBlobInstance(stream)) {
|
56
57
|
return blobToWebStream(stream);
|
57
58
|
}
|
58
|
-
else if (
|
59
|
+
else if ((0, stream_type_check_1.isReadableStream)(stream)) {
|
59
60
|
return stream;
|
60
61
|
}
|
61
62
|
else {
|
@@ -66,4 +67,3 @@ const sdkStreamMixin = (stream) => {
|
|
66
67
|
};
|
67
68
|
exports.sdkStreamMixin = sdkStreamMixin;
|
68
69
|
const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
|
69
|
-
const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.splitStream = void 0;
|
4
|
+
async function splitStream(stream) {
|
5
|
+
if (typeof stream.stream === "function") {
|
6
|
+
stream = stream.stream();
|
7
|
+
}
|
8
|
+
const readableStream = stream;
|
9
|
+
return readableStream.tee();
|
10
|
+
}
|
11
|
+
exports.splitStream = splitStream;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.splitStream = void 0;
|
4
|
+
const stream_1 = require("stream");
|
5
|
+
const splitStream_browser_1 = require("./splitStream.browser");
|
6
|
+
const stream_type_check_1 = require("./stream-type-check");
|
7
|
+
async function splitStream(stream) {
|
8
|
+
if ((0, stream_type_check_1.isReadableStream)(stream)) {
|
9
|
+
return (0, splitStream_browser_1.splitStream)(stream);
|
10
|
+
}
|
11
|
+
const stream1 = new stream_1.PassThrough();
|
12
|
+
const stream2 = new stream_1.PassThrough();
|
13
|
+
stream.pipe(stream1);
|
14
|
+
stream.pipe(stream2);
|
15
|
+
return [stream1, stream2];
|
16
|
+
}
|
17
|
+
exports.splitStream = splitStream;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.isReadableStream = void 0;
|
4
|
+
const isReadableStream = (stream) => {
|
5
|
+
var _a;
|
6
|
+
return typeof ReadableStream === "function" &&
|
7
|
+
(((_a = stream === null || stream === void 0 ? void 0 : stream.constructor) === null || _a === void 0 ? void 0 : _a.name) === ReadableStream.name || stream instanceof ReadableStream);
|
8
|
+
};
|
9
|
+
exports.isReadableStream = isReadableStream;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
export async function headStream(stream, bytes) {
|
2
|
+
let byteLengthCounter = 0;
|
3
|
+
const chunks = [];
|
4
|
+
const reader = stream.getReader();
|
5
|
+
let isDone = false;
|
6
|
+
while (!isDone) {
|
7
|
+
const { done, value } = await reader.read();
|
8
|
+
if (value) {
|
9
|
+
chunks.push(value);
|
10
|
+
byteLengthCounter += value?.byteLength ?? 0;
|
11
|
+
}
|
12
|
+
if (byteLengthCounter >= bytes) {
|
13
|
+
break;
|
14
|
+
}
|
15
|
+
isDone = done;
|
16
|
+
}
|
17
|
+
reader.releaseLock();
|
18
|
+
const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
|
19
|
+
let offset = 0;
|
20
|
+
for (const chunk of chunks) {
|
21
|
+
if (chunk.byteLength > collected.byteLength - offset) {
|
22
|
+
collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
|
23
|
+
break;
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
collected.set(chunk, offset);
|
27
|
+
}
|
28
|
+
offset += chunk.length;
|
29
|
+
}
|
30
|
+
return collected;
|
31
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { Writable } from "stream";
|
2
|
+
import { headStream as headWebStream } from "./headStream.browser";
|
3
|
+
import { isReadableStream } from "./stream-type-check";
|
4
|
+
export const headStream = (stream, bytes) => {
|
5
|
+
if (isReadableStream(stream)) {
|
6
|
+
return headWebStream(stream, bytes);
|
7
|
+
}
|
8
|
+
return new Promise((resolve, reject) => {
|
9
|
+
const collector = new Collector();
|
10
|
+
collector.limit = bytes;
|
11
|
+
stream.pipe(collector);
|
12
|
+
stream.on("error", (err) => {
|
13
|
+
collector.end();
|
14
|
+
reject(err);
|
15
|
+
});
|
16
|
+
collector.on("error", reject);
|
17
|
+
collector.on("finish", function () {
|
18
|
+
const bytes = new Uint8Array(Buffer.concat(this.buffers));
|
19
|
+
resolve(bytes);
|
20
|
+
});
|
21
|
+
});
|
22
|
+
};
|
23
|
+
class Collector extends Writable {
|
24
|
+
constructor() {
|
25
|
+
super(...arguments);
|
26
|
+
this.buffers = [];
|
27
|
+
this.limit = Infinity;
|
28
|
+
this.bytesBuffered = 0;
|
29
|
+
}
|
30
|
+
_write(chunk, encoding, callback) {
|
31
|
+
this.buffers.push(chunk);
|
32
|
+
this.bytesBuffered += chunk.byteLength ?? 0;
|
33
|
+
if (this.bytesBuffered >= this.limit) {
|
34
|
+
const excess = this.bytesBuffered - this.limit;
|
35
|
+
const tailBuffer = this.buffers[this.buffers.length - 1];
|
36
|
+
this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
|
37
|
+
this.emit("finish");
|
38
|
+
}
|
39
|
+
callback();
|
40
|
+
}
|
41
|
+
}
|
@@ -2,9 +2,10 @@ import { streamCollector } from "@smithy/fetch-http-handler";
|
|
2
2
|
import { toBase64 } from "@smithy/util-base64";
|
3
3
|
import { toHex } from "@smithy/util-hex-encoding";
|
4
4
|
import { toUtf8 } from "@smithy/util-utf8";
|
5
|
+
import { isReadableStream } from "./stream-type-check";
|
5
6
|
const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
6
7
|
export const sdkStreamMixin = (stream) => {
|
7
|
-
if (!isBlobInstance(stream) && !
|
8
|
+
if (!isBlobInstance(stream) && !isReadableStream(stream)) {
|
8
9
|
const name = stream?.__proto__?.constructor?.name || stream;
|
9
10
|
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
|
10
11
|
}
|
@@ -51,7 +52,7 @@ export const sdkStreamMixin = (stream) => {
|
|
51
52
|
if (isBlobInstance(stream)) {
|
52
53
|
return blobToWebStream(stream);
|
53
54
|
}
|
54
|
-
else if (
|
55
|
+
else if (isReadableStream(stream)) {
|
55
56
|
return stream;
|
56
57
|
}
|
57
58
|
else {
|
@@ -61,4 +62,3 @@ export const sdkStreamMixin = (stream) => {
|
|
61
62
|
});
|
62
63
|
};
|
63
64
|
const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
|
64
|
-
const isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { PassThrough } from "stream";
|
2
|
+
import { splitStream as splitWebStream } from "./splitStream.browser";
|
3
|
+
import { isReadableStream } from "./stream-type-check";
|
4
|
+
export async function splitStream(stream) {
|
5
|
+
if (isReadableStream(stream)) {
|
6
|
+
return splitWebStream(stream);
|
7
|
+
}
|
8
|
+
const stream1 = new PassThrough();
|
9
|
+
const stream2 = new PassThrough();
|
10
|
+
stream.pipe(stream1);
|
11
|
+
stream.pipe(stream2);
|
12
|
+
return [stream1, stream2];
|
13
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* @internal
|
3
|
+
* @param stream
|
4
|
+
* @param bytes - read head bytes from the stream and discard the rest of it.
|
5
|
+
*
|
6
|
+
* Caution: the input stream must be destroyed separately, this function does not do so.
|
7
|
+
*/
|
8
|
+
export declare function headStream(stream: ReadableStream, bytes: number): Promise<Uint8Array>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Readable } from "stream";
|
2
|
+
/**
|
3
|
+
* @internal
|
4
|
+
* @param stream
|
5
|
+
* @param bytes - read head bytes from the stream and discard the rest of it.
|
6
|
+
*
|
7
|
+
* Caution: the input stream must be destroyed separately, this function does not do so.
|
8
|
+
*/
|
9
|
+
export declare const headStream: (stream: Readable | ReadableStream, bytes: number) => Promise<Uint8Array>;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import type { Readable } from "stream";
|
3
|
+
/**
|
4
|
+
* @param stream
|
5
|
+
* @returns stream split into two identical streams.
|
6
|
+
*/
|
7
|
+
export declare function splitStream(stream: Readable): Promise<[Readable, Readable]>;
|
8
|
+
export declare function splitStream(stream: ReadableStream): Promise<[ReadableStream, ReadableStream]>;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* @internal
|
3
|
+
* @param stream
|
4
|
+
* @param bytes - read head bytes from the stream and discard the rest of it.
|
5
|
+
*
|
6
|
+
* Caution: the input stream must be destroyed separately, this function does not do so.
|
7
|
+
*/
|
8
|
+
export declare function headStream(stream: ReadableStream, bytes: number): Promise<Uint8Array>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Readable } from "stream";
|
2
|
+
/**
|
3
|
+
* @internal
|
4
|
+
* @param stream
|
5
|
+
* @param bytes - read head bytes from the stream and discard the rest of it.
|
6
|
+
*
|
7
|
+
* Caution: the input stream must be destroyed separately, this function does not do so.
|
8
|
+
*/
|
9
|
+
export declare const headStream: (stream: Readable | ReadableStream, bytes: number) => Promise<Uint8Array>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { Readable } from "stream";
|
3
|
+
/**
|
4
|
+
* @param stream
|
5
|
+
* @returns stream split into two identical streams.
|
6
|
+
*/
|
7
|
+
export declare function splitStream(stream: Readable): Promise<[
|
8
|
+
Readable,
|
9
|
+
Readable
|
10
|
+
]>;
|
11
|
+
export declare function splitStream(stream: ReadableStream): Promise<[
|
12
|
+
ReadableStream,
|
13
|
+
ReadableStream
|
14
|
+
]>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@smithy/util-stream",
|
3
|
-
"version": "3.0
|
3
|
+
"version": "3.1.0",
|
4
4
|
"scripts": {
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
6
6
|
"build:cjs": "node ../../scripts/inline util-stream",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
},
|
25
25
|
"license": "Apache-2.0",
|
26
26
|
"dependencies": {
|
27
|
-
"@smithy/fetch-http-handler": "^3.2.
|
28
|
-
"@smithy/node-http-handler": "^3.1.
|
27
|
+
"@smithy/fetch-http-handler": "^3.2.2",
|
28
|
+
"@smithy/node-http-handler": "^3.1.3",
|
29
29
|
"@smithy/types": "^3.3.0",
|
30
30
|
"@smithy/util-base64": "^3.0.0",
|
31
31
|
"@smithy/util-buffer-from": "^3.0.0",
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"tslib": "^2.6.2"
|
35
35
|
},
|
36
36
|
"devDependencies": {
|
37
|
-
"@smithy/util-test": "^0.2.
|
37
|
+
"@smithy/util-test": "^0.2.5",
|
38
38
|
"@types/node": "^16.18.96",
|
39
39
|
"concurrently": "7.0.0",
|
40
40
|
"downlevel-dts": "0.10.1",
|
@@ -56,13 +56,19 @@
|
|
56
56
|
],
|
57
57
|
"browser": {
|
58
58
|
"./dist-es/getAwsChunkedEncodingStream": "./dist-es/getAwsChunkedEncodingStream.browser",
|
59
|
-
"./dist-es/
|
59
|
+
"./dist-es/headStream": "./dist-es/headStream.browser",
|
60
|
+
"./dist-es/sdk-stream-mixin": "./dist-es/sdk-stream-mixin.browser",
|
61
|
+
"./dist-es/splitStream": "./dist-es/splitStream.browser"
|
60
62
|
},
|
61
63
|
"react-native": {
|
62
64
|
"./dist-es/getAwsChunkedEncodingStream": "./dist-es/getAwsChunkedEncodingStream.browser",
|
63
65
|
"./dist-es/sdk-stream-mixin": "./dist-es/sdk-stream-mixin.browser",
|
66
|
+
"./dist-es/headStream": "./dist-es/headStream.browser",
|
67
|
+
"./dist-es/splitStream": "./dist-es/splitStream.browser",
|
64
68
|
"./dist-cjs/getAwsChunkedEncodingStream": "./dist-cjs/getAwsChunkedEncodingStream.browser",
|
65
|
-
"./dist-cjs/sdk-stream-mixin": "./dist-cjs/sdk-stream-mixin.browser"
|
69
|
+
"./dist-cjs/sdk-stream-mixin": "./dist-cjs/sdk-stream-mixin.browser",
|
70
|
+
"./dist-cjs/headStream": "./dist-cjs/headStream.browser",
|
71
|
+
"./dist-cjs/splitStream": "./dist-cjs/splitStream.browser"
|
66
72
|
},
|
67
73
|
"homepage": "https://github.com/awslabs/smithy-typescript/tree/main/packages/util-stream",
|
68
74
|
"repository": {
|
package/package.json
CHANGED
@@ -42,16 +42,16 @@
|
|
42
42
|
"organization": false
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
|
-
"@cdk8s/projen-common": "0.0.
|
45
|
+
"@cdk8s/projen-common": "0.0.533",
|
46
46
|
"@types/fs-extra": "^11.0.4",
|
47
47
|
"@types/jest": "^27",
|
48
48
|
"@types/node": "16.18.78",
|
49
49
|
"@typescript-eslint/eslint-plugin": "^7",
|
50
50
|
"@typescript-eslint/parser": "^7",
|
51
|
-
"aws-cdk": "^2.
|
51
|
+
"aws-cdk": "^2.149.0",
|
52
52
|
"aws-cdk-lib": "2.109.0",
|
53
53
|
"cdk8s": "2.68.4",
|
54
|
-
"cdk8s-cli": "^2.198.
|
54
|
+
"cdk8s-cli": "^2.198.175",
|
55
55
|
"constructs": "10.3.0",
|
56
56
|
"eslint": "^8",
|
57
57
|
"eslint-import-resolver-typescript": "^3.6.1",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"jsii-docgen": "^9.2.2",
|
65
65
|
"jsii-pacmak": "^1.101.0",
|
66
66
|
"jsii-rosetta": "^5",
|
67
|
-
"projen": "^0.84.
|
67
|
+
"projen": "^0.84.4",
|
68
68
|
"standard-version": "^9",
|
69
69
|
"ts-jest": "^27",
|
70
70
|
"ts-node": "^10.9.2",
|
@@ -92,7 +92,7 @@
|
|
92
92
|
"publishConfig": {
|
93
93
|
"access": "public"
|
94
94
|
},
|
95
|
-
"version": "0.0.
|
95
|
+
"version": "0.0.134",
|
96
96
|
"jest": {
|
97
97
|
"coverageProvider": "v8",
|
98
98
|
"testMatch": [
|